NetBSD Problem Report #55423
From www@netbsd.org Fri Jun 26 15:56:22 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id A435A1A9217
for <gnats-bugs@gnats.NetBSD.org>; Fri, 26 Jun 2020 15:56:22 +0000 (UTC)
Message-Id: <20200626155621.B009F1A9227@mollari.NetBSD.org>
Date: Fri, 26 Jun 2020 15:56:21 +0000 (UTC)
From: kd@panix.com
Reply-To: kd@panix.com
To: gnats-bugs@NetBSD.org
Subject: /bin/csh freezes when some interactive programs are suspended
X-Send-Pr-Version: www-1.0
>Number: 55423
>Category: bin
>Synopsis: /bin/csh freezes when some interactive programs are suspended
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 26 16:00:00 +0000 2020
>Closed-Date: Mon Jul 05 08:30:20 +0000 2021
>Last-Modified: Wed Jul 07 06:55:01 +0000 2021
>Originator: Ken Dunlap
>Release: NetBSD-9
>Organization:
Panix
>Environment:
NetBSD panix1.panix.com 9.0 NetBSD 9.0 (PANIX-XEN-USER) #1: Sun May 3 21:15:18 EDT 2020 root@juggler.panix.com:/misc/obj64/misc/devel/netbsd/9.0/src/sys/arch/amd64/compile/PANIX-XEN-USER amd64
>Description:
/bin/csh completely freezes when interactive programs are suspended via ^z. Examples of such programs include newer pythons, irb(ruby), R, erl (the erlang shell), etc. Killing the suspended program does not unfreeze the shell. This happens on NetBSD 8.1 also.
>How-To-Repeat:
% exec /bin/csh
% python3.7
% ^z
>Fix:
>Release-Note:
>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/55423: /bin/csh freezes when some interactive programs are
suspended
Date: Mon, 7 Jun 2021 23:01:37 +0000
On Fri, Jun 26, 2020 at 04:00:01PM +0000, kd@panix.com wrote:
> /bin/csh completely freezes when interactive programs are suspended
> via ^z. Examples of such programs include newer pythons,
> irb(ruby), R, erl (the erlang shell), etc. Killing the suspended
> program does not unfreeze the shell. This happens on NetBSD 8.1
> also.
I can reproduce this and it's not a regression: it also happens with
csh from 20150101 and 20100101, on a -current kernel from a few months
ago.
csh's signal handling is extraordinarily delicate and it's as likely
as not that the problem is in the kernel and not in csh itself. It
might be instructive to test this with our csh on FreeBSD.
Though since tcsh doesn't exhibit the problem, maybe not.
It's not clear which programs trigger it or why; of the things I have
lying around that appear to use real gnu libreadline (vs. libedit),
python 3.8, xindy, and gnuchess trigger it but gawk's debug interface
doesn't, and nothing I tried that's linked to libedit (e.g. base gdb)
or curses (e.g. emacs) does.
--
David A. Holland
dholland@netbsd.org
State-Changed-From-To: open->feedback
State-Changed-By: christos@NetBSD.org
State-Changed-When: Sat, 03 Jul 2021 10:11:29 -0400
State-Changed-Why:
I can't reproduce this; please provide precise instructions
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: christos@netbsd.org
Subject: Re: bin/55423 (/bin/csh freezes when some interactive programs are
suspended)
Date: Sun, 4 Jul 2021 17:05:52 +0000
On Sat, Jul 03, 2021 at 02:11:29PM +0000, christos@NetBSD.org wrote:
> I can't reproduce this; please provide precise instructions
xterm &
then in the new xterm:
% csh # my login shell is tcsh
% /usr/pkg/bin/python3.8 # /usr/pkg/bin not in csh's default path
Python 3.8.10 (default, Jun 24 2021, 02:51:17)
[GCC 10.3.0] on netbsd9
Type "help", "copyright", "credits" or "license" for more information.
>>>
now press ^Z
Suspended
%
but now it's wedged; characters typed are ignored, except that ^C
prints another prompt. ps -l shows python suspended and csh waiting on
"ttyraw". My guess is that the job control state is borked, but I'm
not sure how to check that from another shell.
Probably need to have py38-readline installed for the behavior to
manifest.
--
David A. Holland
dholland@netbsd.org
State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 04 Jul 2021 18:41:18 +0000
State-Changed-Why:
feed is back
From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/55423 (/bin/csh freezes when some interactive programs are suspended)
Date: Mon, 05 Jul 2021 03:41:31 +0700
Date: Sun, 4 Jul 2021 17:45:03 +0000 (UTC)
From: David Holland <dholland-bugs@netbsd.org>
Message-ID: <20210704174503.96B961A923D@mollari.NetBSD.org>
| My guess is that the job control state is borked, but I'm
| not sure how to check that from another shell.
My guess is that the terminal is in non-echo (probably) cbreak mode,
and that ...
| Probably need to have py38-readline installed for the behavior to
| manifest.
that thing, or the application using it, isn't catching SIGTSTP to return
the terminal to a sane mode before the process suspends.
Try blind typing "stty sane^J" (ie: end with an explicit line feed,
not carriage-return) and see what happens.
kre
ps: note I don't have py38-readline (or pyXX-readline for any XX) or
python3.8 (I do have an earlier one) installed to test this hypothesis myself.
State-Changed-From-To: open->closed
State-Changed-By: christos@NetBSD.org
State-Changed-When: Mon, 05 Jul 2021 04:30:20 -0400
State-Changed-Why:
Not a csh bug. py-readline leaves the terminal in raw mode when suspended.
/bin/sh behaves the same way.
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/55423 (/bin/csh freezes when some interactive programs are
suspended)
Date: Tue, 6 Jul 2021 23:53:40 +0000
On Sun, Jul 04, 2021 at 08:45:01PM +0000, Robert Elz wrote:
> | My guess is that the job control state is borked, but I'm
> | not sure how to check that from another shell.
>
> My guess is that the terminal is in non-echo (probably) cbreak mode,
> and that ...
>
> | Probably need to have py38-readline installed for the behavior to
> | manifest.
>
> that thing, or the application using it, isn't catching SIGTSTP to return
> the terminal to a sane mode before the process suspends.
>
> Try blind typing "stty sane^J" (ie: end with an explicit line feed,
> not carriage-return) and see what happens.
I had tried that but it didn't occur to me to use ^J, so of course it
didn't work and thus seemed completely dead. Oops.
oh well.
To the original submitter: consider filing an upstream python bug
report. Some things using readline fail and others don't, so it's
probably not directly a readline issue. I think.
--
David A. Holland
dholland@netbsd.org
From: Kenneth Dunlap <kd@panix.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/55423 (/bin/csh freezes when some interactive programs are
suspended)
Date: Tue, 6 Jul 2021 20:39:05 -0400
Quoth David Holland (dholland-bugs@netbsd.org):
> The following reply was made to PR bin/55423; it has been noted by GNATS.
>
> From: David Holland <dholland-bugs@netbsd.org>
> To: gnats-bugs@netbsd.org
> Cc:
> Subject: Re: bin/55423 (/bin/csh freezes when some interactive programs are
> suspended)
> Date: Tue, 6 Jul 2021 23:53:40 +0000
>
> On Sun, Jul 04, 2021 at 08:45:01PM +0000, Robert Elz wrote:
> > | My guess is that the job control state is borked, but I'm
> > | not sure how to check that from another shell.
> >
> > My guess is that the terminal is in non-echo (probably) cbreak mode,
> > and that ...
> >
> > | Probably need to have py38-readline installed for the behavior to
> > | manifest.
> >
> > that thing, or the application using it, isn't catching SIGTSTP to return
> > the terminal to a sane mode before the process suspends.
> >
> > Try blind typing "stty sane^J" (ie: end with an explicit line feed,
> > not carriage-return) and see what happens.
>
> I had tried that but it didn't occur to me to use ^J, so of course it
> didn't work and thus seemed completely dead. Oops.
>
> oh well.
>
> To the original submitter: consider filing an upstream python bug
> report. Some things using readline fail and others don't, so it's
> probably not directly a readline issue. I think.
>
But, it is far more than just python which is failing, and it is
*only* failing with /bin/csh. It happens with a wide range of
software, as was pointed out in the original bug report.
[panix5-kd] ~/Misc <0> /bin/csh
You have new mail.
% irb
irb(main):001:0>
Suspended
csh is now frozen
% R
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-unknown-netbsd9.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
>
Suspended
csh is now frozen
[panix5-kd] ~/Misc <0> /bin/csh
% erl
Erlang/OTP 23 [erts-11.1.6] [source] [64-bit] [smp:3:3] [ds:3:3:10] [async-threads:1] [hipe]
Eshell V11.1.6 (abort with ^G)
1>
Suspended
%
csh is now frozen.
Ken
--
A vacuum is a hell of a lot better than some of the stuff nature fills it with.
--Tennessee Williams
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org,
kd@panix.com
Subject: Re: bin/55423 (/bin/csh freezes when some interactive programs are
suspended)
Date: Wed, 7 Jul 2021 09:54:33 +0300
--Apple-Mail=_8B00187C-1CD5-4441-89EB-187F9BB4D4DC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
As I mentioned before, this happens only with shells that don't use =
command line
editing. (csh and sh by default). Others that do (bash, tcsh, ash, zsh) =
reset the
tty modes.
christos
> On Jul 7, 2021, at 3:40 AM, Kenneth Dunlap <kd@panix.com> wrote:
>=20
> The following reply was made to PR bin/55423; it has been noted by =
GNATS.
>=20
> From: Kenneth Dunlap <kd@panix.com>
> To: gnats-bugs@netbsd.org
> Cc:
> Subject: Re: bin/55423 (/bin/csh freezes when some interactive =
programs are
> suspended)
> Date: Tue, 6 Jul 2021 20:39:05 -0400
>=20
> Quoth David Holland (dholland-bugs@netbsd.org):
>> The following reply was made to PR bin/55423; it has been noted by =
GNATS.
>>=20
>> From: David Holland <dholland-bugs@netbsd.org>
>> To: gnats-bugs@netbsd.org
>> Cc:
>> Subject: Re: bin/55423 (/bin/csh freezes when some interactive =
programs are
>> suspended)
>> Date: Tue, 6 Jul 2021 23:53:40 +0000
>>=20
>> On Sun, Jul 04, 2021 at 08:45:01PM +0000, Robert Elz wrote:
>>> | My guess is that the job control state is borked, but I'm
>>> | not sure how to check that from another shell.
>>>=20
>>> My guess is that the terminal is in non-echo (probably) cbreak mode,
>>> and that ...
>>>=20
>>> | Probably need to have py38-readline installed for the behavior =
to
>>> | manifest.
>>>=20
>>> that thing, or the application using it, isn't catching SIGTSTP to =
return
>>> the terminal to a sane mode before the process suspends.
>>>=20
>>> Try blind typing "stty sane^J" (ie: end with an explicit line feed,
>>> not carriage-return) and see what happens.
>>=20
>> I had tried that but it didn't occur to me to use ^J, so of course it
>> didn't work and thus seemed completely dead. Oops.
>>=20
>> oh well.
>>=20
>> To the original submitter: consider filing an upstream python bug
>> report. Some things using readline fail and others don't, so it's
>> probably not directly a readline issue. I think.
>>=20
>=20
> But, it is far more than just python which is failing, and it is
> *only* failing with /bin/csh. It happens with a wide range of
> software, as was pointed out in the original bug report.
>=20
> [panix5-kd] ~/Misc <0> /bin/csh
> You have new mail.
> % irb
> irb(main):001:0>
> Suspended
>=20
> csh is now frozen
>=20
>=20
> % R
>=20
> R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
> Copyright (C) 2020 The R Foundation for Statistical Computing
> Platform: x86_64-unknown-netbsd9.0 (64-bit)
>=20
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>=20
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>=20
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>=20
>>=20
> Suspended
>=20
> csh is now frozen
>=20
>=20
> [panix5-kd] ~/Misc <0> /bin/csh
> % erl
> Erlang/OTP 23 [erts-11.1.6] [source] [64-bit] [smp:3:3] [ds:3:3:10] =
[async-threads:1] [hipe]
>=20
> Eshell V11.1.6 (abort with ^G)
> 1>
> Suspended
> %
>=20
>=20
> csh is now frozen.
>=20
> Ken
> --
> A vacuum is a hell of a lot better than some of the stuff nature fills =
it with.
> --Tennessee =
Williams
>=20
--Apple-Mail=_8B00187C-1CD5-4441-89EB-187F9BB4D4DC
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYOVPqQAKCRBxESqxbLM7
Og/SAJ9iD1Oct9ixwTt4Xk137nc6PlDG4gCgkROwj4mz2a+u52/I/P36rmHLWss=
=5NOW
-----END PGP SIGNATURE-----
--Apple-Mail=_8B00187C-1CD5-4441-89EB-187F9BB4D4DC--
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.