Perlbal crash (1.39 and 1.41)

dormando dormando at rydia.net
Wed Mar 1 05:11:50 UTC 2006


Hey,

After throwing a huge number of queries at perlbal which are all doing 
reproxies, my perlbal processes started crashing almost immediately, 
over and over.

I fired it back up in a wrapper that printed the warnings/errors to a 
log, and saw this a few dozen times:

Undef client_ip (Perlbal::ClientProxy=ARRAY(0x9479bbc)) in 
assign_client. Closing. at /usr/share/perl5/Perlbal/BackendHTTP.pm line 179.

Then this:

Argument "" isn't numeric in subroutine entry at 
/usr/lib/perl/5.8/Socket.pm line 201.
Use of uninitialized value in subroutine entry at 
/usr/lib/perl/5.8/Socket.pm line 201.
crash log: Bad arg length for Socket::pack_sockaddr_in, length is 0, 
should be 4 at /usr/lib/perl/5.8/Socket.pm line 201.
ending run

The problem looks to be line 73 (in v1.39) in BackendHTTP.pm.

I have no idea how it's getting to this point with having an empty 
string for $ip. It never happened, or very rarely, before I enabled and 
used reproxying.

I did an eval hack around this line which has stabilized the problem. I 
didn't want to just check if defined($ip) && $ip just in case bad values 
were also being passed, and I really needed them to be stable that day.

--- BackendHTTP.pm.1.39 2006-02-28 20:55:13.634135000 -0800
+++ BackendHTTP.pm      2006-02-28 20:52:59.805445000 -0800
@@ -70,7 +70,14 @@
      }

      IO::Handle::blocking($sock, 0);
-    connect $sock, Socket::sockaddr_in($port, Socket::inet_aton($ip));
+
+    # Sometimes this dies. Unsure of the circumstances.
+    eval {
+        connect $sock, Socket::sockaddr_in($port, Socket::inet_aton($ip));
+    };
+    if ($@) { warn "Socket connect failed (probably due to sockaddr_in) 
$@";
+        return undef;
+    }

      my $self = fields::new($class);
      $self->SUPER::new($sock);

Sorry I don't have anything more insightful on the bug.
-Dormando


More information about the perlbal mailing list