diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-12-10 05:14:24 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-12-10 11:51:25 +0100 |
commit | 5cc338565479a620244c2f8ff35956629c4dbf81 (patch) | |
tree | 4d34939dc95aebbf4b5c57012d0e091394bb6c4f /elf/tst-initorderb1.c | |
parent | 627f5ede70d70c77bdaf857db07404e8bf7f60af (diff) | |
download | glibc-5cc338565479a620244c2f8ff35956629c4dbf81.zip glibc-5cc338565479a620244c2f8ff35956629c4dbf81.tar.gz glibc-5cc338565479a620244c2f8ff35956629c4dbf81.tar.bz2 |
nptl: Add one more barrier to nptl/tst-create1
Without the bar_ctor_finish barrier, it was possible that thread2
re-locked user_lock before ctor had a chance to lock it. ctor then
blocked in its locking operation, xdlopen from the main thread
did not return, and thread2 was stuck waiting in bar_dtor:
thread 1: started.
thread 2: started.
thread 2: locked user_lock.
constructor started: 0.
thread 1: in ctor: started.
thread 3: started.
thread 3: done.
thread 2: unlocked user_lock.
thread 2: locked user_lock.
Fixes the test in commit 83b5323261bb72313bffcf37476c1b8f0847c736
("elf: Avoid deadlock between pthread_create and ctors [BZ #28357]").
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Diffstat (limited to 'elf/tst-initorderb1.c')
0 files changed, 0 insertions, 0 deletions