From dufault@hda.com  Wed Dec 21 01:21:13 1994
Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id BAA05368 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Dec 1994 01:20:56 GMT
Received: (dufault@localhost) by hda.com (8.6.9/8.3) id VAA00417; Mon, 19 Dec 1994 21:46:56 -0500
Message-Id: <199412200246.VAA00417@hda.com>
Date: Mon, 19 Dec 1994 21:46:56 -0500
From: Peter Dufault <dufault@hda.com>
Reply-To: dufault@hda.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Floppy driver gets NULL "%s" arg during errors
X-Send-Pr-Version: 3.2

>Number:         77
>Category:       kern
>Synopsis:       Floppy driver gets NULL "%s" arg during errors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    core
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 20 17:30:05 1994
>Closed-Date:    Thu Jan 12 20:36:24 MET 1995
>Last-Modified:  Tue Nov 27 18:41:14 PST 2001
>Originator:     Peter &
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
Peter Dufault               Real Time Machine Control and Simulation
HD Associates, Inc.         Voice: 508 433 6936
dufault@hda.com             Fax:   508 433 5267
++++ New e-mail address.  E-mail problems? Tell hdslip@iii.net
>Environment:

-current

>Description:

When the floppy gets errors it winds up passing a NULL argument down
to the disk error logger.

>How-To-Repeat:

Start a "dd if=/dev/fd0a of=/dev/null bs=512" and then pop out the
floppy.  You will see this:

> Dec 20 02:36:36 hda kernel: fd0<null>c: hard error reading fsbn 1354 of
> 1352-1355 (ST0 c0<invld,abnrml>  ST1 20<bad_crc>  ST2 20<bad_crc> cyl 37
> hd 1 sec 5)
> Dec 20 02:36:36 hda kernel: fd0: recal failed ST0 80<invld> cyl -1
> Dec 20 02:36:36 hda kernel: fd0<null>c: hard error reading fsbn 1352 of
> 1352-1355 (ST0
> ffffffff<invld,abnrml,seek_cmplt,equ_chck,drive_notrdy,top_head>  ST1
> ffffffff<end_of_cyl,bad_crc,data_overrun,sec_not_fnd,write_protect,no_am>
> ST2
> ffffffff<ctrl_mrk,bad_crc,wrong_cyl,scn_eq,scn_not_fnd,bad_cyl,no_dam>
> cyl

if you apply the patch in the next section.  (without it you'll panic at
each "<null>"


>Fix:
	
The kernel printf should be more forgiving of this particular slip.
Error messages are too infrequently tested to be confident that
all of them are in good shape. I think this should be applied, in
addition to tracking down the floppy problem.

*** subr_prf.c.orig	Mon Dec 19 21:17:13 1994
--- subr_prf.c	Mon Dec 19 21:17:16 1994
***************
*** 429,434 ****
--- 429,436 ----
  			break;
  		case 's':
  			p = va_arg(ap, char *);
+ 			if (!p)
+ 				p = "<null>";
  			while (*p)
  				putchar(*p++, flags, tp);
  			break;


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Thu Jan 12 20:36:24 MET 1995 
State-Changed-Why:  
This failure has been caused by bad code in diskerr(), which has already 
been fixed by Bruce Evans. 
>Unformatted:



