Here is a simple perl program using LWP::UserAgent and threads, that succeeds with http, but segfaults with https. Tried on RH9 and Fedora FC2, both with up to date patches. Can anyone tell me what's happening here?
Try running this code as
perl program.pl 'http://www.yahoo.com'
and it reports success. But, if you run
perl program.pl 'https://www.yahoo.com'
we get a segfault.
Here's the smallest program we could make that shows this problem. Thanks in advance...
use strict;
use threads;
use LWP;
my $uri;
if (@ARGV > 0) {
$uri = shift;
}
my $ua = LWP::UserAgent->new() or die "Can't create ua\n";
if (defined $uri) {
print "uri: $uri\n";
my $r = $ua->get($uri);
if (not $r->is_success()) {
print "GET error on <$uri>...\n" . $r->error_as_HTML() . "\n";
exit(1);
}
}
my $t = threads->new(\&threadedRequestThread)
or die "Can't create thread\n";
print "Joining thread\n";
my @ret = $t->join();
print "Thread returned (@ret)\n";
exit(0);
# Actual Thread function
sub threadedRequestThread {
print "Inside threadedRequestThread\n";
return "A list of words";
}