Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 2003 17:06:21 -0800
From:      "James Thomason" <jthomason@netscaler.com>
To:        <FreeBSD-gnats-submit@FreeBSD.org>
Subject:    kern/59296: Serial Line Noise Causes System Hang in Loader on Reboot
Message-ID:  <BC074362778E4E4F9A15C4E5E0AA222E3B207D@mailsc.engineering.netscaler.com>
Resent-Message-ID: <200311150110.hAF1ABpx063497@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BC074362778E4E4F9A15C4E5E0AA222E3B207D>