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 754795 - [PATCH] core: register G_TYPE_SOCKET early
[PATCH] core: register G_TYPE_SOCKET early
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-09-09 17:44 UTC by Lubomir Rintel
Modified: 2015-09-15 16:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: register G_TYPE_SOCKET early (767 bytes, text/plain)
2015-09-09 17:44 UTC, Lubomir Rintel
Details
backtrace of deadlock (7.60 KB, text/plain)
2015-09-10 09:29 UTC, Thomas Haller
Details

Description Lubomir Rintel 2015-09-09 17:44:46 UTC
Created attachment 311015 [details]
core: register G_TYPE_SOCKET early

Concurrent registrations later on can cause a deadlock due to a GLib bug.
Comment 1 Thomas Haller 2015-09-10 09:29:28 UTC
Created attachment 311046 [details]
backtrace of deadlock

Attaching backtrace for reference.

(lrintel posted it on #nm)
Comment 2 Thomas Haller 2015-09-10 09:33:28 UTC
(In reply to Lubomir Rintel from comment #0)
> Created attachment 311015 [details]
> core: register G_TYPE_SOCKET early
> 
> Concurrent registrations later on can cause a deadlock due to a GLib bug.

LGTM... but maybe you could also generously register other types as well.
We anyway know that we need them (later on) and they were involved in the deadlock you saw.

  g_type_ensure (G_TYPE_SOCKET);
  g_type_ensure (G_TYPE_DBUS_CONNECTION);
  g_type_ensure (NM_TYPE_BUS_MANAGER);
  // and possibly other types that are involved in GDBus (as these objects
  // are used on multiple threas).
Comment 3 Dan Williams 2015-09-11 15:28:02 UTC
Yeah, though lets just start small and find others later if we find we need them?