I've managed (with some help) to include a shared library for GD in my
PAR package, but when I run it more than once on AIX, I get:
IO error: Can't open file /tmp/par-root/
cache-880362d2eb1c66eb77f72ddaa4298178/libgd.a for write : Cannot open
or remove a file containing a running program.
Archive::Zip::Member::extractToFileNamed('Archive::Zip::ZipFileMember=HASH(0x3085e4d8)','/
tmp/par-root/cache-880362d2eb1c66eb77f72ddaa4298178/libgd.a') called
at -e line 635
eval {...} called at -e line 171
__par_pl::BEGIN() called at -e line 894
eval {...} called at -e line 894
This happens since the shared library is still loaded in memory by the
O/S when the PAR binary is run more than once, and thus cannot be
overwritten. On AIX, one can run "slibclean" to remove all unused/
unreferenced libraries and this indeed fixes the problem for me, but
is not acceptable as a permanent solution.
Is there a way in which I one can avoid the shared library from
getting extracted everytime when I run the PAR binary?
Or is there an "eval" I can somewhere use to suppress this "error"?
cheers
Niel
Sounds like a bug in PAR to me: the whole purpose of the
/tmp/par-USER/cache-SHA1/... files is to only extract stuff
on the very first run of a PAR packed executable. Later invocations
are not supposed to extract the stuff again when they see that
the cache directory already exists.
Cheers, Roderich
Mmm... there might be more than one problem here.
Not only does the shared library keep getting re-extracted, it also
seems as if the permissions of the included library is not preserved.
The "running program" error can be avoided if the library is used with
no permissions for others, since this has the effect of localising the
shared library to the executing user. (I'm not sure if this is specific
to AIX). So the copy I included had "0750" permissions but still ends up
in the cache with permissions based on the current user's umask.
By now I've also installed Archive::Unzip::Burst under AIX (wow was that
painful) in the hope it would handle things differently, but this does
not help - the shared library always seems to gets extracted using
Archive::Zip...
The error does however disappear if I set my umask to "027" when running
the packed binary for the first time or manually change the permission
of the library in the cache to 0750.
Should I log a bug?
cheers
Niel
Regards,
Niel
Niel Lambrechts wrote:
> Not only does the shared library keep getting re-extracted, it also
> seems as if the permissions of the included library is not preserved.
as Roderich said, this must be a bug.
[...]
> By now I've also installed Archive::Unzip::Burst under AIX (wow was that
> painful) in the hope it would handle things differently, but this does
> not help - the shared library always seems to gets extracted using
> Archive::Zip...
Yes, I guess. However, if you managed to install A::U::B on AIX, would
it be possible to patch it so it builds out of the box? It's really a
gross hack to speed up PAR binary startup -- the same goal that Scott
Stanton has, but with cruder methods.
Best regards,
Steffen