doxygen hangs when many call graphs are generated.
Takashi Yano
takashi.yano@nifty.ne.jp
Wed Jul 16 12:36:04 GMT 2025
On Wed, 16 Jul 2025 21:13:59 +0900
Takashi Yano via Cygwin <cygwin@cygwin.com> 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=<optimized out>, timeout=timeout@entry=0x0, mask=mask@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 <dll_crt0_1(void*)>, arg=0x0,
buf=buf@entry=0x7ffffcdf0) at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygtls.cc:41
#11 0x00007fffaee55dbb in _cygtls::call (func=<optimized out>, arg=<optimized out>)
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=<optimized out>, timeout=0x0, mask=mask@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=<optimized out>)
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@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=<optimized out>) 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=<optimized out>, once_control=<optimized out>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054
#14 pthread_once (once_control=<optimized out>, init_routine=<optimized out>)
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=<optimized out>, timeout=0x0, mask=mask@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=<optimized out>)
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@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=<optimized out>) 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=<optimized out>, once_control=<optimized out>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054
#14 pthread_once (once_control=<optimized out>, init_routine=<optimized out>)
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=<optimized out>, timeout=0x0, mask=mask@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=<optimized out>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:1792
#5 0x00007fffaefe0f95 in __fp_lock (ptr=<optimized out>, fp=<optimized out>)
at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdio/findfp.c:283
#6 __fp_lock (ptr=<optimized out>, fp=<optimized out>) 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=<synthetic pointer>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:136
#10 hold_everything::hold_everything (x=<synthetic pointer>: <optimized out>, this=<synthetic pointer>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:168
#11 dofork (proc=proc@entry=0x0, with_forkables=with_forkables@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=<optimized out>, once_control=<optimized out>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054
#20 pthread_once (once_control=<optimized out>, init_routine=<optimized out>)
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=<optimized out>, timeout=0x0, mask=mask@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=<optimized out>)
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=<synthetic pointer>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:136
#9 hold_everything::hold_everything (x=<synthetic pointer>: <optimized out>, this=<synthetic pointer>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/local_includes/sigproc.h:168
#10 dofork (proc=proc@entry=0x0, with_forkables=with_forkables@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=<optimized out>, once_control=<optimized out>)
at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/thread.cc:2054
#19 pthread_once (once_control=<optimized out>, init_routine=<optimized out>)
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 <takashi.yano@nifty.ne.jp>
More information about the Cygwin
mailing list