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 661172 - bluetooth-applet crashed with SIGSEGV in filter_type_func()
bluetooth-applet crashed with SIGSEGV in filter_type_func()
Status: RESOLVED OBSOLETE
Product: gnome-bluetooth
Classification: Core
Component: general
3.2.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-bluetooth-general-maint@gnome.bugs
gnome-bluetooth-general-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2011-10-07 11:46 UTC by Pedro Villavicencio
Modified: 2013-04-16 09:15 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2



Description Pedro Villavicencio 2011-10-07 11:46:31 UTC
this report has been filed here:

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

Package: gnome-bluetooth 3.2.0-0ubuntu1

"Trying to browse data on bluetooth device."

".

Thread 1 (Thread 0x7fd1be0f8940 (LWP 2166))

  • #0 filter_type_func
    at bluetooth-chooser.c line 601
  • #1 filter_func
    at bluetooth-chooser.c line 671
  • #2 gtk_tree_model_filter_real_visible
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtktreemodelfilter.c line 1260
  • #3 gtk_tree_model_filter_visible
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtktreemodelfilter.c line 1290
  • #4 gtk_tree_model_filter_row_changed
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtktreemodelfilter.c line 2041
  • #5 g_closure_invoke
    at /build/buildd/glib2.0-2.29.92/./gobject/gclosure.c line 774
  • #6 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3272
  • #7 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3003
  • #8 g_signal_emit
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3060
  • #9 gtk_tree_model_filter_row_changed
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtktreemodelfilter.c line 2088
  • #10 g_closure_invoke
    at /build/buildd/glib2.0-2.29.92/./gobject/gclosure.c line 774
  • #11 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3272
  • #12 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3003
  • #13 g_signal_emit
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3060
  • #14 gtk_tree_store_set_valist
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtktreestore.c line 1164
  • #15 gtk_tree_store_set
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtktreestore.c line 1193
  • #16 device_changed
    at bluetooth-client.c line 421
  • #17 marshal_dbus_message_to_g_marshaller
    at dbus-gproxy.c line 1733
  • #18 g_closure_invoke
    at /build/buildd/glib2.0-2.29.92/./gobject/gclosure.c line 774
  • #19 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3272
  • #20 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3003
  • #21 g_signal_emit
    at /build/buildd/glib2.0-2.29.92/./gobject/gsignal.c line 3060
  • #22 dbus_g_proxy_emit_remote_signal
    at dbus-gproxy.c line 1786
  • #23 dbus_g_proxy_manager_filter
    at dbus-gproxy.c line 1353
  • #24 dbus_g_proxy_manager_filter
    at dbus-gproxy.c line 1194
  • #25 dbus_connection_dispatch
    at ../../dbus/dbus-connection.c line 4603
  • #26 message_queue_dispatch
    at dbus-gmain.c line 90
  • #27 g_main_dispatch
    at /build/buildd/glib2.0-2.29.92/./glib/gmain.c line 2441
  • #28 g_main_context_dispatch
    at /build/buildd/glib2.0-2.29.92/./glib/gmain.c line 3011
  • #29 g_main_context_iterate
    at /build/buildd/glib2.0-2.29.92/./glib/gmain.c line 3089
  • #30 g_main_loop_run
    at /build/buildd/glib2.0-2.29.92/./glib/gmain.c line 3297
  • #31 gtk_main
    at /build/buildd/gtk+3.0-3.1.92/./gtk/gtkmain.c line 1367
  • #32 main
    at main.c line 951

Comment 1 Bastien Nocera 2011-10-19 14:33:11 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 2 James M. Leddy 2012-01-19 19:36:46 UTC
This is actually not a duplicate of bug 654172, because the version of Ubuntu includes the patches in bug 654172, but is still succeptible to this issue. It has since been fixed, however.
Comment 3 Bastien Nocera 2012-01-19 20:31:34 UTC
(In reply to comment #2)
> This is actually not a duplicate of bug 654172, because the version of Ubuntu
> includes the patches in bug 654172, but is still succeptible to this issue. It
> has since been fixed, however.

I'd need either a way to reproduce the problem, or assurances that the problem isn't in the humongous app indicator patch.
Comment 4 James M. Leddy 2012-01-19 20:58:51 UTC
I hadn't considered that. We have been able to fix the problem by only updating gnome-bluetooth to the latest development package (3.2.1-0ubuntu2), but I'm still investigating and may end up bisecting everything to figure out what fixed it. Since it's fixed I don't think there's anything for you to do here unless it is fixed by one of our distro patches.

I'm leaving on NEEDINFO for now. I'll post again I complete analysis.
Comment 5 James M. Leddy 2012-01-20 18:47:23 UTC
There is definitely a bug in bluetooth-applet, though it will not be visible to gnome3 users or (i think) to people that have a working bluetooth stack. I think what makes this bug visible is that browsing files on the device fails, which is the current case in Ubuntu.

It looks like we have a use of a variable after it's been freed. First let me go through how to reproduce the problem. Select "browse files on device" from the applet, then select a device, then hit the "browse" button on the dialog. A few seconds will go by, and then there is a segfault.

(bluetooth-applet:24077): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `BluetoothChooser'

(bluetooth-applet:24077): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'

Program received signal SIGSEGV, Segmentation fault.


That corresponds to this code, around bluetooth-chooser.c:675:

	BluetoothChooser *self = BLUETOOTH_CHOOSER (data);
	BluetoothChooserPrivate *priv = BLUETOOTH_CHOOSER_GET_PRIVATE(self);

Subsequently, *priv is dereferenced and the application crashes. 


Using gdb to figure out what's happening here:
Breakpoint 1, bluetooth_chooser_init (self=0x64f5c0) at bluetooth-chooser.c:869
warning: Source file is more recent than executable.
869	{
7: x/2xg 0x64f5c0
0x64f5c0:	0x00000000007cfe30	0x0000000000000001
(gdb) p *self
$18 = {parent = {container = {widget = {parent_instance = {g_type_instance = {g_class = 0x7cfe30}, ref_count = 1, 
          qdata = 0x74e942}, priv = 0x64f5f0}, priv = 0x64f660}, priv = 0x64f670}}


on initialization, self has ref_count = 1. 

Then after clicking the "browse" button:

Breakpoint 2, filter_func (model=0x73b500, iter=0x7fffffffcef0, data=0x64f5c0) at bluetooth-chooser.c:667
667	{
7: x/2xg 0x64f5c0
0x64f5c0:	0x000000000064fe60	0x0000000000000000

Has ref_count = 0. If you continue from here you'll get the glib messages and the segfault.

I haven't looked into where we have "one too many" free() yet.

I don't appear to have the appropiate permission to make this UNCONFIRMED.
Comment 6 James M. Leddy 2012-01-20 19:10:52 UTC
One solution to this is to make gnome-applet look like the dropdown in gnome-shell. That consists of removing the "Browse files on a device" option and moving the "Send files to device" down with the "Setup new device" field. 

This bug is also present on gnome-classic.
Comment 7 Bastien Nocera 2012-03-06 11:54:34 UTC
I tried very hard and couldn't reproduce the bug at the time. I need a sure fire way to reproduce the problem, or a run under valgrind for example, so we can see the first after-free usage.
Comment 8 James M. Leddy 2012-04-06 16:02:30 UTC
(In reply to comment #7)
> I tried very hard and couldn't reproduce the bug at the time. I need a sure
> fire way to reproduce the problem, or a run under valgrind for example, so we
> can see the first after-free usage.

Hi Bastien. I've been working on other things, but I have enough time to look into this bug further. Is there a specific valgrind test I should run to get the best output?

Also, I have one additional anecdote. If the user selects "Motorola Phone" from the applet drop down and uses "browse", this works. From then on, there is no segfault from the browse dialog. If I then log out and back in, and select the browse dialog straight away, the applet crashes.
Comment 9 Bastien Nocera 2012-04-07 12:03:30 UTC
Run it under valgrind and reproduce the problem, the default settings should show whatever interesting things there are to see.
Comment 10 James M. Leddy 2012-05-29 16:32:39 UTC
We never figured out what the problem is. It looks to be resolved with a rebase that we pulled in. Thanks for your help. Please close this bug.
Comment 11 Steve White 2013-04-15 10:53:08 UTC
This is still happening in Ubuntu 12.10.

You should have some stack traces by now from Ubuntu's crash reporter.

Please fix this.
Comment 12 Bastien Nocera 2013-04-15 14:34:51 UTC
(In reply to comment #11)
> This is still happening in Ubuntu 12.10.
> 
> You should have some stack traces by now from Ubuntu's crash reporter.

Stack traces are useless as already mentioned.
Comment 13 James M. Leddy 2013-04-15 20:11:11 UTC
(In reply to comment #11)
> This is still happening in Ubuntu 12.10.
> 
> You should have some stack traces by now from Ubuntu's crash reporter.
> 
> Please fix this.

Hi Steve,

Our investigation into the problem confirmed that it was fixed in 12.04 and, we assumed, 12.10. If you are still having problems it is a different issue. Please open a new issue in launchpad against 12.10
Comment 14 Steve White 2013-04-16 09:15:16 UTC
James,

OK, I'll re-open it in another bug report.  

I took your previous remark: "We never figured out what the problem is", to mean you had *not* confirmed anything -- my mistake, I guess.

There will be several more reports, I expect.  I just did a clean upgrade to my system, and now gnome bluetooth is broken in one new way, and two old ones.

But really, the gnome bluetooth applet is a bug-o-rama -- who's to say *which* bug one is seeing at any given time?



Bastien,

"stack traces are useless as already mentioned"

???  What  ???

Already mentioned where?  I don't see any such previous remark in this exchange.

Why?  I use stack traces regularly!  Are you referring to something about this particular application?  Or are you impugning the programming capacities of the contributors?