std::mutex bug: Windows handle growth
ASSI
Stromeko@nexgo.de
Tue Mar 17 17:40:10 GMT 2026
Frank Eskesen via Cygwin writes:
> I've run into a problem that occurs on Cygwin that doesn't occur on
> Linux systems: When a std::mutex is used, it doesn't clean up a
> Windows handle that it uses. This sample program demonstrates the
> problem, failing in under 60 seconds. Run this while using Window task
> manager to watch the handle count rise. On my machine, the count
> rapidly grows to about 16 million and then a std::exception is thrown.
This is likely a bug in upstream libstadc++, more specifically by making
a wrong assumption about the behaviour of the pthread library. It looks
like Corinna has identified a potential workaround, but that is a bit
hack-ish and I'd rather not carry such a patch that will likely not get
accepted upstream.
Can you please report this bug upstream and send the link to the
bugreport here? Meanwhile, I'd be interested to know if maybe that was
already fixed in a later version of gcc / libstdc++, so if you could try
one (or all) of the gcc test versions on your code that would be
helpful.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada
More information about the Cygwin
mailing list