[3/4] misc: Do not release the unwind-link lock on dlopen failure

Message ID 20261022205107.259407-4-adhemerval.zanella@linaro.org (mailing list archive)
State New
Headers
Series nptl: Load the unwinder during the first pthread_create (BZ 34689) |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Adhemerval Zanella Oct. 22, 2026, 8:50 p.m. UTC
  __libc_unwind_link_get only acquires the lock after the dlopen of
libgcc_s succeeds.

The issue is present since the initial implementation
(9fc813e1a37 "Implement <unwind-link.h> for dynamically loading
the libgcc_s unwinder").

Checked on x86_64-linux-gnu.
---
 misc/unwind-link.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Patch

diff --git a/misc/unwind-link.c b/misc/unwind-link.c
index c5c1a3ea692..332730c460c 100644
--- a/misc/unwind-link.c
+++ b/misc/unwind-link.c
@@ -56,10 +56,7 @@  __libc_unwind_link_get (void)
      unwinding.  */
   void *local_libgcc_handle = __libc_dlopen (UNWIND_SONAME);
   if (local_libgcc_handle == NULL)
-    {
-      __libc_lock_unlock (lock);
-      return NULL;
-    }
+    return NULL;
 
   struct unwind_link local;
   local.ptr__Unwind_Backtrace