diff options
author | Stefan Liebler <stli@linux.vnet.ibm.com> | 2018-05-04 10:00:59 +0200 |
---|---|---|
committer | Stefan Liebler <stli@linux.vnet.ibm.com> | 2018-05-04 10:00:59 +0200 |
commit | 1660901840dfc9fde6c5720a32f901af6f08f00a (patch) | |
tree | fea79b57e81f2dcaaf7d5c15fa37d31ced9beef3 /sysdeps/riscv/jmpbuf-unwind.h | |
parent | 15c19147a8361b7281519b9784b3b823c447cf7a (diff) | |
download | glibc-1660901840dfc9fde6c5720a32f901af6f08f00a.tar.gz glibc-1660901840dfc9fde6c5720a32f901af6f08f00a.tar.xz glibc-1660901840dfc9fde6c5720a32f901af6f08f00a.zip |
Fix blocking pthread_join. [BZ #23137]
On s390 (31bit) if glibc is build with -Os, pthread_join sometimes blocks indefinitely. This is e.g. observable with testcase intl/tst-gettext6. pthread_join is calling lll_wait_tid(tid), which performs the futex-wait syscall in a loop as long as tid != 0 (thread is alive). On s390 (and build with -Os), tid is loaded from memory before comparing against zero and then the tid is loaded a second time in order to pass it to the futex-wait-syscall. If the thread exits in between, then the futex-wait-syscall is called with the value zero and it waits until a futex-wake occurs. As the thread is already exited, there won't be a futex-wake. In lll_wait_tid, the tid is stored to the local variable __tid, which is then used as argument for the futex-wait-syscall. But unfortunately the compiler is allowed to reload the value from memory. With this patch, the tid is loaded with atomic_load_acquire. Then the compiler is not allowed to reload the value for __tid from memory. ChangeLog: [BZ #23137] * sysdeps/nptl/lowlevellock.h (lll_wait_tid): Use atomic_load_acquire to load __tid.
Diffstat (limited to 'sysdeps/riscv/jmpbuf-unwind.h')
0 files changed, 0 insertions, 0 deletions