Ralf S. Engelschall wrote:
> 
> On Sat, Oct 31, 1998, Ben Laurie wrote:
> 
> > >[...]
> > > | nRead=saferead(nFD,&usLength,sizeof usLength);
> > > | assert(nRead == sizeof usLength);
> > >
> > > Here the assert makes sure that really the requested number of bytes are read.
> > > But when an I/O error or some other communication problem occurs the actual
> > > number of read bytes can be different. Then the gcache process falls down.
> > > And I've seen exactly gcache exits with this assertion on my boxes (Solaris
> > > 2.6) while I was mostly sure that no personal attacker was involved. Instead
> > > I really assume it was just some I/O communication error...
> >
> > This is exactly where it failed when gcache was crashing because of a
> > bug. Could it be that you assumed there was a network error instead?
> > Since gcache was fixed I have had no reports of this assertion failing.
> 
> May be, I've the error messages no longer available.

I assume you log something when it happens. Do you see the log message?

> > I do not believe that an I/O error is possible on a locally connected
> > socket.
> 
> But isn't this assumption at least _risky_, Ben?

It isn't an assumption, it is something I believe to be true. I could
doubt everything I believe to be true, I suppose. It would make
programming rather hard. Actually, it would make existing rather hard.

> > I would be most reluctant to fix this without evidence that it
> > is actually a bug. Since this seems to be the thread for maxims, one of
> > my favourites is "if you don't understand why it is broken, don't fix
> > it", and I intend to stick to that.
> 
> That's a good maxim, of course.
> But always do good prevention is another good maxim, too ;-)

I do. That's why I back my assumption up with an assertion. The
assertion is not intended to catch a condition I believe will ever occur
in normal operation. It is a symptom that something is wrong. Isn't this
where we came in?

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: [EMAIL PROTECTED] |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/
______________________________________________________________________
Apache Interface to SSLeay (mod_ssl)   www.engelschall.com/sw/mod_ssl/
Official Support Mailing List               [EMAIL PROTECTED]
Automated List Manager                       [EMAIL PROTECTED]

Reply via email to