X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 740D2385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1705753493; bh=m/+qZzL/P/8BEHRw/z/yEw84y4GntC4wqJFaMag7HaQ=; h=Date:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=tT9qpHJqv9uIjIyM+IBJF8v9y8Vi7KMNZ6Jb12y5Si9NFKS1TSORSBVs6KkJXUEHJ Z/tmUPBtxiYqUFmqala/ktUsoCATUTRjJVtTNcjDjFV3nwBhiHapAjWaP+NGAS+ybk oCNt/DZAHhSP7y3AhfsyUHPxtYU0Ya46x6keLA0o= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C912D3858D39 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C912D3858D39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705753473; cv=none; b=O8IfN2yz9rBB1znMrLH7Y+2KjLhZ27TJWdfnpE5VpN50WT4xIin5jw+21g0rgAjST6gD/a5OnCq9hyX2yrPFJ1v2nhLj/vACvuYqq9Pouj2CNz4TnR9m7oCydIXTRJGgZahjDxtnBodrqSeVm0oLoKty3XOLiI3rOF9ZWu9xGTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705753473; c=relaxed/simple; bh=e5Ajflh/ZCnnhuPFDy/ShWm8NmfC4twFxnczfEkdaUQ=; h=Date:From:To:Subject:Message-Id:Mime-Version; b=BYBY5WN439TyLlgvLOJiYhRioH3zrTEsKGv5arkVQo+rOxE8tLlGnyXgwElbIXc7FEVJfq5HsFibCky/enn0ZjrsVAFjSrr5b7k40sv7/aHNeEQb4nXUs5pt1MykwwioFKuZk/LwDKaVxNb3jTQETRr6YWxzyBj1M/qPe0F1fZ0= ARC-Authentication-Results: i=1; server2.sourceware.org Date: Sat, 20 Jan 2024 21:24:27 +0900 To: ASSI Cc: cygwin AT cygwin DOT com Subject: Re: Possiblly bug of cygwin1.dll Message-Id: <20240120212427.1e69fd3655ece73ecd508def@nifty.ne.jp> In-Reply-To: <87v87ov03x.fsf@Gerda.invalid> References: <20240119224436 DOT 876a055f356f7c6796bc725b AT nifty DOT ne DOT jp> <20240120131825 DOT 4157c259fe058155137d6fe0 AT nifty DOT ne DOT jp> <20240120141349 DOT cde31e62177a0405b0ee9934 AT nifty DOT ne DOT jp> <87v87ov03x DOT fsf AT Gerda DOT invalid> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Sat, 20 Jan 2024 10:13:22 +0100 ASSI wrote: > Takashi Yano via Cygwin writes: > > I might find the culprit in gcc's libstdc++ code such as: > > libstdc++-v3/include/ext/concurrentce.h: > > class __mutex > > { > > private: > > #if __GTHREADS && defined __GTHREAD_MUTEX_INIT > > __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT; > > #else > > __gthread_mutex_t _M_mutex; > > #endif > > > > __GTHREAD_MUTEX_INIT here is PTHREAD_MUTEX_INITIALIZER and > > __gthread_mutex_t is pthread_mutex_t. > > > > I think this code vaiolates the POSIX statement. > > So what happens if you undefine __GTHREAD_MUTEX_INIT? I have tried. The test case: #include int main() { for (;;) { std::mutex *m = new std::mutex; m->lock(); m->unlock(); delete m; } return 0; } gets working fine. However, this test case: #include int func() { return 0; } int main() { for (;;) { std::future f = std::async(std::launch::async, func); f.get(); } return 0; } still has the problem. pthread_mutex_t might be initialized also at another place... -- Takashi Yano -- 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