Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 53463
Status: resolved
Priority: 0/
Queue: PAR-Packer

People
Owner: Nobody in particular
Requestors: chenshenyou [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: PAR::Packer 1.002 on HPUX 11.23 PA-RISC issue
Date: Thu, 7 Jan 2010 14:36:34 +0800
To: bug-PAR-Packer [...] rt.cpan.org
From: chen shenyou <chenshenyou [...] gmail.com>
Download (untitled) / with headers
text/plain 5.8k
on pa-risc hpux, the pp compiled binary is not a perl independent executable. the pp installation is successful(with cpan), the detail test steps: # cat test.pl print "hello world\n"; # pp -o test test.pl # ls -l test -rwxr-xr-x 1 root sys 3638157 Jan 6 23:10 test # ./test hello world # mv /opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/libperl.sl/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/libperl.sl.backup # ./test /usr/lib/dld.sl: Can't open shared library: /opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/libperl.sl /usr/lib/dld.sl: No such file or directory Abort(coredump) The problem is the binary looks for the hard-coded path of libperl.sl. Here is the detail env info: --- # uname -a HP-UX xxxx B.11.23 U 9000/800 1045550765 unlimited-user license # swlist | grep -i perl perl D.5.8.8.B 5.8.8 Perl Programming Language # perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=hpux, osvers=11.00, archname=PA-RISC1.1-thread-multi uname='hp-ux bertha b.11.00 u 9000800 136901587 unlimited-user license ' config_args='-ders -Dcc=cc -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Dsh=/usr/bin/sh -Dd_attribut=undef -Dd_attribute_warn_unused_result=undef -Dd_u32align=define -Aprepend:libswanted=cl -Dvendorprefix=/opt/perl_32 -Darchname=PA-RISC1.1 -Doptimize=-fast +Onolimit +Opromote_indirect_calls +DAportable +DS2.0 -Accflags=+Z -Accflags=-DUSE_SITECUSTOMIZE -Duselargefiles -Accflags=-DNO_HASH_SEED -Dprefix=/opt/perl_32 -Dinc_version_list=5.8.7/$archname 5.8.7 5.8.6/$archname 5.8.6 5.8.4/$archname 5.8.4 5.8.3/$archname 5.8.3 5.8.2/$archname 5.8.2 5.8.1/$archname 5.8.1 5.8.0/$archname 5.8.0 -Dsed=/usr/bin/sed -Dconfig_heavy=Config_static.pl -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags =' -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ', optimize='-fast +Onolimit +Opromote_indirect_calls +DAportable +DS2.0', cppflags='-Aa -D__STDC_EXT__ -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED' ccversion='B.11.X.32509-32512.GP', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='/usr/bin/ld', ldflags ='' libpth=/lib /usr/lib /usr/ccs/lib /usr/local/lib libs=-lcl -lcres -lnsl -lnm -lndbm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc perllibs=-lcl -lcres -lnsl -lnm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+Z', lddlflags='-b +vnocompatwarnings' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 817.1 [268662] Iin_load_module moved for compatibility with build 806 POSIX: Support the long hostname version of uname() Avoid signal flag SA_RESTART for older versions of HP-UX PerlEx support in CGI::Carp Less verbose ExtUtils::Install and Pod::Find Patch for CAN-2005-0448 from Debian with modifications Partly reverted 24733 to preserve binary compatibility 28671 Define PERL_NO_DEV_RANDOM on Windows 28376 Add error checks after execing PL_cshname or PL_sh_path 28305 Pod::Html should not convert "foo" into ``foo'' 27736 Make perl_fini() run with Sun WorkShop compiler 27619 Bug in Term::ReadKey being triggered by a bug in Term::ReadLine 27549 Move DynaLoader.o into libperl.so 27528 win32_pclose() error exit doesn't unlock mutex 27527 win32_async_check() can loop indefinitely 27515 ignore directories when searching @INC 27359 Fix -d:Foo=bar syntax 27210 Fix quote typo in c2ph 27203 Allow compiling swigged C++ code 27200 Make stat() on Windows handle trailing slashes correctly 27194 Get perl_fini() running on HP-UX again 27133 Initialise lastparen in the regexp structure 27034 Avoid "Prototype mismatch" warnings with autouse 26970 Make Passive mode the default for Net::FTP 26921 Avoid getprotobyname/number calls in IO::Socket::INET 26897,26903 Make common IPPROTO_* constants always available 26670 Make '-s' on the shebang line parse -foo=bar switches 26379 Fix alarm() for Windows 2003 26087 Storable 0.1 compatibility 25861 IO::File performace issue 25084 long groups entry could cause memory exhaustion 24699 ICMP_UNREACHABLE handling in Net::Ping Built under hpux Compiled at Sep 19 2006 13:51:08 @INC: /opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi /opt/perl_32/lib/5.8.8 /opt/perl_32/lib/site_perl/5.8.8/PA-RISC1.1-thread-multi /opt/perl_32/lib/site_perl/5.8.8 /opt/perl_32/lib/site_perl /opt/perl_32/lib/vendor_perl/5.8.8/PA-RISC1.1-thread-multi /opt/perl_32/lib/vendor_perl/5.8.8 /opt/perl_32/lib/vendor_perl
On Thu Jan 07 01:37:04 2010, chenshenyou@gmail.com wrote:
Show quoted text
> on pa-risc hpux, the pp compiled binary is not a perl independent
> executable.

Yeah, looks like the full path to the Perl shared library has been "burnt"
in the prototypical packed executable. Can you post the full build
log (i.e. unpack the tarball and then the output of "perl Makefile.PL, make")?
Then maybe someone - not me :) - with a better understanding
of how (old style, i.e. non-ELF) linking works on HPUX can spot
why this happens.

Cheers, Roderich


From: chenshenyou [...] gmail.com
Download (untitled) / with headers
text/plain 12.9k

Message body is not shown because it is too large.

From: chenshenyou [...] gmail.com
Download (untitled) / with headers
text/plain 6.1k
the full build log<br /> <br /> # cd PAR-Packer-1.002/<br /> # perl Makefile.PL<br /> Checking if your kit is complete...<br /> Looks good<br /> Writing Makefile for the par program<br /> Writing Makefile for PAR::Packer<br /> # make<br /> cp lib/PAR/Packer.pm blib/lib/PAR/Packer.pm<br /> cp lib/PAR/Filter/PodStrip.pm blib/lib/PAR/Filter/PodStrip.pm<br /> cp lib/PAR/Filter/Obfuscate.pm blib/lib/PAR/Filter/Obfuscate.pm<br /> cp lib/PAR/StrippedPARL/Base.pm blib/lib/PAR/StrippedPARL/Base.pm<br /> cp lib/App/Packer/PAR.pm blib/lib/App/Packer/PAR.pm<br /> cp lib/PAR/Filter.pm blib/lib/PAR/Filter.pm<br /> cp lib/PAR/Filter/PatchContent.pm blib/lib/PAR/Filter/PatchContent.pm<br /> cp lib/PAR/StrippedPARL/Dynamic.pm blib/lib/PAR/StrippedPARL/Dynamic.pm<br /> cp lib/PAR/Filter/Bytecode.pm blib/lib/PAR/Filter/Bytecode.pm<br /> cp lib/pp.pm blib/lib/pp.pm<br /> cp lib/PAR/Filter/Bleach.pm blib/lib/PAR/Filter/Bleach.pm<br /> cp lib/PAR/StrippedPARL/Static.pm blib/lib/PAR/StrippedPARL/Static.pm<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl sha1.c.PL sha1.c<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc -c -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64&nbsp;&nbsp; -I/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE&nbsp; -DPARL_EXE=\&quot;parl\&quot; -fast +Onolimit +Opromote_indirect_calls +DAportable +DS2.0 sha1.c<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl ./file2c.pl /opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/libperl.sl my_perl.c load_me_0 0 30000<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc -c -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64&nbsp;&nbsp; -I/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE&nbsp; -DPARL_EXE=\&quot;parl\&quot; -fast +Onolimit +Opromote_indirect_calls +DAportable +DS2.0 main.c<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl ./file2c.pl ../script/par.pl my_par_pl.c load_me_2 0<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc -c -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64&nbsp;&nbsp; -I/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE&nbsp; -DPARL_EXE=\&quot;parl\&quot; -fast +Onolimit +Opromote_indirect_calls +DAportable +DS2.0 my_par_pl.c<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc main.o my_par_pl.o&nbsp; -Wl,-E -Wl,-B,deferred&nbsp;&nbsp;&nbsp; -L/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE -lperl -lcl -lcres -lnsl -lnm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc -o ./par<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl -e1<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl ./file2c.pl ./par my_par.c load_me_1 0 30000<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc -c -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64&nbsp;&nbsp; -I/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE&nbsp; -DPARL_EXE=\&quot;parl\&quot; -fast +Onolimit +Opromote_indirect_calls +DAportable +DS2.0 static.c<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cc static.o -Wl,-E -Wl,-B,deferred&nbsp;&nbsp;&nbsp; -L/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE -lcl -lcres -lnsl -lnm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc&nbsp; -o ./static<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl -e1<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl parlsig.pl ./static ./par 1 30000<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl run_with_inc.pl ./static -I../myldr/.. -I../blib/lib -q -B -O../script/parl<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl run_with_inc.pl ./par -I./myldr/.. -I../blib/lib -q -B -O../script/parldyn<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl -e &quot;chmod(oct('0600'), '../blib/lib/PAR/StrippedPARL/Static.pm');&quot;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl encode_append.pl ./static ../blib/lib/PAR/StrippedPARL/Static.pm<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl -e &quot;chmod(oct('0444'), '../blib/lib/PAR/StrippedPARL/Static.pm');&quot;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl -e &quot;chmod(oct('0600'), '../blib/lib/PAR/StrippedPARL/Dynamic.pm');&quot;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl encode_append.pl ./par ../blib/lib/PAR/StrippedPARL/Dynamic.pm<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perl -e &quot;chmod(oct('0444'), '../blib/lib/PAR/StrippedPARL/Dynamic.pm');&quot;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp script/parl blib/script/parl<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/bin/perl &quot;-Iinc&quot; -MExtUtils::MY -e 'MY-&gt;fixin(shift)' -- blib/script/parl<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp script/tkpp blib/script/tkpp<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/bin/perl &quot;-Iinc&quot; -MExtUtils::MY -e 'MY-&gt;fixin(shift)' -- blib/script/tkpp<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp script/pp blib/script/pp<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/bin/perl &quot;-Iinc&quot; -MExtUtils::MY -e 'MY-&gt;fixin(shift)' -- blib/script/pp<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cp script/par.pl blib/script/par.pl<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/bin/perl &quot;-Iinc&quot; -MExtUtils::MY -e 'MY-&gt;fixin(shift)' -- blib/script/par.pl<br /> Manifying blib/man1/tkpp.1<br /> Manifying blib/man1/parl.1<br /> Manifying blib/man1/pp.1<br /> Manifying blib/man1/par.pl.1<br /> Manifying blib/man3/App::Packer::PAR.3<br /> Manifying blib/man3/PAR::StrippedPARL::Base.3<br /> Manifying blib/man3/PAR::Filter::Obfuscate.3<br /> Manifying blib/man3/PAR::Filter::PodStrip.3<br /> Manifying blib/man3/PAR::Packer.3<br /> Manifying blib/man3/PAR::Filter.3<br /> Manifying blib/man3/PAR::StrippedPARL::Dynamic.3<br /> Manifying blib/man3/PAR::Filter::PatchContent.3<br /> Manifying blib/man3/PAR::Filter::Bytecode.3<br /> Manifying blib/man3/pp.3<br /> Manifying blib/man3/PAR::Filter::Bleach.3<br /> Manifying blib/man3/PAR::StrippedPARL::Static.3<br /> <br /> <br />
From: lgtaube [...] gmail.com
Download (untitled) / with headers
text/plain 939b
On Thu Jan 07 03:45:56 2010, RSCHUPP wrote: Show quoted text
> Then maybe someone - not me :) - with a better understanding > of how (old style, i.e. non-ELF) linking works on HPUX can spot > why this happens.
While I make no claim about understanding how linking on HP-UX works, I think I know the why the situation occurs (and how to make it work). The problem (and its solution) is two-fold: 1. HP-UX has *two* environment variables for runtime linking, LD_LIBRARY_PATH and SHLIB_PATH. Step one is to add SHLIB_PATH to the list of variables in myldr/mktempdir.c 2. HP-UX binaries are not (by default, AFAIK) configured to actually care if the environment variables in question have values, or not. Step two in the solution is to explicitly enable this functionality by calling "chatr +s enable <BINARY>" in myldr/static.c I have tried and verified this on HP-UX 11.11 PA-RISC with PA-Packer 1.008. A patch is attached. --lgt
Subject: par-packer-hpux.patch
*** mktmpdir.c.OLD Wed Mar 16 21:13:17 2011 --- mktmpdir.c Wed Mar 16 21:13:37 2011 *************** *** 33,41 **** { const char *key = NULL , *val = NULL; int i; ! const char *ld_path_keys[6] = { "LD_LIBRARY_PATH", "LIBPATH", "LIBRARY_PATH", ! "PATH", "DYLD_LIBRARY_PATH", "" }; char *ld_path_env = NULL; for ( i = 0 ; strlen(key = ld_path_keys[i]) > 0 ; i++ ) { --- 33,41 ---- { const char *key = NULL , *val = NULL; int i; ! const char *ld_path_keys[7] = { "LD_LIBRARY_PATH", "LIBPATH", "LIBRARY_PATH", ! "PATH", "DYLD_LIBRARY_PATH", "SHLIB_PATH", "" }; char *ld_path_env = NULL; for ( i = 0 ; strlen(key = ld_path_keys[i]) > 0 ; i++ ) { *** static.c.OLD Wed Mar 16 22:53:47 2011 --- static.c Thu Mar 17 09:17:51 2011 *************** *** 41,46 **** --- 41,49 ---- char *my_file; char *my_perl; char buf[20]; /* must be large enough to hold "PAR_ARGV_###" */ + #ifdef __hpux + char chatrcmd[255]; + #endif #ifdef WIN32 typedef BOOL (WINAPI *pALLOW)(DWORD); HINSTANCE hinstLib; *************** *** 69,74 **** --- 72,82 ---- WRITE_load_my_par(i); close(i); chmod(my_perl, 0755); } + + #ifdef __hpux + (void)snprintf(chatrcmd, 40+strlen(my_perl), "/usr/bin/chatr +s enable %s > /dev/null",my_perl,0); + (void)system(chatrcmd); + #endif /* extract libperl DLL into stmpdir */ i = my_mkfile( argv[0], stmpdir, name_load_my_libperl, size_load_my_libperl, &my_file );
Download (untitled) / with headers
text/plain 643b
On 2011-03-21 05:44:09, lgtaube wrote: Show quoted text
> While I make no claim about understanding how linking on HP-UX works, > I think I know the why the situation occurs (and how to make it work).
Thanks for the patch, applied after minor edits. You can find it in the Subversion repository at http://svn.openfoundry.org/par/PAR-Packer/trunk Unrelated to this bug: I have recently rewritten myldr/Makefile.PL a bit (and renamed static.c to boot.c), but this has not been tested outside of Linux and Windows. Maybe you could give it a try? That would be very helpful since CPAN Testers doesn't seem have any HPUX testers at present. Cheers, Roderich
Fixed in PAR::Packer 1.010 (actually 1.009, forgot to close this bug)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.