"g_file_new_for_path: assertion 'path != NULL' failed" when calling g_settings_new_with_path()
This must be a regression from #1822 (closed). When starting Epiphany:
(gdb) bt
#0 0x00007feb33b865e5 in _g_log_abort (breakpoint=1) at ../glib/gmessages.c:554
#1 0x00007feb33b878b6 in g_logv
(log_domain=0x7feb33e03657 "GLib-GIO", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffa675ef20) at ../glib/gmessages.c:1371
#2 0x00007feb33b87a83 in g_log
(log_domain=log_domain@entry=0x7feb33e03657 "GLib-GIO", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7feb33bd85e8 "%s: assertion '%s' failed") at ../glib/gmessages.c:1413
#3 0x00007feb33b8827d in g_return_if_fail_warning
(log_domain=log_domain@entry=0x7feb33e03657 "GLib-GIO", pretty_function=pretty_function@entry=0x7feb33e08300 <__FUNCTION__.32691> "g_file_new_for_path", expression=expression@entry=0x7feb33e1cafb "path != NULL")
at ../glib/gmessages.c:2767
#4 0x00007feb33d2240a in g_file_new_for_path (path=0x0) at ../gio/gfile.c:6486
#5 0x00007feb33d2240a in g_file_new_for_path (path=<optimized out>) at ../gio/gfile.c:6484
#6 0x00007feb33daa628 in g_keyfile_settings_backend_set_property
(object=0x56087b96da60 [GKeyfileSettingsBackend], prop_id=1, value=0x7fffa675f090, pspec=0x56087b9ff060 [GParamString]) at ../gio/gkeyfilesettingsbackend.c:743
#7 0x00007feb33c716ec in object_set_property
(nqueue=0x56087baeec80, value=<optimized out>, pspec=0x56087b9ff060 [GParamString], object=0x56087b96da60 [GKeyfileSettingsBackend]) at ../gobject/gobject.c:1469
#8 0x00007feb33c716ec in g_object_new_internal
(class=class@entry=0x56087ba72790, params=params@entry=0x0, n_params=n_params@entry=0)
at ../gobject/gobject.c:1861
#9 0x00007feb33c72a75 in g_object_new_with_properties
(object_type=0x56087ba12470 [GKeyfileSettingsBackend/GSettingsBackend], n_properties=0, names=names@entry=0x0, values=values@entry=0x0) at ../gobject/gobject.c:1995
#10 0x00007feb33c73621 in g_object_new
(object_type=object_type@entry=0x56087ba12470 [GKeyfileSettingsBackend/GSettingsBackend], first_property_name=first_property_name@entry=0x0) at ../gobject/gobject.c:1667
#11 0x00007feb33d38214 in try_implementation
(extension_point=extension_point@entry=0x7feb33e0e2f3 "gsettings-backend", extension=extension@entry=0x56087ba13360, verify_func=verify_func@entry=0x7feb33dab790 <g_settings_backend_verify>) at ../gio/giomodule.c:869
#12 0x00007feb33d3871e in _g_io_module_get_default
(extension_point=extension_point@entry=0x7feb33e0e2f3 "gsettings-backend", envvar=envvar@entry=0x7feb33e22c43 "GSETTINGS_BACKEND", verify_func=verify_func@entry=0x7feb33dab790 <g_settings_backend_verify>) at ../gio/giomodule.c:979
#13 0x00007feb33dac3f2 in g_settings_backend_get_default () at ../gio/gsettingsbackend.c:1006
#14 0x00007feb33db12c3 in g_settings_constructed (object=<optimized out>) at ../gio/gsettings.c:683
#15 0x00007feb33c7158c in g_object_new_internal
(class=class@entry=0x56087ba44b70, params=params@entry=0x7fffa675f500, n_params=n_params@entry=2)
at ../gobject/gobject.c:1867
#16 0x00007feb33c732a8 in g_object_new_valist
(object_type=<optimized out>, first_property_name=first_property_name@entry=0x7feb33e236cd "schema-id", var_args=var_args@entry=0x7fffa675f650) at ../gobject/gobject.c:2152
#17 0x00007feb33c735fd in g_object_new
(object_type=<optimized out>, first_property_name=first_property_name@entry=0x7feb33e236cd "schema-id")
at ../gobject/gobject.c:1670
#18 0x00007feb33db1a0d in g_settings_new_with_path
(schema_id=schema_id@entry=0x7feb345f56be "org.gnome.Epiphany.state", path=path@entry=0x56087b9feb50 "/org/gnome/epiphany/state/") at ../gio/gsettings.c:1028
#19 0x00007feb345de52b in ephy_settings_init () at ../lib/ephy-settings.c:67
#20 0x00007feb345de6e6 in ephy_settings_init () at ../lib/ephy-settings.c:115
#21 0x00007feb345de6e6 in ephy_settings_get (schema=0x560879ddf279 "org.gnome.Epiphany") at ../lib/ephy-settings.c:89
#22 0x0000560879ddbe3c in main (argc=<optimized out>, argv=<optimized out>) at ../src/ephy-main.c:334
Problem is the GKeyfileSettingsBackend is being instantiated without the required "filename" construct-only property. You can see g_settings_new_with_path() does:
GSettings *
g_settings_new_with_path (const gchar *schema_id,
const gchar *path)
{
g_return_val_if_fail (schema_id != NULL, NULL);
g_return_val_if_fail (path_is_valid (path), NULL);
return g_object_new (G_TYPE_SETTINGS,
"schema-id", schema_id,
"path", path,
NULL);
}
but this is now illegal since the filename is required since 5357a233 (surprise!). Of course, it's impossible to provide a filename here, so I think we need a strategy rethink.