[PATCH] Cygwin: lock cygheap during fork

Jon Turney jon.turney@dronecode.org.uk
Sun Sep 21 18:44:31 GMT 2025


On 20/09/2025 20:52, Jeremy Drake via Cygwin-patches wrote:
> On Sat, 20 Sep 2025, Jon Turney wrote:
> 
>> On 19/09/2025 22:43, Jeremy Drake via Cygwin-patches wrote:
>>> another thread may simultaneously be doing a cmalloc/cfree while the
>>> cygheap is being copied to the child.
>>
>> Makes sense. Please apply.
> 
> Done (and cygwin-3_6-branch)
> 
>>
>>> Addresses: https://cygwin.com/pipermail/cygwin/2025-September/258801.html
>>> Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
>>> ---
>>> I'm seeing a timeout failure of pthread/cancel2.exe test in GitHub CI.
>>> This seems to be happening even without this change, so perhaps it is more
>>> to do with the update to windows-2025 runners?  In any event, this
>>> prevents the 'stress' jobs from running against this change.
>>
>> Thank you *so much* for keeping an eye on that!
> 
> I did a test run downgrading the windows-build job to windows-2022, and
> all the tests succeed there.  I still have no idea why the pthread/cancel2
> test times out on windows-2025 though.

Hmm... odd.

Please feel free to push that change to the yml, if you think that's 
appropriate.

I did have some struggles with the cancel tests when I was getting the 
testsuite working again, because there's a bit of funkiness in cygwin 
where async cancellation sometimes silently turns into a deferred 
cancellation because we can't stop a thread while it's inside the NT 
kernel... but I can't see how that could cause a test like this to 
timeout rather than simply fail?



More information about the Cygwin-patches mailing list