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

Hi Monks -- Actually I am getting a segmentation fault after sending a request to a web page using LWP::UserAgent. By the way it does not matter which web page (internal or external). I have been using the same code on Linux and Windows (Win32) platforms for quite some time without any problems. It seems not to be a hardware problem, at least RAM and hard disk have been tested OK. But I cannot rule out an environmental problem (Windows update or other software recently installed). I uninstalled Activestate Perl which I originally used and replaced it by its newest version (5.10) with no positive effect. I unistalled Activestate Perl again and installed Strawberry Perl (5.10). Perl itself works fine but I am unable to install any module from CPAN using Strawberry's CPAN shell because LWP is being used there. Has anyone an idea where to look next or (even better) where the problem could come from? Regards TheloniusM
  • Comment on Segmentation Fault when using LWP::UserAgent

Replies are listed 'Best First'.
Re: Segmentation Fault when using LWP::UserAgent
by BrowserUk (Patriarch) on May 28, 2010 at 16:56 UTC
    I am getting a segmentation fault

    There is usually more information available than just "segmentation fault"?

      Yes, certainly. I am sorry for not giving enough information.

      In case the fault happens while executing regularly (not debugging) Windows opens a pop up window showing the content of the memory and the question whether an error message should be sent to Microsoft.

      During debugging the following message is given

      Signal SEGV at C:\strawberry\perl\vendor\lib/LWP/UserAgent.pm line 178 eval {...} called at C:\strawberry\perl\vendor\lib/LWP/UserAge +nt.pm line 177 LWP::UserAgent::send_request('LWP::UserAgent=HASH(0xc704d4)', +'HTTP::Req uest=HASH(0x121ac6c)', undef, undef) called at C:\strawberry\perl\vend +or\lib/LWP /UserAgent.pm line 253 LWP::UserAgent::simple_request('LWP::UserAgent=HASH(0xc704d4)' +, 'HTTP::R equest=HASH(0x121ac6c)', undef, undef) called at C:\strawberry\perl\ve +ndor\lib/L WP/UserAgent.pm line 261 LWP::UserAgent::request('LWP::UserAgent=HASH(0xc704d4)', 'HTTP +::Request= HASH(0x121ac6c)') called at C:\strawberry\perl\vendor\lib/LWP/UserAgen +t.pm line 389 LWP::UserAgent::get('LWP::UserAgent=HASH(0xc704d4)', 'http://m +y_server/apache2-default/') called at check_lwp.pl line 9

      Thank you for your help, BrowserUk.
        Windows opens a pop up window showing the content of the memory

        It's been a while since I've seen one, so I don't remember the exact wording or options available, but doesn't it tell which dll or executable actually segfaulted? Also, isn't there an option to have it display the report that would be sent to MS, containing a stack trace and other information?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Segmentation Fault when using LWP::UserAgent
by Anonymous Monk on May 28, 2010 at 20:28 UTC