Closed barathrm closed 4 months ago
Hello @barathrm ! Oh dear, you clearly win my "bug report and analysis of the year" trophy! :trophy: Thanks so much for tracking this down!
The fix is straightforward, as usual in these cases (where there's a ton of work in debugging and understanding the problem).
Unfortunately meson is making a boo-boo in Debian testing. That has nothing to do with your fix, it just broke independently. I'll investigate this, and then rebase/queue your PR after that fix.
Cheers!
Related to and discussed more at https://github.com/martinpitt/umockdev/issues/252
To avoid clobbering a threads signal mask with that of another thread, take locks before storing a thread's signal mask in case another thread has already stored its own signal mask in the trap_path_sig_restore variable, but has not yet restored it.
Without this change, the following could happen:
If umockdev-run is used to run a process which spawns multiple threads, and each of those threads writes to a file, and has specific signal mask requirements, the following may happen
Thread A:
Thread B:
Thread A: