From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id E246A3858C50; Mon, 18 Apr 2022 12:03:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E246A3858C50 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Fix deadlock caused by Ctrl-C in setup_pseudoconsole(). X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: b58b5a96601f9e7424e4cb21aa0b9b2915daa49c X-Git-Newrev: 98b6f23d98c5c75f96abd91860a2dccbebe7ffda Message-Id: <20220418120337.E246A3858C50@sourceware.org> Date: Mon, 18 Apr 2022 12:03:37 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2022 12:03:38 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D98b6f23d98c= 5c75f96abd91860a2dccbebe7ffda commit 98b6f23d98c5c75f96abd91860a2dccbebe7ffda Author: Takashi Yano Date: Mon Apr 18 19:56:14 2022 +0900 Cygwin: pty: Fix deadlock caused by Ctrl-C in setup_pseudoconsole(). =20 - If Ctrl-C is pressed just after setup_pseudoconsole() is called, mintty stops to respond a while when CPU load is high. This patch fixes the issue. =20 Addresses: https://cygwin.com/pipermail/cygwin/2022-April/251272.html Diff: --- winsup/cygwin/spawn.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 400457117..c9e1fb6d2 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -679,8 +679,12 @@ child_info_spawn::worker (const char *prog_arg, const = char *const *argv, HANDLE h_stdin =3D handle (fileno_stdin, false); if (h_stdin =3D=3D ptys_primary->get_handle_nat ()) stdin_is_ptys =3D true; + if (reset_sendsig) + myself->sendsig =3D myself->exec_sendsig; ptys_primary->setup_for_non_cygwin_app (nopcon, envblock, stdin_is_ptys); + if (reset_sendsig) + myself->sendsig =3D NULL; ptys_primary->get_duplicated_handle_set (&ptys_handle_set); ptys_ttyp =3D (tty *) ptys_primary->tc (); ptys_need_cleanup =3D true;