From owner-freebsd-bugs@FreeBSD.ORG Fri Nov 14 17:10:13 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01BA616A4CE for ; Fri, 14 Nov 2003 17:10:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7ACFD43FBD for ; Fri, 14 Nov 2003 17:10:11 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hAF1ABFY063498 for ; Fri, 14 Nov 2003 17:10:11 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hAF1ABpx063497; Fri, 14 Nov 2003 17:10:11 -0800 (PST) (envelope-from gnats) Resent-Date: Fri, 14 Nov 2003 17:10:11 -0800 (PST) Resent-Message-Id: <200311150110.hAF1ABpx063497@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "James Thomason" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E24F16A4CE for ; Fri, 14 Nov 2003 17:07:58 -0800 (PST) Received: from backup.netscaler.com (backup.netscaler.com [64.56.204.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9611D43FCB for ; Fri, 14 Nov 2003 17:07:57 -0800 (PST) (envelope-from jthomason@netscaler.com) Received: from mailsc.engineering.netscaler.com ([65.219.20.7]) by backup.netscaler.com (8.11.1/8.9.3) with SMTP id hAF1SL037474 for ; Fri, 14 Nov 2003 17:28:21 -0800 (PST) Message-Id: Date: Fri, 14 Nov 2003 17:06:21 -0800 From: "James Thomason" To: Subject: kern/59296: Serial Line Noise Causes System Hang in Loader on Reboot X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 01:10:13 -0000 >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: