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 727709 - Check system_bus before unref
Check system_bus before unref
Status: RESOLVED FIXED
Product: GUPnP
Classification: Other
Component: gupnp
unspecified
Other Linux
: Normal minor
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-06 17:33 UTC by Juan A. Suarez Romero
Modified: 2014-05-10 16:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check system_bus before unref (804 bytes, patch)
2014-04-06 17:34 UTC, Juan A. Suarez Romero
none Details | Review
Check if system-bus is accessible (1.47 KB, patch)
2014-04-08 08:15 UTC, Juan A. Suarez Romero
none Details | Review
Prevent critical if there's no system bus (937 bytes, patch)
2014-05-10 16:35 UTC, Jens Georg
committed Details | Review
Check for system bus before using DBus (1.30 KB, patch)
2014-05-10 16:38 UTC, Jens Georg
committed Details | Review

Description Juan A. Suarez Romero 2014-04-06 17:33:42 UTC
In gupnp_context_manager_create() system_bus unreffed after obtained it. But could be that it is not running.

So we need to check the object before unreffing it.
Comment 1 Juan A. Suarez Romero 2014-04-06 17:34:51 UTC
Created attachment 273667 [details] [review]
Check system_bus before unref
Comment 2 Jens Georg 2014-04-07 06:47:29 UTC
I think we could short-cut the check for connman/NetworkManager availability as well then; without system bus, they won't work. Would you mind adding that and commit the patch?

Otherwise just commit this patch and I'll do the rest later.
Comment 3 Juan A. Suarez Romero 2014-04-07 07:26:02 UTC
I'll do
Comment 4 Juan A. Suarez Romero 2014-04-08 08:15:04 UTC
Created attachment 273768 [details] [review]
Check if system-bus is accessible

Not sure if this is what you meant.
Comment 5 Jens Georg 2014-05-10 16:35:36 UTC
Created attachment 276288 [details] [review]
Prevent critical if there's no system bus

Found by Juan A. Suarez Romero <jasuarez@igalia.com>

Signed-off-by: Jens Georg <mail@jensge.org>

I slightly modified it to use g_clear_object
Comment 6 Jens Georg 2014-05-10 16:38:24 UTC
Created attachment 276290 [details] [review]
Check for system bus before using DBus

If there's no system bus, there's no need to check for Connman or
NetworkManager availability.

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 7 Jens Georg 2014-05-10 16:39:40 UTC
Attachment 276288 [details] pushed as 7507049 - Prevent critical if there's no system bus
Attachment 276290 [details] pushed as dd6008c - Check for system bus before using DBus