From 3fa34ebd8a4cac8873a380d4009ba7b7612faa0d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 9 Aug 2018 17:21:56 +0200 Subject: [PATCH] Work around libsoup recursive type hang in tests Closes: #1952 Approved by: alexlarsson --- app/flatpak-main.c | 3 +++ common/flatpak-installation.c | 2 ++ tests/httpcache.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/app/flatpak-main.c b/app/flatpak-main.c index 98334564..9e74bb44 100644 --- a/app/flatpak-main.c +++ b/app/flatpak-main.c @@ -596,6 +596,9 @@ main (int argc, g_set_prgname (argv[0]); + /* Avoid weird recursive type initialization deadlocks from libsoup */ + g_type_ensure (G_TYPE_SOCKET); + /* avoid gvfs (http://bugzilla.gnome.org/show_bug.cgi?id=526454) */ old_env = g_strdup (g_getenv ("GIO_USE_VFS")); g_setenv ("GIO_USE_VFS", "local", TRUE); diff --git a/common/flatpak-installation.c b/common/flatpak-installation.c index a8368fd3..42374635 100644 --- a/common/flatpak-installation.c +++ b/common/flatpak-installation.c @@ -129,6 +129,8 @@ flatpak_installation_class_init (FlatpakInstallationClass *klass) object_class->set_property = flatpak_installation_set_property; object_class->finalize = flatpak_installation_finalize; + /* Avoid weird recursive type initialization deadlocks from libsoup */ + g_type_ensure (G_TYPE_SOCKET); } static void diff --git a/tests/httpcache.c b/tests/httpcache.c index 3c4e9473..eb747b35 100644 --- a/tests/httpcache.c +++ b/tests/httpcache.c @@ -8,6 +8,9 @@ main (int argc, char *argv[]) const char *url, *dest; int flags = 0; + /* Avoid weird recursive type initialization deadlocks from libsoup */ + g_type_ensure (G_TYPE_SOCKET); + if (argc == 3) { url = argv[1];