Discussion:
[rt.cpan.org #119224] Issue about Can't locate loadable object for module
(too old to reply)
Roderich Schupp via RT
2016-12-13 15:40:35 UTC
Permalink
Tue Dec 13 10:40:24 2016: Request 119224 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Issue about Can't locate loadable object for module
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
PAR: 1.010
PAR::Packer: 1.033
Module::ScanDeps: 1.21
This is the one that works?
PAR: 1.013
PAR::Packer: 1.033 (I used cpanm to install this version, 1.038 also
fails so I guess this one is not related)
(1) There is no PAR::Packer 1.038
(2) It's highly unlikely that "hello world" fails while cpanm did install
PAR::Packer successfully (unless you did "cpan -f ...")
What does "Pp log" do? Sorry, I can't wade thru its output.
Please unset all PERL* environment variables (esp. PERL5LIB), then run
just the two commands in "hello world" example from my previous message.

Cheers, Roderich
Roderich Schupp via RT
2016-12-13 16:27:58 UTC
Permalink
Tue Dec 13 11:27:52 2016: Request 119224 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Issue about Can't locate loadable object for module
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
I tried with completely new environment, I spin up a new box with
PAR: 1.013
PAR::Packer: 1.035
Module::ScanDeps: 1.23
CODE(0x258ae98) /root/perl5/perlbrew/perls/perl-
5.24.0/lib/site_perl/5.24.0/x86_64-linux-thread-multi
/root/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0
/root/perl5/perlbrew/perls/perl-5.24.0/lib/5.24.0/x86_64-linux-thread-
multi /root/perl5/perlbrew/perls/perl-5.24.0/lib/5.24.0 .) at
/root/perl5/perlbrew/perls/perl-5.24.0/lib/5.24.0/x86_64-linux-thread-
multi/IO/Handle.pm line 269.
That line does not make any sense. Are you sure that calling pp
in this environment invokes /root/perl5/perlbrew/perls/perl-5.24.0/bin/pp?

Plase provide the unabridged output of the following commands:

perl -V
cpanm -v --reinstall PAR::Packer


Cheers, Roderich
Andrey via RT
2016-12-13 21:06:22 UTC
Permalink
Tue Dec 13 16:06:01 2016: Request 119224 was acted upon.
Transaction: Correspondence added by ***@yandex.com
Queue: PAR-Packer
Subject: RE: [rt.cpan.org #119224] Issue about Can't locate loadable object for module
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >


I had the same problem with perl-5.22.2, PAR-1.013, PAR::Packer-1.035, and Module::ScanDeps-1.23.

I managed to workaround it by downgrading PAR to 1.011.
(1.012 is also broken)

Now, executables produced with pp seem to work fine.


Roderich, please, let me know if you want me to test a fix or something.

Thank you,
--
Andrey.
Roderich Schupp via RT
2016-12-13 22:43:10 UTC
Permalink
Tue Dec 13 17:43:04 2016: Request 119224 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Issue about Can't locate loadable object for module
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
Post by Andrey via RT
I had the same problem with perl-5.22.2, PAR-1.013, PAR::Packer-1.035,
and Module::ScanDeps-1.23.
I managed to workaround it by downgrading PAR to 1.011.
(1.012 is also broken)
1.012 is definitely broken.
Post by Andrey via RT
Now, executables produced with pp seem to work fine.
Yeah, I'm beginning to suspect that the problem is in PAR, not in PAR::Packer.
Though I don't know why I can't reproduce it.
Can you try the attached patch for PAR (on top of PAR 1.013)?


Cheers, Roderich
Andrey via RT
2016-12-13 23:38:03 UTC
Permalink
Tue Dec 13 18:37:52 2016: Request 119224 was acted upon.
Transaction: Correspondence added by ***@yandex.com
Queue: PAR-Packer
Subject: Re: [rt.cpan.org #119224] Issue about Can't locate loadable object for module
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
Post by Roderich Schupp via RT
Yeah, I'm beginning to suspect that the problem is in PAR, not in PAR::Packer.
Though I don't know why I can't reproduce it.
Hm, that's strange, because even "hello.exe" doesn't work.
I've built a fresh perl-5.22.2 using perlbrew on CentOS 5.9 and then installed PAR::Packer using cpan.
I've also installed PAR::Packer from cpan on an up-to-date Gentoo machine running perl-5.22.2 and PAR 1.013.
Both hello.exe's die with "Can't locate loadable object for module IO".
Post by Roderich Schupp via RT
Can you try the attached patch for PAR (on top of PAR 1.013)?
Sure.
It now works!
Both on CentOS 5 and Gentoo.
A more sophisticated script now works just fine too.

Thank you so much for the patch!
--
Andrey.
Roderich Schupp via RT
2016-12-14 16:13:49 UTC
Permalink
Wed Dec 14 11:13:38 2016: Request 119224 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Issue about Can't locate loadable object for module
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >


Thank you both for testing the fix!
I'm going to release a fixed PAR over the weekend.
In hindsight it was a silly idea to "use" anything in PAR/Heavy.pm
(esp. anything that could directly or recursively load an XS module).
After all, PAR/Heavy.pm contains the machinery that allows XSLoader
or DynaLoader to load XS modules from a packed executable or .par archive.

But I'm still puzzled about the fact that PAR::Packer's self test passes
(which packs and runs a variety of simple scripts), but the "hello world"
example bombs out for you (but not on my test systems).
So that we're all on the same page here:
Did you *run* the "hello world" executable on the *same* machine
where you generated it (with pp)?

Cheers, Roderich
Roderich Schupp via RT
2016-12-14 19:33:28 UTC
Permalink
Wed Dec 14 14:33:26 2016: Request 119224 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR
Subject: Issue about Can't locate loadable object for module
Broken in: 1.013
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >


Again, thanks to both of you. Puzzle solved!

A bit of explanation: When a packed executable runs, its @INC will only contain
paths inside of the cache area (usually /tmp/par-XXX/SOME-SHA1) (plus some CODE refs).
The self test will check for this.

However, this is only correct once the bootstrap phase is finished.
During bootstrap we might still see remnants of the perl built-in @INC, but if
everythings works as planned we do not call any operation that causes a search
in @INC. Except for stupid mistakes which go undetected if we're running the executable
in the same environment where we packed it :(

Cheers, Roderich
Roderich Schupp via RT
2016-12-18 16:30:45 UTC
Permalink
Sun Dec 18 11:30:33 2016: Request 119224 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR
Subject: Issue about Can't locate loadable object for module
Broken in: 1.013
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >


Fixed in PAR 1.014, just released to CPAN

Cheers, Roderich
Andrey via RT
2016-12-19 23:05:48 UTC
Permalink
Mon Dec 19 18:05:47 2016: Request 119224 was acted upon.
Transaction: Correspondence added by ***@yandex.com
Queue: PAR
Subject: Re: [rt.cpan.org #119224] Issue about Can't locate loadable object for module
Broken in: 1.013
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: resolved
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
Post by Roderich Schupp via RT
Fixed in PAR 1.014, just released to CPAN
Awesome, thank you so much for releasing so quickly!
I've just updated to PAR-1.014 and it works great!

Thank you again!
--
Andrey.
Andrey via RT
2016-12-14 17:43:51 UTC
Permalink
Wed Dec 14 12:43:49 2016: Request 119224 was acted upon.
Transaction: Correspondence added by ***@yandex.com
Queue: PAR
Subject: Re: [rt.cpan.org #119224] Issue about Can't locate loadable object for module
Broken in: 1.013
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
Post by Roderich Schupp via RT
Thank you both for testing the fix!
No problem.
The fix came right in time!
I was really desperate and looking for other packagers for perl.
Post by Roderich Schupp via RT
I'm going to release a fixed PAR over the weekend.
Great news, thank you so much!
Post by Roderich Schupp via RT
But I'm still puzzled about the fact that PAR::Packer's self test passes
(which packs and runs a variety of simple scripts), but the "hello world"
example bombs out for you (but not on my test systems).
Did you *run* the "hello world" executable on the *same* machine
where you generated it (with pp)?
No, I ran it on a different clean machine.
I guess, it worked fine on the build machine because it loaded everything from system-wide perl.

The simplest way to get a clean environment for me is to setup a minimalistic chroot:
mkdir -p chroot/{dev,tmp,lib64}
mount --rbind /dev chroot/dev
mount --bind /lib64 chroot/lib64
mount --bind -o ro,remount /lib64 chroot/lib64 # yes, a separate remount is needed with util-linux < 2.27
cp hello.exe chroot/
chroot ./chroot /hello.exe

It has a downside of running hello.exe as root though.

Not sure, how to plug this in Packer's self-tests though.
An LD_PRELOAD library that hides system-wide perl might work.
--
Andrey.
Andrey via RT
2016-12-14 17:43:51 UTC
Permalink
Wed Dec 14 12:43:51 2016: Request 119224 was acted upon.
Transaction: Correspondence added by ***@yandex.com
Queue: PAR
Subject: Re: [rt.cpan.org #119224] Issue about Can't locate loadable object for module
Broken in: 1.013
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@factset.com
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119224 >
Post by Roderich Schupp via RT
Thank you both for testing the fix!
No problem.
The fix came right in time!
I was really desperate and looking for other packagers for perl.
Post by Roderich Schupp via RT
I'm going to release a fixed PAR over the weekend.
Great news, thank you so much!
Post by Roderich Schupp via RT
But I'm still puzzled about the fact that PAR::Packer's self test passes
(which packs and runs a variety of simple scripts), but the "hello world"
example bombs out for you (but not on my test systems).
Did you *run* the "hello world" executable on the *same* machine
where you generated it (with pp)?
No, I ran it on a different clean machine.
I guess, it worked fine on the build machine because it loaded everything from system-wide perl.

The simplest way to get a clean environment for me is to setup a minimalistic chroot:
mkdir -p chroot/{dev,tmp,lib64}
mount --rbind /dev chroot/dev
mount --bind /lib64 chroot/lib64
mount --bind -o ro,remount /lib64 chroot/lib64 # yes, a separate remount is needed with util-linux < 2.27
cp hello.exe chroot/
chroot ./chroot /hello.exe

It has a downside of running hello.exe as root though.

Not sure, how to plug this in Packer's self-tests though.
An LD_PRELOAD library that hides system-wide perl might work.
--
Andrey.
Loading...