Luis,

> I am running into a problem running the latest version of Amavisd from the
> FreeBSD ports.  The server is a running FreeBSD 4.11 + amavisd-new 2.3.1 +
> perl 5.8.7

Sorry for a late reply. I think you just missed the discussion on the list
about the Perl 5.8.7 problem.

> mime_decode-1 FAILED: Error reading: Resource temporarily unavailable at
> (eval 65) line 153, <GEN8> line 1. (in reply to end of DATA command))
>
> and
>
> ClamAV-clamscan av-scanner FAILED: Error reading: Resource temporarily
> unavailable at (eval 57) line 389, <GEN9> line 1.
>
> I have a server configured with FreeBSD 4.9 + amavisd 2.3.1 and perl 5.8.7
> and it works perfectly.  Actually... I took dumps from the 4.9 machine and
> then installed them on a new box and upgraded the box to 4.11 and that is
> when the trouble started. It seems that FreeBSD 4.11 has chanced a system
> call that is making perl 5.8 act a little peculiar.
>
> Anyway, after looking through the mail archives I found a posting by Mark
> Martinec with the following fix
>
>  +    defined $ln || $!==0 || $!==EAGAIN
>  +      or die "Error reading from file(1) utility: $!";

That workaround was included in 2.3.2.

> ... Anyway, the amavisd run_av
> routine seems to have the same kind of problems as the file(1) routine.  So
> I modified av_scan to test for EAGAIN before doing the die.  Here is the
> code change
> +    defined $ln || $!==0 || $!==EAGAIN
> +      or die "Error reading from avscan utility: $!";

> This fixed the virus scanning.  As far as I can tell in my test environment
> everything seems to be working now. Mail is being scanned by sa and clamav
> and being delivered correctly to maildrop.
>
> Looking at the rest of the source for amavisd I see many occurrences of
>  for (undef $!; defined($ln=$proc_fh->getline);
>  followed by
>     defined $ln || $!==0  or die "Error reading: $!";
>
> and worry that other sections of code are going to bomb when we put the
> server into production.  My second issue is that I don't feel comfortable
> hacking up a bunch of code on a production server.

The workaround in 2.3.2 was applied to all the locations where it matters.

From 2.3.2 release notes:

- ignore status EAGAIN when reading results on a pipe from a forked process;
  the status EAGAIN seems to be an artifact of Perl I/O on some installations;
  reported by several people to cause problems on FreeBSD with Perl 5.8.7
  (but Perl 5.8.6 is fine); thanks to Bart Matterne for testing and feedback;


> Does anyone know if there is a plan to fix this issue permanently?  Does
> anyone have an opinion on doing a global search and replace for  defined
> $ln || $!==0  or die "Error reading: $!"; and replacing the line with 
> defined $ln || $!==0 || $!==EAGAIN or die "Error reading: $!" Is the global
> search and replace a reasonable thing to do?

If anyone is willing to bring the issue to Perl folks, that would be perfect.
Or to the FreeBSD perl port maintainer. So far I can live with a couple
of workarounds for Perl bugs that accumulated in amavisd-new over
the years. After submitting few Perl bugs and not receiving any attention,
I go a bit disillusioned to report further bugs, but if someone has a contact
with anyone from the inner circle of Perl developers, I'd be glad to
sort out the Perl issues that amavisd-new stumbled across in the past.

  Mark


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to