Bug 39234 - GeoclueMasterClient causes crash after deleted
Summary: GeoclueMasterClient causes crash after deleted
Status: RESOLVED WONTFIX
Alias: None
Product: GeoClue
Classification: Unclassified
Component: Master Server (obsolete) (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Geoclue Bugs
QA Contact: Geoclue Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 11:47 UTC by Jade Ho
Modified: 2013-09-09 14:50 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Jade Ho 2011-07-14 11:47:10 UTC
The crasher is caused by handling the signal "PositionProviderChanged" received
when the original GeoclueMasterClient connected to the
"PositionProviderChanged" signal is already disposed.

In geoclue-0.12.0_git0825\geoclue\geoclue-master-client.c, the implementation
of the constructor() connects the signal PositionProviderChanged with the
GeoclueMasterClientPrivate's proxy, but the signal is never disconnected when
the GeoclueMasterClientPrivate is destroyed in either finalize() or dispose().

When the signal "PositionProviderChanged" is received, it attempts emit the
signal to the GeoclueMasterClient, in the function position_provider_changed().
 If the client is destroyed by then, the memory it points to could be anything.
 Thus causing at times GLib-GObject warning or possibly even a crasher.

I have downloaded the original source and updated the function finalize
(GObject *object) as follows:

    finalize (GObject *object) 
    {
    GeoclueMasterClientPrivate* priv = GET_PRIVATE(object);
    dbus_g_proxy_disconnect_signal(priv->proxy, "PositionProviderChanged",
                                 G_CALLBACK (position_provider_changed),
                                 object);

    G_OBJECT_CLASS (geoclue_master_client_parent_class)->finalize (object);
    }

After this change, the crasher experienced by my application no longer exist
and the warning messages also disappeared.

For more detail, I have previously submitted a defect in Meego Bugzilla under: https://bugs.meego.com/show_bug.cgi?id=17918

All related attachments and detail can be retrieved from there.  

Thanks.
Comment 1 Zeeshan Ali 2013-09-09 14:50:11 UTC
Closing all bugs on old geoclue. If your bug still applies to new geoclue, please do re-open, I really don't have time to go through each and every bug and evaluate separately. :( Apologies for any inconvenience caused by this change.


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.