DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 62HHfN9K1179326
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 62HHfN9K1179326
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=eIH8LwPB
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9430B49002CA
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1773769282;
	bh=kGSQKC/qcptjya0MmLzB+ca8nOc2sezutXRlsrsm7ow=;
	h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=eIH8LwPBqKTrseNvPg3JHAzoMsL5glWZOoiR5Ny/U4zkV8ASjKYqRwa7oeqetRfdT
	 UuQMF1B3XYGmzJBx9Rw8YdkUxSTzXblWgHYKkQTSWfGc+F2s0IDPUP592xIXBx44zE
	 T8d+oUJSH7kCdIBvT/OGrHjC4CQe7QweruKEMfVo=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 564D948FF1B8
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 564D948FF1B8
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773769222; cv=none;
 b=vlGhP28zVPrLXPlAEF1IeBNQ2cIYuM9JdxAmqDMNbtHSZNVrn+1FMwtWtLOz9xnD5LVw2Amuioe+EhU5WsrOVKoD5eFHyYXpS57PlwKAwZZSOu6/6D97y4tBRMpXD6iwyKIbR+dFBML5bXXe/pRgQTSYKqmToOFGlJcU529d+vg=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1773769222; c=relaxed/simple;
 bh=Ac1EfY5Oak8+oju6UKb0SRP+aAu1m5PdUtOydBwJ5xU=;
 h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;
 b=G5RU49vCbgOVdA3uGvTGckPKvb7M9NaOMd2cwbnJpF60AR7Ks6eGOpttN9vFILIym8RXFy2TMw29054co3TBrslkKN6HAODoqOF9zg21czUyWJHXF1MF1DpwxluMr8SFSNVNNgxx8CgMuCfVkYB+aYH+ZrkCNFiNdMOQz800VwA=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 564D948FF1B8
To: cygwin@cygwin.com
Subject: Re: std::mutex bug: Windows handle growth
In-Reply-To: <2d48a740-ce2b-4259-8947-f5c875dd1672@hvc.rr.com> (Frank Eskesen
 via Cygwin's message of "Mon, 16 Mar 2026 17:39:49 -0400")
References: <2d48a740-ce2b-4259-8947-f5c875dd1672@hvc.rr.com>
Date: Tue, 17 Mar 2026 18:40:10 +0100
Message-ID: <87tsue4ao5.fsf@>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-purgate-server: smtpa01
X-purgate-type: clean
X-purgate: clean
X-purgate-size: 1268
X-purgate-ID: 155817::1773769218-EC4B06D1-1C936F79/0/0
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: ASSI via Cygwin <cygwin@cygwin.com>
Reply-To: ASSI <Stromeko@nexgo.de>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
