dbus crasher

Gordon Messmer yinyang at eburg.com
Tue Nov 17 21:13:46 PST 2009


According to the documentation for dbus_connection_send_with_reply:

      Warning:
         if the connection is disconnected, the DBusPendingCall will be
         set to NULL, so be careful with this.

hald sometimes crashes when my laptop resumes because this isn't being 
checked.  I think that NetworkManager is crashing and causing the 
problem, but I haven't tracked that down yet.  In any case, please apply 
the attached patch to prevent hald from also crashing.


-------------- next part --------------
--- hal-0.5.12-29/hald/hald_dbus.c.pending	2009-10-28 11:50:35.000000000 -0700
+++ hal-0.5.12-29/hald/hald_dbus.c	2009-10-28 11:52:04.000000000 -0700
@@ -3477,11 +3477,13 @@
 					     message,
 					     &pending_call,
 					     /*-1*/ 8000)) {
-		/*HAL_INFO (("connection=%x message=%x", connection, message));*/
-		dbus_pending_call_set_notify (pending_call,
-					      reply_from_singleton_device_changed,
-					      (void *) new_sdci (added, device),
-					      (DBusFreeFunction) del_sdci);
+		if (pending_call) {
+			/*HAL_INFO (("connection=%x message=%x", connection, message));*/
+			dbus_pending_call_set_notify (pending_call,
+						      reply_from_singleton_device_changed,
+						      (void *) new_sdci (added, device),
+						      (DBusFreeFunction) del_sdci);
+		} /* else the connection was disconnected */
 	}
 
 	dbus_message_unref (message);


More information about the hal mailing list