From dd80a13e1b079567c76769a0519529481a65c341 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 18 May 2018 08:02:51 +0200 Subject: [PATCH] Work around libsoup type initialization deadlocks As reported in https://bugzilla.gnome.org/show_bug.cgi?id=796031#c1 we sometimes hang in libsoup downloading stuff. This uses an early type initialization to avoid that. We don't use libsoup for the main download anymore, but its still used for some things, so better safe than sorry. Closes: #153 Approved by: alexlarsson --- src/builder-main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/builder-main.c b/src/builder-main.c index 8c1eec6e..7a08d2eb 100644 --- a/src/builder-main.c +++ b/src/builder-main.c @@ -355,6 +355,15 @@ main (int argc, else g_unsetenv ("GIO_USE_VFS"); + + /* Work around libsoup/glib race condition, as per: + https://bugzilla.gnome.org/show_bug.cgi?id=796031 and + https://bugzilla.gnome.org/show_bug.cgi?id=674885#c87 */ + g_type_ensure (G_TYPE_SOCKET_FAMILY); + g_type_ensure (G_TYPE_SOCKET_TYPE); + g_type_ensure (G_TYPE_SOCKET_PROTOCOL); + g_type_ensure (G_TYPE_SOCKET_ADDRESS); + orig_argv = g_memdup (argv, sizeof (char *) * argc); orig_argc = argc;