--- dbus-1.8.20/dbus/dbus-connection.c 2015-05-14 13:23:25.000000000 +0100 +++ dbus-1.8.20-patch/dbus/dbus-connection.c 2017-09-19 17:30:51.343264413 +0100 @@ -325,6 +325,7 @@ unsigned int disconnected_message_processed : 1; /**< We did our default handling of the disconnected message, * such as closing the connection. */ + unsigned int processing : 1; /**< TRUE if dispatch processing is in progress */ #ifndef DBUS_DISABLE_CHECKS unsigned int have_connection_lock : 1; /**< Used to check locking */ @@ -1222,6 +1223,10 @@ { _dbus_verbose ("pending call completed while acquiring I/O path (reply found in queue)"); } + else if ( connection->processing ) + { + _dbus_verbose ("connection processing while acquiring I/O path"); + } else { _dbus_transport_do_iteration (connection->transport, @@ -2525,7 +2530,7 @@ { /* block again, we don't have the reply buffered yet. */ _dbus_connection_do_iteration_unlocked (connection, - NULL, + pending, DBUS_ITERATION_DO_READING | DBUS_ITERATION_BLOCK, timeout_milliseconds - elapsed_milliseconds); @@ -4622,11 +4627,13 @@ reply_serial); if (pending) { + connection->processing = 1; _dbus_verbose ("Dispatching a pending reply\n"); complete_pending_call_and_unlock (connection, pending, message); pending = NULL; /* it's probably unref'd */ CONNECTION_LOCK (connection); + connection->processing = 0; _dbus_verbose ("pending call completed in dispatch\n"); result = DBUS_HANDLER_RESULT_HANDLED; goto out;