Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

PAR compilation of custom perl script fails during run

by winksmith (Initiate)
on Jan 28, 2014 at 02:22 UTC ( [id://1072309]=perlquestion: print w/replies, xml ) Need Help??

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

I have a perl script 4500 line script that i want to compile into a single executable on ubuntu 12.04 system. this will allow it to be run in a configured environment quite easily (e.g. the correct modules are loaded, etc.).

the compilation completes without error, but when i go to run the resulting executable it runs for a while, but as soon as it gets to doing its SOAP HTTPS calls it fails as follows:

ATest::SOAP::connect: read failed: at Net/HTTP/Methods.pm line 256 at Net/SSL.pm line 210 Net::SSL::die_with_error('LWP::Protocol::https::Socket=GLOB(0x +5928c48)', 'read failed') called at Net/SSL.pm line 223 Net::SSL::read('LWP::Protocol::https::Socket=GLOB(0x5928c48)', + '', 1024, 0) called at Net/HTTP/Methods.pm line 256 Net::HTTP::Methods::my_readline('LWP::Protocol::https::Socket= +GLOB(0x5928c48)', 'Status') called at Net/HTTP/Methods.pm line 343 Net::HTTP::Methods::read_response_headers('LWP::Protocol::http +s::Socket=GLOB(0x5928c48)', 'laxed', 1, 'junk_out', 'ARRAY(0x56e31d8) +') called at LWP/Protocol/http.pm line 378 LWP::Protocol::http::request('LWP::Protocol::https=HASH(0x58d0 +c60)', 'HTTP::Request=HASH(0x58b4d20)', undef, undef, undef, 180) cal +led at LWP/UserAgent.pm line 192 eval {...} called at LWP/UserAgent.pm line 191 LWP::UserAgent::send_request('LWP::UserAgent=HASH(0x58ab2d8)', + 'HTTP::Request=HASH(0x58b4d20)', undef, undef) called at LWP/UserAge +nt.pm line 274 LWP::UserAgent::simple_request('LWP::UserAgent=HASH(0x58ab2d8) +', 'HTTP::Request=HASH(0x58b4d20)', undef, undef) called at LWP/UserA +gent.pm line 282 LWP::UserAgent::request('LWP::UserAgent=HASH(0x58ab2d8)', 'HTT +P::Request=HASH(0x58b4d20)') called at /home/ENDACE/mark.smith/atest/ +lib/perl/ATest/SOAP.pm line 6077 ATest::SOAP::SoapCall('LWP::UserAgent=HASH(0x58ab2d8)', 'https +://nzhmlamp-7-03/services/fwif', 'VersionQuery', '<soapenv:Envelope x +mlns:soapenv="http://schemas.xmlsoap.org/s...') called at /home/ENDAC +E/mark.smith/atest/lib/perl/ATest/SOAP.pm line 6030 ATest::SOAP::VersionQuery('ATest::SOAP=HASH(0x572d2d8)') calle +d at /home/ENDACE/mark.smith/atest/lib/perl/ATest/SOAP.pm line 235 ATest::SOAP::connect('ATest::SOAP=HASH(0x572d2d8)') called at +/home/ENDACE/mark.smith/atest/lib/perl/ATest/SOAP/Do.pm line 115 ATest::SOAP::Do::connect('ATest::SOAP::Do=HASH(0x5728048)') ca +lled at script/vis_run.pl line 4325 require main called at /usr/share/perl5/PAR.pm line 636 PAR::_run_member('Archive::Zip::ZipFileMember=HASH(0x35b2c88)' +, 1) called at script/main.pl line 26 require main called at /usr/share/perl5/PAR.pm line 636 PAR::_run_member('Archive::Zip::ZipFileMember=HASH(0x35b29d0)' +) called at /usr/share/perl5/PAR.pm line 428 PAR::import('PAR') called at -e line 953 eval {...} called at -e line 209 __par_pl::BEGIN() called at script/vis_run.pl line 0 eval {...} called at script/vis_run.pl line 0 soap at script/vis_run.pl line 4325.

I've tried various --module and --link flags, but no luck. i focused around the Crypt::SSLeay, LWP, Net:HTTP, Net::SSL, libssl.so.0.9.8 objects.

My google-foo has let me down this time. Anyone seen this before and/or can give some guidance as to how to make this work?

Replies are listed 'Best First'.
Re: PAR compilation of custom perl script fails during run (-x)
by Anonymous Monk on Jan 28, 2014 at 02:51 UTC

    the compilation completes without error

    Did you use -x option?

    I've tried various --module and --link flags, but no luck

    How about increasing debugging level? Because "read failed" doesn't say why it failed -- the why is the important part

      i didn't see any debugging level specifiable on 'pp'. i had -c, but not -x. when you mentioned it, i tried, but there was no difference. it seemed like a lot of detailed output and related to SSL and/or dynamic loading in LWP. I found a reasonable solution after reading the next reply. see below.

        i didn't see any debugging level specifiable on 'pp

        So you think Test::SOAP::connect: read failed is an error message that comes from pp?

        See PAR::Environment for debugging PAR

        but not -x. when you mentioned it, i tried, but there was no difference. it seemed like a lot of detailed output and related to SSL and/or dynamic loading in LWP. I found a reasonable solution after reading the next reply. see below.

        When you used -x did your program attempt to load a https website?

        Thats the thing with on-demand plugins, unless you demand them, they're not loaded :)

Re: PAR compilation of custom perl script fails during run
by jellisii2 (Hermit) on Jan 28, 2014 at 14:41 UTC
      that was a helpful post. though it didn't exactly hit the spot it suggested setting debug99 for IO::Socket::SSL. once i did this, all errors went away! my next step was to remove the debug flag and magically everything was fine. so, my top level .pl script, even though it doesn't use IO::Socket::SSL directly, benefits from calling it at the top level. i've simplified my pp line quite a bit and everything seems much better. thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1072309]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-16 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found