in reply to Segmentation fault using LWP and threads

You don't tell us which SSL library you are using, but did you make sure that it is threadsafe and compiled for threading ?

As LWP dynamically loads stuff, you could maybe test the following program to further narrow it down:

use strict; use Net::SSLeay; # or whatever other SSL implementation you use use threads; 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"; }

or, failing that program, you might need to call some routines in Net::SSLeay to initialize it.

Replies are listed 'Best First'.
Re^2: Segmentation fault using LWP and threads
by Ray Smith (Beadle) on Nov 12, 2004 at 21:38 UTC
    Our problem seams to appear when we are using all three: LWP, HTTPS, and threads. I tried using Net::SSLeay that you use - still segmentation fault. Note that we run under "perl -d" we don't get the segmentation fault but rather the join never returns. In a larger case which also gives a segmentation fault, we get "Bad signature in parser state object at 88de850 during global destruction." when we try to join the completed thread. We are using perl v5.8.0 built for i386-linux-thread-multi I thank you for your help so far. Ray Smith @ raysmith@alum.mit.edu
Re^2: Segmentation fault using LWP and threads
by MarkSWarren (Initiate) on Nov 12, 2004 at 22:45 UTC
    On the FC2 system, we have:

    Perl 5.8.3
    Net::SSLeay 1.25
    openssl-0.9.7a-35

    Also, I ran code you suggested (explicitly use Net::SSLeay, and them I did a call to get_https('www.yahoo.com', 443, '/') just to make sure SSL was fully initialized). This ran fine, no errors. So we're still stuck.