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 686172 - [patch] fix crasher on error == NULL
[patch] fix crasher on error == NULL
Status: RESOLVED FIXED
Product: gnome-bluetooth
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-bluetooth-general-maint@gnome.bugs
gnome-bluetooth-general-maint@gnome.bugs
: 687777 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-10-15 16:59 UTC by Oleksij Rempel
Modified: 2012-11-06 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-lib-fix-crasher-on-error-NULL.patch (1.24 KB, patch)
2012-10-15 16:59 UTC, Oleksij Rempel
none Details | Review
0001-lib-fix-crasher-on-error-NULL.patch v2 (1.43 KB, patch)
2012-10-15 17:15 UTC, Oleksij Rempel
rejected Details | Review
lib: Fix refcounting problems with Connect/Disconnect (3.67 KB, patch)
2012-10-30 11:19 UTC, Bastien Nocera
committed Details | Review

Description Oleksij Rempel 2012-10-15 16:59:27 UTC
Created attachment 226489 [details] [review]
0001-lib-fix-crasher-on-error-NULL.patch

this patch fixes crash on colling error->message in case where error == NULL.

It is easy reproducible on enabling/disable bluetooth headset.
Comment 1 Oleksij Rempel 2012-10-15 17:15:51 UTC
Created attachment 226493 [details] [review]
0001-lib-fix-crasher-on-error-NULL.patch v2

other patch version.
I included the check g_error_free too.

g_error_free will not fail any way, but it produce more warnings.
Comment 2 Bastien Nocera 2012-10-29 17:27:15 UTC
How do I reproduce this bug? I don't think that those calls should ever return failure with a non-NULL error.
Comment 3 Oleksij Rempel 2012-10-29 17:33:59 UTC
I is easy to reproduce with bluetooth headset. First connect it, then press disconnect it over bluetooth manager.
Comment 4 Bastien Nocera 2012-10-30 10:36:31 UTC
Instead of fixing the warning, your patch works around it:
(gnome-control-center:5234): GLib-GObject-WARNING **: invalid cast from `GDBusProxy' to `Device'
Comment 5 Bastien Nocera 2012-10-30 10:37:00 UTC
Review of attachment 226493 [details] [review]:

Not the root cause.
Comment 6 Oleksij Rempel 2012-10-30 10:47:27 UTC
Yep, i know it. But i do not know the root cause. Is it some thing to do with bluez api change? I talked about this with cyphermox on irc:ubuntu-devel, at the end he suggested to wait for your help :)
Comment 7 Bastien Nocera 2012-10-30 11:17:24 UTC
(In reply to comment #6)
> Yep, i know it. But i do not know the root cause.

Then I would rather you didn't post patches that you know are wrong.

> Is it some thing to do with
> bluez api change?

Nope, it was a bug in the GDBus port.

> I talked about this with cyphermox on irc:ubuntu-devel, at
> the end he suggested to wait for your help :)

I would suggest not to post patches that are wrong. The backtrace from the first warning and a reproducer are immensely more useful than wrong patches.
Comment 8 Bastien Nocera 2012-10-30 11:19:15 UTC
Created attachment 227624 [details] [review]
lib: Fix refcounting problems with Connect/Disconnect

Proxies related to particular interfaces were unref'ed even
though we never took a new reference to them, and the incorrect
GDBusProxy was used in some cases, causing crashers.
Comment 9 Bastien Nocera 2012-10-30 11:22:03 UTC
Attachment 227624 [details] pushed as ca2085a - lib: Fix refcounting problems with Connect/Disconnect
Comment 10 Oleksij Rempel 2012-10-30 11:23:08 UTC
(In reply to comment #7)

> I would suggest not to post patches that are wrong. The backtrace from the
> first warning and a reproducer are immensely more useful than wrong patches.

uff, initially i didn't knew i was wrong, only after long discussion on irc. But, OK - i'll try it.
Comment 11 Bastien Nocera 2012-11-06 16:44:44 UTC
*** Bug 687777 has been marked as a duplicate of this bug. ***