Go to file
Florian Weimer 60f8062425 nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161]
Commit 27761a1042 ("Refactor atfork
handlers") introduced a lock, atfork_lock, around fork handler list
accesses.  It turns out that this lock occasionally results in
self-deadlocks in malloc/tst-mallocfork2:

(gdb) bt
#0  __lll_lock_wait_private ()
    at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:63
#1  0x00007f160c6f927a in __run_fork_handlers (who=(unknown: 209394016),
    who@entry=atfork_run_prepare) at register-atfork.c:116
#2  0x00007f160c6b7897 in __libc_fork () at ../sysdeps/nptl/fork.c:58
#3  0x00000000004027d6 in sigusr1_handler (signo=<optimized out>)
    at tst-mallocfork2.c:80
#4  sigusr1_handler (signo=<optimized out>) at tst-mallocfork2.c:64
#5  <signal handler called>
#6  0x00007f160c6f92e4 in __run_fork_handlers (who=who@entry=atfork_run_parent)
    at register-atfork.c:136
#7  0x00007f160c6b79a2 in __libc_fork () at ../sysdeps/nptl/fork.c:152
#8  0x0000000000402567 in do_test () at tst-mallocfork2.c:156
#9  0x0000000000402dd2 in support_test_main (argc=1, argv=0x7ffc81ef1ab0,
    config=config@entry=0x7ffc81ef1970) at support_test_main.c:350
#10 0x0000000000402362 in main (argc=<optimized out>, argv=<optimized out>)
    at ../support/test-driver.c:168

If no locking happens in the single-threaded case (where fork is
expected to be async-signal-safe), this deadlock is avoided.
(pthread_atfork is not required to be async-signal-safe, so a fork
call from a signal handler interrupting pthread_atfork is not
a problem.)

(cherry picked from commit 669ff911e2)
2019-02-08 12:55:21 +01:00
argp
assert
benchtests
bits
catgets
ChangeLog.old
conform
crypt
csu
ctype
debug
dirent
dlfcn malloc: tcache double free check 2018-11-28 15:45:42 -05:00
elf RISC-V: properly terminate call chain (bug 23125) 2018-12-15 21:57:43 +01:00
gmon
gnulib
grp [BZ #20271] Add newlines in __libc_fatal calls. 2018-11-09 10:17:07 -05:00
gshadow
hesiod
htl
hurd
iconv
iconvdata
include CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings [BZ #20018] 2019-02-04 21:36:37 +01:00
inet inet/tst-if_index-long: New test case for CVE-2018-19591 [BZ #23927] 2018-12-12 12:04:12 +01:00
intl intl: Do not return NULL on asprintf failure in gettext [BZ #24018] 2019-01-02 16:46:12 +01:00
io
libio Increase timeout of libio/tst-readline 2018-11-19 14:21:24 +01:00
locale
localedata
login
mach
malloc malloc: Always call memcpy in _int_realloc [BZ #24027] 2019-01-01 10:46:55 +01:00
manual malloc: tcache double free check 2018-11-28 15:45:42 -05:00
math Add XFAIL_ROUNDING_IBM128_LIBGCC to more fma() tests 2019-01-16 15:55:23 -02:00
mathvec
misc
nis
nptl nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161] 2019-02-08 12:55:21 +01:00
nptl_db
nscd nscd: Do not use __inet_aton_exact@GLIBC_PRIVATE [BZ #20018] 2019-02-04 21:36:38 +01:00
nss CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings [BZ #20018] 2019-02-04 21:36:37 +01:00
po
posix
pwd
resolv CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings [BZ #20018] 2019-02-04 21:36:37 +01:00
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib stdlib/tst-strtod-overflow: Switch to support_blob_repeat 2018-11-02 10:47:16 +01:00
streams
string Only build libm with -fno-math-errno (bug 24024) 2019-01-08 21:06:25 +01:00
sunrpc
support support: Do not require overflow builtin in support/blob_repeat.c 2018-12-15 19:09:25 +01:00
sysdeps nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161] 2019-02-08 12:55:21 +01:00
sysvipc
termios
time Fix tzfile low-memory assertion failure 2018-11-09 10:17:13 -05:00
timezone
wcsmbs
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4
ChangeLog nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161] 2019-02-08 12:55:21 +01:00
config.h.in
config.make.in
configure
configure.ac
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig Only build libm with -fno-math-errno (bug 24024) 2019-01-08 21:06:25 +01:00
Makefile
Makefile.in
Makerules
NEWS nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161] 2019-02-08 12:55:21 +01:00
o-iterator.mk
README
Rules
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.

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
	arm-*-linux-gnueabi
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-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
	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 http://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 http://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 http://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.