GNOME Bugzilla – Bug 700523
crashes at shutdown due to system bus going away
Last modified: 2013-05-17 13:58:50 UTC
We often crash at shutdown because systemd simply sends SIGTERM/SIGKILL to all processes simultaenously. The system bus might get killed before us, and we (due to Debian) have a reconnection handler for the system bus. Of course, it doesn't work, and we end up leaving a core most of the time on shutdown. Leaving a core at shutdown is one of those things that makes us look dumb. I'd like to not look dumb. Options: 1) Add --enable-debian-we-pretend-the-system-bus-can-be-restarted-but-have-no-testing-whee-package-me-harder configure option that conditionalizes the system bus restart 2) Change systemd to not tear down the system bus with SIGTERM, and have the bus only die with SIGKILL 3) Attempt to fix this code (Due to a brief nostalgia for Debian I'm briefly looking at it now)
Created attachment 244526 [details] stack trace
I'd be up for just doing: + if (!g_dbus_connection_is_closed (manager->priv->connection)) { ... unexport code here ... + }
Created attachment 244532 [details] [review] 0001-manager-Don-t-attempt-to-unexport-DBus-object-if-con.patch Yeah, that works.
Created attachment 244533 [details] [review] manager: don't try to unexport objects on system bus after it closes When the main GDM manager object is finalized, it unexports any exported DBus ObjectManager objects. In many cases, the system bus is no longer around by the time the GDM manager object is finalized. Unexporting an object when the the bus connection is already closed will make GDBus blow an assertion (since it's already been implicitly unexported by virtue of being disconnected). This commit changes the GDM manager object's finalize method to avoid explicitly unexporting the objects in the above scenario.
Review of attachment 244532 [details] [review]: oh you were faster than me, and yours is more foolproof.