DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 56GCb8E13029532 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 56GCb8E13029532 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=v3CVet+y X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56EFD3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1752669427; bh=c3K7N7eIYPBcE19PglXRcr3PdrCeLHvB4vaEhFtIWUc=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=v3CVet+ymml4fIcFbqaoMvM4RtkDDphpNwzStkb4Nho20QdR/mR8IB0nnl0jJ7IwE T8pTesVJFqy+ElcaeiVtnPmq4lkOHL20Ks6PiyEJrwrYnVBMD4e72tPjLfPzN5bJvm qMnJ661KrJQS/a/DyPtInt/s26tZ9X0t6STDRVK4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D482E3858402 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D482E3858402 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752669367; cv=none; b=lK18xb2/zooa8/58R/bELJO1m/StVN1gIEkPNGBAYuBLwSqVTbgZWHPXN1pQYodS62DOljizx6NvFDJ/9LtkZ72UTeNxJMQDpNQkYUhA1HgoQk49F0rFELSxmBVlFTszaKdCGj/JoJkMBafv+sSxYfdrg7lLzxf7YTgwWBW1B6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752669367; c=relaxed/simple; bh=zPavi2qYjsSSIvWpl5eT+YGe/OWrr4Qgj2LFos+SOYc=; h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature; b=dCVLceIYdyk4NsK9vHIGcBpTY3nRBaQlI3rIMwc4sj/+XZxLHHi4dd07oSW1LIWDDpCa9dUlOr5b6saVCbFHym46538ffvoMcD3PIzG7cnjzl06ZO6G3aR526kXuYU8Pjc6PBSA01aj9PVv1sEoYHDXytlg7ZKhs7nfpQMAL0+k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D482E3858402 Date: Wed, 16 Jul 2025 21:36:04 +0900 To: cygwin AT cygwin DOT com Subject: Re: doxygen hangs when many call graphs are generated. Message-Id: <20250716213604.539ada3b63feb7c9e5c3ab05@nifty.ne.jp> In-Reply-To: <20250716211359.8f40e5248fe69b9033cba081@nifty.ne.jp> References: <20250617214647 DOT ed6f64d44a665820a3fbd1b9 AT nifty DOT ne DOT jp> <20250716211359 DOT 8f40e5248fe69b9033cba081 AT nifty DOT ne DOT jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 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 Wed, 16 Jul 2025 21:13:59 +0900 Takashi Yano via Cygwin wrote: > On Tue, 17 Jun 2025 21:46:47 +0900 > Takashi Yano wrote: > > I encountered a problem of doxygen when many call graphs are generated. > > > > How to reproduce: > > 1) Make a empty directory. > > 2) Place two files (Doxyfile, x.c) attached in the directory. > > 3) Run doxygen in the directory. > > > > It seems that this is a bug of cygwin1.dll and the cause is > > a deadlock in newlib/libc/stdio/findfp.c:__fp_lock_all(). > > > > The following patch solves the issue, however, I am not sure > > this is the right thing at all. > > > > diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c > > index 2cc549537..3de6b33fd 100644 > > --- a/newlib/libc/stdio/findfp.c > > +++ b/newlib/libc/stdio/findfp.c > > @@ -298,7 +298,9 @@ __fp_unlock (struct _reent * ptr __unused, FILE * fp) > > void > > __fp_lock_all (void) > > { > > +#ifndef __CYGWIN__ > > __sfp_lock_acquire (); > > +#endif > > (void) _fwalk_sglue (NULL, __fp_lock, &__sglue); > > } > > > > @@ -306,6 +308,8 @@ void > > __fp_unlock_all (void) > > { > > (void) _fwalk_sglue (NULL, __fp_unlock, &__sglue); > > +#ifndef __CYGWIN__ > > __sfp_lock_release (); > > +#endif > > } > > #endif > > > > Any suggenstions? > > The same hang happened while building aom package with doxygen. > Above patch also solves the issue. > > Any idea? The stack trace is as follows. (gdb) thr 1 [Switching to thread 1 (Thread 20620.0xb7ac)] #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll (gdb) bt #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll #1 0x00007ff82c760cd0 in WaitForMultipleObjectsEx () from /cygdrive/c/Windows/System32/KERNELBASE.dll #2 0x00007ff82c760bce in WaitForMultipleObjects () from /cygdrive/c/Windows/System32/KERNELBASE.dll #3 0x00007fffaee56044 in cygwait (object=, timeout=timeout AT entry=0x0, mask=mask AT entry=33) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygwait.cc:79 #4 0x00007fffaeeb3439 in pthread_cond::wait (this=0xa0151fba0, mutex=0xa0057eb50, timeout=0x0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:1263 #5 0x00007fffaef9ae74 in _sigfe () at sigfe.s:35 #6 0x000000010082920b in ?? () #7 0x000000010045af88 in ?? () #8 0x0000000100c5b8f3 in ?? () #9 0x00007fffaee580cd in dll_crt0_1 () at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/dcrt0.cc:1003 #10 0x00007fffaee55d05 in _cygtls::call2 (this=0x7ffffce00, func=0x7fffaee5707c , arg=0x0, buf=buf AT entry=0x7ffffcdf0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygtls.cc:41 #11 0x00007fffaee55dbb in _cygtls::call (func=, arg=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygtls.cc:28 #12 0x0000000000000000 in ?? () (gdb) thr 3 [Switching to thread 3 (Thread 20620.0x10c84)] #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll (gdb) bt #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll #1 0x00007ff82c760cd0 in WaitForMultipleObjectsEx () from /cygdrive/c/Windows/System32/KERNELBASE.dll #2 0x00007ff82c760bce in WaitForMultipleObjects () from /cygdrive/c/Windows/System32/KERNELBASE.dll #3 0x00007fffaee56044 in cygwait (object=, timeout=0x0, mask=mask AT entry=36) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygwait.cc:79 #4 0x00007fffaeeb2644 in pthread_mutex::lock (this=0xa00000110, timeout=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:1792 #5 0x00007fffaefe0ff7 in __sfp_lock_acquire () at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:269 #6 __sfp (d=d AT entry=0x7ffdfce00) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:180 #7 0x00007fffaefe13bf in _fopen_r (ptr=0x7ffdfce00, file=0xa002dff98 "/home/yano/cygwin-packages/aom/aom-3.12.1-1.x86_64/build/docs/html/aom_8h__dep__incl.png", mode=) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/fopen.c:124 #8 0x00007fffaef9ae74 in _sigfe () at sigfe.s:35 #9 0x000000010085497d in ?? () #10 0x0000000100825bfd in ?? () #11 0x0000000100c00f7d in ?? () #12 0x00007fffaeeb91bd in pthread::once (once_control=0xa011d38a0, init_routine=0x1009ff0f0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2064 #13 0x00007fffaeeb9209 in pthread::once (init_routine=, once_control=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054 #14 pthread_once (once_control=, init_routine=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:3101 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) thr 4 [Switching to thread 4 (Thread 20620.0x151d4)] #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll (gdb) bt #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll #1 0x00007ff82c760cd0 in WaitForMultipleObjectsEx () from /cygdrive/c/Windows/System32/KERNELBASE.dll #2 0x00007ff82c760bce in WaitForMultipleObjects () from /cygdrive/c/Windows/System32/KERNELBASE.dll #3 0x00007fffaee56044 in cygwait (object=, timeout=0x0, mask=mask AT entry=36) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygwait.cc:79 #4 0x00007fffaeeb2644 in pthread_mutex::lock (this=0xa00000110, timeout=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:1792 #5 0x00007fffaefe0ff7 in __sfp_lock_acquire () at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:269 #6 __sfp (d=d AT entry=0x7ffbfce00) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:180 #7 0x00007fffaefe13bf in _fopen_r (ptr=0x7ffbfce00, file=0xa004878e8 "/home/yano/cygwin-packages/aom/aom-3.12.1-1.x86_64/build/docs/html/aom_8h__incl.png", mode=) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/fopen.c:124 #8 0x00007fffaef9ae74 in _sigfe () at sigfe.s:35 #9 0x000000010085497d in ?? () #10 0x0000000100825bfd in ?? () #11 0x0000000100c00f7d in ?? () #12 0x00007fffaeeb91bd in pthread::once (once_control=0xa0149a8f0, init_routine=0x1009ff0f0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2064 #13 0x00007fffaeeb9209 in pthread::once (init_routine=, once_control=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054 #14 pthread_once (once_control=, init_routine=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:3101 Backtrace stopped: previous frame identical to this frame (corrupt stack?) ... ... (gdb) thr 33 [Switching to thread 33 (Thread 20620.0x3fc8)] #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll (gdb) bt #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll #1 0x00007ff82c760cd0 in WaitForMultipleObjectsEx () from /cygdrive/c/Windows/System32/KERNELBASE.dll #2 0x00007ff82c760bce in WaitForMultipleObjects () from /cygdrive/c/Windows/System32/KERNELBASE.dll #3 0x00007fffaee56044 in cygwait (object=, timeout=0x0, mask=mask AT entry=36) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygwait.cc:79 #4 0x00007fffaeeb2644 in pthread_mutex::lock (this=0xa0151b0e0, timeout=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:1792 #5 0x00007fffaefe0f95 in __fp_lock (ptr=, fp=) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:283 #6 __fp_lock (ptr=, fp=) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:280 #7 0x00007fffaefe27e8 in _fwalk_sglue (ptr=0x0, func=0x7fffaefe0f6f <__fp_lock>, g=0xa0008c070) at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/fwalk.c:47 #8 0x00007fffaeeb4ce5 in pthread::atforkprepare () at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2095 #9 0x00007fffaee793ea in lock_pthread::lock_pthread (this=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:136 #10 hold_everything::hold_everything (x=: , this=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:168 #11 dofork (proc=proc AT entry=0x0, with_forkables=with_forkables AT entry=0x7fc1fc11f) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/fork.cc:640 #12 0x00007fffaee7982f in fork () at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/fork.cc:590 #13 0x00007fffaef9ae74 in _sigfe () at sigfe.s:35 #14 0x00000001008b94d1 in ?? () #15 0x0000000100854085 in ?? () #16 0x0000000100825bfd in ?? () #17 0x0000000100c00f7d in ?? () #18 0x00007fffaeeb91bd in pthread::once (once_control=0xa0149d720, init_routine=0x1009ff0f0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2064 #19 0x00007fffaeeb9209 in pthread::once (init_routine=, once_control=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054 #20 pthread_once (once_control=, init_routine=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:3101 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) thr 34 [Switching to thread 34 (Thread 20620.0x11d48)] #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll (gdb) bt #0 0x00007ff82ea8e044 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll #1 0x00007ff82c760cd0 in WaitForMultipleObjectsEx () from /cygdrive/c/Windows/System32/KERNELBASE.dll #2 0x00007ff82c760bce in WaitForMultipleObjects () from /cygdrive/c/Windows/System32/KERNELBASE.dll #3 0x00007fffaee56044 in cygwait (object=, timeout=0x0, mask=mask AT entry=36) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygwait.cc:79 #4 0x00007fffaeeb2644 in pthread_mutex::lock (this=0xa00000110, timeout=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:1792 #5 0x00007fffaefe1270 in __sfp_lock_acquire () at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:269 #6 __fp_lock_all () at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:301 #7 0x00007fffaeeb4ce5 in pthread::atforkprepare () at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2095 #8 0x00007fffaee793ea in lock_pthread::lock_pthread (this=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:136 #9 hold_everything::hold_everything (x=: , this=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:168 #10 dofork (proc=proc AT entry=0x0, with_forkables=with_forkables AT entry=0x7fbffc11f) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/fork.cc:640 #11 0x00007fffaee7982f in fork () at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/fork.cc:590 #12 0x00007fffaef9ae74 in _sigfe () at sigfe.s:35 #13 0x00000001008b94d1 in ?? () #14 0x0000000100854085 in ?? () #15 0x0000000100825bfd in ?? () #16 0x0000000100c00f7d in ?? () #17 0x00007fffaeeb91bd in pthread::once (once_control=0xa0149d9a0, init_routine=0x1009ff0f0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2064 #18 0x00007fffaeeb9209 in pthread::once (init_routine=, once_control=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054 #19 pthread_once (once_control=, init_routine=) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:3101 Backtrace stopped: previous frame identical to this frame (corrupt stack?) -- 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