NetBSD Problem Report #29683

From buchanan@rdpnet.com  Sat Mar 12 22:31:49 2005
Return-Path: <buchanan@rdpnet.com>
Received: from mail11.mdx.safepages.com (mail11.mdx.safepages.com [216.127.133.34])
	by narn.netbsd.org (Postfix) with ESMTP id 4A29D63B116
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 12 Mar 2005 22:31:49 +0000 (UTC)
Message-Id: <20050312223021.82D19A0A63@mail11.mdx.safepages.com>
Date: Sat, 12 Mar 2005 22:30:21 +0000 (GMT)
From: protected@mail11.mdx.safepages.com (echo "com . rdpnet @ buchanan" | perl -wpne '$_ = join ("", reverse "\n", split)')
Reply-To: protected@mail11.mdx.safepages.com (echo "com . rdpnet @ buchanan" | perl -wpne '$_ = join ("", reverse "\n", split)')
To: undisclosed-recipients: ;
Subject: mcd driver (1) fails to compile and (2) fails to attach device
X-Send-Pr-Version: 3.95

>Number:         29683
>Category:       port-i386
>Synopsis:       mcd driver (1) fails to compile and (2) fails to attach device
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 12 22:32:00 +0000 2005
>Closed-Date:    Sat Sep 23 20:32:29 +0000 2006
>Last-Modified:  Sat Sep 23 20:32:29 +0000 2006
>Originator:     M. B. Buchanan
>Release:        NetBSD 2.0
>Organization:
N/A
>Environment:


System: NetBSD muleshoe.mbb.org 2.0 NetBSD 2.0 (V20050228) #12: Sat Mar 12 04:53:15 CST 2005 buchanan@woodrow.mbb.org:/usr/src/sys/arch/i386/compile/V20050228 i386
Architecture: i386
Machine: i386
>Description:
1) A printf() call in mcdstrategy() uses a format specifier that does not
   match its argument, which causes a compile error.
2) mcdprobe() assigns a length (MCD_NPORT) to the base I/O port address,
   preventing the kernel from attaching the device.

>How-To-Repeat:
Enable the mcd(4) driver in the kernel and compile it.  Fix the printf()
and boot the kernel.  You'll get "can't map i/o space" when mcd tries to
attach.

>Fix:
Apply this patch:

*** /tmp/usr/src/sys/dev/isa/mcd.c      Thu Nov  6 22:10:57 2003
--- /usr/src/sys/dev/isa/mcd.c  Sat Mar 12 05:51:13 2005
***************
*** 442,448 ****
            bp->b_blkno, bp->b_bcount, 0);
        if (bp->b_blkno < 0 ||
            (bp->b_bcount % sc->blksize) != 0) {
!               printf("%s: strategy: blkno = %d bcount = %ld\n",
                    sc->sc_dev.dv_xname, bp->b_blkno, bp->b_bcount);
                bp->b_error = EINVAL;
                goto bad;
--- 442,449 ----
            bp->b_blkno, bp->b_bcount, 0);
        if (bp->b_blkno < 0 ||
            (bp->b_bcount % sc->blksize) != 0) {
! /*            printf("%s: strategy: blkno = %d bcount = %ld\n", */
!               printf("%s: strategy: blkno = % " PRId64 " bcount = %ld\n",
                    sc->sc_dev.dv_xname, bp->b_blkno, bp->b_bcount);
                bp->b_error = EINVAL;
                goto bad;
***************
*** 953,959 ****

        if (rv) {
                ia->ia_nio = 1;
!               ia->ia_io[0].ir_addr = MCD_NPORT;

                ia->ia_nirq = 1;

--- 954,961 ----

        if (rv) {
                ia->ia_nio = 1;
! /*            ia->ia_io[0].ir_addr = MCD_NPORT; */
!               ia->ia_io[0].ir_size = MCD_NPORT;

                ia->ia_nirq = 1;


>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/29683 CVS commit: src/sys/dev/isa
Date: Sat, 12 Mar 2005 22:54:48 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Sat Mar 12 22:54:48 UTC 2005

 Modified Files:
 	src/sys/dev/isa: mcd.c

 Log Message:
 PR/29683: M. B. Buchanan: mcd driver has printf formatting compile issue
 and sets the wrong field to the number of ports.


 To generate a diff of this commit:
 cvs rdiff -r1.89 -r1.90 src/sys/dev/isa/mcd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: georg.schwarz@freenet.de (Georg Schwarz)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-i386/29683
Date: Sat, 11 Jun 2005 23:07:26 +0200

 This bug also shows up in NetBSD 2.0.2. I can confirm that the patch
 does the trick, and the mcd driver works fine again.

 Regarding the printf int arg format bug, I wonder whether it is also
 present at other lines; just look about five lines above in the code
 (that line seems to be typically def'd away, so it normally does not
 have an effect) or at various printf instances in fd.c in the same
 syssrc directory.

From: Sergey Svishchev <svs@ropnet.ru>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-i386/29683
Date: Fri, 14 Apr 2006 02:04:53 +0400

 mcd.c does not compile (with or without MCDDEBUG).  diff:

 begin 644 mcd.c.diff.gz
 M'XL("#'*/D0``VUC9"YC+F1I9F8`M59M3]M($/[L_(HYJJ`8.\%Q@$+2<!B2
 MXZ*F4*5`.>DDR['7P<*Q7:]#P[7\]YO9M1.'IH'J=*C-VMYYVV>>F9UZO0Y3
 MUVNX2K,)/>:":1C[T#3;IMDV6E`W\$]I-H[,BJ9IA60+K"0ER0,PF^W]@W9K
 M3TI63DZ@?KBG'X$F?D].*O`FB-QPYC%XY[&'W8`[NV@E99/&W7$%:-N//.;#
 MA[->KW]Z?5ZIO\'7(&+TQ;X:66?]FC_-=$<?ZZ[NJ15M_7ZCT5#1&@LY>\F$
 M\BWPH<;=^K''QK.)"M^2-(@RO[95Y6W@6;=JF/,V;.E`,MRU,?"&]V#/(V?*
 M\H^9D\VXVH%<LVR^\_2T*<C_R;MMWUBV-3K_9-LB`H0B\@)?0"QC43"6C];H
 MJH8&5:4W^/1^\2;RUFR9^EO0Y$*9JX""YI4@_:*#EW[IX)>ZXMXYJ;*3/2:L
 M4]$4-XYX!N5O4L</G0GOK+C^P_X\M$[[0\68&WO*[@Z$SIB%$'#XF@:9,PX9
 M[.P^TQ`*P\'%.2D=DA+)!M$D5T8%BKRU=Z@C?;5\I=@5!2&@_QCR,@=;<<*B
 M-B1.FJ&9..I6/?`"?L^#?Q@]C\/B\>\($T!R.AH`_!,)RT5E%G)A'0RU4ZFC
 M-Q*'+I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z5PK0L]SV@Y1G@O'M9ZPL8J;?Y<7@(Y'*127,
 MR9Y8G*&HLQ\8^Y)%66S%V>154[*?ER&=B9K"+,"+$&]Q[,T92V75YJU0N>,3
 M<\K]6ED;W]4BT6_E*"S7O`EC;G(<?IX[[,K.2WD;]:W>+^3M!_'2&7OD#B=H
 M"N"Q.-MXQFV>.#AHT;#,[&8MB-%'$-^)4<L^NQJ:Z`RG<+5#1FYO;TGS7ZN-
 &8(`*#@``
 `
 end

 -- 
 Sergey Svishchev

From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/29683 CVS commit: src/sys/dev/isa
Date: Thu, 13 Apr 2006 23:16:33 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Thu Apr 13 23:16:33 UTC 2006

 Modified Files:
 	src/sys/dev/isa: mcd.c

 Log Message:
 PR/29683: Sergey Svishchev: Make this compile again..


 To generate a diff of this commit:
 cvs rdiff -r1.92 -r1.93 src/sys/dev/isa/mcd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Sat, 23 Sep 2006 20:32:29 +0000
State-Changed-Why:
christos@ fixed it


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.