Created attachment 45388 [details] full stack trace From the downstream bug report: https://bugs.edge.launchpad.net/ubuntu/+source/geoclue/+bug/738584 Apparently the master provider crashes in some cases, possibly more likely after a resume from suspend: __kernel_vsyscall () raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 abort () at abort.c:92 g_assertion_message (domain=0x0, file=0x804f779 "master-provider.c", line=822, func=0x804fb20 "gc_master_provider_initialize_interfaces", message=<value optimized out>) at /build/buildd/glib2.0-2.28.3/./glib/gtestutils.c:1358 g_assertion_message_expr (domain=0x0, file=0x804f779 "master-provider.c", line=822, func=0x804fb20 "gc_master_provider_initialize_interfaces", expr=0x804f7d1 "priv->position == NULL") at /build/buildd/glib2.0-2.28.3/./glib/gtestutils.c:1369 Looks like in this particular case priv->position is not NULL.
Created attachment 45389 [details] [review] don't assert for position/address to be NULL when initializing interfaces I'm not certain of the exact case since I haven't been able to reproduce the crash at all, no matter how hard I tried, but I think the following would make sense: @@ -819,20 +819,20 @@ } if (priv->interfaces & GC_IFACE_POSITION) { - g_assert (priv->position == NULL); - - priv->position = geoclue_position_new (priv->service, - priv->path); - g_signal_connect (G_OBJECT (priv->position), "position-changed", - G_CALLBACK (position_changed), provider); + if (priv->position == NULL) { + priv->position = geoclue_position_new (priv->service, + priv->path); + g_signal_connect (G_OBJECT (priv->position), "position-changed", + G_CALLBACK (position_changed), provider); + } } if (priv->interfaces & GC_IFACE_ADDRESS) { If for some reason the position object isn't NULL (e.g. which I guess could be possible on resume, see below), merrily carry on. I think what's happening is in the case of this bug report, the system resumes and NM quickly cycles through the various states, probably fast enough to online that the master provider gets to call: /* update connection-cacheable providers */ if (status == GEOCLUE_CONNECTIVITY_ONLINE && priv->provides & GEOCLUE_PROVIDE_CACHEABLE_ON_CONNECTION) { /* intialize to fill cache (this will handle status change) */ if (gc_master_provider_initialize (provider)) { gc_master_provider_deinitialize (provider); } Tries to initialize the interfaces, and fails because position or address are already filled. Attached is the "full" patch for the piece of code I added above. Might be cleaner to deinit it and fill it back though.
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.