Bug 9309 - problem getting dbus connection second time
Summary: problem getting dbus connection second time
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-12 04:59 UTC by Radek Doulik
Modified: 2007-10-09 12:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Radek Doulik 2006-12-12 04:59:41 UTC
I get

10118: arguments to dbus_connection_ref() were incorrect, assertion
"connection->generation == _dbus_current_generation" failed in file
dbus-connection.c line 1749.

when calling dbus_bus_get( DBUS_BUS_SESSION, &pDBusError );
then dbus_connection_unref( m_pDBusConnection );
and some time later when I need the connection again I call dbus_bus_get(
DBUS_BUS_SESSION, &pDBusError ); again and get that assertion and crash later.

it is dbus-1 0.60

If I understand the documentation right, I own the reference to the connection
which I get from dbus_bus_get, or do I not?
http://dbus.freedesktop.org/doc/dbus/api/html/group__DBusBus.html#g1d29aa7e5337a792a40d91aba81f2f0c
Comment 1 Havoc Pennington 2006-12-12 07:59:27 UTC
Yes, you own a reference. dbus 0.60 has a quite a few bugs though, including 
some in managing the memory of bus objects, iirc. The code in this area was 
fixed up quite a bit prior to 1.0.

Assuming it's not a libdbus bug (big assumption for 0.60), this error could 
either mean the connection was unref'd too many times somehow and thus 
connection->generation is garbage, or it could mean dbus_shutdown() was called 
so _dbus_current_generation does not match (this is what that assertion is 
supposed to catch, primarily). It's not allowed to dbus_shutdown() unless 
you've dropped all references to all dbus objects.

If you can reproduce with 1.0.x please try to boil it down to a little test 
program and we'll get it fixed...
Comment 2 John (J5) Palmieri 2007-10-09 12:52:56 UTC
Closing. Assuming this is fixed in later versions of D-Bus since there was no reply to this bug. If this is not the case then please reopen with a test case attached.


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.