delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/06/30/07:35:51

DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 45UBZpCQ364185
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=MxnRn+/w
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7E3E3877021
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1719747350;
bh=Hz04ipQvnpbLnp3mTD/+0k87dOikiA3FT2zCGwj0VBw=;
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=MxnRn+/wcAMx94CIquWcaBGSOe75Z/TvfFu9oA9BriHk/QvAWUeuhrcMhGuZmvJCg
AodUTvi+lQEjQ7xNu32IYJK6zMdVl1IKcLZXqoS3A8Ru0IvfWPr0KNe30Fb0G4l2JE
634Ql9FpIk7vqqe7gpAiwyzFx6BwlHf6wYFjGsww=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54C08385DDDF
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 54C08385DDDF
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719747216; cv=none;
b=ayGJ+7Po8NRg1t57gVhwwxsw5rwPgX1Ppi2I+b8UrKfDtbraqjX3F8sJHF988/pa5Rkq4lx3jL1Xshz+sQ203DAVC/hAqtxrJI/y5th2w2tsENHrR7qoKcpGKbl5qv4qE7cxm/ora+GM4zDKSw+7X+Hj161RS/RFeY4Lkf9mAlI=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1719747216; c=relaxed/simple;
bh=jGLxCXmx3NtZHstvR5aYjg1NOszNYTSmovMp0g62JH0=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
b=XUps9rFVPVqowtl2p+0ekBF9Xti00TXlRx6ltkxj79g7Zk0MrdnwuG7eZ1OjpzA0KwVQD9f7jACzlZx/s5gQvFVoYQT1t2hearY8kZCS6UYVM8pXB05b1mAwTKbja5wteWJ83yx1NdEEVSE8eVRuN3qG34COiEpt38QH/8TA/zE=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1719747213; x=1720352013;
h=content-transfer-encoding:in-reply-to:from:content-language
:references:newsgroups:to:subject:user-agent:mime-version:date
:message-id:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=f9+3H2tdotpoUYVVdjJz0+Igca1QurekQDZmpP3c1gU=;
b=Zf+7e4MpyxK+beMZhaT7yeW9T/OXaVWXlrJfNE907tIcHZnhBpim7oHZn6qicA4oB4
spT9CWl/rnDj051rKpfs15/tyh/hQSzbmWOWzuymHHRiH1sjoY9F38JCK5/LceIPgI3n
m6oMDf9GZDnSFNRinDZbR1bsgonCJUkOxCPmALcqzTlMMgUWO/mV8qYBO2iCk95URddu
gQNwd0Kz09mRxm42VU76FV5hVxiYUFy45zhB7nbr+RZIbm9MryY4JtXdK3tQ0rZ2y8En
vPdyyOceY4INiOpgk0coRSicsGcEFr3Ll7GVKcThNxuI6xwlX5auJQ9DeqOpNVCBBFF5
1MDA==
X-Gm-Message-State: AOJu0YzCrkR2jZ3KhLWj0lWLJSeqWtZ2zT9b55rQxoDalJeD1oM0p6xk
JgFzyReBvkUz1pKagcWWRh9AfopTWAowND/8v3CXPGdVSVqSBDnmTQE2dg==
X-Google-Smtp-Source: AGHT+IHyhgE/f0OKcAUzdZMyu2Ie9NSuV6N5XDdDyVwZK1uxJNU19+L69y1Jz5Yiw428IMut+6i43w==
X-Received: by 2002:a05:6a20:3948:b0:1bd:4bc4:750 with SMTP id
adf61e73a8af0-1bef60f5f3fmr5300644637.5.1719747213134;
Sun, 30 Jun 2024 04:33:33 -0700 (PDT)
Message-ID: <19c300bb-97ff-4dee-be8c-2215b38f0a1c@gmail.com>
Date: Sun, 30 Jun 2024 20:33:19 +0900
MIME-Version: 1.0
User-Agent: Thunderbird Daily
Subject: Re: ssh-add -l hangs under cygwin test 3.6.0-0.139.g...
To: cygwin AT cygwin DOT com
Newsgroups: gmane.os.cygwin
References: <bd97f4a1-0298-4422-8594-40f0989d13ce AT SystematicSW DOT ab DOT ca>
In-Reply-To: <bd97f4a1-0298-4422-8594-40f0989d13ce@SystematicSW.ab.ca>
X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP,
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-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
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: jojelino via Cygwin <cygwin AT cygwin DOT com>
Reply-To: jojelino <jojelino AT gmail DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On 6/29/2024 2:39 PM, Brian Inglis via Cygwin wrote:
> Reran cygport --debug upload and command hanging was ssh-add -l!
> 
   296   72109 [main] ssh-add 63275 win32env_to_cygenv: 0xA000232E0: 
TERM_PROGRAM=mintty
   189   72298 [main] ssh-add 63275 win32env_to_cygenv: 0xA00023300: 
TERM_PROGRAM_VERSION=3.7.1

I was able to reproduce this problem by entering below command with 
ffmpeg from https://www.gyan.dev/ffmpeg/builds/ , this ffmpeg build 
spams putc. So, without piping its output to `tee', It would not 
possible track down any cause among lengthy trace output.

strace mintty -e /bin/timeout 10 sh -c './ffmpeg -h full|& tee'

In summary, When `timeout' expires, `timeout' signals SIGHUP to pgrp of 
itself, btw some member of the pgrp may have acquired any of 
synchronization object of some part of cygwin internal when a member 
process of the pgrp did encounter the signal interrupt from `timeout'. 
In my case it was output_mutex of pty.

  1565 10693297 [main] timeout 745 kill_pgrp: pid 0, signal 15
  2701 15224348 [main] mintty 744 
fhandler_pty_master::process_slave_output: bytes read 256
  1736 9525442 [sig] sh 746 proc_subproc: args: 4, 1
  3137 6700294 [main] tee 748 fhandler_pty_slave::write: pty5, 
write(0x7FFFFC780, 1024)
  1347 9526789 [sig] sh 746 proc_subproc: clear waiting threads
  2084 15226432 [main] mintty 744 
fhandler_pty_master::process_slave_output: returning 256
  1110 6701404 [main] tee 748 fhandler_pty_slave::write: (1267): pty 
output_mutex (0x4C0): waiti
-1 ms
   732 9527521 [sig] sh 746 checkstate: child_procs count 2
  3648 10696945 [main] timeout 745 open_shared: name cygpid.724, shared 
0x1A0050000 (wanted 0x1A
0000), h 0x16C, m 6, created 0
  1055 6702459 [main] tee 748 fhandler_pty_slave::write: (1267): pty 
output_mutex: acquired

  2092 15753306 [main] mintty 744 fhandler_pty_master::close: (2095): 
pty output_mutex (0x4AC):
ting -1 ms

And below is a location where `tee' did hang.

#3  0x00007ffd0e408fdf in fhandler_pty_slave::write (this=0x800009a10,
     ptr=0x7ffffc780, len=<optimized out>)
     at ../../.././winsup/cygwin/fhandler/pty.cc:1268
1268      if (!process_opost_output (get_output_handle (), ptr, towrite, 
false,
(gdb)  li
1263      termios_printf ("pty%d, write(%p, %lu)", get_minor (), ptr, len);
1264
1265      push_process_state process_state (PID_TTYOU);
1266
1267      acquire_output_mutex (mutex_timeout);
1268      if (!process_opost_output (get_output_handle (), ptr, towrite, 
false,
1269                                 get_ttyp (), is_nonblocking ()))


I ended up prepending two CancelIo call just above of 
acquire_output_mutex located in fhandler_pty_master::close of pty.cc.

 >	  CancelIo(get_ttyp()->to_master());
 >	  CancelIo(get_ttyp()->to_master_nat());
	  acquire_output_mutex (mutex_timeout);

Hope it helps

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