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

Okay, this is driving me nuts because I have no clue. I am not sure this has as much to do with my code as it does with the perl environment.

I just installed several of the modules to help get https support so I could stop getting an error message about loading LWP::Protocol::HTTPS. However, now I am down another road. First off, CPAN installed the modules outside of @INC path which is strange. But, secondly and most importantly, it gives me a segmentation fault (plain and simple, no other message) when it tries to access Net::SSL.pm.

(I use the lib pragma because the modules it is looking for is outside my path and at this point it was just easier to do it that way until I can fix the seg fault.)

Any ideas what is causing the seg fault and how would I go about diagnoising it without delving into Net::SSL.pm?

use lib qw(/usr/local/lib/perl5/site_perl/5.6.1/ /usr/local/lib/perl5/ +site_perl/5.6.1/i686-linux); use LWP; use HTTP::Cookies; my $browser = LWP::UserAgent->new; my $cookie_locale = "cookies.lwp"; $browser->agent("Jonzilla/666"); $browser->cookie_jar( HTTP::Cookies->new( 'file' => $cookie_locale, 'autosave' => 1, )); &sign_in; sub sign_in { my $result; my $gb_num = 10; my $email = "xxxxxxx"; my $password = "xxxxxxxx"; my $url = "https://www.amazon.com/exec/obidos/flex-sign-in-done/10 +3-9886259-8125402"; my $response = $browser->post( $url, [ 'email' => "$email", 'action' => 'sign-in checked', 'next-page' => 'recs/instant-recs-register-secure.htm +l', 'password' => $password, ], ); my $request = new HTTP::Request 'GET' => $url; $result = $browser->request($request); if ($result->is_success) { print $result->as_string; } else { print "Error: " . $result->status_line . "\n"; } }


I admit it, I am Paco.

Replies are listed 'Best First'.
Re: Net::SSL seg fault
by fglock (Vicar) on Sep 27, 2002 at 19:09 UTC

    CPAN installed the modules outside of @INC

    Check if you have more than one perl installation.

    I've had problems with shared module binaries between perl installations.

    Check if
      which perl
    gives the same as what you have in the script
      #! line.

      That is messed up! Yes, they were different, but I changed the #! to the new path and I still get the segfault.


      I admit it, I am Paco.
        instead of changing the #! line of your script, try using the instance/version of perl allready in your #! line to install Net::SSL.
bug in libcrypt-ssleay-perl
by Mr. Muskrat (Canon) on Sep 27, 2002 at 19:19 UTC

    I don't know if this is related to your problem or not since you didn't mention what distro of linux you are running. Anyway, there is a bug in a Debian Sid package that affects ssl. bad depends on new version 0.29-3

      I am running RedHat. However, I wonder if all this @INC path mess has anything to do with it.

      The report did not really give an idea of how to correct it. Do you have any more details?


      I admit it, I am Paco.

        The bug is only in the libcrypt-ssleay-perl package version 0.29-3. It was compiled on a Debian Woody (Perl 5.6.1) system instead of Debian Sid (Perl 5.8.0). It has a bad dependency because of this.

        Since you are running Red Hat, I do not see how the two could be related. Unless you are doing some really funky package installs. ;)

Re: Net::SSL seg fault
by spartacus9 (Beadle) on Sep 27, 2002 at 22:38 UTC
    I encountered a similar problem some months ago. After searching google and other places for an answer someone suggested that perhaps my installation of OpenSSL and/or Net::SSL was compiled with a different version of GCC than Perl was compiled with. I had, in face, installed a new version of gcc recently so I removed all of the SSL stuff, downgraded gcc to the version with which I originally built Perl, then re-compiled OpenSSL and Net::SSL. After that, it worked perfectly.

    That said, it is also possible that something else was screwed up and the re-compile of the SSL software cleaned it up. Regardless, my problem was solved.
      This may be the case.

      I just upgraded to RH7.3, so my guess is that Perl was installed with the the version of GCC that came with that, and the installation today was with that version.

      Frankly, I found a way to do what I wanted without HTTPS so I may forego the GCC mess for now. But, if I get a chance I will try it and let you all know.


      I admit it, I am Paco.