delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/05/15/11:38:02

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB94F385E83E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1715787479;
bh=VrpI4Q0DH01eno2+DuRlWkhUNPaEBhlKxFiZOJQhICo=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=MF97qqcb5sUkpJuwzTIHUbk+k1y8rc6Sdql+DBkZmY2bW1mKHiN3xuqxsJSuX5ers
uhe6nN1T/+kSIhMzCcPzgNTSgK/GGSGrqL+c/YH10bQKHnW/apCqbZ+2i4/D2IG3g0
x0oAqvke/X4pAg1dY5HJ6nA9pPD+OzPg94O/oet4=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 453DD3858D20
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 453DD3858D20
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715787457; cv=none;
b=xyuo8eEE53Q3UTAFr5si9dQCqUk3cH0U/6fSMimvUOZlHnm9yjWBd8ID5DKg3KSJ2WvCZAqRW1mEY7tpqB8RaMb0QV23pBdxTqWa4kWPfEkD3m+npGwPY1ovQ6QC5wOUwhPQejA5nR5ZYrdIHT+2vWLdXaOZZhiNvCwSglpo3Kw=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1715787457; c=relaxed/simple;
bh=khNrY2inV3apeFQ7Y4CA6z6kfJjykSgK9oB9ZCxHXFw=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
b=wuBi/dAxKJIM5yVrUuAhpRGzcI82AT/vEZWtjzloucpPlNHSFBF4i9Ge5YhXHx04LWScjCvjupp0LfdefcLh5oJ0B7mLMksAnBoTUU5KBkzt4GJBmxZaS1LauyHESo1/j3rPllRfsXgAof4DzrExf6dLZAXrvWUEgPQtKHlOAWk=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6
Message-ID: <6dd8a568-88c0-42d5-aa46-b09247cdecec@johannesthoma.com>
Date: Wed, 15 May 2024 17:37:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: cygwin application hangs on closing console
To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>, cygwin AT cygwin DOT com
References: <d268ca90-3c5b-4de6-9dd5-320ee713283c AT johannesthoma DOT com>
<20240423035104 DOT 85352f8a8d821c0f4d569d18 AT nifty DOT ne DOT jp>
<b71816f0-633c-4eaf-b9d6-955b10e4866a AT johannesthoma DOT com>
<20240423192606 DOT 7b4aa04685afca2525eb5ed3 AT nifty DOT ne DOT jp>
In-Reply-To: <20240423192606.7b4aa04685afca2525eb5ed3@nifty.ne.jp>
X-Provags-ID: V03:K1:HANeAdkjX13D0sBoGgFAMrluLbPMDfWk94VYtgeWJHWsPq1j/GL
CzsjlU7WZmTvaN2tVVFpkhRQiQrISUPnXRI1rOYl5phpGzW6QrJCdzQWctgE+nqlvob6nsW
LaiEDhYuC4wDohLug7faBpWYnka1SrCShOwUjMbOOxhQcgoXEiu1U8IEJ5dvgNzlwilJkK5
1P2Myg08td/hJ2JjZv2sQ==
UI-OutboundReport: notjunk:1;M01:P0:qucK+0UyMTA=;e5mdUbfIGOrsXaKZWPzo0t/RRTJ
OGxlXOFjsbMBvEl9yOZLAb6i/o9KOI4Mk7uJuiXyUSpLQ/LLl30sk+MNGdKiEZBqN8B5i+sab
Wc4vvPXf7Llm0GmIT5IIEOzcSwVAyxoGJ3h11wugNDk+MG189tTYwi/FAcxfSIapN8GDTTu6w
ub1BRNqe9R1ndKdUtmIgDInn9GkptfrnG/sNSaYr/RRXN+czxjo22cl6nAbSTl4696q0QXLGT
EF0dDLxo4h+B4NApIqTYxERUN7JIUmTCZmalNTcivGutaILeAqf4eujuufwvmBl8J7zaW3a/L
V93ruCH1w9Yfaq6nq0pDksCckljvNsyXsbSIU+sU9YrynydVMvW/LXxsqD+TA5McSj8e8c4Ks
vjT60F8QXrW5ax0b/m3TXhIOuaCpatLRDpmX1gOwvokz38d0K79d3QhbW1tnInmPNtSSqz2Gq
munnz3+YPmLXqqfhLzoRIvspF/2j4g07vKtwxT6SxcrRBWRZyr9AEtlkXBH+j1UomjkdDeX8v
gZSHpdHfYz4P+POVtSthRhG6KWeeeQk/QWKL3v3mryegpQB4OSXf5UyGVP/jnvkeHs9GzPQ4F
Vlfxf9bNAuU5BBn6g/i4KMoFh1qzVkRUG8EK3W87z8tUBGo1p5y/WSnE2R+TKosKtOwCW7Z3V
fJN679auS1ngrT/Kdqy9oEyiDo4Ls2Md7I6aPuRk/WCOHRdygb/En5jhPrum7jZ016/qcJJlu
qDIbZveOEcZ0LodQGNSbPNryBecTHhv5X5P5/nh3vUzsw//4QkiMiI=
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP,
URIBL_SBL_A, WEIRD_PORT 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
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Johannes Khoshnazar-Thoma via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Johannes Khoshnazar-Thoma <johannes AT johannesthoma DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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:

(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
#3  0x00007ffe4a1f6ce7 in fhandler_base::close_with_arch (this=0x800009030) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/fhandler/base.cc:1288
#4  0x00007ffe4a26a4cd in init_cygheap::close_ctty (this=0x800000000) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/mm/cygheap.cc:135
#5  0x00007ffe4a1c7c4e in close_all_files (norelease=norelease AT entry=false) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/syscalls.cc:81
#6  0x00007ffe4a146840 in do_exit (status=0) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/dcrt0.cc:1128
#7  0x00007ffe4a1469f7 in _exit (n=<optimized out>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/dcrt0.cc:1243
#8  0x00007ffe4a2a4bb9 in exit (code=0) at /usr/src/debug/cygwin-3.5.3-1/newlib/libc/stdlib/exit.c:65
#9  0x00007ffe4a1469e7 in cygwin_exit (n=5392) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/dcrt0.cc:1237
#10 0x00007ffe4a14809a in dll_crt0_1 () at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/dcrt0.cc:1002
#11 0x00007ffe4a145e08 in _cygtls::call2 (this=0x7ffffce00, func=0x7ffe4a146fb8 <dll_crt0_1(void*)>, arg=0x0, buf=buf AT entry=0x7ffffcdf0) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:41
#12 0x00007ffe4a145e86 in _cygtls::call (func=<optimized out>, arg=<optimized out>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:28
#13 0x0000000000000000 in ?? ()
(gdb) thread 2
[Switching to thread 2 (Thread 0x8ec)]
#0  0x00007ffe579d5ee4 in ntdll!ZwReadFile () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
(gdb) bt
#0  0x00007ffe579d5ee4 in ntdll!ZwReadFile () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#1  0x00007ffe5415e704 in ReadFile () from C:\src\dlls-syms\KERNELBASE.dll\660F5EEC21e000\KERNELBASE.dll
#2  0x00007ffe4a1bada6 in wait_sig () at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/sigproc.cc:1324
#3  0x00007ffe4a144d5f in cygthread::callfunc (this=this AT entry=0x7ffe4a335560 <threads>, issimplestub=issimplestub AT entry=false) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygthread.cc:48
#4  0x00007ffe4a145270 in cygthread::stub (arg=arg AT entry=0x7ffe4a335560 <threads>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygthread.cc:91
#5  0x00007ffe4a145e08 in _cygtls::call2 (this=0xdbce00, func=0x7ffe4a1451ea <cygthread::stub(void*)>, arg=0x7ffe4a335560 <threads>, buf=buf AT entry=0xdbcd50) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:41
#6  0x00007ffe4a145e86 in _cygtls::call (func=<optimized out>, arg=<optimized out>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:28
#7  0x00007ffe555584d4 in KERNEL32!BaseThreadInitThunk () from C:\src\dlls-syms\kernel32.dll\640993B0ad000\kernel32.dll
#8  0x00007ffe57981791 in ntdll!RtlUserThreadStart () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#9  0x0000000000000000 in ?? ()
(gdb) thread 3
[Switching to thread 3 (Thread 0x55c)]
#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  0x00007ffe4a1452ab in cygthread::stub (arg=arg AT entry=0x7ffe4a3355b8 <threads+88>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygthread.cc:112
#3  0x00007ffe4a145e08 in _cygtls::call2 (this=0x2aece00, func=0x7ffe4a1451ea <cygthread::stub(void*)>, arg=0x7ffe4a3355b8 <threads+88>, buf=buf AT entry=0x2aecd50) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:41
#4  0x00007ffe4a145e86 in _cygtls::call (func=<optimized out>, arg=<optimized out>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:28
#5  0x00007ffe555584d4 in KERNEL32!BaseThreadInitThunk () from C:\src\dlls-syms\kernel32.dll\640993B0ad000\kernel32.dll
#6  0x00007ffe57981791 in ntdll!RtlUserThreadStart () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#7  0x0000000000000000 in ?? ()
(gdb) thread 4
[Switching to thread 4 (Thread 0x131c)]
#0  0x00007ffe579d95f4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
(gdb) bt
#0  0x00007ffe579d95f4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#1  0x00007ffe5794eb5e in ntdll!RtlReleaseSRWLockExclusive () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#2  0x00007ffe4a145e08 in _cygtls::call2 (this=0x323ce00, func=0x7ffe5794e3f0 <ntdll!RtlReleaseSRWLockExclusive+8704>, arg=0xc0b60, buf=buf AT entry=0x323cd50) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:41
#3  0x00007ffe4a145e86 in _cygtls::call (func=<optimized out>, arg=<optimized out>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:28
#4  0x00007ffe555584d4 in KERNEL32!BaseThreadInitThunk () from C:\src\dlls-syms\kernel32.dll\640993B0ad000\kernel32.dll
#5  0x00007ffe57981791 in ntdll!RtlUserThreadStart () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#6  0x0000000000000000 in ?? ()
(gdb) thread 5
[Switching to thread 5 (Thread 0x9b8)]
#0  0x00007ffe579d95f4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
(gdb) bt
#0  0x00007ffe579d95f4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#1  0x00007ffe5794eb5e in ntdll!RtlReleaseSRWLockExclusive () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#2  0x00007ffe4a145e08 in _cygtls::call2 (this=0x343ce00, func=0x7ffe5794e3f0 <ntdll!RtlReleaseSRWLockExclusive+8704>, arg=0xc0b60, buf=buf AT entry=0x343cd50) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:41
#3  0x00007ffe4a145e86 in _cygtls::call (func=<optimized out>, arg=<optimized out>) at /usr/src/debug/cygwin-3.5.3-1/winsup/cygwin/cygtls.cc:28
#4  0x00007ffe555584d4 in KERNEL32!BaseThreadInitThunk () from C:\src\dlls-syms\kernel32.dll\640993B0ad000\kernel32.dll
#5  0x00007ffe57981791 in ntdll!RtlUserThreadStart () from C:\src\dlls-syms\ntdll.dll\6502806A1cf000\ntdll.dll
#6  0x0000000000000000 in ?? ()
(gdb) thread 6
Unknown thread 6.
(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) 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)

It looks like the master_thread already exited while thread 1 is waiting for some event
to be set (but I am not at all a cygwin expert). The executable (drbdsetup.exe) was running
from a Windows Service.

Please reach out if you need more information.

Best regards,

- Johannes

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019