NetBSD Problem Report #29597
From mouse@Sparkle.Rodents.Montreal.QC.CA Fri Mar 4 18:49:51 2005
Return-Path: <mouse@Sparkle.Rodents.Montreal.QC.CA>
Received: from Sparkle.Rodents.Montreal.QC.CA (Sparkle.Rodents.Montreal.QC.CA [216.46.5.7])
by narn.netbsd.org (Postfix) with ESMTP id 3088663B104
for <gnats-bugs@gnats.NetBSD.org>; Fri, 4 Mar 2005 18:49:51 +0000 (UTC)
Message-Id: <200503041849.NAA16835@Sparkle.Rodents.Montreal.QC.CA>
Date: Fri, 4 Mar 2005 13:49:44 -0500 (EST)
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Reply-To: mouse@Rodents.Montreal.QC.CA
To: gnats-bugs@netbsd.org
Subject: gdb mishandles EOF in various ways
X-Send-Pr-Version: 3.95
>Number: 29597
>Category: toolchain
>Synopsis: gdb EOF-handling bugs
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: toolchain-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Mar 04 18:50:00 +0000 2005
>Closed-Date: Mon Feb 26 22:36:38 +0000 2018
>Last-Modified: Mon Feb 26 22:36:38 +0000 2018
>Originator: der Mouse
>Release: NetBSD 2.0
>Organization:
Dis-
>Environment:
Identical symptoms seen on two machines:
NetBSD/sparc 2.0 on a SPARCclassic:
mainbus0 (root): SUNW,SPARCclassic: hostid 80722791
cpu0 at mainbus0: TMS390S10 @ 50 MHz, on-chip FPU
cpu0: physical 4K instruction (32 b/l), 2K data (16 b/l): cache enabled
NetBSD/i386 2.0 on a...Xeon, I think:
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel (686-class), 3200.24 MHz, id 0xf34
cpu0: features bfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features bfebfbff<PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX>
cpu0: features bfebfbff<FXSR,SSE,SSE2,SS,HTT,TM,SBF>
cpu0: I-cache 12K uOp cache 8-way
cpu0: L2 cache 1 MB 64B/line 8-way
cpu0: ITLB 4K/4M: 64 entries
cpu0: DTLB 4K/4M: 64 entries
cpu0: 32 page colors
>Description:
I run with unusual stty settings (eof ^Z susp ^P kill ^X),
largely for historical reasons. These cause trouble with gdb.
The first problem is that, without any configuration at all,
gdb does not obey my eof setting; typing ^Z suspends gdb, and
only ^D works for EOF. (^P does work to suspend.)
I eventually found "echo edit off > ~/.editrc". Under past
NetBSD versions, this makes gdb "work": typing ^Z gives EOF
behaviour. (This is the behaviour under 1.4T on many ports and
1.6.1 on i386; I can't easily check 1.6.* on other ports.) But
under 2.0, with that ~/.editrc in place, ^Z echos as ^, Z,
backspace, backspace, and does nothing (at the (gdb) prompt).
^D echos as ^, D without backspaces and also does nothing. The
only way to exit I've found is "quit".
>How-To-Repeat:
(on 1.4T, 1.6.1, 2.0, or probably pretty much any other)
% rm -f ~/.editrc
% stty eof ^Z susp ^P kill ^X
% gdb
...type ^Z and notice that it suspends rather than exiting...
...type ^D and notice that it exits...
(on a 1.6.1 or 1.4T or probably other pre-2.0 system)
% echo edit off > ~/.editrc
% stty eof ^Z susp ^P kill ^X
% gdb
...type ^Z and notice it works as EOF...
(on 2.0)
% echo edit off > ~/.editrc
% stty eof ^Z susp ^P kill ^X
% gdb
...type ^Z and notice it doesn't work as EOF...
...type ^D and notice it doesn't work either...
>Fix:
Unknown. But I note that ftp, which also uses editline (its
behaviour changes if ~/.editrc is in place) behaves correctly
with this ~/.editrc in place, even on 2.0 (though it breaks the
same as gdb without ~/.editrc); perhaps gdb needs to do
something the same way ftp does?
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 26 Feb 2018 20:36:21 +0000
State-Changed-Why:
testing the ^Z behaviour here shows it behaving as intended in netbsd 8.0_BETA. are there other issues?
From: Mouse <mouse@Rodents-Montreal.ORG>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: toolchain/29597 (gdb EOF-handling bugs)
Date: Mon, 26 Feb 2018 15:53:35 -0500 (EST)
> testing the ^Z behaviour here shows it behaving as intended in netbsd
> 8.0_BETA. are there other issues?
If you mean "other issues with ftp on 8.x", I don't know; I haven't run
NetBSD more recent than 5.2.
If you mean something else by "other issues", well, it depends on what.
:-) (The only other thing that comes to mind as misbehaving because of
my stty settings is bash, which strikes me as not relevant to this PR.)
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: toolchain/29597 (gdb EOF-handling bugs)
Date: Mon, 26 Feb 2018 21:39:11 +0000
Given the time that passed since the bug report, I expected some
change (e.g. I recall gdb used readline even on netbsd in the past).
with just:
rm -f ~/.editrc
stty eof ^Z susp ^P kill ^X
gdb
^Z
gdb exits.
but I feel like I might have missed another part of the bug, and didn't
re-test fully.
From: Mouse <mouse@Rodents-Montreal.ORG>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: toolchain/29597 (gdb EOF-handling bugs)
Date: Mon, 26 Feb 2018 17:06:38 -0500 (EST)
> with just:
> rm -f ~/.editrc
> stty eof ^Z susp ^P kill ^X
> gdb
> ^Z
> gdb exits.
Then the primary sumptom, at least, is gone.
> but I feel like I might have missed another part of the bug, and
> didn't re-test fully.
Since I don't use post-5.2 NetBSD, I think this can be closed unless
someone else using unusual stty settings sees issues (or, contrary to
all my expectations, NetBSD decides to (re-)start issuing fixes for 5.2
or earlier).
The right fix, of course, is to move command-line editing out of
userland programs (gdb, ftp, sh, etc) and - as far as they're concerned
- back into the kernel. Doing *that* right means an auxiliary
line-editing process. This has been on my to-do list for years, but
never very close to the top.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
State-Changed-From-To: feedback->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 26 Feb 2018 22:36:38 +0000
State-Changed-Why:
It's probably all fixed. thanks for the quick feedback.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.