Bug 26303 - D-Bus crashing in dbus_loop_quit
Summary: D-Bus crashing in dbus_loop_quit
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.2.x
Hardware: x86 (IA32) Solaris
: medium normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
Whiteboard: r+, but merge/rebase needed
Keywords: patch
Depends on:
Reported: 2010-01-28 11:24 UTC by Brian Cameron
Modified: 2011-02-18 06:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

move sigterm handling into a pipe (6.23 KB, patch)
2010-03-22 13:36 UTC, Colin Walters
Details | Splinter Review

Description Brian Cameron 2010-01-28 11:24:53 UTC
This is using D-Bus version 1.2.16.

Some Solaris users are complaining that dbus-daemon is crashing on occasion in _dbus_loop_quit, when it is being passed in a NULL pointer.  This is happening with the dbus-daemon that is started with the new GDM used when GDM presents the login GUI screen to the user.

See here for more information:


Looking at the D-Bus code it looks like _dbus_loop_quit only gets called in SIGTERM.  It seems the crash is happening when _dbus_loop_quit is being called with a NULL pointer, which seems odd.  The _dbus_loop quit does the following:

  _dbus_assert (loop->depth > 0);
  loop->depth -= 1;

So it would make sense that it would crash if passed a NULL pointer.

Note that the new GDM does kill D-Bus with a SIGTERM.  However, I wonder if it is possible that it might be receiving multiple SIGTERM signals or if it is receiving a SIGTERM when it is already in the process of shutting down.  This might explain why a NULL pointer is being passed into the _dbus_loop_quit() function.  Is it possible that there is some odd race condition here?

Perhaps the fix would be to simply d_get_loop (context) returns NULL, or otherwise better handle a NULL so it doesn't crash.
Comment 1 Colin Walters 2010-03-22 13:36:10 UTC
Created attachment 34331 [details] [review]
move sigterm handling into a pipe
Comment 2 Simon McVittie 2011-01-14 05:01:24 UTC
Patch looks good to me, assuming it still applies.
Comment 3 Simon McVittie 2011-01-14 05:04:55 UTC
This doesn't apply to master any more, and will need a bit of merging.
Comment 4 Brian Cameron 2011-01-17 22:51:28 UTC
I thought Colin fixed this with release 1.2.24 when the SIGTERM handler is no longer installed.


Comment 5 Simon McVittie 2011-02-18 06:18:20 UTC
(In reply to comment #4)
> I thought Colin fixed this with release 1.2.24 when the SIGTERM handler is no
> longer installed.

Indeed. Fixed in 1.2.24 and 1.4.x.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.