xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

Switch from semaphore to mutex #672

Closed ktmf01 closed 4 months ago

ktmf01 commented 4 months ago

After trying for quite a while to find the source of some hard-to-reproduce fuzz bugs, this PR seems the best fix. While I was unable to find the exact cause, commit 8b30a36 did indeed trigger threadsanitizer, so it seemed the semaphores sometimes work in ways I do not understand.

Mutexes, while needing more syscalls, are easier to comprehend. While I haven't yet run local fuzzing for long enough to be able to assume the bug has been fixed, I am creating this PR to run CI and CI-Fuzz.