bionic/libc
Yabin Cui 952e9eb086 Don't use __thread in __cxa_thread_finalize().
Currently we use __thread variable to store thread_local_dtors,
which makes tsan test fork_atexit.cc hang. The problem is as below:
The main thread creates a worker thread, the worker thread calls
pthread_exit() -> __cxa_thread_finalize() -> __emutls_get_address()
-> pthread_once(emutls_init) -> emutls_init().
Then the main thread calls fork(), the child process cals
exit() -> __cxa_thread_finalize() -> __emutls_get_address()
-> pthread_once(emutls_init).
So the child process is waiting for pthread_once(emutls_init)
to finish which will never occur.

It might be the test's fault because POSIX standard says if a
multi-threaded process calls fork(), the new process may only
execute async-signal-safe operations until exec functions are
called. And exit() is not async-signal-safe. But we can make
bionic more reliable by not using __thread in
__cxa_thread_finalize().

Bug: 25392375
Change-Id: Ife403dd7379dad8ddf1859c348c1c0adea07afb3
2015-11-24 17:24:06 -08:00
..
arch-arm fix the mremap signature 2015-11-06 13:14:43 -08:00
arch-arm64 fix the mremap signature 2015-11-06 13:14:43 -08:00
arch-common/bionic Properly align init/fini_arrays for crtend.o 2015-05-07 11:57:53 -07:00
arch-mips fix the mremap signature 2015-11-06 13:14:43 -08:00
arch-mips64 fix the mremap signature 2015-11-06 13:14:43 -08:00
arch-x86 fix the mremap signature 2015-11-06 13:14:43 -08:00
arch-x86_64 fix the mremap signature 2015-11-06 13:14:43 -08:00
bionic Don't use __thread in __cxa_thread_finalize(). 2015-11-24 17:24:06 -08:00
dns Fix alignment after variable-length data. 2015-07-06 14:43:28 -07:00
include Introduce anonymous namespace 2015-11-23 16:13:10 -08:00
kernel <netinet/udp.h> should include <linux/udp.h>. 2015-09-22 12:34:13 -07:00
private Merge "Use FUTEX_WAIT_BITSET to avoid converting timeouts." 2015-11-21 01:50:29 +00:00
stdio Change _stdio_handles_locking into _caller_handles_locking. 2015-11-20 17:44:26 -08:00
stdlib name the atexit handler pages 2015-07-27 11:04:58 -07:00
tools Generate libdl.so per-architecture version script 2015-10-30 17:43:27 -07:00
tzcode Improve libc time zone fallback behavior. 2015-11-13 08:38:48 -08:00
upstream-dlmalloc Return total footprint, not high water mark. 2014-10-13 12:45:35 -07:00
upstream-freebsd Move several FreeBSD functions to OpenBSD. 2015-09-14 19:01:58 -07:00
upstream-netbsd Sync with upstream NetBSD lib/libc/regex. 2015-09-14 18:45:52 -07:00
upstream-openbsd Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC. 2015-10-23 12:32:52 -07:00
zoneinfo Update timezone data to 2015g 2015-10-09 17:58:58 +01:00
Android.bp move arch variant structs down a level 2015-11-23 14:14:57 -08:00
Android.mk Merge "Disable clang for mips/mips64 libc." 2015-11-20 18:27:14 +00:00
crt.mk Make .note.android.ident section type SH_NOTE 2015-02-12 21:37:20 -08:00
libc.arm64.map Implement pthread spin. 2015-11-18 17:51:21 -08:00
libc.arm.map Implement pthread spin. 2015-11-18 17:51:21 -08:00
libc.map.txt Implement pthread spin. 2015-11-18 17:51:21 -08:00
libc.mips64.map Implement pthread spin. 2015-11-18 17:51:21 -08:00
libc.mips.map Implement pthread spin. 2015-11-18 17:51:21 -08:00
libc.x86_64.map Implement pthread spin. 2015-11-18 17:51:21 -08:00
libc.x86.map Implement pthread spin. 2015-11-18 17:51:21 -08:00
MODULE_LICENSE_BSD auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
NOTICE Regenerate NOTICE files. 2015-08-28 20:23:52 -07:00
SYSCALLS.TXT fix the mremap signature 2015-11-06 13:14:43 -08:00
version_script.txt Revert "Fix volantis boot." 2015-05-07 15:12:24 -07:00