cosmopolitan/libc/testlib
Justine Tunney 98c5847727
Fix fork waiter leak in nsync
This change fixes a bug where nsync waiter objects would leak. It'd mean
that long-running programs like runitd would run out of file descriptors
on NetBSD where waiter objects have ksem file descriptors. On other OSes
this bug is mostly harmless since the worst that can happen with a futex
is to leak a little bit of ram. The bug was caused because tib_nsync was
sneaking back in after the finalization code had cleared it. This change
refactors the thread exiting code to handle nsync teardown appropriately
and in making this change I found another issue, which is that user code
which is buggy, and tries to exit without joining joinable threads which
haven't been detached, would result in a deadlock. That doesn't sound so
bad, except the main thread is a joinable thread. So this deadlock would
be triggered in ways that put libc at fault. So we now auto-join threads
and libc will log a warning to --strace when that happens for any thread
2024-12-31 01:30:13 -08:00
..
almostequal.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
almostequalf.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
almostequallongdouble.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
aspect.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
bench.h Reduce header complexity 2023-11-28 14:39:42 -08:00
bench.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
benchmark.h Add more tests for strlcpy() 2024-09-13 01:14:35 -07:00
benchrunner.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
binequals.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
blake2b256_tests.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
blake2b256_tests.txt Run all BLAKE2B256 test vectors (#1185) 2024-05-24 10:59:23 -07:00
blocktronics.h Reduce header complexity 2023-11-28 14:39:42 -08:00
blocktronics.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
blocktronics.txt Remove trailing whitespace from all files (#497) 2022-07-20 20:31:16 -07:00
BUILD.mk Make threads faster and more reliable 2024-12-21 22:13:00 -08:00
clearxmmregisters.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
contains.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
endswith.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
exactlyequallongdouble.c Fix UB in gdtoa hexadecimal float scanf and strtod (#1288) 2024-09-14 17:11:04 -07:00
extract.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ezbench.h Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
ezbenchcontrol.c Make improvements 2024-02-12 10:23:00 -08:00
ezbenchreport.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
ezbenchwarn.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fastrandomstring.h Reduce header complexity 2023-11-28 14:39:42 -08:00
fixture.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
fixturerunner.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
formatbinaryasglyphs.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
formatbinaryashex.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
formatbool.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
formatfloat.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
formatint.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
formatrange.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
formatstr.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
getcore.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
geterrno.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getinterrupts.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
globals.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
hexequals.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
hyperion.h Reduce header complexity 2023-11-28 14:39:42 -08:00
hyperion.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
hyperion.txt Initial import 2020-06-15 07:18:57 -07:00
incrementfailed.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
manystack.c Make threads faster and more reliable 2024-12-21 22:13:00 -08:00
manystack.h Make threads faster and more reliable 2024-12-21 22:13:00 -08:00
memoryexists.c Make realloc() go 100x faster on Linux/NetBSD 2024-07-07 12:40:30 -07:00
moby.h Reduce header complexity 2023-11-28 14:39:42 -08:00
moby.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
moby.txt Make improvements to redbean 2021-07-10 15:19:37 -07:00
polluteregisters.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
runner.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
seterrno.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
shoulddebugbreak.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
showerror.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
startswith.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
strcaseequals.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
strequals.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
strerror.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
subprocess.h Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
testcase.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
testlib.h Fix UB in gdtoa hexadecimal float scanf and strtod (#1288) 2024-09-14 17:11:04 -07:00
testmain.c Fix fork waiter leak in nsync 2024-12-31 01:30:13 -08:00
testrunner.c Allow user to override pthread mutex and cond 2024-12-23 21:57:52 -08:00
thunks.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
tmptest.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
trace.c Test rwlock more 2024-12-14 09:40:13 -08:00
trace.h Test rwlock more 2024-12-14 09:40:13 -08:00
viewables.h Reduce header complexity 2023-11-28 14:39:42 -08:00
viewables.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
viewables.txt Do some string library work 2022-08-20 22:17:14 -07:00
waitforexit.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
waitforterm.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
yield.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00