From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 17 12:10:08 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D04E106566B for ; Mon, 17 Oct 2011 12:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3D49F8FC0A for ; Mon, 17 Oct 2011 12:10:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p9HCA8Jc060102 for ; Mon, 17 Oct 2011 12:10:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p9HCA8vo060101; Mon, 17 Oct 2011 12:10:08 GMT (envelope-from gnats) Date: Mon, 17 Oct 2011 12:10:08 GMT Message-Id: <201110171210.p9HCA8vo060101@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Alexander Best Cc: Subject: Re: bin/161739: top -b does not restore ICANON and ECHO terminal capabilities when exiting X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexander Best List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2011 12:10:08 -0000 The following reply was made to PR bin/161739; it has been noted by GNATS. From: Alexander Best To: Jeremy Chadwick Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/161739: top -b does not restore ICANON and ECHO terminal capabilities when exiting Date: Mon, 17 Oct 2011 12:08:13 +0000 On Mon Oct 17 11, Jeremy Chadwick wrote: > > >Number: 161739 > >Category: bin > >Synopsis: top -b does not restore ICANON and ECHO terminal capabilities when exiting > >Confidential: no > >Severity: non-critical > >Priority: medium > >Responsible: freebsd-bugs > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Mon Oct 17 12:00:24 UTC 2011 > >Closed-Date: > >Last-Modified: > >Originator: Jeremy Chadwick > >Release: FreeBSD 8.2-STABLE amd64 > >Organization: > >Environment: > System: FreeBSD icarus.home.lan 8.2-STABLE FreeBSD 8.2-STABLE #0: Wed Sep 28 05:02:05 PDT 2011 root@icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_8_amd64 amd64 > >Description: > It appears that "top -b" results in top disabling ICANON and > ECHO the controlling terminal/tty, but upon exit never > re-enables them. > > I can confirm this problem on RELENG_7 (7.4-STABLE) and RELENG_8 > (8.2-STABLE). "top -b" does not work on RELENG_6. i can also confirm this running a very recent HEAD: otaku% stty -a > start; top -b ; stty -a > stop ; diff start stop [...] 2c2 < lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl --- > lflags: -icanon isig iexten -echo echoe echok echoke -echonl echoctl cheers. alex > > stty -a after running top -b shows "-icanon" and "-echo", which > confirms the bug. > > I have not looked at the top code to find out where the bug > is, but I do see calls which adjust ICANON and ECHO capabilities > on the tty, so it's definitely there. > >How-To-Repeat: > 1. Run top -b > 2. Attempt to type something into your shell or make use of an > app which relies on canonical input. > >Fix: > Manually typing "stty echo icanon" after using top -b will > restore proper bits on the tty. > > >Release-Note: > >Audit-Trail: > >Unformatted: