public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin@cygwin.com
Subject: Re: frequent hangs running ldd
Date: Fri, 24 May 2024 15:24:35 -0700	[thread overview]
Message-ID: <1660bc3d-19d5-4274-8477-2ebd63c34920@maxrnd.com> (raw)
In-Reply-To: <20240525071739.167d0f2b66b3dd8d2313be19@nifty.ne.jp>

On 5/24/2024 3:17 PM, Takashi Yano via Cygwin wrote:
> On Fri, 24 May 2024 14:46:40 -0700 (PDT)
> Jeremy Drake wrote:
>>> Thanks for the report. However, I cannot reproduce the issue.
>>> If it always hangs in GetConsoleProcessList (), I doubt it is not a cygwin
>>> bug but a windows bug.
>>>
>>> By any chance, is the number of processes that attach to the same pty more
>>> than 32768 in your environment?
>>>
>>
>> I doubt it, I was running a shell with this command:
>> find /usr/bin -name \*.dll -printf '%p:\n' -exec ldd '{}' \;
> 
> Thanks for the details. I could reproduce the issue.
> It seems that ldh.exe (which is called from ldd?) falls into infinite loop.
> However, gdb cannot attach to ldh.exe...

I could reproduce this too, even to not being able to attach gdb. If you 
exit that gdb session, I think you'll find the target process still 
stuck. You might be able to attach gdb again and it'll work. Here's what 
I found:

~ gdb -q /usr/bin/ldd
Reading symbols from /usr/bin/ldd...
Reading symbols from /usr/lib/debug//usr/bin/ldd.exe.dbg...
(gdb) att 6807
Attaching to program: /usr/bin/ldd, process 9732
[New Thread 9732.0x36a4]
[New Thread 9732.0x2bac]
(gdb) i thr
   Id   Target Id                Frame
   1    Thread 9732.0x31a8 "ldd" 0x00007ff8524f0b04 in 
ntdll!ZwWaitForDebugEvent
     () from /c/Windows/SYSTEM32/ntdll.dll
   2    Thread 9732.0x36a4 "sig" 0x00007ff8524ed174 in ntdll!ZwReadFile ()
    from /c/Windows/SYSTEM32/ntdll.dll
* 3    Thread 9732.0x2bac       0x00007ff8524f0be1 in ntdll!DbgBreakPoint ()
    from /c/Windows/SYSTEM32/ntdll.dll
(gdb) thr 1
[Switching to thread 1 (Thread 9732.0x31a8)]
#0  0x00007ff8524f0b04 in ntdll!ZwWaitForDebugEvent ()
    from /c/Windows/SYSTEM32/ntdll.dll
(gdb) bt
#0  0x00007ff8524f0b04 in ntdll!ZwWaitForDebugEvent ()
    from /c/Windows/SYSTEM32/ntdll.dll
#1  0x00007ff850165796 in WaitForDebugEventEx ()
    from /c/Windows/System32/KERNELBASE.dll
#2  0x0000000100401ba1 in report (
     in_fn=0x800009200 "/usr/bin/cygdialog-14.dll",
     multiple=multiple@entry=false)
     at /usr/src/debug/cygwin-3.5.3-1/winsup/utils/ldd.cc:325
#3  0x00000001004026de in main (argc=<optimized out>, argv=0xa000004d0)
     at /usr/src/debug/cygwin-3.5.3-1/winsup/utils/ldd.cc:439
(gdb) f 2
#2  0x0000000100401ba1 in report (
     in_fn=0x800009200 "/usr/bin/cygdialog-14.dll",
     multiple=multiple@entry=false)
     at /usr/src/debug/cygwin-3.5.3-1/winsup/utils/ldd.cc:325
325    	      if (!WaitForDebugEvent (&ev, INFINITE))
(gdb) list
320
321    	  while (1)
322    	    {
323    	      bool exitnow = false;
324    	      DWORD cont = DBG_CONTINUE;
325    	      if (!WaitForDebugEvent (&ev, INFINITE))
326    	       	break;
327    	      switch (ev.dwDebugEventCode)
328    	       	{
329    	       	case CREATE_PROCESS_DEBUG_EVENT:
(gdb)

..mark

  reply	other threads:[~2024-05-24 22:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 18:50 Jeremy Drake
2024-05-24 19:54 ` Takashi Yano
2024-05-24 20:09   ` Takashi Yano
2024-05-24 21:46   ` Jeremy Drake
2024-05-24 22:17     ` Takashi Yano
2024-05-24 22:24       ` Mark Geisert [this message]
2024-05-24 22:26       ` Jeremy Drake
2024-05-24 22:38         ` Jeremy Drake
2024-05-24 23:29           ` Jeremy Drake
2024-05-25  2:28             ` Jeremy Drake
2024-05-25  2:29               ` Jeremy Drake
2024-05-28  1:58                 ` Takashi Yano
2024-05-28  2:16                   ` Takashi Yano
2024-05-24 22:43         ` Mark Geisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1660bc3d-19d5-4274-8477-2ebd63c34920@maxrnd.com \
    --to=mark@maxrnd.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).