OK, I'm writing some code to scan our machines for the silly windows 
"favicon.ico" file for IE bookmarking.

CONSISTENTLY, I can scan through many many thousand machines until I get to 
the request contained in the sample code below.

At that point I get

$perl foo2.pl
SET ALARM
ALARM!
perl in malloc(): warning: recursive call.
Out of memory!
perl in free(): warning: recursive call.
perl in free(): warning: recursive call.
perl in malloc(): warning: recursive call.
Out of memory!
perl in malloc(): warning: recursive call.
Out of memory!
perl in malloc(): warning: recursive call.
Out of memory!
perl in free(): warning: recursive call.
.... repeated several hundred times .....
perl in malloc(): warning: recursive call.
Out of memory!
$

Something seriously foobar is happening when LWP tries to handle the 
SIGALRM it looks like, and it seems to be consistently reproduceable on my 
machine.  LWP version is 5.47, IO 1.20.... anything else, just ask, and I 
shall document. :)

Spent a day trying to track down where *I* was going runaway, only to find 
it was in LWP. :(

D



----- code follows -----

#!/usr/local/bin/perl

require LWP;
require HTTP::Request;
require LWP::UserAgent;

$| = 1;

$url = 'https://store2.europe.yahoo.com/favicon.ico';
$hostname = 'store.europe.yahoo.com';
$AGENT_STR = "Mozilla/3.0 (Win98; I; Watchdog Script Browser Simulation)";

$request = HTTP::Request->new (GET => $url);
$request->push_header("Host",$hostname);

$SIG{'ALRM'} = sub { print "ALARM!\n"; die ("Timeout after 25 seconds"); };

my $ua = new LWP::UserAgent;

$ua -> use_eval(1);
$ua -> agent($AGENT_STR);

alarm(25);
print "SET ALARM\n";
$response = $ua->request($request);
print "GOT RESPONSE\n";
alarm(0);
print "DONE\n";


-----------------------------------------------------------------------
Derek Balling                                              408-530-5062
Technical Yahoo                                          Do You Yahoo!?

Reply via email to