Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 1997 07:36:45 +0600 (ESD)
From:      "Serge A. Babkin" <babkin@hq.icb.chel.su>
To:        jkh@time.cdrom.com (Jordan K. Hubbard)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: C optimizer bug ?
Message-ID:  <199706150136.HAA07646@hq.icb.chel.su>
In-Reply-To: <10287.866334301@time.cdrom.com> from "Jordan K. Hubbard" at Jun 14, 97 05:25:01 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > I tried everything and finally decided to build the kernel
> > without the optimization. Everything started working fine!
> > So the C optimizer seems like having a bug.
> 
> Without trying to reduce this down to something others can actually
> reproduce, however, this basically goes into the same category as
> UFO sightings and alien abductions.  There's strong evidence that
> it _might_ happen, but with no concrete proof we can only continue
> to speculate as to whether or not they're real. :-)

Okay, here is the description: The function scsi_done() must check
whether xs->bp is zero and then depending on it call biodone()
or wakeup(xs). Sometimes it confuses these cases and does the
wrong thing, in this case the process hangs on tsleep(...,"scsicmd")
or waiting for biodone() (I can't remember the argument of
tsleep() for biodone exactly). The probability of hangup on missing
wakeup(xs) is about 1/4. The hangups on missing biodone() are
rare.

In case of any delays caused by printf() or tcpdump or
using a loopback Ethernet card simulator
the SCSI simulator is able to finish the operation before the
scsi_scsi_cmd() function gets control back from the SCSI
card driver and in this case it just does not sleep. The hangups
on missing biodone() still occur even with delays.

I don't know how to reproduce this bug without all those
simulators but I think it should be possible.

-SB



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