Likeless has asked for the wisdom of the Perl Monks concerning the following question:

On my development server, I have two Apaches, both with this setup:

Apache/1.3.41 (Unix) mod_perl/1.30 mod_ssl/2.8.31 OpenSSL/0.9.8g

Apache A is running a HTTPS virtualhost on port 443. Apache B is trying to connect to it using NET::SSLeay. The code looks like this:

my %fields = ( #Bunch of data goes here ); my $form_data = make_form(%fields); my ($page, $response, %reply_headers) = post_https($host, $port, $scr +ipt, $header, $form_data);

Apache B gets a segmentation fault whenever it hits the post_https.

Debugging tests and information:

  1. Taking down Apache A avoids any segmentation fault.
  2. However, when Apache A is up, the segmentation fault occurs and Apache A does not record anything in its access log.
  3. Running identical code to connect to Apache A in a command line script connects successfully and outputs the relevant data returned by Apache A.
  4. The same code runs on a production server without any problems (though not on a 100% identical Apache).

I'm not sure if this is an Apache or perl issue, but I'm hoping the wisdom here will be enough to cover both and help me figure what is stopping this post_https request and causing a segmentation fault.

Any ideas? Thanks in advance

Replies are listed 'Best First'.
Re: NET::SSLeay Segmentation Fault
by Illuminatus (Curate) on Apr 28, 2010 at 16:09 UTC
    I'm sure you have already checked the obvious facts that:
    • Apache B probably runs as a different user than when you run on the command line
    • Apache B has a different path/environment than when you run on the command line
    • Apache B runs from a different directory than when you run on the command line