kern/95339: [libexec] [patch] rtld is thread-unsafe. fixes for dlopen mt behavior

Mark Linimon linimon at lonesome.com
Wed Jul 16 16:20:05 UTC 2008


The following reply was made to PR kern/95339; it has been noted by GNATS.

From: linimon at lonesome.com (Mark Linimon)
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: kern/95339: [libexec] [patch] rtld is thread-unsafe. fixes for dlopen mt behavior
Date: Wed, 16 Jul 2008 11:17:39 -0500

 ----- Forwarded message from Oleg Dolgov <agile at sunbay.com> -----
 
 Hi,
 
 I'am able to reproduce this bug even with patched files
 (rtld.c, rev 1.124, rtld.h, rev 1.38)
 
 ...
 dlopen: /usr/lib/libm.so is running finalizers now
 dlopen: (null)
 dlopen: (null)
 dlopen: (null)
 dlopen: (null)
 dlopen: (null)
 dlopen: (null)
 dlopen: /usr/lib/libm.so is running finalizers now
 Segmentation fault (core dumped)
 deimos# gdb test2 test2.core
 GNU gdb 6.1.1 [FreeBSD]
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you are
 welcome to change it and/or distribute copies of it under certain conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for details.
 This GDB was configured as "amd64-marcel-freebsd"...
 Core was generated by `test2'.
 Program terminated with signal 11, Segmentation fault.
 Reading symbols from /lib/libthr.so.3...done.
 Loaded symbols for /lib/libthr.so.3
 Reading symbols from /lib/libc.so.7...done.
 Loaded symbols for /lib/libc.so.7
 Reading symbols from /usr/lib/libm.so...done.
 Loaded symbols for /usr/lib/libm.so
 Reading symbols from /libexec/ld-elf.so.1...done.
 Loaded symbols for /libexec/ld-elf.so.1
 #0  0x0000000800509abb in _rtld_thread_init () from /libexec/ld-elf.so.1
 [New Thread 0x800a01f80 (LWP 100202)]
 [New Thread 0x800a01e10 (LWP 100201)]
 [New Thread 0x800a01ca0 (LWP 100200)]
 [New Thread 0x800a01b30 (LWP 100199)]
 [New Thread 0x800a019c0 (LWP 100198)]
 [New Thread 0x800a01850 (LWP 100197)]
 [New Thread 0x800a016e0 (LWP 100196)]
 [New Thread 0x800a01570 (LWP 100194)]
 [New Thread 0x800a01400 (LWP 100160)]
 [New Thread 0x800a01290 (LWP 100150)]
 [New Thread 0x800a01120 (LWP 100184)]
 (gdb) info threads
   11 Thread 0x800a01120 (LWP 100184)  0x000000080080ac5c in nanosleep () 
   from /lib/libc.so.7
   10 Thread 0x800a01290 (LWP 100150)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
   9 Thread 0x800a01400 (LWP 100160)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
 * 8 Thread 0x800a01570 (LWP 100194)  0x0000000800509abb in _rtld_thread_init 
 () from /libexec/ld-elf.so.1
   7 Thread 0x800a016e0 (LWP 100196)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
   6 Thread 0x800a01850 (LWP 100197)  0x000000080050ac0c in _rtld_thread_init 
   () from /libexec/ld-elf.so.1
   5 Thread 0x800a019c0 (LWP 100198)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
   4 Thread 0x800a01b30 (LWP 100199)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
   3 Thread 0x800a01ca0 (LWP 100200)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
   2 Thread 0x800a01e10 (LWP 100201)  0x0000000800825e4c in write () from 
 /lib/libc.so.7
   1 Thread 0x800a01f80 (LWP 100202)  0x0000000800798e5c in _umtx_op () from 
 /lib/libc.so.7
 (gdb) bt
 #0  0x0000000800509abb in _rtld_thread_init () from /libexec/ld-elf.so.1
 #1  0x0000000800519f39 in _rtld_thread_init () from /libexec/ld-elf.so.1
 #2  0x0000000800509e09 in _rtld_thread_init () from /libexec/ld-elf.so.1
 #3  0x000000080050731c in dlsym () from /libexec/ld-elf.so.1
 #4  0x0000000800507c76 in dlopen () from /libexec/ld-elf.so.1
 #5  0x00000000004008c3 in func ()
 #6  0x000000080063ab98 in pthread_getprio () from /lib/libthr.so.3
 #7  0x0000000000000000 in ?? ()
 Cannot access memory at address 0x7fffff7fd000
 (gdb) t 6
 [Switching to thread 6 (Thread 0x800a01850 (LWP 100197))]#0  
 0x000000080050ac0c in _rtld_thread_init ()
    from /libexec/ld-elf.so.1
 (gdb) bt
 #0  0x000000080050ac0c in _rtld_thread_init () from /libexec/ld-elf.so.1
 #1  0x0000000800504c6c in dl_iterate_phdr () from /libexec/ld-elf.so.1
 #2  0x00000008005075ac in dlclose () from /libexec/ld-elf.so.1
 #3  0x00000000004008f7 in func ()
 #4  0x000000080063ab98 in pthread_getprio () from /lib/libthr.so.3
 #5  0x0000000000000000 in ?? ()
 Cannot access memory at address 0x7fffff3fb000
 
 p.s. seems that bug (bin/123932: amd(8) core dumps while load high) related 
 to this.
 
 p.p.s. FreeBSD 7.0-RELEASE (SCHED_ULE, SMP), amd64, 2xcpu 4-core, 6 Gb RAM.
 
 ----- End forwarded message -----


More information about the freebsd-bugs mailing list