Go to file
Arjun Shankar 9f0d2c0ee6 libio: Fix a deadlock after fork in popen
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>
2024-10-23 13:40:16 +02:00
advisories
argp
assert
benchtests replace tgammaf by the CORE-MATH implementation 2024-10-11 11:12:32 +02:00
bits
catgets
ChangeLog.old
conform Disable _TIME_BITS if the compiler defaults to it 2024-10-01 08:44:41 -03:00
csu
ctype
debug stdlib: Make abort/_Exit AS-safe (BZ 26275) 2024-10-08 14:40:12 -03:00
dirent
dlfcn
elf
gmon
gnulib
hesiod
htl
hurd
iconv
iconvdata
include stdlib: Make abort/_Exit AS-safe (BZ 26275) 2024-10-08 14:40:12 -03:00
inet Add IPPROTO_SMC from Linux 6.11 to netinet/in.h 2024-10-10 10:28:04 -03:00
intl locale: Fix some spelling typos 2024-10-14 15:38:26 +01:00
io linux: Update stat-generic.h with linux 6.11 2024-10-10 10:27:58 -03:00
libio libio: Fix a deadlock after fork in popen 2024-10-23 13:40:16 +02:00
locale locale: Fix some spelling typos 2024-10-14 15:38:26 +01:00
localedata Enable transliteration rules with two input characters in scn_IT [BZ #32280] 2024-10-16 17:15:39 +02:00
login
mach
malloc
manual manual: Document stdio.h functions that may be macros 2024-10-21 17:08:31 -04:00
math replace tgammaf by the CORE-MATH implementation 2024-10-11 11:12:32 +02:00
mathvec
misc misc: Add support for Linux uio.h RWF_ATOMIC flag 2024-10-10 10:28:01 -03:00
nis
nptl Check time arguments to pthread_timedjoin_np and pthread_clockjoin_np 2024-10-21 20:56:48 +00:00
nptl_db
nscd
nss
po
posix libio: Fix a deadlock after fork in popen 2024-10-23 13:40:16 +02:00
resolv
resource
rt rt: more clock_nanosleep tests addendum 2024-10-08 14:30:21 -04:00
scripts Use Linux 6.11 in build-many-glibcs.py 2024-10-10 10:27:47 -03:00
setjmp
signal stdlib: Make abort/_Exit AS-safe (BZ 26275) 2024-10-08 14:40:12 -03:00
socket
soft-fp
stdio-common stdio-common/Makefile: Fix FAIL: lint-makefiles 2024-10-08 08:46:45 +08:00
stdlib stdlib: Make abort/_Exit AS-safe (BZ 26275) 2024-10-08 14:40:12 -03:00
string
sunrpc
support support: Make support_process_state_wait return the found state 2024-10-16 14:32:28 -03:00
sysdeps configure: default to --prefix=/usr on GNU/Linux 2024-10-22 18:11:49 -04:00
sysvipc
termios
time
timezone
wcsmbs Do not use -Wp to disable fortify (BZ 31928) 2024-10-01 08:44:40 -03:00
wctype
.b4-config Add .b4-config file 2024-10-21 14:26:42 +01:00
.clang-format
.gitattributes
.gitignore
abi-tags
aclocal.m4
config.h.in
config.make.in
configure Disable _TIME_BITS if the compiler defaults to it 2024-10-01 08:44:41 -03:00
configure.ac Disable _TIME_BITS if the compiler defaults to it 2024-10-01 08:44:41 -03:00
CONTRIBUTED-BY
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig Disable _TIME_BITS if the compiler defaults to it 2024-10-01 08:44:41 -03:00
Makefile
Makefile.help
Makefile.in
Makerules
NEWS stdlib: Make abort/_Exit AS-safe (BZ 26275) 2024-10-08 14:40:12 -03:00
o-iterator.mk
README
Rules
SECURITY.md
SHARED-FILES replace tgammaf by the CORE-MATH implementation 2024-10-11 11:12:32 +02:00
shlib-versions
test-skeleton.c
version.h

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu and x86_64-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arc*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	loongarch64-*-linux-gnu Hardware floating point, LE only.
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	or1k-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv32-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see https://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at https://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see https://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.