Qmail
[Top] [All Lists]

Is saferead not really safe on Solaris 8?

To: qmail@list.cr.yp.to
Subject: Is saferead not really safe on Solaris 8?
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
Date: Fri, 24 Nov 2006 19:11:56 +0100 (CET)
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-qmail@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list qmail@list.cr.yp.to
Mailing-list: contact qmail-help@list.cr.yp.to; run by ezmlm
We are seeing some qmail-smtpd processes hanging for days on end.  If
truss is to be believed, they all hang in a read() on stdin, that is,
on a socket read.

Now this should not be possible, because qmail-smtpd uses saferead() on
all network reads, and saferead first calls select() and then read()
only if select() indicates that there is data to be read.  Surely, if
select() said there is data, then read() cannot hang?

So I begin to suspect an OS bug.  Has anybody else seen this?

- Harald


PS.  Here is output from uname -a

SunOS abel.math.ntnu.no 5.8 Generic_117350-02 sun4u sparc SUNW,Sun-Fire-880

And the auto-generated select.h, in case someone suspects it (looks
good to me):

#ifndef SELECT_H
#define SELECT_H

#include <sys/types.h>
#include <sys/time.h>
#include <sys/select.h>
extern int select();

#endif

<Prev in Thread] Current Thread [Next in Thread>