Bug 8235 - fix possible crashes + memory leak in dbus-gproxy.c
Summary: fix possible crashes + memory leak in dbus-gproxy.c
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: GLib (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Rob Taylor
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2006-09-12 04:55 UTC by Kimmo Hämäläinen
Modified: 2007-02-08 18:08 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (2.71 KB, patch)
2006-09-12 04:56 UTC, Kimmo Hämäläinen
Details | Splinter Review
proposed patch (1.88 KB, patch)
2006-10-13 03:17 UTC, Kimmo Hämäläinen
Details | Splinter Review
proposed patch (1.29 KB, patch)
2006-11-16 02:41 UTC, Kimmo Hämäläinen
Details | Splinter Review

Description Kimmo Hämäläinen 2006-09-12 04:55:30 UTC
Here is a patch that works against dbus-glib-0.71. It adds missing checks to
dbus-gproxy.c because it assumes too much about received NameOwnerChanged signals.

Also one memory leak patch that came from you guys, I think...
Comment 1 Kimmo Hämäläinen 2006-09-12 04:56:00 UTC
Created attachment 6920 [details] [review]
proposed patch
Comment 2 Kimmo Hämäläinen 2006-10-12 00:26:41 UTC
Comment on attachment 6920 [details] [review]
proposed patch

This turned out to be a buggy patch. I'll attach a new one when it's been
tested.
Comment 3 Kimmo Hämäläinen 2006-10-13 03:17:06 UTC
Created attachment 7401 [details] [review]
proposed patch

Here is the tested, fixed patch.
Comment 4 Rob Taylor 2006-10-25 13:31:12 UTC
I'd like to look into the 'neater' option mentioned in the patch.
Comment 5 Kimmo Hämäläinen 2006-11-03 05:26:42 UTC
It seems that unassociate_proxies() should also remove the proxy from the proxy
list before adding it to the data->destroyed list, because the caller destroys
the proxy.
Comment 6 Kimmo Hämäläinen 2006-11-16 02:41:55 UTC
Created attachment 7809 [details] [review]
proposed patch

Here is a modified patch that applies against 0.72.
Comment 7 Matthias Clasen 2006-11-28 09:21:33 UTC
Don't you want to create a new info in the else part ?
Comment 8 Ray Strode [halfline] 2006-11-28 09:25:54 UTC
Red Hat downstream report:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216034
Comment 9 Matthias Clasen 2006-11-28 09:32:01 UTC
The RH bug has my alternative patch
Comment 10 Kimmo Hämäläinen 2006-11-29 00:28:12 UTC
(In reply to comment #7)
> Don't you want to create a new info in the else part ?

I'm not sure, because of the comment "Name owner changed or deleted" in the
code: if the info was not found, doesn't that mean that there was not changing
or deletion? I.e. If the info is not found, the name owner is not related to
GProxies. Or am I confused?
Comment 11 Owen Taylor 2006-12-06 12:47:05 UTC
Just wanted to note here that this is regularly crashing gnome-session,
since it blanket listens to all NameOwnerChanged signals; I don't see
a GNOME bugzilla issue for this, but there are probably some dups there
if you looked hard enough.

I think that Kimmo is right and you don't want to insert a new info 
object, the message was simply not related to any GProxy objects that
the library was tracking.
Comment 12 Rob Taylor 2006-12-08 05:35:19 UTC
Yep, that patch looks right to me, I'll prep a release with it in asap.
Comment 13 Rob Taylor 2007-02-08 18:07:38 UTC
Fixed in git head, will be in dbus-glib 0.73


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.