-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carlos E. R. wrote:
> 
> 
> The Sunday 2007-12-09 at 09:49 -0500, Patrick Shanahan wrote:
> 
>>> Dec  9 13:43:31 nimrodel spamd[14295]: prefork: sysread(8) failed

<snip>

> 
> retry_read:
>   my $nbytes = $sock->sysread($buf, $toread);
> 
>   if (!defined $nbytes) {
>     unless ((exists &Errno::EAGAIN && $! == &Errno::EAGAIN)
>         || (exists &Errno::EWOULDBLOCK && $! == &Errno::EWOULDBLOCK))
>     {
>       # an error that wasn't non-blocking I/O-related.  that's serious
>       return undef;
>     }
> 
>     # ok, we didn't get it first time.  we'll have to start using
>     # select() and timeouts (which is slower).  Don't warn just yet,
>     # as it's quite acceptable in our design to have to "block" on
>     # sysread()s here.
> 
>     my $now = time();
>     my $tout = $timeout;
>     if (!defined $deadline) {
>       # set this.  it'll be close enough ;)
>       $deadline = $now + $timeout;
>     }
>     elsif ($now > $deadline) {
>       # timed out!  report failure
>       warn "prefork: sysread(".$sock->fileno.") failed after $timeout
> secs";  <====
>       return undef;
>     }
> 
> 
> But I don't know perl, and even less spamassassin code.
> 
> 
> 

<snip>

> Dec  9 16:34:45 nimrodel spamd[16817]: Use of uninitialized value in
> concatenation (.) or string at
> /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/SpamdForkScaling.pm
> line 323. Dec  9 16:34:45 nimrodel spamd[22472]: prefork: sysread(9)
> failed after 300 secs at

<snip>

> 
> That uninitialized value refers to this code:
> 
> 
>   # errors; handle undef *or* -1 returned.  do this before "errors on
>   # the handle" below, since an error condition is signalled both via
>   # a -1 return and a $eout bit.
>   if (!defined $nfound || $nfound < 0)
>   {
>     if (exists &Errno::EINTR && $selerr == &Errno::EINTR)
>     {
>       # this happens if the process is signalled during the select(),
>       # for example if someone sends SIGHUP to reload the configuration.
>       # just return inmmediately
>       dbg("prefork: select returned err $selerr, probably signalled");
>       return;
>     }
> 
>     # if a child exits during that select() call, it generates a spurious
>     # error, like this:
>     #
>     # Jan 29 12:53:17 dogma spamd[18518]: prefork: child states: BI
>     # Jan 29 12:53:17 dogma spamd[18518]: spamd: handled cleanup of
> child pid 13101 due to SIGCHLD
>     # Jan 29 12:53:17 dogma spamd[18518]: prefork: select returned -1!
> recovering:
>     #
>     # avoid by setting a boolean in the child_exited() callback and
> checking
>     # it here.  log $! just in case, though.
>     if ($self->{child_just_exited} && $nfound == -1) {
>       dbg("prefork: select returned -1 due to child exiting, ignored
> ($selerr)");
>       return;
>     }
> 
>     warn "prefork: select returned ".
>             (defined $nfound ? $nfound : "undef").
>             "! recovering: $selerr\n";
> 
>     sleep 1;        # avoid overload
>     return;
>   }
> 
>   # errors on the handle?
>   # return them immediately, they may be from a SIGHUP restart signal
>   if ($self->vec_all(\$eout, $self->{server_fileno})) {
>     warn "prefork: select returned error on server filehandle: $selerr
> $!\n";   <====
>     return;
>   }
> 
> 
> 
> But I have no idea what is all about.
> 

Out of curiosity had a look at my copy of this Perl module. Firstly,
this code does not appear in the same place in my version. Could tell
more if the line involved is highlighted in the second snippet.
Secondly, the code is reported a little out of context. Both are in
class methods of a class that seems to be at the heart of a Perl fork.

I think you will need to raise this the spamassassin people as this
looks as if something much earlier is returning an undefined result. By
the time it is hitting the read operation the underlying call is broken.

Like many scripting languages a runtime error is detected when the
result is used rather than when the error actually occurred and it is
extremely difficult to figure out what the real problem is with code
alone.




> 
> 
> 
> -- Cheers,
>        Carlos E. R.
> 

- --
==============================================================================
I have always wished that my computer would be as easy to use as my
telephone.
My wish has come true. I no longer know how to use my telephone.

Bjarne Stroustrup
==============================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHXQqaasN0sSnLmgIRAl8qAJ4mZQW6wwuurf7GZ4aeGJbLFZL+GgCeMvL/
hAWmGeKwZKroaqQK8TcGViY=
=h0om
-----END PGP SIGNATURE-----
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to