Date: Wed, 22 Mar 2000 00:40:13 +0100 (CET) From: Edwin.Groothuis@cgmd76206.chello.nl (mavetju@chello.nl) To: FreeBSD-gnats-submit@freebsd.org Subject: kern/17539: kernel panic when asking help in visual userconfig Message-ID: <200003212340.AAA00567@cgmd76206.chello.nl>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003212340.AAA00567>