ERRNO stops mapping to error string

Troy Davis troydavis at gmail.com
Fri Mar 19 15:19:45 UTC 2010


After a little more investigation, it seems to me that after a long enough 
runtime, perl goes braindead and stops mapping the errno value to the 
appropriate error message string.

I'm CC'ing the perl package maintainers, however, I can't find any evidence 
anywhere that anyone else is having this problem, so it seems hard to 
believe this is a perl bug.  I also doubt it's a Net::Ident bug since it's 
that modules has been unchanged for over 10 years.  Nonetheless, I'm stuck.

This is found at line 171 of /usr/share/perl5/Net/Ident.pm:

       # connect it to the remote identd port, this can return EINPROGRESS.
       # for some reason, reading $! twice doesn't work as it should
       connect($self->{fh}, $identbind) or ($e=$!) =~ /in progress/ or
         die "= connect failed: $e\n";

$! is being used in string context, so $e should be the plaintext error 
message.  The case of "Operation now in progress" is not a fatal error; 
everything else is.

I commented that out and replaced it with this:

        my $fail = 0;
        connect($self->{fh}, $identbind) or $fail = 1;
        $e = $!;

        print STDDBG "FOO e = $e\n";

        if ($fail and $e !~ /in progress/) {
            print STDDBG "FOO Fail! e = $e\n";
            die "= connect failed: $e\n";
        }

For a while, you see the expected:

tiferet:/tmp $> grep FOO spamd-debug.txt
FOO e = Operation now in progress
FOO e = Operation now in progress
FOO e = Operation now in progress
FOO e = Operation now in progress
FOO e = Operation now in progress
...

Then the problem starts and you see this:

FOO e = 115
FOO Fail! e = 115
FOO e = 115
FOO Fail! e = 115
FOO e = 115
FOO Fail! e = 115

-- 
Troy




More information about the Perl-maintainers mailing list