about summary refs log tree commit diff
path: root/nptl/tst-atfork1.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2020-05-07 15:50:09 +0200
committerAndreas Schwab <schwab@suse.de>2020-05-12 17:17:49 +0200
commit4cab20fa49b3ea3e3454fdc4f13bf3828d8efd19 (patch)
tree4d9e5f35863adc7468002bc246b2c4dbd0abfcd3 /nptl/tst-atfork1.c
parent16536e98e36e08bc1ce1edbd8dd50c7c3bb7a936 (diff)
downloadglibc-4cab20fa49b3ea3e3454fdc4f13bf3828d8efd19.tar.gz
glibc-4cab20fa49b3ea3e3454fdc4f13bf3828d8efd19.tar.xz
glibc-4cab20fa49b3ea3e3454fdc4f13bf3828d8efd19.zip
nptl: wait for pending setxid request also in detached thread (bug 25942)
There is a race between __nptl_setxid and exiting detached thread, which
causes a deadlock on stack_cache_lock.  The deadlock happens in this
state:

T1: setgroups -> __nptl_setxid (holding stack_cache_lock, waiting on cmdp->cntr == 0)
T2 (detached, exiting): start_thread -> __deallocate_stack (waiting on stack_cache_lock)
more threads waiting on stack_cache_lock in pthread_create

For non-detached threads, start_thread waits for its own setxid handler to
finish before exiting.  Do this for detached threads as well.
Diffstat (limited to 'nptl/tst-atfork1.c')
0 files changed, 0 insertions, 0 deletions