mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
The patches are a subset taken from Debian (see: <https://sources.debian.org/patches/libsoup3/3.6.5-3/>). * gnu/packages/patches/libsoup-auth-digest-fix-crash.patch * gnu/packages/patches/libsoup-deadlock-in-add_listener_in_thread.patch * gnu/packages/patches/libsoup-fix-merge-of-ranges.patch * gnu/packages/patches/libsoup-memory-leak-in-soup_form_decode.patch * gnu/packages/patches/libsoup-multipart-bounds-check.patch * gnu/packages/patches/libsoup-use-libdl-instead-of-gmodule.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/gnome.scm (libsoup-minimal): Apply them. Change-Id: I7e4968c1d87e28860fc68616f6107d018e0d93dd
70 lines
1.9 KiB
Diff
70 lines
1.9 KiB
Diff
From: Fabio Manganiello <fabio@manganiello.tech>
|
|
Date: Tue, 15 Jul 2025 15:41:47 +0200
|
|
Subject: soup-init: Use libdl instead of gmodule in `soup2_is_loaded` check
|
|
|
|
Calling `g_module_open` in the library constructor can cause deadlocks
|
|
when libsoup is used with other libraries that also contend for GLib
|
|
mutexes. `dlopen` should be used instead.
|
|
|
|
Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
|
|
Bug: https://gitlab.gnome.org/GNOME/libsoup/-/issues/463
|
|
Bug: https://gitlab.gnome.org/GNOME/glib/-/issues/1443
|
|
Bug-Debian: https://bugs.debian.org/1109685
|
|
Origin: https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/475
|
|
Applied-upstream: 3.7.0, commit:1296cbf983f036f20262c453926dff77e1d6a852
|
|
Applied-upstream: 3.6.6, commit:2316e56a5502ac4c41ef4ff56a3266e680aca129
|
|
---
|
|
libsoup/soup-init.c | 28 +++++++++++++++++-----------
|
|
1 file changed, 17 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/libsoup/soup-init.c b/libsoup/soup-init.c
|
|
index 8a33c77..3392e8e 100644
|
|
--- a/libsoup/soup-init.c
|
|
+++ b/libsoup/soup-init.c
|
|
@@ -10,7 +10,6 @@
|
|
#endif
|
|
|
|
#include <glib/gi18n-lib.h>
|
|
-#include <gmodule.h>
|
|
#include "gconstructor.h"
|
|
|
|
#ifdef G_OS_WIN32
|
|
@@ -18,21 +17,28 @@
|
|
#include <windows.h>
|
|
|
|
HMODULE soup_dll;
|
|
+#else
|
|
+#include <dlfcn.h>
|
|
#endif
|
|
|
|
static gboolean
|
|
soup2_is_loaded (void)
|
|
{
|
|
- GModule *module = g_module_open (NULL, 0);
|
|
- gpointer func;
|
|
- gboolean result = FALSE;
|
|
-
|
|
- if (g_module_symbol (module, "soup_uri_new", &func))
|
|
- result = TRUE;
|
|
-
|
|
- g_module_close (module);
|
|
-
|
|
- return result;
|
|
+ gboolean result = FALSE;
|
|
+
|
|
+ /* Skip on PE/COFF, as it doesn't have a flat symbol namespace */
|
|
+#ifndef G_OS_WIN32
|
|
+ gpointer handle;
|
|
+ gpointer func;
|
|
+
|
|
+ handle = dlopen (NULL, RTLD_LAZY | RTLD_GLOBAL);
|
|
+ if (handle != NULL) {
|
|
+ func = dlsym (handle, "soup_uri_new");
|
|
+ result = (func != NULL);
|
|
+ dlclose (handle);
|
|
+ }
|
|
+#endif
|
|
+ return result;
|
|
}
|
|
|
|
static void
|