This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/18778] ld.so crashes if failed dlopen causes libpthread to be forced unloaded


https://sourceware.org/bugzilla/show_bug.cgi?id=18778

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
diff --git a/elf/tst-nodelete.cc b/elf/tst-nodelete.cc
index 176cb68..24bb4c0 100644
--- a/elf/tst-nodelete.cc
+++ b/elf/tst-nodelete.cc
@@ -1,12 +1,15 @@
 #include "../dlfcn/dlfcn.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <gnu/lib-names.h>

 static int
 do_test (void)
 {
   int result = 0;

+  void *pthread = dlopen (LIBPTHREAD_SO, RTLD_LAZY);
+
   /* This is a test for correct handling of dlopen failures for library that
      is loaded with RTLD_NODELETE flag.  The first dlopen should fail because
      of undefined symbols in shared library.  The second dlopen then verifies
@@ -18,6 +21,9 @@ do_test (void)
       result = 1;
     }

+  if (pthread)
+    dlclose (pthread);
+
   /* This is a test for correct handling of dlopen failures for library that
      is linked with '-z nodelete' option and hence has DF_1_NODELETE flag.
      The first dlopen should fail because of undefined symbols in shared

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]