summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2023-10-12Release 3.0.33.0.3Tavian Barnes
2023-10-12bftw: Make sure we don't close a directory while we unwrap itTavian Barnes
bftw_cache_reserve() can lead to bftw_cache_pop(), which could close the directory we're trying to unwrap! If that happened, we would try dup_cloexec(-1), which would fail with EBADF, so there was no observable bug. But it's better to avoid the whole situation.
2023-10-12bftw: Fix to_close list corruption with !BFS_USE_UNWRAPDIRTavian Barnes
It's possible for pincount to drop to zero, then get incremented and drop back to zero again. If this happens, we shouldn't add it to the to_close list twice. This should fix the intermittent hang on the macOS CI. Fixes: 815798e1eea7fc8dacd5acab40202ec4d251d517
2023-10-12list: Assert that we're not inserting already-attached nodesTavian Barnes
2023-10-12diag: Move enum debug_flags out of ctx.hTavian Barnes
2023-10-12bftw: Don't force buffering for parallel dfsTavian Barnes
2023-10-12bftw: Fix unbuffered depth-first searchesTavian Barnes
bftw() implements depth-first search by appending files to a batch, then prepending the batch to the queue. When we switched to separate file/ directory queues, this was only implemented for the file queue. Unbuffered searches don't use the file queue, so they were all breadth- first in practice. This meant that iterative deepening (-S ids) was actually "iterative deepening *breadth*-first search," a horrible strategy with no advantage over regular breadth-first search. Now it performs iterative deepening *depth*-first search, which at least limits its memory consumption. Fixes: c1b16b49988ecff17ae30978ea14798d95b80018
2023-10-12bftw: Let iterative deepening work depth-first when sortingTavian Barnes
2023-10-06bar: Replace volatile sig_atomic_t with actual atomicsTavian Barnes
2023-10-06alloc: Test allocation size overflowsTavian Barnes
2023-10-05bfstd: Add a thread-safe wrapper for strerror()Tavian Barnes
2023-10-05thread: Define thread_localTavian Barnes
2023-10-05config: Fold !__FreeBSD__ into BFS_USE_SYS_CAPABILITY_HTavian Barnes
2023-10-04dstring: Limit the special dchar typedef to lint buildsTavian Barnes
Clang still thinks that alignof(dstr[1]) == 2, so out of an abundance of caution, don't mess with dchar alignment in normal builds.
2023-10-03thread: s/call_once/invoke_once/Tavian Barnes
call_once() is a reserved identifier from C11.
2023-10-02ioq: Use io_uringTavian Barnes
Closes #65.
2023-09-27Formatting fixesTavian Barnes
2023-09-26bit: Fix UINTPTR_WIDTH typoTavian Barnes
2023-09-26bit: Use predefined __*_WIDTH__ macros if we canTavian Barnes
2023-09-26dstring: New dchar typedef for dynamic stringsTavian Barnes
2023-09-25Use the new list macrosTavian Barnes
2023-09-25list: New for_[s]list() macrosTavian Barnes
2023-09-25list: Unify formattingTavian Barnes
2023-09-25list: New [S]LIST_EMPTY() macrosTavian Barnes
2023-09-25list: New [S]LIST_ITEM_INIT() macrosTavian Barnes
2023-09-25list: Use (void)(...) rather than do { ... } while (0)Tavian Barnes
This makes everything usable in expression contexts.
2023-09-13bftw: Share the bftw_state between iterations of ids/edsTavian Barnes
2023-09-12parse: Give more ephemeral_fds to -no{user,group}Tavian Barnes
Fewer than 3 can lead to Assertion failed: (retval->write_queue != -1), function __open_cached_connection, file /usr/src/lib/libc/net/nscachedcli.c, line 224. on a FreeBSD system with LDAP accounts.
2023-09-06Release 3.0.23.0.2Tavian Barnes
2023-09-06bfstd: Work around a FreeBSD-specific msan issueTavian Barnes
Link: https://github.com/llvm/llvm-project/issues/65532
2023-09-06bfstd: Skip a whole loop in dollar_quote() if possibleTavian Barnes
2023-09-06bfstd: Fix printable_len() off-by-oneTavian Barnes
If xmbrtowc() fails, or if xiswprint() is false, then we shouldn't include that wide char in the printable length. Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
2023-09-06bfstd: Fix an OOB string index in xmbrtowc()Tavian Barnes
This bug could be reproduced with something like $ bfs -samefile $'\xFA\xFA' bfs: error: bfs: dstrnescat@src/dstring.c:252: wordesc() result truncated or worse, with -DNDEBUG, $ bfs -samefile $'.....................\xFA\xFA' bfs: error: bfs -samefile $'.....................\xFA\xFA\x00\x55\x53\x45\x52\x3D\x74\x61\x76\x69\x61\x6E\x61\x74\x6F\x72 bfs: error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bfs: error: No such file or directory. which prints the memory after the end of the string (in this case, the environment variable USER=tavianator). The bug was caused by the line `*i += len`, which was intended to be `*i = len`. But actually, the right behaviour seems to be `*i += 1`. Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
2023-09-06bftw: Enforce the dirlimit strictlyTavian Barnes
The previous accounting didn't fully control the number of allocated bfs_dirs, as the dirlimit was incremented once we popped the directory, not when we freed it.
2023-08-31pwcache: Don't use _SC_GET{PW,GR}_R_SIZE_MAXTavian Barnes
They tend be 1024, which is a lot of memory per user/group. 128 is usually enough, so start there instead.
2023-08-31pwcache: Arena-allocate struct passwd/groupTavian Barnes
2023-08-31alloc: New varena_grow() functionTavian Barnes
2023-08-31trie: New trie_clear() functionTavian Barnes
2023-08-31alloc: New [v]arena_clear() functionsTavian Barnes
2023-08-23Work around https://github.com/llvm/llvm-project/issues/64946Tavian Barnes
2023-08-23ioq: New ioq_slot_monitor() helperTavian Barnes
2023-08-14parse: Allow -files0-from an empty set of pathsTavian Barnes
This follows a behaviour change in GNU findutils 4.9.0.
2023-08-08bfstd: Don't label a declarationTavian Barnes
2023-08-07stat: Don't check for statx() mask bits we already checked forTavian Barnes
2023-08-07bfstd: Check multiple chars at once for isascii()Tavian Barnes
2023-08-07bfstd: Speed up wordesc() by caching isprint()/isspace()Tavian Barnes
2023-07-24bit: Add a cast to squelch -Wsign-compareTavian Barnes
I see this only with musl-gcc for some reason.
2023-07-18Release 3.0.13.0.1Tavian Barnes
2023-07-18bftw: Use bftw_file->next for multiple listsTavian Barnes
A file can be on the to_open and to_read lists at the same time, but otherwise only one list, so we can save memory by sharing the pointers.
2023-07-18bftw: Use a larger ioq depthTavian Barnes
Now that the dirlimit provides backpressure on the number of open directories, we can use a uniformly larger queue depth for increased performance. The current parameters were tuned with a small grid search on my workstation.