cosmopolitan/libc/mem
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
..
_gc_free.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
alg.h Make improvements 2024-09-01 01:27:47 -07:00
aligned_alloc.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
alloca.h Remove some dead code 2023-07-03 02:48:29 -07:00
arraylist.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
arraylist2.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
BUILD.mk Release Cosmopolitan v3.8.0 2024-08-30 20:14:07 -07:00
bulk_free.c Delete ASAN 2024-06-22 05:45:49 -07:00
calloc.c Fix MODE=tiny build 2024-12-17 01:36:29 -08:00
critbit0.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
critbit0_allprefixed.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
critbit0_clear.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
critbit0_contains.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
critbit0_delete.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
critbit0_emplace.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
critbit0_get.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
critbit0_insert.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
free.c Delete ASAN 2024-06-22 05:45:49 -07:00
gc.c Fix greenbean example 2024-07-07 17:52:33 -07:00
gc.h Make cosmo.h work a little better 2024-02-21 16:40:09 -08:00
grow.c Fix regression in package.ape build tool 2024-09-17 02:54:17 -07:00
heapsort.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
internal.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
leaks.c Fix fork waiter leak in nsync 2024-12-31 01:30:13 -08:00
leaks.h Eliminate cyclic locks in runtime 2024-12-16 22:25:12 -08:00
levenshtein.c Fix the build 2024-08-26 16:44:05 -07:00
mallinfo.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
malloc.c Fix MODE=tiny build 2024-12-17 01:36:29 -08:00
malloc_inspect_all.c Make malloc() go 200x faster 2024-06-05 02:02:14 -07:00
malloc_trim.c Delete ASAN 2024-06-22 05:45:49 -07:00
malloc_usable_size.c Delete ASAN 2024-06-22 05:45:49 -07:00
mallopt.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
mem.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
memalign.c Fix MODE=tiny build 2024-12-17 01:36:29 -08:00
mergesort.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
opensort.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
posix_memalign.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
putenv.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
pvalloc.c Create variables for page size 2024-07-18 21:16:53 -07:00
qsort.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
radix_sort_int32.c Rerun clang-format on the repo (#1217) 2024-06-15 16:34:48 -04:00
radix_sort_int64.c Rerun clang-format on the repo (#1217) 2024-06-15 16:34:48 -04:00
realloc.c Fix MODE=tiny build 2024-12-17 01:36:29 -08:00
realloc_in_place.c Delete ASAN 2024-06-22 05:45:49 -07:00
reallocarray.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
realpath.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
reverse.internal.h Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
setenv.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
sortedints.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sortedints.internal.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
strdup.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
strndup.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
tinymalloc.inc Get monorepo fully building on Windows again 2024-09-12 05:07:21 -07:00
valloc.c Create variables for page size 2024-07-18 21:16:53 -07:00
wcsdup.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00