Wait for JIT threads to be created in ASAN builds
A race between pthread_create and dlopen could cause deadlock in ASAN
builds with older glibc versions. The pthread_create sanitizer
interceptor uses dl_iterate_phdr with a callback that uses __tls__addr.
__tls_addr could wait on dl_load_lock when there is a dlopen in progress
on other thread in older versions of glibc. dl_iterate_phdr already
holds this lock which could cause a deadlock. As a workaround for this
issue we wait for jit threads creation to finish before loading the
system library (which could dlopen) to prevent this race.
Bug: 238730394
Test: art/test.py
Change-Id: Ic7f71e4a3eaab847c878c2a08c6bcf25b6a03a3d
1 file changed