kern/59296: Serial Line Noise Causes System Hang in Loader on Reboot

James Thomason jthomason at netscaler.com
Fri Nov 14 17:10:13 PST 2003


>Number:         59296
>Category:       kern
>Synopsis:       Serial Line Noise Causes System Hang in Loader on Reboot
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 14 17:10:11 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     James Thomason
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Netscaler, Inc
>Environment:

System: FreeBSD acara.netscaler.com 4.9-STABLE FreeBSD 4.9-STABLE #11:
Fri Nov 14 13:52:29 GMT 2003 root@:/usr/obj/usr
/src/sys/GENERIC i386


>Description:

FreeBSD boxes in datacenter environments are often connected to serial
console servers=20
for disaster recovery.  When the current loader(8) with autoboot enabled
gets '\r' or '\n' =20
from the terminal it proceeds immediately with system boot, while any
other character is
interpreted as an escape sequence for kernel configuration.  This causes
some systems to hang
on reboot waiting for user input, likely due to line noise on the serial
port.

>How-To-Repeat:

Reboot with line noise.=20

>Fix:

Make escape sequence a break, such as in the patch below, and therefore
less likely to occur
with noisy serial links.

--- boot.c.orig	Fri Nov 14 16:55:37 2003
+++ boot.c	Fri Nov 14 17:04:36 2003
@@ -187,14 +187,20 @@
     yes =3D 0;
=20
     /* XXX could try to work out what we might boot */
-    printf("%s\n", (prompt =3D=3D NULL) ? "Hit [Enter] to boot =
immediately,
or any other key for command prompt." : prompt);
+    printf("%s\n", (prompt =3D=3D NULL) ? "Press [CTRL-C] for command
prompt, or any other key to boot immediately." : prompt);
=20
     for (;;) {
 	if (ischar()) {
 	    c =3D getchar();
-	    if ((c =3D=3D '\r') || (c =3D=3D '\n'))
+	    if (c !=3D '\003')
+            {
 		yes =3D 1;
-	    break;
+		break;
+            }
+	    else
+	    {
+		break;
+	    }
 	}
 	ntime =3D time(NULL);
 	if (ntime >=3D when) {
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list