public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Cc: Johannes Khoshnazar-Thoma <johannes@johannesthoma.com>
Subject: Re: cygwin application hangs on closing console
Date: Thu, 16 May 2024 18:14:18 +0900	[thread overview]
Message-ID: <20240516181418.c97d8fb42b34efd903f81b01@nifty.ne.jp> (raw)
In-Reply-To: <b67fc4f5-3fbb-454a-a0ce-da4f987924dc@johannesthoma.com>

On Wed, 15 May 2024 17:48:49 +0200
Johannes Khoshnazar-Thoma wrote:
> Hi again,
> 
> Am 15.05.24 um 17:37 schrieb Johannes Khoshnazar-Thoma:
> > Hi again,
> >
> > Am 23.04.24 um 12:26 schrieb Takashi Yano:
> >>>> Thanks for the report. Could you please test cygwin1.dll 3.5.3-1
> >>>> wihch is the latest cygwin release?
> >>>>
> >
> > We retried the tests with cygwin1.dll 3.5.3-1 and it looks like
> > the issue is still there. Here's an excerpt from the gdb debug
> > session:
> >
> Sorry somehow the formatting got messed up I try again:

Thanks for testing and the additional information.

> (gdb) info thread
>    Id   Target Id         Frame
> * 1    Thread 0x11cc     0x00007ffe579d5ea4 in ntdll!ZwWaitForSingleObject () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
>    2    Thread 0x8ec      0x00007ffe579d5ee4 in ntdll!ZwReadFile () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
>    3    Thread 0x55c      0x00007ffe579d5ea4 in ntdll!ZwWaitForSingleObject () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
>    4    Thread 0x131c     0x00007ffe579d95f4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
>    5    Thread 0x9b8      0x00007ffe579d95f4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
> (gdb) thread 1
> [Switching to thread 1 (Thread 0x11cc)]
> #0  0x00007ffe579d5ea4 in ntdll!ZwWaitForSingleObject () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
> (gdb) bt
> #0  0x00007ffe579d5ea4 in ntdll!ZwWaitForSingleObject () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
> #1  0x00007ffe54156d1f in WaitForSingleObjectEx () from C:\src\dlls-syms\KERNELBASE.dll\660F5EEC21e000\KERNELBASE.dll
> #2  0x00007ffe4a2033a0 in fhandler_console::close (this=0x800009030) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/fhandler/console.cc:1914

Line 1914 of fhandler/console.cc is:
      WaitForSingleObject (thread_sync_event, INFINITE);

This waits termination of cons_master_thread(). However, it does not seem
that the cons_master_thread exists in thread list obove. If the thread was
terminated normally, thread_sync_event should has been set.

> #0  0x00007ffe579d5ea4 in ntdll!ZwWaitForSingleObject () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
> (gdb) up
> #1  0x00007ffe54156d1f in WaitForSingleObjectEx () from C:\src\dlls-syms\KERNELBASE.dll\660F5EEC21e000\KERNELBASE.dll
> (gdb)
> #2  0x00007ffe4a2033a0 in fhandler_console::close (this=0x800009030) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/fhandler/console.cc:1914
> 1914    in /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/fhandler/console.cc
> (gdb) p thread_sync_event
> $6 = (HANDLE) 0x1510
> (gdb) p name
> $7 = "cygcons.thread_sync.0", '\000' <repeats 19 times>, "r", '\000' <repeats 183 times>...
> (gdb) p con.owner
> No symbol "con" in current context.
> (gdb) p master_thread_started
> $8 = true
> (gdb) p unit
> $9 = 0
> (gdb) p shared_console_info
> $10 = {0x1a0030000, 0x0 <repeats 64 times>}
> (gdb)

fhandler_console::close() was called twice? Or master thread had crashed
without setting thread_sync_event?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

      parent reply	other threads:[~2024-05-16  9:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 12:50 Johannes Khoshnazar-Thoma
2024-04-22 18:51 ` Takashi Yano
2024-04-23  9:20   ` Johannes Khoshnazar-Thoma
2024-04-23 10:26     ` Takashi Yano
2024-05-15 15:37       ` Johannes Khoshnazar-Thoma
2024-05-15 15:48         ` Johannes Khoshnazar-Thoma
2024-05-15 20:24           ` Brian Inglis
2024-05-21 16:23             ` Johannes Khoshnazar-Thoma
2024-05-16  9:14           ` Takashi Yano [this message]

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=20240516181418.c97d8fb42b34efd903f81b01@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@cygwin.com \
    --cc=johannes@johannesthoma.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).