[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1109817: marked as done (unblock: libsoup3/3.6.5-3)



Your message dated Thu, 24 Jul 2025 14:28:13 +0000
with message-id <E1uewvd-00DehF-3D@respighi.debian.org>
and subject line unblock libsoup3
has caused the Debian Bug report #1109817,
regarding unblock: libsoup3/3.6.5-3
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1109817: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109817
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
X-Debbugs-Cc: libsoup3@packages.debian.org
Control: affects -1 + src:libsoup3
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package libsoup3, or consider this as a trixie-pu request 
for 13.1 if it's too late for 13.0.

[ Reason ]

Fix #1109685, a deadlock that appeared after gstreamer1.0-plugins-good 
was upgraded to 1.26.2

[ Impact ]

If not fixed, some GStreamer applications will deadlock. The example 
that we know about is Mopidy with third-party plugins installed, but it 
seems likely that there are others.

[ Tests ]

I attached an artificial test-case to 
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109685#33>.

With trixie's current libsoup3, ./1109685 deadlocks. I believe it is 
probabilistic and timing-dependent, but in practice looping for 10 
seconds seems to be enough that I see the deadlock every time.

With the proposed libsoup3, ./1109685 runs successfully.

With the proposed libsoup3, `LD_PRELOAD=libsoup-2.4.so.1 ./1109685` 
still crashes out with a fatal error, as designed:

>(process:510322): libsoup-ERROR **: 11:20:55.865: libsoup2 symbols detected. Using libsoup2 and libsoup3 in the same process is not supported.

This check is necessary because libsoup2.4 and libsoup3 symbols 
collide, and unfortunately it cannot be solved by using versioned 
symbols to disambiguate the global ELF symbol namespace, because the 
GObject type vocabulary is also a flat global namespace and has no 
equivalent of symbol-versioning.

[ Risks ]

Key package in at least our default GNOME desktop environment (and 
probably others such as KDE Plasma, via GStreamer).

The change is targeted and seems low-risk, and would be easy to revert 
if it causes a problem. Upstream has cherry-picked it to their 3.6.x 
branch and it will presumably be included in 3.6.6.

[ Checklist ]

  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing
      (filtered to remove duplicate patch contents)

unblock libsoup3/3.6.5-3
debdiff *.dsc | filterdiff -p1 -x'debian/patches/*.patch'

diff -Nru libsoup3-3.6.5/debian/changelog libsoup3-3.6.5/debian/changelog
--- libsoup3-3.6.5/debian/changelog	2025-07-12 09:52:52.000000000 +0100
+++ libsoup3-3.6.5/debian/changelog	2025-07-24 10:40:02.000000000 +0100
@@ -1,3 +1,22 @@
+libsoup3 (3.6.5-3) unstable; urgency=medium
+
+  * Team upload
+  * d/p/soup-init-Use-libdl-instead-of-gmodule-in-soup2_is_loaded.patch:
+    Fix a deadlock in some use patterns with dlopen and GModule.
+    If earlier versions of libsoup were dlopen'd (without using GModule)
+    in thread A, while thread B is holding the GModule lock but not the
+    libdl lock, the process would deadlock: in this scenario, thread A
+    is holding the libdl lock and attempts to take the GModule lock,
+    while thread B is holding the GModule lock and attempts to take the
+    libdl lock.
+    For example, this is known to affect some mopidy plugins, which load
+    libsoup via souphttpsrc.
+    Avoid this by making the check for libsoup2 symbols call dlopen
+    directly, so that there is no lock ordering inconsistency.
+    (Closes: #1109685)
+
+ -- Simon McVittie <smcv@debian.org>  Thu, 24 Jul 2025 10:40:02 +0100
+
 libsoup3 (3.6.5-2) unstable; urgency=medium
 
   * Team upload
diff -Nru libsoup3-3.6.5/debian/patches/series libsoup3-3.6.5/debian/patches/series
--- libsoup3-3.6.5/debian/patches/series	2025-07-12 09:52:52.000000000 +0100
+++ libsoup3-3.6.5/debian/patches/series	2025-07-24 10:40:02.000000000 +0100
@@ -1,3 +1,4 @@
+soup-init-Use-libdl-instead-of-gmodule-in-soup2_is_loaded.patch
 skip-tls_interaction-test.patch
 Record-Apache-error-log-for-unit-tests-and-show-it-during.patch
 test-utils-Add-more-debug-for-starting-stopping-Apache.patch
diff -Nru libsoup3-3.6.5/libsoup/soup-init.c libsoup3-3.6.5/libsoup/soup-init.c
--- libsoup3-3.6.5/libsoup/soup-init.c	2025-03-21 18:30:16.000000000 +0000
+++ libsoup3-3.6.5/libsoup/soup-init.c	2025-07-24 11:25:24.000000000 +0100
@@ -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;
+	gboolean result = FALSE;
 
-    if (g_module_symbol (module, "soup_uri_new", &func))
-        result = TRUE;
-
-    g_module_close (module);
-
-    return result;
+	/* 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

--- End Message ---
--- Begin Message ---
Unblocked libsoup3.

--- End Message ---

Reply to: