From owner-freebsd-threads@FreeBSD.ORG Sun Apr 27 04:40:04 2008 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AAF106567C for ; Sun, 27 Apr 2008 04:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 33DA08FC0C for ; Sun, 27 Apr 2008 04:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3R4e4qq063505 for ; Sun, 27 Apr 2008 04:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3R4e4Cr063504; Sun, 27 Apr 2008 04:40:04 GMT (envelope-from gnats) Date: Sun, 27 Apr 2008 04:40:04 GMT Message-Id: <200804270440.m3R4e4Cr063504@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Andy Newman Cc: Subject: Re: threads/123062: C++ exception handling can loop during stacking unwinding in multithreaded programs X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andy Newman List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2008 04:40:04 -0000 The following reply was made to PR threads/123062; it has been noted by GNATS. From: Andy Newman To: bug-followup@FreeBSD.org, Andy Newman Cc: Subject: Re: threads/123062: C++ exception handling can loop during stacking unwinding in multithreaded programs Date: Sun, 27 Apr 2008 10:53:13 +1000 Yes, obviously it needs the bind lock before it accesses the objs list. As in, Index: rtld.c =================================================================== RCS file: /home/ncvs/root/src/src/libexec/rtld-elf/rtld.c,v retrieving revision 1.124 diff -u -r1.124 rtld.c --- rtld.c 17 May 2007 18:00:27 -0000 1.124 +++ rtld.c 27 Apr 2008 00:51:25 -0000 @@ -2098,9 +2098,10 @@ { struct dl_phdr_info phdr_info; const Obj_Entry *obj; - int error, lockstate; + int error, bind_lockstate, phdr_lockstate; - lockstate = rlock_acquire(rtld_bind_lock); + phdr_lockstate = wlock_acquire(rtld_phdr_lock); + bind_lockstate = rlock_acquire(rtld_bind_lock); error = 0; @@ -2119,7 +2120,8 @@ break; } - rlock_release(rtld_bind_lock, lockstate); + rlock_release(rtld_bind_lock, bind_lockstate); + wlock_release(rtld_phdr_lock, phdr_lockstate); return (error); } Index: rtld_lock.c =================================================================== RCS file: /home/ncvs/root/src/src/libexec/rtld-elf/rtld_lock.c,v retrieving revision 1.4 diff -u -r1.4 rtld_lock.c --- rtld_lock.c 3 Apr 2007 18:28:13 -0000 1.4 +++ rtld_lock.c 27 Apr 2008 00:50:01 -0000 @@ -171,7 +171,7 @@ lockinfo.thread_clr_flag(mask); } -#define RTLD_LOCK_CNT 2 +#define RTLD_LOCK_CNT 3 struct rtld_lock { void *handle; int mask; @@ -179,6 +179,7 @@ rtld_lock_t rtld_bind_lock = &rtld_locks[0]; rtld_lock_t rtld_libc_lock = &rtld_locks[1]; +rtld_lock_t rtld_phdr_lock = &rtld_locks[2]; int rlock_acquire(rtld_lock_t lock) Index: rtld_lock.h =================================================================== RCS file: /home/ncvs/root/src/src/libexec/rtld-elf/rtld_lock.h,v retrieving revision 1.2 diff -u -r1.2 rtld_lock.h --- rtld_lock.h 19 Jun 2003 02:39:37 -0000 1.2 +++ rtld_lock.h 27 Apr 2008 00:50:34 -0000 @@ -52,6 +52,7 @@ extern rtld_lock_t rtld_bind_lock; extern rtld_lock_t rtld_libc_lock; +extern rtld_lock_t rtld_phdr_lock; int rlock_acquire(rtld_lock_t); int wlock_acquire(rtld_lock_t); From owner-freebsd-threads@FreeBSD.ORG Mon Apr 28 11:07:11 2008 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA0941065691 for ; Mon, 28 Apr 2008 11:07:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CF91E8FC17 for ; Mon, 28 Apr 2008 11:07:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3SB7BCD056292 for ; Mon, 28 Apr 2008 11:07:11 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3SB7BfM056288 for freebsd-threads@FreeBSD.org; Mon, 28 Apr 2008 11:07:11 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 28 Apr 2008 11:07:11 GMT Message-Id: <200804281107.m3SB7BfM056288@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2008 11:07:11 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/76690 threads fork hang in child for -lc_r 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s bin/32295 threads pthread dont dequeue signals s threa/34536 threads accept() blocks other threads s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/49087 threads Signals lost in programs linked with libc_r o threa/70975 threads unexpected and unreliable behaviour when using SYSV se o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag s threa/76694 threads fork cause hang in dup()/close() function in child (-l o threa/79683 threads svctcp_create() fails if multiple threads call at the o threa/80435 threads panic on high loads o threa/83914 threads [libc] popen() doesn't work in static threaded program s threa/84483 threads problems with devel/nspr and -lc_r on 4.x s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r o threa/101323 threads fork(2) in threaded programs broken. o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/118715 threads kse problem o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 o threa/123062 threads C++ exception handling can loop during stacking unwind 24 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/30464 threads pthread mutex attributes -- pshared s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/69020 threads pthreads library leaks _gc_mutex o threa/79887 threads [patch] freopen() isn't thread-safe o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/116181 threads /dev/io-related io access permissions are not propagat o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/122923 threads 'nice' does not prevent background process from steali 11 problems total.