From owner-freebsd-current Thu Nov 8 23:52:40 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 1B12237B617 for ; Thu, 8 Nov 2001 23:52:34 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA24987; Fri, 9 Nov 2001 18:52:26 +1100 Date: Fri, 9 Nov 2001 18:51:18 +1100 (EST) From: Bruce Evans X-X-Sender: To: Joerg Wunsch Cc: Subject: Re: shell coredumps with missing termcap entries ? In-Reply-To: <200111012120.fA1LKCk25023@uriah.heep.sax.de> Message-ID: <20011109180918.E8067-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 1 Nov 2001, Joerg Wunsch wrote: > Luigi Rizzo wrote: > > > I have been experiencing this problem for sometimes on CURRENT-based > > picobsd images: the shell coredumps if it does not find an > > entry for its terminal type in /etc/termcap. > > Seems to be a =BBfeature=AB of the new libedit. Try this fix. libedit now does more error checking, but doesn't check the error codes properly. It checks too much in term_init() so it doesn't initialize the arrow keys. Then it doesn't check enough in term_init()'s caller[s], so it continues when there is no terminal and soon uses the uninitialized arrow keys. Continuing when there is no terminal is correct and should give builtin defaults for a dumb terminal like it used to. Symptoms of the bug, at least on i386's: if malloc() returns zeroed storage, then the uninitialized arrow keys are sort of initialized (to 0), and the arrow keys just don't work. If malloc() returns the garbage given by the default malloc options, then the uninitialized arrow keys cause a core dump. I still think the correct fix is to back out the libedit changes and start over. Index: term.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/lib/libedit/term.c,v retrieving revision 1.15 diff -u -2 -r1.15 term.c --- term.c=091 Oct 2001 08:41:25 -0000=091.15 +++ term.c=099 Nov 2001 07:30:51 -0000 @@ -339,7 +339,7 @@ =09(void) memset(el->el_term.t_val, 0, T_val * sizeof(int)); =09term_outfile =3D el->el_outfile; +=09term_init_arrow(el); =09if (term_set(el, NULL) =3D=3D -1) =09=09return (-1); -=09term_init_arrow(el); =09return (0); } Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message