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 681456 - Extra config widgets destroyed and recreated when Bluez device properties change
Extra config widgets destroyed and recreated when Bluez device properties change
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Bluetooth
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-08 15:29 UTC by Dan Williams
Modified: 2012-09-07 12:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bluetooth: Don't break the custom widgets on connect (2.74 KB, patch)
2012-08-28 15:37 UTC, Bastien Nocera
committed Details | Review

Description Dan Williams 2012-08-08 15:29:44 UTC
During the NM plugin's DUN setup, the device's rfcomm service is started, which causes a the device to become Connected.  That triggers the widget being destroyed by cc_bluetooth_panel_update_properties().  Backtraces of this happening twice, once when Connected -> TRUE, and the second time when Connected -> FALSE.


Starting program: /usr/bin/gnome-control-center bluetooth
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe64bd700 (LWP 24012)]
[New Thread 0x7fffe58a9700 (LWP 24013)]
^Y[Thread 0x7fffe58a9700 (LWP 24013) exited]
** Message: has_config_widget 00:XX:XX:XX:XX:66 DialupNetworking
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXObjectPush
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXFileTransfer
** Message: has_config_widget 00:XX:XX:XX:XX:66 AudioSource
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControlTarget
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControl
** Message: has_config_widget 00:XX:XX:XX:XX:66 Headset_-_AG
** Message: has_config_widget 00:XX:XX:XX:XX:66 HandsfreeAudioGateway
** Message: has_config_widget 00:XX:XX:XX:XX:66 Phonebook_Access_-_PSE
** Message: has_config_widget 00:XX:XX:XX:XX:66 DialupNetworking
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXObjectPush
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXFileTransfer
** Message: has_config_widget 00:XX:XX:XX:XX:66 AudioSource
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControlTarget
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControl
** Message: has_config_widget 00:XX:XX:XX:XX:66 Headset_-_AG
** Message: has_config_widget 00:XX:XX:XX:XX:66 HandsfreeAudioGateway
** Message: has_config_widget 00:XX:XX:XX:XX:66 Phonebook_Access_-_PSE
** Message: Default Bluetooth adapter is powered
** Message: dun_start: starting DUN device discovery...
** Message: Detecting phone configuration...
** Message: dun_start: calling Connect...
** Message: dun_start: waiting for Connect success...

Breakpoint 1, widget_info_destroy (data=0x9d2020) at bt-widget.c:190
190	{
(gdb) bt
  • #0 widget_info_destroy
    at bt-widget.c line 190
  • #1 g_datalist_clear
    at gdataset.c line 283
  • #2 g_object_unref
    at gobject.c line 3018
  • #3 gtk_box_forall
    at gtkbox.c line 1858
  • #4 remove_extra_setup_widgets
    at cc-bluetooth-panel.c line 234
  • #5 cc_bluetooth_panel_update_properties
    at cc-bluetooth-panel.c line 255
  • #6 g_closure_invoke
    at gclosure.c line 777
  • #7 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #8 g_signal_emit_valist
    at gsignal.c line 3300
  • #9 g_signal_emit
    at gsignal.c line 3356
  • #10 g_object_dispatch_properties_changed
    at gobject.c line 1041
  • #11 g_object_notify_by_spec_internal
    at gobject.c line 1133
  • #12 g_object_notify
    at gobject.c line 1175
  • #13 device_model_row_changed
    at bluetooth-chooser.c line 453
  • #14 g_closure_invoke
    at gclosure.c line 777
  • #15 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #16 g_signal_emit_valist
    at gsignal.c line 3300
  • #17 g_signal_emit
    at gsignal.c line 3356
  • #18 gtk_tree_model_row_changed
    at gtktreemodel.c line 1801
  • #19 gtk_tree_model_filter_row_changed
    at gtktreemodelfilter.c line 2086
  • #20 g_closure_invoke
    at gclosure.c line 777
  • #21 signal_emit_unlocked_R
  • #22 g_signal_emit_valist
    at gsignal.c line 3300
  • #23 g_signal_emit
    at gsignal.c line 3356
  • #24 gtk_tree_model_row_changed
    at gtktreemodel.c line 1801
  • #25 gtk_tree_model_filter_row_changed
    at gtktreemodelfilter.c line 2086
  • #26 g_closure_invoke
    at gclosure.c line 777
  • #27 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #28 g_signal_emit_valist
    at gsignal.c line 3300
  • #29 g_signal_emit
    at gsignal.c line 3356
  • #30 gtk_tree_model_row_changed
    at gtktreemodel.c line 1801
  • #31 gtk_tree_store_set_valist
    at gtktreestore.c line 1163
  • #32 gtk_tree_store_set
    at gtktreestore.c line 1192
  • #33 device_changed
    at bluetooth-client.c line 467
  • #34 device_g_signal
    at bluetooth-client.c line 500
  • #35 device_g_signal
    at bluetooth-client.c line 487
  • #36 ffi_call_unix64
    at ../src/x86/unix64.S line 75
  • #37 ffi_call
    at ../src/x86/ffi64.c line 486
  • #38 g_cclosure_marshal_generic
    at gclosure.c line 1454
  • #39 g_closure_invoke
    at gclosure.c line 777
  • #40 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #41 g_signal_emit_valist
    at gsignal.c line 3300
  • #42 g_signal_emit
    at gsignal.c line 3356
  • #43 on_signal_received
    at gdbusproxy.c line 927
  • #44 emit_signal_instance_in_idle_cb
    at gdbusconnection.c line 3665
  • #45 g_main_dispatch
    at gmain.c line 2539
  • #46 g_main_context_dispatch
    at gmain.c line 3075
  • #47 g_main_context_iterate
    at gmain.c line 3146
  • #48 g_main_context_iteration
    at gmain.c line 3207
  • #49 g_application_run
    at gapplication.c line 1499
  • #50 main
    at control-center.c line 207
  • #0 widget_info_destroy
    at bt-widget.c line 190
  • #1 g_datalist_clear
    at gdataset.c line 283
  • #2 g_object_unref
    at gobject.c line 3018
  • #3 gtk_box_forall
    at gtkbox.c line 1858
  • #4 remove_extra_setup_widgets
    at cc-bluetooth-panel.c line 234
  • #5 cc_bluetooth_panel_update_properties
    at cc-bluetooth-panel.c line 255
  • #6 g_closure_invoke
    at gclosure.c line 777
  • #7 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #8 g_signal_emit_valist
    at gsignal.c line 3300
  • #9 g_signal_emit
    at gsignal.c line 3356
  • #10 g_object_dispatch_properties_changed
    at gobject.c line 1041
  • #11 g_object_notify_by_spec_internal
    at gobject.c line 1133
  • #12 g_object_notify
    at gobject.c line 1175
  • #13 device_model_row_changed
    at bluetooth-chooser.c line 453
  • #14 g_closure_invoke
    at gclosure.c line 777
  • #15 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #16 g_signal_emit_valist
    at gsignal.c line 3300
  • #17 g_signal_emit
    at gsignal.c line 3356
  • #18 gtk_tree_model_row_changed
    at gtktreemodel.c line 1801
  • #19 gtk_tree_model_filter_row_changed
    at gtktreemodelfilter.c line 2086
  • #20 g_closure_invoke
    at gclosure.c line 777
  • #21 signal_emit_unlocked_R
  • #22 g_signal_emit_valist
    at gsignal.c line 3300
  • #23 g_signal_emit
    at gsignal.c line 3356
  • #24 gtk_tree_model_row_changed
    at gtktreemodel.c line 1801
  • #25 gtk_tree_model_filter_row_changed
    at gtktreemodelfilter.c line 2086
  • #26 g_closure_invoke
    at gclosure.c line 777
  • #27 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #28 g_signal_emit_valist
    at gsignal.c line 3300
  • #29 g_signal_emit
    at gsignal.c line 3356
  • #30 gtk_tree_model_row_changed
    at gtktreemodel.c line 1801
  • #31 gtk_tree_store_set_valist
    at gtktreestore.c line 1163
  • #32 gtk_tree_store_set
    at gtktreestore.c line 1192
  • #33 device_changed
    at bluetooth-client.c line 467
  • #34 device_g_signal
    at bluetooth-client.c line 500
  • #35 device_g_signal
    at bluetooth-client.c line 487
  • #36 ffi_call_unix64
    at ../src/x86/unix64.S line 75
  • #37 ffi_call
    at ../src/x86/ffi64.c line 486
  • #38 g_cclosure_marshal_generic
    at gclosure.c line 1454
  • #39 g_closure_invoke
    at gclosure.c line 777
  • #40 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #41 g_signal_emit_valist
    at gsignal.c line 3300
  • #42 g_signal_emit
    at gsignal.c line 3356
  • #43 on_signal_received
    at gdbusproxy.c line 927
  • #44 emit_signal_instance_in_idle_cb
    at gdbusconnection.c line 3665
  • #45 g_main_dispatch
    at gmain.c line 2539
  • #46 g_main_context_dispatch
    at gmain.c line 3075
  • #47 g_main_context_iterate
    at gmain.c line 3146
  • #48 g_main_context_iteration
    at gmain.c line 3207
  • #49 g_application_run
    at gapplication.c line 1499
  • #50 main
    at control-center.c line 207
Continuing.
** Message: widget_info_destroy: NM Bluetooth widget info being destroyed
** Message: has_config_widget 00:XX:XX:XX:XX:66 DialupNetworking
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXObjectPush
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXFileTransfer
** Message: has_config_widget 00:XX:XX:XX:XX:66 AudioSource
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControlTarget
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControl
** Message: has_config_widget 00:XX:XX:XX:XX:66 Headset_-_AG
** Message: has_config_widget 00:XX:XX:XX:XX:66 HandsfreeAudioGateway
** Message: has_config_widget 00:XX:XX:XX:XX:66 Phonebook_Access_-_PSE
** Message: has_config_widget 00:XX:XX:XX:XX:66 DialupNetworking
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXObjectPush
** Message: has_config_widget 00:XX:XX:XX:XX:66 OBEXFileTransfer
** Message: has_config_widget 00:XX:XX:XX:XX:66 AudioSource
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControlTarget
** Message: has_config_widget 00:XX:XX:XX:XX:66 A/V_RemoteControl
** Message: has_config_widget 00:XX:XX:XX:XX:66 Headset_-_AG
** Message: has_config_widget 00:XX:XX:XX:XX:66 HandsfreeAudioGateway
** Message: has_config_widget 00:XX:XX:XX:XX:66 Phonebook_Access_-_PSE
** Message: Default Bluetooth adapter is powered
Comment 1 Dan Williams 2012-08-08 15:34:18 UTC
So what's happening here is:

  • #32 gtk_tree_store_set
    at gtktreestore.c line 1192
  • #33 device_changed
    at bluetooth-client.c line 467
  • #34 device_g_signal
    at bluetooth-client.c line 500
  • #12 g_object_notify
    at gobject.c line 1175
  • #13 device_model_row_changed
    at bluetooth-chooser.c line 453

which apparently doesn't bother to compare the currently selected device against the previously selected device, and only emit the signal if the selected device actually changed:

static void
device_model_row_changed (GtkTreeModel *model,
			   GtkTreePath  *path,
			   GtkTreeIter  *iter,
			   gpointer      data)
{
	BluetoothChooser *self = BLUETOOTH_CHOOSER (data);
	BluetoothChooserPrivate *priv = BLUETOOTH_CHOOSER_GET_PRIVATE(self);
	char *address;

	/* Not the selection changing? */
	if (gtk_tree_selection_path_is_selected (priv->selection, path) == FALSE)
		return;

	g_object_notify (G_OBJECT (self), "device-selected");
	address = bluetooth_chooser_get_selected_device (self);
	g_signal_emit (G_OBJECT (self),
		       selection_table_signals[SELECTED_DEVICE_CHANGED],
		       0, address);
	g_free (address);
}
Comment 2 Dan Williams 2012-08-08 15:34:59 UTC
Since this *is* still the selected device changing, the "Not the selection changing?" bit doesn't trigger.  The comment is wrong, because the currently selected device *can* can change without the selecting having changed.
Comment 3 Bastien Nocera 2012-08-28 15:37:17 UTC
Created attachment 222646 [details] [review]
bluetooth: Don't break the custom widgets on connect

We used to destroy and recreate the custom widgets whenever any of
the properties changed. Now we make sure that the custom widgets are
only destroyed and recreated when the device selected is a different one.

This fixes NetworkManager's Bluetooth plugins getting destroyed
because the Connected property changed, as it was trying to connect to
the device.
Comment 4 Bastien Nocera 2012-08-28 15:40:00 UTC
Let me know whether that fixes the problem for you.
Comment 5 Bastien Nocera 2012-09-07 12:32:27 UTC
Pushed to gnome-3-4 and master

Attachment 222646 [details] pushed as 12a3198 - bluetooth: Don't break the custom widgets on connect