mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 06:56:27 -05:00
The _stop check in _try_remove_self_if_above was outside the _threads_mutex lock, creating a window where a worker thread could read _stop==false, then the destructor could set _stop and snapshot _threads (including that worker), then the worker could acquire the lock, detach itself, and exit. The destructor would then call pthread_join on a detached thread — undefined behavior. Move the _stop check inside the _threads_mutex lock so it is serialized with the destructor's snapshot. Now either the worker holds the lock first (detaches and erases itself before the snapshot) or the destructor sets _stop first (worker sees it and bails out, remaining joinable in the snapshot). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| acutest | ||
| boost | ||
| CLI11 | ||
| fmt | ||
| khash | ||
| libfuse | ||
| nonstd | ||
| rapidhash | ||
| scope_guard | ||
| subprocess | ||