errno is modified in signal handlers
buchgr opened this issue · 1 comments
buchgr commented
Using thread sanitizer I found that the signal handler for SIGCHLD processx__sigchld_callback
Line 41 in 8a959af
may modify errno
. The fix is to save errno
when entering and restoring it when exiting the signal handler, like in processx.c
Line 92 in b7e15fb
I am happy to send a PR, but it's unclear to me yet on how to best write an automated test for it.
gaborcsardi commented
Thanks! A PR is welcome. No need to test for it in the PR, but a good test would be to run thread sanitizer on GHA.