Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strawberry perl : Can't locate loadable object for module IO

670 views
Skip to first unread message

nikos

unread,
Jun 14, 2011, 3:23:51 AM6/14/11
to p...@perl.org
Hi
building an executable with Strawberry Perl is successful but when
actually running the exe (after we have renamed the c:/strawberry to
c:/strawberryX so it cannot find the dependencies from the path),
fails with the following errors :

" Can't locate loadable object for module IO in @INC (@INC contains:
CODE(0xa1d31c
) C:\strawberry\perl\vendor\lib .) at C:/strawberry/perl/site/lib/PAR/
Heavy.pm l
ine 103
Compilation failed in require at C:/strawberry/perl/lib/IO/Handle.pm
line 266.
BEGIN failed--compilation aborted at C:/strawberry/perl/lib/IO/
Handle.pm line 26
6.
Compilation failed in require at C:/strawberry/perl/lib/IO/Seekable.pm
line 101.
BEGIN failed--compilation aborted at C:/strawberry/perl/lib/IO/
Seekable.pm line
101.
Compilation failed in require at C:/strawberry/perl/lib/IO/File.pm
line 133.
BEGIN failed--compilation aborted at C:/strawberry/perl/lib/IO/File.pm
line 133.
Compilation failed in require at -e line 351. "

I am on WinXP SP3 ,PAR 1.002,PAR::Packer 1.009, and have tried
Strawberry Perl versions 5.12.3.0,5.10.1.5,5.10.1.1 and the problem
persists in all of them

perl -V reveals something strange with the backslashes:

%ENV:
PERL_JSON_BACKEND="JSON::XS"
PERL_YAML_BACKEND="YAML"
@INC:
C:/strawberry/perl/lib
C:/strawberry/perl/site/lib
C:\strawberry\perl\vendor\lib
.

"C:\strawberry\perl\vendor\lib" is not consistent with the other
entries

I've found id 52794 (https://rt.cpan.org/Public/Bug/Display.html?
id=52794) which is related to the issue although it refers to version
PAR::Packer 1.001;nevertheless I got the
"if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }" from the patch
and added it to par.pl.
I also corrected Strawberry's @INC by prepending the path "C:/
strawberry/perl/vendor/lib" by setting the PERL5LIB env variable,
rebuilt it and everything works fine;even tried it on machines that
have no Perl installation whatsoever

It looks like Strawberry has the path messed up and needs the correct
one. Furthemore
"if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }" satisfies
Heavy.pm

Any hints?
thanks


Roderich Schupp

unread,
Jun 15, 2011, 4:36:40 AM6/15/11
to nikos, p...@perl.org
On Tue, Jun 14, 2011 at 9:23 AM, nikos <niko...@gmail.com> wrote:
> building an executable with Strawberry Perl is successful but when
> actually running the exe (after we have renamed the c:/strawberry to
> c:/strawberryX so it cannot find the dependencies from the path),
> fails with the following errors :
>
> " Can't locate loadable object for module IO in @INC
> ...

> perl -V reveals something strange with the backslashes:
>
> %ENV:
>   PERL_JSON_BACKEND="JSON::XS"
>   PERL_YAML_BACKEND="YAML"
>  @INC:
>   C:/strawberry/perl/lib
>   C:/strawberry/perl/site/lib
>   C:\strawberry\perl\vendor\lib

That is indeed a bit strange, but has been there for quite some time
without causing any problems for PAR::Packer.

> I've found id 52794 (https://rt.cpan.org/Public/Bug/Display.html?
> id=52794) which is related to the issue although it refers to version
> PAR::Packer 1.001;nevertheless I got the
> "if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }"  from the patch

You read it wrong: this line _was_ the problem and got thrown out.
Also it could only affect the C:\strawberry\perl\vendor\lib item in @INC
and IO.dll (that's what the "loadable object" in the error message is)
is almost certainly not located under that path.

But the @INC given in the error message is totally wrong:
a packed executable's @INC should only contains paths into the the (per-user)
cache area and some subroutine refs. Can you please try the following

pp -o show_inc.exe -e "print qq[INC = \@INC\n]"
.\show_inc.exe

and post the output. Also: did you build PAR::Packer yourself?

Cheers, Roderich

nikos

unread,
Jun 15, 2011, 5:17:42 AM6/15/11
to p...@perl.org
Hi

>You read it wrong: this line _was_ the problem and got thrown out.

I am sorry I did not clarify it.When I filed it at rt,
https://rt.cpan.org/Public/Bug/Display.html?id=68817, I described it
better by saying :

"Nevertheless I got the following line :


if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }

from the patch "proper-fix.patch" (the patch actually REMOVES this
line)
and added it to par.pl after line 540."


>Can you please try the following
>pp -o show_inc.exe -e "print qq[INC = \@INC\n]"
>.\show_inc.exe

It just displays :
INC = @INC


>did you build PAR::Packer yourself?

yes got it from CPAN and built it with strawberrys gcc and its dmake
also I must note that I've tried the same with Activestate and had no
problem at all. It built and executed correctly

Nikos

unread,
Jun 15, 2011, 5:15:45 AM6/15/11
to Roderich Schupp, p...@perl.org
Hi

>You read it wrong: this line _was_ the problem and got thrown out.
I am sorry I did not clarify it.When I filed it at rt,
https://rt.cpan.org/Public/Bug/Display.html?id=68817, I described it better
by saying :

"Nevertheless I got the following line :

if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }

from the patch "proper-fix.patch" (the patch actually REMOVES this line)


and added it to par.pl after line 540."

>Can you please try the following


>pp -o show_inc.exe -e "print qq[INC = \@INC\n]"
>.\show_inc.exe

It just displays :
INC = @INC

>did you build PAR::Packer yourself?


yes got it from CPAN and built it with strawberrys gcc and its dmake
also I must note that I've tried the same with Activestate and had no
problem at all. It built and executed correctly

Nikos

unread,
Jun 15, 2011, 5:38:08 AM6/15/11
to Roderich Schupp, p...@perl.org
>pp -o show_inc.exe -e "print qq[INC = @INC\n]"

INC =
E:\DOCUME~1\LOCALU~1\LOCALS~1\Temp\par-LocalUser\cache-24fc4e15c702dfc458f
533f99fd8ae8a8261ffb5\inc CODE(0x10cf89c) CODE(0x125fe94)

On Wed, Jun 15, 2011 at 12:34 PM, Roderich Schupp <
roderic...@googlemail.com> wrote:

> On Wed, Jun 15, 2011 at 11:15 AM, Nikos <niko...@gmail.com> wrote:
> >>pp -o show_inc.exe -e "print qq[INC = \@INC\n]"
> >>.\show_inc.exe
> >
> > It just displays :
> > INC = @INC
>

> Sorry, one backslash too many, should have been


>
> pp -o show_inc.exe -e "print qq[INC = @INC\n]"
>

> >>did you build PAR::Packer yourself?
> > yes got it from CPAN and built it with strawberrys gcc and its dmake
>

> OK. I'll investigate. Interestingly Strawberry 5.12.2 had
>
> @INC:
> C:/strawberry/perl/site/lib
> C:/strawberry/perl/vendor/lib
> C:/strawberry/perl/lib
> .
>
>
> Cheers, Roderich
>

Roderich Schupp

unread,
Jun 15, 2011, 5:34:15 AM6/15/11
to Nikos, p...@perl.org
On Wed, Jun 15, 2011 at 11:15 AM, Nikos <niko...@gmail.com> wrote:
>>pp -o show_inc.exe -e "print qq[INC = \@INC\n]"
>>.\show_inc.exe
>
> It just displays :
>   INC = @INC

Sorry, one backslash too many, should have been

pp -o show_inc.exe -e "print qq[INC = @INC\n]"

>>did you build PAR::Packer yourself?


> yes got it from CPAN and built it with strawberrys gcc and its dmake

OK. I'll investigate. Interestingly Strawberry 5.12.2 had

Roderich Schupp

unread,
Jun 15, 2011, 6:37:04 AM6/15/11
to Nikos, p...@perl.org
On Wed, Jun 15, 2011 at 11:38 AM, Nikos <niko...@gmail.com> wrote:
>>pp -o show_inc.exe -e "print qq[INC = @INC\n]"
>
> INC =
> E:\DOCUME~1\LOCALU~1\LOCALS~1\Temp\par-LocalUser\cache-24fc4e15c702dfc458f
> 533f99fd8ae8a8261ffb5\inc CODE(0x10cf89c) CODE(0x125fe94)

That looks OK. But the problem occurs probably earlier in stage 2 of
bootstrapping
where @INC may have a different value...
There's a diganostic script in the PAR::Packer tarball, can you run it like so

perl contrib/extract_embedded/extract-embedded.pl any-pp-generated.exe
some-scratch-directory

(you may use the above show_inc.exe as the first argument) and post its output?
Also: does show_inc.exe show the original symptoms ("Can't locate
loadable object for module IO...")?

Cheers, Roderich

Nikos

unread,
Jun 15, 2011, 7:12:30 AM6/15/11
to Roderich Schupp, p...@perl.org
before I run any test, should I 'rollback' any changes I've made (revert
PERL5LIB to its orginal value which was actually empty and also take the "if
Config.." out of parl.pl line 540?) so everything comes back to the
original state?
(since the modifications seem to have fixed it and maybe are masquerading
the original issue**)

Roderich Schupp

unread,
Jun 15, 2011, 9:38:21 AM6/15/11
to Nikos, p...@perl.org
On Wed, Jun 15, 2011 at 1:12 PM, Nikos <niko...@gmail.com> wrote:
> before I run any test, should I 'rollback' any changes I've made (revert

Not necessary as I can reproduce your problem here after a clean
install of the Strawberry 5.12.3.0 MSI + "cpan -i PAR::Packer"

BTW, my Strawberry says (different from yours)

> perl -V
...


%ENV:
PERL_JSON_BACKEND="JSON::XS"
PERL_YAML_BACKEND="YAML"

@INC:
C:/strawberry/perl/site/lib
C:/strawberry/perl/vendor/lib
C:/strawberry/perl/lib
.


Preliminary findings:

- running "perl extract-embedded.pl show-inc.exe ..."
shows that indeed IO.dll is missing

- in fact the FILE stuff
(cf. http://search.cpan.org/~smueller/PAR-1.002/lib/PAR/Tutorial.pod#Anatomy_of_a_Self-Contained_PAR_executable)
in show-inc.exe contains no DLL except Win32.dll (would have
at least expected IO.dll, Cwd.dll, Zlib.dll, Glob.dll, possibly others)

- myldr/parl.exe (in the PAR-Packer build directory) (which is the
"prototypical" packed executable) _does_ contain the above DLLs

Puzzled, Roderich

Nikos

unread,
Jun 15, 2011, 11:25:30 AM6/15/11
to Roderich Schupp, p...@perl.org
ok so output of
perl extract-embedded.pl show-inc.exe .
is :

FILE "9b2a292c/Carp.pm"... extracted to Carp.pm
FILE "eda2159c/AutoLoader.pm"... extracted to AutoLoader.pm
FILE "779e50c8/Carp/Heavy.pm"... extracted to Carp\Heavy.pm
FILE "e08d49b6/Compress/Raw/Zlib.
pm"... extracted to Compress\Raw\Zlib.pm
FILE "9acfdcf6/Compress/Zlib.pm"... extracted to Compress\Zlib.pm
FILE "9b54d199/Config.pm"... extracted to Config.pm
FILE "f0d492b4/Config_git.pl"... extracted to Config_git.pl
FILE "7f924c81/Config_heavy.pl"... extracted to Config_heavy.pl
FILE "edb5cc43/Cwd.pm"... extracted to Cwd.pm
FILE "7a2751c7/DynaLoader.pm"... extracted to DynaLoader.pm
FILE "ebb0de45/Errno.pm"... extracted to Errno.pm
FILE "2793e937/Exporter.pm"... extracted to Exporter.pm
FILE "c227a33d/Exporter/Heavy.pm"... extracted to Exporter\Heavy.pm
FILE "bccd5df4/Fcntl.pm"... extracted to Fcntl.pm
FILE "2d7cb87e/File/Basename.pm"... extracted to File\Basename.pm
FILE "d66bcc19/File/Copy.pm"... extracted to File\Copy.pm
FILE "ec5741c9/File/Find.pm"... extracted to File\Find.pm
FILE "a1eebf3d/File/Glob.pm"... extracted to File\Glob.pm
FILE "95893914/File/GlobMapper.pm"... extracted to File\GlobMapper.pm
FILE "6e6d426e/File/Path.pm"... extracted to File\Path.pm
FILE "67f0619a/File/Spec.pm"... extracted to File\Spec.pm
FILE "8644ea76/File/Spec/Unix.pm"... extracted to File\Spec\Unix.pm
FILE "57dc2808/File/Spec/Win32.pm"... extracted to File\Spec\Win32.pm
FILE "b7b8942f/File/Temp.pm"... extracted to File\Temp.pm
FILE "c186f562/FileHandle.pm"... extracted to FileHandle.pm
FILE "01f9e823/IO.pm"... extracted to IO.pm
FILE "2a581ecc/IO/Compress/Adapter/Deflate.pm"... extracted to
IO\Compress\Adapt
er\Deflate.pm
FILE "f6a20a0a/IO/Compress/Base.pm"... extracted to IO\Compress\Base.pm
FILE "c58f4987/IO/Compress/Base/Common.pm"... extracted to
IO\Compress\Base\Comm
on.pm
FILE "65256827/IO/Compress/Gzip.pm"... extracted to IO\Compress\Gzip.pm
FILE "d385f3b4/IO/Compress/Gzip/Constants.pm"... extracted to
IO\Compress\Gzip\C
onstants.pm
FILE "418564f3/IO/Compress/RawDeflate.pm"... extracted to
IO\Compress\RawDeflate
.pm
FILE "a8c6597f/IO/Compress/Zlib/Extra.pm"... extracted to
IO\Compress\Zlib\Extra
.pm
FILE "7322d8da/IO/File.pm"... extracted to IO\File.pm
FILE "fd3e5ad9/IO/Handle.pm"... extracted to IO\Handle.pm
FILE "675aa0bc/IO/Seekable.pm"... extracted to IO\Seekable.pm
FILE "e83e6b3b/IO/Uncompress/Adapter/Inflate.pm"... extracted to
IO\Uncompress\A
dapter\Inflate.pm
FILE "c716439e/IO/Uncompress/Base.pm"... extracted to IO\Uncompress\Base.pm
FILE "ca7cec39/IO/Uncompress/Gunzip.pm"... extracted to
IO\Uncompress\Gunzip.pm
FILE "a472b075/IO/Uncompress/RawInflate.pm"... extracted to
IO\Uncompress\RawInf
late.pm
FILE "6e167062/List/Util.pm"... extracted to List\Util.pm
FILE "63759633/PerlIO.pm"... extracted to PerlIO.pm
FILE "b45f1664/PerlIO/scalar.pm"... extracted to PerlIO\scalar.pm
FILE "875360fc/Scalar/Util.pm"... extracted to Scalar\Util.pm
FILE "21c30c94/SelectSaver.pm"... extracted to SelectSaver.pm
FILE "16136bc4/Symbol.pm"... extracted to Symbol.pm
FILE "d710c571/Tie/Hash/NamedCapture.pm"... extracted to
Tie\Hash\NamedCapture.p
m
FILE "da3ac6da/Time/Local.pm"... extracted to Time\Local.pm
FILE "4ceddded/UNIVERSAL.pm"... extracted to UNIVERSAL.pm
FILE "ffd8c35b/Win32.pm"... extracted to Win32.pm
FILE "1230c433/XSLoader.pm"... extracted to XSLoader.pm
FILE "456a5df6/attributes.pm"... extracted to attributes.pm
FILE "bd4c5554/auto/Compress/Raw/Zlib/autosplit.ix"... extracted to
auto\Compres
s\Raw\Zlib\autosplit.ix
FILE "979b0b98/auto/DynaLoader/dl_findfile.al"... extracted to
auto\DynaLoader\d
l_findfile.al
FILE "3ffe9e7a/base.pm"... extracted to base.pm
FILE "8ed95d04/bytes.pm"... extracted to bytes.pm
FILE "22045340/constant.pm"... extracted to constant.pm
FILE "86e51a2a/integer.pm"... extracted to integer.pm
FILE "a84ae5a8/lib.pm"... extracted to lib.pm
FILE "a2141098/overload.pm"... extracted to overload.pm
FILE "174747df/re.pm"... extracted to re.pm
FILE "2ea3b9d0/strict.pm"... extracted to strict.pm
FILE "c4f90a2b/utf8.pm"... extracted to utf8.pm
FILE "e565070d/vars.pm"... extracted to vars.pm
FILE "faf08316/warnings.pm"... extracted to warnings.pm
FILE "1e616690/warnings/register.pm"... extracted to warnings\register.pm
FILE "c6961c10/PAR/Filter.pm"... extracted to PAR\Filter.pm
FILE "a3950bc7/PAR/Filter/PatchContent.pm"... extracted to
PAR\Filter\PatchConte
nt.pm
FILE "6bff668f/PAR/Filter/PodStrip.pm"... extracted to
PAR\Filter\PodStrip.pm
FILE "016d4826/Archive/Zip.pm"... extracted to Archive\Zip.pm
FILE "347c38c4/Archive/Zip/Archive.pm"... extracted to
Archive\Zip\Archive.pm
FILE "a8613993/Archive/Zip/DirectoryMember.pm"... extracted to
Archive\Zip\Direc
toryMember.pm
FILE "80b7eb74/Archive/Zip/FileMember.pm"... extracted to
Archive\Zip\FileMember
.pm
FILE "e9d024e0/Archive/Zip/Member.pm"... extracted to Archive\Zip\Member.pm
FILE "ddde8105/Archive/Zip/NewFileMember.pm"... extracted to
Archive\Zip\NewFile
Member.pm
FILE "39e2b42c/Archive/Zip/StringMember.pm"... extracted to
Archive\Zip\StringMe
mber.pm
FILE "d2a71040/Archive/Zip/ZipFileMember.pm"... extracted to
Archive\Zip\ZipFile
Member.pm
FILE "ac716f7b/PAR.pm"... extracted to PAR.pm
FILE "95f4e66c/PAR/Dist.pm"... extracted to PAR\Dist.pm
FILE "3dcd3025/PAR/Heavy.pm"... extracted to PAR\Heavy.pm
FILE "39112d3f/PAR/SetupProgname.pm"... extracted to PAR\SetupProgname.pm
FILE "58fa31ed/PAR/SetupTemp.pm"... extracted to PAR\SetupTemp.pm
FILE "c8b1dd32/auto/Compress/Raw/Zlib/Zlib.dll"... extracted to
auto\Compress\Ra
w\Zlib\Zlib.dll
FILE "140b4240/auto/Cwd/Cwd.dll"... extracted to auto\Cwd\Cwd.dll
FILE "2e98a51c/auto/Fcntl/Fcntl.dll"... extracted to auto\Fcntl\Fcntl.dll
FILE "ce5e4940/auto/File/Glob/Glob.dll"... extracted to
auto\File\Glob\Glob.dll
FILE "09f36e3a/auto/IO/IO.dll"... extracted to auto\IO\IO.dll
FILE "4102421d/auto/List/Util/Util.dll"... extracted to
auto\List\Util\Util.dll
FILE "66f1702a/auto/PerlIO/scalar/scalar.dll"... extracted to
auto\PerlIO\scalar
\scalar.dll
FILE "1476eef8/auto/Win32/Win32.dll"... extracted to auto\Win32\Win32.dll

Reini Urban

unread,
Jun 14, 2011, 2:09:07 PM6/14/11
to nikos, p...@perl.org
2011/6/14 nikos <niko...@gmail.com>:

> Hi
> building an executable with Strawberry Perl is successful but when
> actually running the exe (after we have renamed the c:/strawberry to
> c:/strawberryX so it cannot find the dependencies from the path),
> fails with the following errors :
>
> " Can't locate loadable object for module IO in @INC (@INC contains:
> CODE(0xa1d31c
> ) C:\strawberry\perl\vendor\lib .) at C:/strawberry/perl/site/lib/PAR/
> Heavy.pm l
> ine 103

IO is a particular exception and hard to find in the scanner,
as I know from the compiler.
I haven't check Module::Scandeps if it uses all the weird needed
logic to detect it (FileHandle), but that would be my first guess.

The workaround would to add IO manually (-m IO) in pp.

--
Reini Urban
http://phpwiki.org/           http://murbreak.at/

Roderich Schupp

unread,
Jun 16, 2011, 4:23:09 AM6/16/11
to Nikos, p...@perl.org
On Wed, Jun 15, 2011 at 3:38 PM, Roderich Schupp
<roderic...@googlemail.com> wrote:
> Puzzled, Roderich

Not anymore :) In fact loading of XS modules (i.e. the DLLs) has been broken
for _all_ platforms with Perl 5.14.0, because 5.14.0 (actually starting
with 5.13.6) changed XSLoader.pm. This causes the hack used by
PAR::Packer to intercept loading of XS DLLs to fail. You won't notice
until you run the packed executable on a machine without a Perl
installation (or a suitably different Perl), because failing to intercept
it will load the DLLs from the installed Perl instead.

nikos doesn't use Perl 5.14.0, but Strawberry 5.12.3.0 has elected
to include the modified XSLoader.pm (from 5.13.6 onward) in lieu
of the one included in Perl 5.12.3.

Please try the attached patch to PAR::Packer, should make
the hack work on both old and new versions of XSLoader.pm.
Note: you must rebuild and reinstall PAR::Packer and then repack executables
to see any effect.


Cheers, Roderich

xsloader.patch

Roderich Schupp

unread,
Jun 16, 2011, 4:19:09 AM6/16/11
to Reini Urban, nikos, p...@perl.org
On Tue, Jun 14, 2011 at 8:09 PM, Reini Urban <rur...@x-ray.at> wrote:
> IO is a particular exception and hard to find in the scanner,
> as I know from the compiler.

IO is a red herring :)
It's total irrelevant here because Module::ScanDeps doesn't come
into play at all - the IO and IO::* modules are already needed during
bootstrapping and hence are always "hardwired" into a packed executable.
And IO only shows up in the error message because its the first
of these hardwired modules to be loaded during bootstrapping
that has an XS part.

For an explanation what's really going on, see my next post.

Cheers, Roderich

Roderich Schupp

unread,
Jun 16, 2011, 6:19:37 AM6/16/11
to Reini Urban, Nikos, p...@perl.org
On Thu, Jun 16, 2011 at 10:36 AM, Reini Urban <rur...@x-ray.at> wrote:
> BTW: The XSLoader API is a joke, really.

Seconded. If there were a better API (or even better a "legal"
interposer interface)
PAR::Packer wouldn't have to patch the copy of XSLoader.pm that
it packs into every pp-generated executable.

Same goes for the gross DynaLoader hack to intercept DLL loading there.
It uses some - err - non-obvious trick which might also be broken
by accident when someone touches DynaLoader.pm. This has already
happened once, in Perl 5.10.0 (since reverted), which totally broke
PAR::Packer and the only possible remedy would have been to resort
to on-the-fly patching like for XSLoader.

Cheers, Roderich

Nikos

unread,
Jun 17, 2011, 12:59:28 AM6/17/11
to Roderich Schupp, p...@perl.org
Roderich,
the patch worked fine,it builds and executes alright !!
can you shed more light on the internals of why my quick 'hack' worked
before patching PAR? it was a hack based on observation rather than having
knowledge of the internals

Reini Urban

unread,
Jun 16, 2011, 4:36:13 AM6/16/11
to Roderich Schupp, Nikos, p...@perl.org
2011/6/16 Roderich Schupp <roderic...@googlemail.com>:

> On Wed, Jun 15, 2011 at 3:38 PM, Roderich Schupp
> <roderic...@googlemail.com> wrote:
>> Puzzled, Roderich
>
> Not anymore :) In fact loading of XS modules (i.e. the DLLs) has been broken
> for _all_ platforms with Perl 5.14.0, because 5.14.0 (actually starting
> with 5.13.6) changed XSLoader.pm. This causes the hack used by
> PAR::Packer to intercept loading of XS DLLs to fail. You won't notice
> until you run the packed executable on a machine without a Perl
> installation (or a suitably different Perl), because failing to intercept
> it will load the DLLs from the installed Perl instead.

Yes, I had the same problem with 5.14.
Using XSLoader::bootstrap_inherit solved it for me also.

BTW: The XSLoader API is a joke, really. One has to put the full dll
path into the
COP->FILE so that XSLoader is able to load the DLL. It uses only
caller for the context,
no argument.
XSLoader should be private to CORE only, but not exposed to the
general public like this.

Thanks!

> nikos doesn't use Perl 5.14.0, but Strawberry 5.12.3.0 has elected
> to include the modified XSLoader.pm (from 5.13.6 onward) in lieu
> of the one included in Perl 5.12.3.
>
> Please try the attached patch to PAR::Packer, should make
> the hack work on both old and new versions of XSLoader.pm.
> Note: you must rebuild and reinstall PAR::Packer and then repack executables
> to see any effect.

Roderich Schupp

unread,
Jun 20, 2011, 3:10:23 AM6/20/11
to Nikos, p...@perl.org
On Fri, Jun 17, 2011 at 6:59 AM, Nikos <niko...@gmail.com> wrote:
> can you shed more light on the internals of why my quick 'hack' worked
> before patching PAR? it was a hack based on observation rather than having
> knowledge of the internals

Dunno. Maybe there's another problem still lurking there. Or your testing
was a bit flawed - with PAR::Packer you have to be very careful to always do
a whole clean/build/install/repack/purge cache area/test cycle.
You also said that you rebuilt Strawberry yourself. Maybe that way you
inadvertently reverted to the "old" XSLoader.pm, look for a line containing
"goto retry". If you see one, it's the "old" version.

Cheers, Roderich

Nikos

unread,
Jun 21, 2011, 1:36:58 AM6/21/11
to Roderich Schupp, p...@perl.org
ok I did a clean install on a PC with Windows 2003 that had never Perl
installed

1.strawberry-perl-5.10.1.5.msi

2.perl -V shows :

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname='Win32 strawberryperl 5.10.1.5 #1 Sun May 15 09:44:53 2011 i386'
config_args='undef'
hint=recommended, useposix=true, d_sigaction=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='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT
-DUSE_SITECUSTOMIZE -
DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing
-DPERL_MSVCRT_RE
ADFIX',
optimize='-s -O2',
cppflags='-DWIN32'
ccversion='', gccversion='3.4.5', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long',
lseek
size=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE"
-L"C:\strawberry\c\li
b"'
libpth=C:\strawberry\c\lib
libs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi3
2 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm
-lversio
n -lodbc32 -lodbccp32
perllibs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladv
api32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm
-lve
rsion -lodbc32 -lodbccp32
libc=, so=dll, useshrplib=true, libperl=libperl510.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE"
-L"C:\st
rawberry\c\lib"'

Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE
Built under MSWin32
Compiled at May 15 2011 09:50:23


%ENV:
PERL_JSON_BACKEND="JSON::XS"
PERL_YAML_BACKEND="YAML"
@INC:

C:/strawberry/perl/lib
C:/strawberry/perl/site/lib
C:\strawberry\perl\vendor\lib

.

Still vendor lib path messed up

3.XSLoader.pm is version 0.15 and does not contain a 'goto retry' reference

4. pp -o test.exe test.pl

5.renamed strawberry to strawberrX so the dependencies cannot be found

6.run test.exe
same error "Can't locate loadable object for module IO" etc.....

7.applied your patch,rebuilt,pp'ed again,runs ok

but this is Strawberry 5.10.1.5 not 5.12 or 5.14

Roderich Schupp

unread,
Jun 21, 2011, 4:30:02 AM6/21/11
to Nikos, p...@perl.org
On Tue, Jun 21, 2011 at 7:36 AM, Nikos <niko...@gmail.com> wrote:
> 3.XSLoader.pm is version 0.15 and does not contain a 'goto retry' reference

That means: it's the "new" version. So what?

Cheers, Roderich

Nikos

unread,
Jun 21, 2011, 6:59:59 AM6/21/11
to Roderich Schupp, p...@perl.org
I mean that the patch not only fixes 5.12 but could be applied to earlier
versions as well i.e 5.10.1.5 in this case

thanks

Roderich Schupp

unread,
Jun 21, 2011, 8:06:26 AM6/21/11
to Nikos, p...@perl.org
On Tue, Jun 21, 2011 at 12:59 PM, Nikos <niko...@gmail.com> wrote:
> I mean that the patch not only fixes 5.12 but could be applied to earlier
> versions as well i.e  5.10.1.5 in this case

Thanks for confirmation. The patch actually doesn't care which version
your Perl is, it's the version of XSLoader that you have (since XSloader is
a dual-life module and Strawberry distributes a version that is newer
than the version in the corresponding Perl core). The patch
will work for all versions of XSLoader up to the latest (0.15).

Cheers, Roderich

0 new messages