SIGSEGV in on_name_lost_or_acquired
Submitted by Piotr Bartosiewicz
Assigned to David Zeuthen
Link to original bug (#742091)
Description
Segmentation fault occurs from time to time after invoking:
g_bus_unown_name(nameId); g_object_unref(connection);
This code is invoked from a thread different from glib-loop thread. Connection is created using g_dbus_connection_new_for_address_sync, name is acquired using g_bus_own_name_on_connection.
GDB says that 'client' variable inside on_name_lost_or_acquired is already freed.
#0 0x00007f3f8897d8a8 in __strcmp_ssse3 () at ../sysdeps/x86_64/strcmp.S:355
#1 0x00007f3f8acab630 in on_name_lost_or_acquired (connection=<optimized out>, sender_name=0x7f3f70003dc0 "org.freedesktop.DBus", object_path=<optimized out>, interface_name=0x7f3f70007440 "org.freedesktop.DBus", signal_name=0x7f3f700072f0 "NameLost", parameters=0x2c1f2a0, user_data=0x2c20650) at gdbusnameowning.c:279
#2 0x00007f3f8ac9d114 in emit_signal_instance_in_idle_cb (data=0x7f3f70007720) at gdbusconnection.c:3753
#3 0x00007f3f8a695aeb in g_main_context_dispatch (context=0x2c077e0) at gmain.c:3111
#4 0x00007f3f8a695aeb in g_main_context_dispatch (context=context@entry=0x2c077e0) at gmain.c:3710
#5 0x00007f3f8a695e88 in g_main_context_iterate (context=0x2c077e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
#6 0x00007f3f8a6961b2 in g_main_loop_run (loop=0x2c078a0) at gmain.c:3975