about summary refs log tree commit diff
path: root/ports/sysdeps/m68k/m680x0/fpu/s_significandl.c
diff options
context:
space:
mode:
authorArjun Shankar <arjun@redhat.com>2024-10-18 16:03:25 +0200
committerArjun Shankar <arjun@redhat.com>2024-10-23 13:40:16 +0200
commit9f0d2c0ee6c728643fcf9a4879e9f20f5e45ce5f (patch)
tree86cff8d63944f5a0e573b1d0a72d3a669c4f124d /ports/sysdeps/m68k/m680x0/fpu/s_significandl.c
parent81439a116cf48583127ddf1f09809440aa40969a (diff)
downloadglibc-master.tar.gz
glibc-master.tar.xz
glibc-master.zip
libio: Fix a deadlock after fork in popen HEAD master
popen modifies its file handler book-keeping under a lock that wasn't
being taken during fork.  This meant that a concurrent popen and fork
could end up copying the lock in a "locked" state into the fork child,
where subsequently calling popen would lead to a deadlock due to the
already (spuriously) held lock.

This commit fixes the deadlock by appropriately taking the lock before
fork, and releasing/resetting it in the parent/child after the fork.

A new test for concurrent popen and fork is also added.  It consistently
hangs (and therefore fails via timeout) without the fix applied.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'ports/sysdeps/m68k/m680x0/fpu/s_significandl.c')
0 files changed, 0 insertions, 0 deletions