On Fri, 2003-10-17 at 15:31, [EMAIL PROTECTED] wrote:
> Roderich,
>      I get the same error even after adding libz.so. The script I am
> converting is an interactive script. When I run it on the machine where I
> built it and interrupt it while it's runnig, I can see in the
> /tmp/par_priv....tmp/ directory all *.pm files including the libz.so. I read
> that the LD_LIBRARY_PATH will modified to include this temp directory. Any
> idea how I can debug this?

Raj, 
I dug a little deeper (using truss and the PAR source) and found
that explicitly packing libz.so won't help, because it is already
needed for unpacking the PAR (i.e. zip) archive that's included
in the executable. 

Actually, executing a PAR-packed exe works like this -
Autrijus correct me if I got this wrong:

(1) exe creates a temp directory
(2) exe writes to files into this temp directory:
    the shared perl library (e.g. libperl.so) and a small executable
    called par; these files get extracted from C char[] arrays inside
    the executable
(3) exec then sets LD_LIBRARY_PATH to the temp direcctory and execs par
    with one argument: the name of the executable
(4) par is actually a mini-perl (linked against libperl.so), that
    does some stuff in C, then eval's a Perl script contained in par
(5) this script extracts all modules that a required for PAR.pm to work
    from the executable; the script can't use any modules
(6) the extracted stuff is somewhere packed into the executable,
    but NOT in the included PAR; esp. this stuff is NOT zipped, as
    extracting it would require libz
(7) (5) should no have produced an environment (in the temp directory)
    so that PAR.pm can run, finally control is transferred to PAR.pm
    to extract and execute your original script that's contained
    in the PAR (i.e. zip) file that is the executable
(8) all modules/shared libs needed by the script are either extracted
    internally (for modules, by hooking into @INC) from the PAR, or
    are extracted upfronm into the temp directory (for shared libraries,
    because the are loaded by the system's shared library loader)

The problem is (5) above: PAR.pm uses Archive::Zip which uses
Compress::Zlib which has ashared library Zlib.so that links to
libz.so. Everything is there EXCEPT libz.so. If you explicitly
pack it, it would  be extracted in (8), but execution never gets there
because it bombs out in (7) because of the missing libz.

So for now, there's nothing you can do, PAR needs to be fixed.

Cheers, Roderich


Reply via email to