From owner-freebsd-bugs Tue Mar 21 15:50: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 023F637BCEB for ; Tue, 21 Mar 2000 15:50:07 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA64536; Tue, 21 Mar 2000 15:50:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from cgmd76206.chello.nl (cgmd76206.chello.nl [212.83.76.206]) by hub.freebsd.org (Postfix) with ESMTP id 0C1B937BD2F for ; Tue, 21 Mar 2000 15:40:19 -0800 (PST) (envelope-from edwin@cgmd76206.chello.nl) Received: (from edwin@localhost) by cgmd76206.chello.nl (8.9.3/8.9.3) id AAA00567; Wed, 22 Mar 2000 00:40:13 +0100 (CET) (envelope-from mavetju@chello.nl) Message-Id: <200003212340.AAA00567@cgmd76206.chello.nl> Date: Wed, 22 Mar 2000 00:40:13 +0100 (CET) From: Edwin.Groothuis@cgmd76206.chello.nl (mavetju@chello.nl) Reply-To: Edwin.Groothuis@cgmd76206.chello.nl (mavetju@chello.nl) To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/17539: kernel panic when asking help in visual userconfig Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17539 >Category: kern >Synopsis: kernel panic when asking help in visual userconfig >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 21 15:50:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 3.4-RELEASE i386 >Organization: - >Environment: visual config help >Description: When in the visual user configuration and I ask for help and press space several times to get aa the bottom, at the last time space is entered the kernel will stop with a kernel-panic. This is a fix to kern/14394 >How-To-Repeat: Reset your computer. Enter "boot user_config" Enter "visual" Enter "?" for help Press space a couple of times Computer will hang with a kernel panic >Fix: The problem is when you are at the end of the help (i.e. helptext[line]=NULL) and getchar() is being called. At that moment delta=0. If you press space for the next page, the delta nor topline are changed because helptext[line]==NULL. Back at the top of the for(;;)-loop, delta is stil 0 (was not changed), line is set to 0, the if (delta) failes (so line is still 0), getchar() is ran, space is pressed, helptext[line] is checked and found valid, topline is increased, delta is set and back the helptext is displayed again with an invalid value of topline for helptext. In /sys/i386/i386/userconfig.c: static void helpscreen(void) { int topline = 0; /* where we are in the text */ int c, delta = 1; char prompt[80]; + int line = 0; for (;;) /* loop until user quits */ { - int line = 0; /* display help text */ if (delta) { clear(); /* remove everything else */ for (line = topline; (line < (topline + 24)) && (helptext[line]); Perhaps there is a more elegant solution with working with topline instead of line at the checking for space, but this one works. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message