Subject: Re: port-mac68k/32583: mac68k netbsd-2 panics during rcp(1)
To: None <port-mac68k-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Dave Huang <khym@azeotrope.org>
List: netbsd-bugs
Date: 01/24/2006 22:55:05
The following reply was made to PR port-mac68k/32583; it has been noted by GNATS.

From: Dave Huang <khym@azeotrope.org>
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: Scott Reynolds <scottr@clank.org>,
	port-mac68k-maintainer@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: port-mac68k/32583: mac68k netbsd-2 panics during rcp(1)
Date: Tue, 24 Jan 2006 16:53:37 -0600

 On Tue, Jan 24, 2006 at 10:20:46PM +0100, Hauke Fath wrote:
 > At 13:17 Uhr -0600 24.1.2006, Scott Reynolds wrote:
 > >I'd almost rather see what happens if DIAGNOSTIC is set.
 > 
 > The kernel in question was built with DEBUG and DIAGNOSTIC.
 
 Ohhh! :)
 
 #define bus_space_set_region_2(t, h, o, val, c) do {                     \
         if (!c) panic("bus_space_set_region_2 called with zero count."); \
         (h).bssr2(t,&(h),o,val,c); } while (0)
 
                 bus_space_set_region_2(sc->sc_buft, sc->sc_bufh, buf, 0,
                     (ETHER_MIN_LEN - ETHER_CRC_LEN - totlen) >> 1);
 
 So, that "if" line expands to:
 
 	if (!(ETHER_MIN_LEN - ETHER_CRC_LEN - totlen) >> 1) panic([...]);
 
 ETHER_MIN_LEN - ETHER_CRC_LEN - totlen == 1, so that's
 	if (!(1) >> 1) panic();
 or
 	if (0 >> 1) panic();
 
 Needs more parentheses :)