On 13/07/2023 12:38, Jon Turney wrote: > > cancel11: some funkiness I can't work out, causing the save/restoring signal handlers around system() to not > work correctly So, the test here: is the SIGINT handle restored correctly if the thread executing system() is cancelled. This test fails, because it's not. It seems like that scenario was explicitly considered when this test was added in https://cygwin.com/pipermail/cygwin-patches/2003q1/003378.html I think maybe this is a regression introduced in https://cygwin.com/cgit/newlib-cygwin/commit/?id=3cb9da14617c58c2821c80d48f0bd80a2deb5fdf child_info_spawn::worker calls waitpid() which ultimately calls cygwait() which notices the thread's cancel event is signalled and acts as a cancellation point. Attached is a patch which adds back the restoration of signal handlers on thread cancellation. I can't find any hints in the mailing lists around 2013-04 about what problem that change is fixing, but given the commentary, this might be reintroducing another problem, though.