After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700523 - crashes at shutdown due to system bus going away
crashes at shutdown due to system bus going away
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-17 13:04 UTC by Colin Walters
Modified: 2013-05-17 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stack trace (4.39 KB, text/plain)
2013-05-17 13:11 UTC, Colin Walters
  Details
0001-manager-Don-t-attempt-to-unexport-DBus-object-if-con.patch (963 bytes, patch)
2013-05-17 13:38 UTC, Colin Walters
committed Details | Review
manager: don't try to unexport objects on system bus after it closes (3.21 KB, patch)
2013-05-17 13:39 UTC, Ray Strode [halfline]
none Details | Review

Description Colin Walters 2013-05-17 13:04:02 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)
Comment 1 Colin Walters 2013-05-17 13:11:41 UTC
Created attachment 244526 [details]
stack trace
Comment 2 Ray Strode [halfline] 2013-05-17 13:34:09 UTC
I'd be up for just doing: 
+        if (!g_dbus_connection_is_closed (manager->priv->connection)) {
... unexport code here ...
+        }
Comment 3 Colin Walters 2013-05-17 13:38:59 UTC
Created attachment 244532 [details] [review]
0001-manager-Don-t-attempt-to-unexport-DBus-object-if-con.patch

Yeah, that works.
Comment 4 Ray Strode [halfline] 2013-05-17 13:39:28 UTC
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.
Comment 5 Ray Strode [halfline] 2013-05-17 13:40:31 UTC
Review of attachment 244532 [details] [review]:

oh you were faster than me, and yours is more foolproof.
Comment 6 Ray Strode [halfline] 2013-05-17 13:40:32 UTC
Review of attachment 244532 [details] [review]:

oh you were faster than me, and yours is more foolproof.