Subject: | Problem when one PAR-packed executable calls another |
Perl: v5.6.1 built for MSWin32-x86-multi-thread
Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com
OS: WindowsXP
Executing (directly or indirectly) one PAR-packed executable from another
doesn't work. Example:
H:\test>type hello.pl
use FindBin;
print STDERR "hello\n";
system("${FindBin::Bin}/goodbye");
H:\test>type goodbye.pl
print STDERR "good bye\n";
H:\test>pp -o hello.exe hello.pl
H:\test>pp -o goodbye.exe goodbye.pl
H:\test>hello
hello
H:/test/goodbye:
creation of C:\DOCUME~1\qx06959\LOCALS~1\Temp\par_priv.1372.tmp\perl56.dll failed - aborting with 13.
The problem is most likely one of the environment variables PAR_...
that gets set (and propagated to descendants) by hello.exe:
goodbye.exe tries to reuse the parent's PAR_TEMP and can't
unpack its copy of perl56.dll there (because it is still
in use by hello.exe).
This behaviour is probably not specific to Windows, but you won't see an
error on, say, Solaris, because Solaris will happily overwrite a shared
library while it is in use (but with probably desastrous results).
Descendant programs should see a "clean" environment, i.e. no
PAR_... stuff and also the "original" values of LD_LIBRARY_PATH etc.
Cheers, Roderich