Bug 8655 - dbus_connection_unregister_object_path segfaults
Summary: dbus_connection_unregister_object_path segfaults
Status: RESOLVED NOTOURBUG
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All All
: high critical
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL: http://people.freedesktop.org/~daniel...
Whiteboard:
Keywords:
Depends on:
Blocks: 7813
  Show dependency treegraph
 
Reported: 2006-10-16 01:40 UTC by Daniel Stone
Modified: 2006-10-16 13:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Stone 2006-10-16 01:40:49 UTC
As the subject says.  In the testcase (basically copy and pasted from the
current X server D-BUS code), you'll see 'about to init' printed, then 'about to
finish', then a segfault.  gdb shows the segfault appears to be in
dbus_connection_unregister_object_path.

Being able to restart the connection is a hard requirement for us.  I have no
idea if it otherwise works (apparently _close is not what I want, and instead I
need to unref the connection), because we can't register the same path again.
Comment 1 Havoc Pennington 2006-10-16 08:34:30 UTC
Thanks for the test case, looks like it is supposed to work, so this should be 
pretty simple to debug.

(unrelated, you do want to unref() not close() the result of dbus_bus_get() - 
the docs in latest cvs sources go into some detail on this, but the html docs 
on the web site probably haven't been updated. if you want a connection that 
can be closed, you should use dbus_bus_get_private instead, but that will be 
decidedly more wasteful if other code in the same process also wants to use 
the bus since the connection won't be shared.)
Comment 2 Daniel Stone 2006-10-16 08:41:51 UTC
yeah, i'm unreffing it in most spots, just not all.  thanks for the catch.
Comment 3 John (J5) Palmieri 2006-10-16 13:22:10 UTC
I am happy to report that the issue is not in D-Bus but in how C nulls out
structs (namely it doesn't):

Adding a memset(&vtable, 0, sizeof(vtable)); removes the crash.
Comment 4 Daniel Stone 2006-10-16 13:48:47 UTC
i suck at life.  thanks.


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.