summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld_lock.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-05-06 09:27:41 +0000
committerkib <kib@FreeBSD.org>2008-05-06 09:27:41 +0000
commit60e5d7d0529be9f877e67cf34013ac32320062f0 (patch)
tree0d4b4b84b2ad5fa15e5d4e4caee3794dae371904 /libexec/rtld-elf/rtld_lock.h
parentfc58e99cef77a3982048f6b39d87180dd8b28ad9 (diff)
downloadFreeBSD-src-60e5d7d0529be9f877e67cf34013ac32320062f0.zip
FreeBSD-src-60e5d7d0529be9f877e67cf34013ac32320062f0.tar.gz
Fix the problem with the C++ exception handling for the multithreaded
programs. From the PR description: The gcc runtime's _Unwind_Find_FDE function, invoked during exception handling's stack unwinding, is not safe to execute from within multiple threads. FreeBSD' s dl_iterate_phdr() however permits multiple threads to pass through it though. The result is surprisingly reliable infinite looping of one or more threads if they just happen to be unwinding at the same time. Introduce the new lock that is write locked around the dl_iterate_pdr, thus providing required exclusion for the stack unwinders. PR: threads/123062 Submitted by: Andy Newman <an at atrn org> Reviewed by: kan MFC after: 2 weeks
Diffstat (limited to 'libexec/rtld-elf/rtld_lock.h')
-rw-r--r--libexec/rtld-elf/rtld_lock.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h
index cca4f18..2e3f954 100644
--- a/libexec/rtld-elf/rtld_lock.h
+++ b/libexec/rtld-elf/rtld_lock.h
@@ -52,6 +52,7 @@ typedef struct rtld_lock *rtld_lock_t;
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);
OpenPOWER on IntegriCloud