SessionManager.Inhibit with 0 for flags crashes session
Running the following command makes GNOME Session crash with GLib-GObject: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
:
gdbus call --session -d org.gnome.SessionManager -o /org/gnome/SessionManager -m org.gnome.SessionManager.Inhibit 'org.gnome.Boxes' 'uint32 79691784' 'Downloading media' 'uint32 0'
Setting the flags to a non-zero value e.g. 420
is fine.
Stack trace
#0 g_type_check_instance_is_fundamentally_a (
type_instance=type_instance@entry=0x7f2a940137b0,
fundamental_type=fundamental_type@entry=80) at ../gobject/gtype.c:4166
node = <optimized out>
#1 0x00007f2aaf413359 in g_object_unref (_object=0x7f2a940137b0)
at ../gobject/gobject.c:3807
_g_boolean_var_135 = <optimized out>
object = 0x7f2a940137b0
old_ref = <optimized out>
__func__ = "g_object_unref"
retry_atomic_decrement1 = <optimized out>
#2 0x00007f2aaf30a159 in g_source_callback_unref (cb_data=0x7f2a9400e200)
at ../glib/gmain.c:1742
callback = <optimized out>
callback = <optimized out>
#3 g_source_callback_unref (cb_data=0x7f2a9400e200) at ../glib/gmain.c:1735
callback = 0x7f2a9400e200
#4 0x00007f2aaf30a63f in g_source_destroy_internal (source=0x7f2a94005040,
context=0x17a0780, have_lock=1) at ../glib/gmain.c:1407
tmp_list = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
old_cb_data = 0x7f2a9400e200
old_cb_funcs = 0x7f2aaf3f52e0 <g_source_callback_funcs>
#5 0x00007f2aaf30dd20 in g_main_dispatch (context=0x17a0780) at ../glib/gmain.c:3490
dispatch = <optimized out>
prev_source = <optimized out>
begin_time_nsec = 0
was_in_call = 0
user_data = 0x7f2a940137b0
callback = 0x7f2aaf569a10 <call_in_idle_cb>
cb_funcs = <optimized out>
cb_data = <optimized out>
need_destroy = <optimized out>
source = 0x7f2a94005040
current = 0x17a8490
i = 0
current = <optimized out>
i = <optimized out>
__func__ = "g_main_dispatch"
source = <optimized out>
_g_boolean_var_163 = <optimized out>
was_in_call = <optimized out>
user_data = <optimized out>
callback = <optimized out>
cb_funcs = <optimized out>
cb_data = <optimized out>
need_destroy = <optimized out>
dispatch = <optimized out>
prev_source = <optimized out>
begin_time_nsec = <optimized out>
_g_boolean_var_164 = <optimized out>
#6 g_main_context_dispatch (context=0x17a0780) at ../glib/gmain.c:4200
No locals.
#7 0x00007f2aaf30e068 in g_main_context_iterate (context=0x17a0780, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4276
max_priority = 2147483647
timeout = -1
some_ready = 1
nfds = <optimized out>
allocated_nfds = 9
--Type <RET> for more, q to quit, c to continue without paging--
fds = 0x185d5e0
begin_time_nsec = 0
#8 0x00007f2aaf30e31f in g_main_loop_run (loop=0x17b0d50) at ../glib/gmain.c:4479
self = <optimized out>
__func__ = "g_main_loop_run"
#9 0x000000000040c06a in main (argc=<optimized out>, argv=<optimized out>) at ../gnome-session/main.c:627
error = 0x0
override_autostart_dirs = 0x0
opt_session_name = 0x1795ad0 "gnome"
debug_string = <optimized out>
env_override_autostart_dirs = <optimized out>
env_override_autostart_dirs_v = 0x0
gl_failed = 0
name_owner_id = 1
options = <optimized out>
entries = {{long_name = 0x437a21 "systemd-service", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a6a4 <systemd_service>,
description = 0x437a31 "Running as systemd service", arg_description = 0x0}, {long_name = 0x431c09 "systemd", short_name = 0 '\000', flags = 0,
arg = G_OPTION_ARG_NONE, arg_data = 0x44a050 <use_systemd>, description = 0x437f80 "Use systemd session management", arg_description = 0x0}, {
long_name = 0x437a4c "builtin", short_name = 0 '\000', flags = 4, arg = G_OPTION_ARG_NONE, arg_data = 0x44a050 <use_systemd>,
description = 0x437fa0 "Use builtin session management (rather than the systemd based one)", arg_description = 0x0}, {long_name = 0x437a54 "autostart",
short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING_ARRAY, arg_data = 0x44a668 <override_autostart_dirs>,
description = 0x437fe8 "Override standard autostart directories", arg_description = 0x437974 "AUTOSTART_DIR"}, {long_name = 0x435dcb "session",
short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x44a660 <opt_session_name>, description = 0x437a5e "Session to use",
arg_description = 0x437a6d "SESSION_NAME"}, {long_name = 0x432aae "debug", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE,
arg_data = 0x44a698 <debug>, description = 0x437a7a "Enable debugging code", arg_description = 0x0}, {long_name = 0x433257 "failsafe", short_name = 102 'f',
flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a6a0 <failsafe>, description = 0x438010 "Do not load user-specified applications", arg_description = 0x0}, {
long_name = 0x437a90 "version", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a69c <show_version>,
description = 0x437a98 "Version of this application", arg_description = 0x0}, {long_name = 0x437ab4 "whale", short_name = 0 '\000', flags = 0,
arg = G_OPTION_ARG_NONE, arg_data = 0x44a694 <please_fail>, description = 0x438038 "Show the fail whale dialog for testing", arg_description = 0x0}, {
long_name = 0x437aba "disable-acceleration-check", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a690 <disable_acceleration_check>,
description = 0x438060 "Disable hardware acceleration check", arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0,
arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
(gdb) bt full
#0 g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x7f2a940137b0, fundamental_type=fundamental_type@entry=80) at ../gobject/gtype.c:4166
node = <optimized out>
#1 0x00007f2aaf413359 in g_object_unref (_object=0x7f2a940137b0) at ../gobject/gobject.c:3807
_g_boolean_var_135 = <optimized out>
object = 0x7f2a940137b0
old_ref = <optimized out>
__func__ = "g_object_unref"
retry_atomic_decrement1 = <optimized out>
#2 0x00007f2aaf30a159 in g_source_callback_unref (cb_data=0x7f2a9400e200) at ../glib/gmain.c:1742
callback = <optimized out>
callback = <optimized out>
#3 g_source_callback_unref (cb_data=0x7f2a9400e200) at ../glib/gmain.c:1735
callback = 0x7f2a9400e200
#4 0x00007f2aaf30a63f in g_source_destroy_internal (source=0x7f2a94005040, context=0x17a0780, have_lock=1) at ../glib/gmain.c:1407
tmp_list = <optimized out>
old_cb_data = 0x7f2a9400e200
old_cb_funcs = 0x7f2aaf3f52e0 <g_source_callback_funcs>
#5 0x00007f2aaf30dd20 in g_main_dispatch (context=0x17a0780) at ../glib/gmain.c:3490
dispatch = <optimized out>
prev_source = <optimized out>
begin_time_nsec = 0
was_in_call = 0
user_data = 0x7f2a940137b0
callback = 0x7f2aaf569a10 <call_in_idle_cb>
cb_funcs = <optimized out>
cb_data = <optimized out>
need_destroy = <optimized out>
source = 0x7f2a94005040
current = 0x17a8490
i = 0
current = <optimized out>
i = <optimized out>
__func__ = "g_main_dispatch"
source = <optimized out>
_g_boolean_var_163 = <optimized out>
was_in_call = <optimized out>
user_data = <optimized out>
callback = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
cb_funcs = <optimized out>
cb_data = <optimized out>
need_destroy = <optimized out>
dispatch = <optimized out>
prev_source = <optimized out>
begin_time_nsec = <optimized out>
_g_boolean_var_164 = <optimized out>
#6 g_main_context_dispatch (context=0x17a0780) at ../glib/gmain.c:4200
No locals.
#7 0x00007f2aaf30e068 in g_main_context_iterate (context=0x17a0780, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4276
max_priority = 2147483647
timeout = -1
some_ready = 1
nfds = <optimized out>
allocated_nfds = 9
fds = 0x185d5e0
begin_time_nsec = 0
#8 0x00007f2aaf30e31f in g_main_loop_run (loop=0x17b0d50) at ../glib/gmain.c:4479
self = <optimized out>
__func__ = "g_main_loop_run"
#9 0x000000000040c06a in main (argc=<optimized out>, argv=<optimized out>) at ../gnome-session/main.c:627
error = 0x0
override_autostart_dirs = 0x0
opt_session_name = 0x1795ad0 "gnome"
debug_string = <optimized out>
env_override_autostart_dirs = <optimized out>
env_override_autostart_dirs_v = 0x0
gl_failed = 0
name_owner_id = 1
options = <optimized out>
entries = {{long_name = 0x437a21 "systemd-service", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a6a4 <systemd_service>,
description = 0x437a31 "Running as systemd service", arg_description = 0x0}, {long_name = 0x431c09 "systemd", short_name = 0 '\000', flags = 0,
arg = G_OPTION_ARG_NONE, arg_data = 0x44a050 <use_systemd>, description = 0x437f80 "Use systemd session management", arg_description = 0x0}, {
long_name = 0x437a4c "builtin", short_name = 0 '\000', flags = 4, arg = G_OPTION_ARG_NONE, arg_data = 0x44a050 <use_systemd>,
description = 0x437fa0 "Use builtin session management (rather than the systemd based one)", arg_description = 0x0}, {long_name = 0x437a54 "autostart",
short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING_ARRAY, arg_data = 0x44a668 <override_autostart_dirs>,
description = 0x437fe8 "Override standard autostart directories", arg_description = 0x437974 "AUTOSTART_DIR"}, {long_name = 0x435dcb "session",
short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x44a660 <opt_session_name>, description = 0x437a5e "Session to use",
--Type <RET> for more, q to quit, c to continue without paging--
arg_description = 0x437a6d "SESSION_NAME"}, {long_name = 0x432aae "debug", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE,
arg_data = 0x44a698 <debug>, description = 0x437a7a "Enable debugging code", arg_description = 0x0}, {long_name = 0x433257 "failsafe", short_name = 102 'f',
flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a6a0 <failsafe>, description = 0x438010 "Do not load user-specified applications", arg_description = 0x0}, {
long_name = 0x437a90 "version", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a69c <show_version>,
description = 0x437a98 "Version of this application", arg_description = 0x0}, {long_name = 0x437ab4 "whale", short_name = 0 '\000', flags = 0,
arg = G_OPTION_ARG_NONE, arg_data = 0x44a694 <please_fail>, description = 0x438038 "Show the fail whale dialog for testing", arg_description = 0x0}, {
long_name = 0x437aba "disable-acceleration-check", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x44a690 <disable_acceleration_check>,
description = 0x438060 "Disable hardware acceleration check", arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0,
arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
This is with gnome-session 44.0 on NixOS. Downstream issue report: https://github.com/NixOS/nixpkgs/issues/226355
Edited by Jan Tojnar