After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 661177 - gnome-control-center crashed with SIGSEGV in default_adapter_powered_changed()
gnome-control-center crashed with SIGSEGV in default_adapter_powered_changed()
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal critical
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2011-10-07 12:35 UTC by Pedro Villavicencio
Modified: 2011-10-21 13:21 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
Fix the issue (720 bytes, patch)
2011-10-13 14:01 UTC, Vincent Untz
none Details | Review
Another tighter fix (2.15 KB, patch)
2011-10-21 13:11 UTC, Bastien Nocera
none Details | Review

Description Pedro Villavicencio 2011-10-07 12:35:16 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/gnome-bluetooth/+bug/828436

"Trying to add a new bluetooth device"

Package: gnome-control-center 1:3.2.0-0ubuntu6

".

Thread 1 (Thread 0x7f0b38719940 (LWP 14583))

  • #0 g_type_check_instance_cast
    at /build/buildd/glib2.0-2.30.0/./gobject/gtype.c line 3980
  • #1 default_adapter_powered_changed
    at bt-widget.c line 962
  • #2 g_closure_invoke
    at /build/buildd/glib2.0-2.30.0/./gobject/gclosure.c line 774
  • #3 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c line 3272
  • #4 g_signal_emit_valist
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c line 3003
  • #5 g_signal_emit
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c line 3060
  • #6 g_object_dispatch_properties_changed
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 925
  • #7 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.30.0/./gobject/gobjectnotifyqueue.c line 132
  • #8 g_object_notify_by_spec_internal
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 983
  • #9 g_object_notify
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 1024
  • #10 adapter_changed
    at bluetooth-client.c line 646
  • #11 marshal_dbus_message_to_g_marshaller
    at dbus-gproxy.c line 1733
  • #12 g_closure_invoke
    at /build/buildd/glib2.0-2.30.0/./gobject/gclosure.c line 774
  • #13 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c line 3272
  • #14 g_signal_emit_valist
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c line 3003
  • #15 g_signal_emit
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c line 3060
  • #16 dbus_g_proxy_emit_remote_signal
    at dbus-gproxy.c line 1786
  • #17 dbus_g_proxy_manager_filter
    at dbus-gproxy.c line 1353
  • #18 dbus_g_proxy_manager_filter
    at dbus-gproxy.c line 1194
  • #19 dbus_connection_dispatch
    at ../../dbus/dbus-connection.c line 4603
  • #20 message_queue_dispatch
    at dbus-gmain.c line 90
  • #21 g_main_dispatch
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 2441
  • #22 g_main_context_dispatch
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 3011
  • #23 g_main_context_iterate
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 3089
  • #24 g_main_loop_run
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 3297
  • #25 gtk_main
    at /build/buildd/gtk+3.0-3.2.0/./gtk/gtkmain.c line 1367
  • #26 g_application_run
    at /build/buildd/glib2.0-2.30.0/./gio/gapplication.c line 1323
  • #27 main
    at control-center.c line 201

Comment 1 Bastien Nocera 2011-10-12 17:02:27 UTC


  • #1 default_adapter_powered_changed
    at bt-widget.c line 962

That's in NetworkManager.
Comment 2 Dan Williams 2011-10-12 23:55:38 UTC
We'd need to get ~/.xsession-errors here too, if this happens again.  Otherwise there's no context and we can't figure out why the crash happened.
Comment 3 Vincent Untz 2011-10-13 08:22:25 UTC
I can reproduce a similar bug (maybe it's the same core issue) very easily:

  • #0 g_type_check_instance_cast
    at gtype.c line 3980
  • #1 default_adapter_changed
    at bt-widget.c line 994
  • #2 g_cclosure_marshal_VOID__PARAM
    at gmarshal.c line 539
  • #3 g_closure_invoke
    at gclosure.c line 774
  • #4 signal_emit_unlocked_R
    at gsignal.c line 3272
  • #5 g_signal_emit_valist
    at gsignal.c line 3003
  • #6 g_signal_emit
    at gsignal.c line 3060
  • #7 g_object_dispatch_properties_changed
    at gobject.c line 925
  • #8 g_object_notify_dispatcher
    at gobject.c line 331
  • #9 g_object_notify_queue_thaw
    at gobjectnotifyqueue.c line 132
  • #10 g_object_notify_by_spec_internal
    at gobject.c line 983
  • #11 g_object_notify
    at gobject.c line 1024
  • #12 adapter_removed
    at bluetooth-client.c line 805
  • #13 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #14 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #15 g_closure_invoke
    at gclosure.c line 774
  • #16 signal_emit_unlocked_R
    at gsignal.c line 3272
  • #17 g_signal_emit_valist
    at gsignal.c line 3003
  • #18 g_signal_emit
    at gsignal.c line 3060
  • #19 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #20 dbus_connection_dispatch
    from /lib/libdbus-1.so.3
  • #21 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #22 g_main_dispatch
    at gmain.c line 2441
  • #23 g_main_context_dispatch
    at gmain.c line 3011
  • #24 g_main_context_iterate
    at gmain.c line 3089
  • #25 g_main_loop_run
    at gmain.c line 3297
  • #26 gtk_main
    from /usr/lib/libgtk-3.so.0
  • #27 ??
    from /usr/lib/libgtk-3.so.0
  • #28 g_application_run
    from /usr/lib/libgio-2.0.so.0
  • #29 main

Steps to reproduce:

1) Disable bluetooth with hardware switch
2) Start g-c-c and go to bluetooth panel
3) Enable bluetooth with hardware switch
4) (gnome-bluetooth bug) See that the panel still sees bluetooth as disabled with no way to enable it; use the gnome-shell icon to disable and re-enable bluetooth
5) (not sure if it's needed) go to a phone device that can be used by NM
6) use hardware switch to disable bluetooth

=> crash

I have this in my ~/.xsession-errors:

Agent unregistration failed: Method "UnregisterAgent" with signature "o" on interface "org.bluez.Adapter" doesn't exist
 'dbus-glib-error-quark'
Comment 4 Vincent Untz 2011-10-13 08:31:57 UTC
I think the issue is that the the dbus object is gone when I disable bluetooth with the hardware switch, so the calling a method on the org.bluez.Adapter interface can't work anymore.
Comment 5 Vincent Untz 2011-10-13 13:14:20 UTC
(In reply to comment #4)
> I think the issue is that the the dbus object is gone when I disable bluetooth
> with the hardware switch, so the calling a method on the org.bluez.Adapter
> interface can't work anymore.

So, looking at the code, and based on the stack trace... this is completely unrelated to my error in ~/.xsession-errors. So comment 4 is just wrong :-)

It just looks like a property of the BluetoothClient is changed, but when we get to the signal handler, we've already unreferenced the BluetoothClient.
Comment 6 Vincent Untz 2011-10-13 14:01:15 UTC
Created attachment 198936 [details] [review]
Fix the issue

Confirming that disconnecting the signals fix the crash.

I'm not really happy about doing it this way -- ideally, we wouldn't even get the signals after having unref'ed the object. But I'm unsure why this is happening in the first place...
Comment 7 Bastien Nocera 2011-10-19 14:33:28 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 654172 ***
Comment 8 Vincent Untz 2011-10-19 14:38:12 UTC
This one is not a duplicate :-)
Comment 9 Bastien Nocera 2011-10-19 16:12:02 UTC
(In reply to comment #8)
> This one is not a duplicate :-)

Indeed, my mistake.
Comment 10 Dan Williams 2011-10-21 06:15:29 UTC
Hmm.  If info->bt_client is getting destroyed correctly it shouldn't be emitting any signals.  But AFAICT we don't ref/unref it anywhere except when it's created, and when it's destroyed.  So I can't really see what's going on here.  In any case, patch applied, thanks!

bfb603de56c9be28594c637b7030d0c43be353ef (master)
(also applied to 0.8.x)
Comment 11 Bastien Nocera 2011-10-21 12:35:10 UTC
(In reply to comment #10)
> Hmm.  If info->bt_client is getting destroyed correctly

Nope, it's getting unreffed. And as it's a singleton, you need to disconnect from those manually.

> it shouldn't be
> emitting any signals.  But AFAICT we don't ref/unref it anywhere except when
> it's created, and when it's destroyed.  So I can't really see what's going on
> here.  In any case, patch applied, thanks!
> 
> bfb603de56c9be28594c637b7030d0c43be353ef (master)
> (also applied to 0.8.x)

I'm not sure that patch isn't breaking other things though. Let's reopen, and I'll see about cleaning this up.
Comment 12 Bastien Nocera 2011-10-21 13:11:29 UTC
Created attachment 199638 [details] [review]
Another tighter fix
Comment 13 Bastien Nocera 2011-10-21 13:21:18 UTC
I'm being stupid though, and missed the "info" part of the disconnection. Feel free to apply this patch or drop it, don't think it's necessary.