Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 16.04: /lib/x86_64-linux-gnu/libcrypt.so.1: version `XCRYPT_2.0' not found #22

Closed
hakonhagland opened this issue Jun 20, 2020 · 7 comments

Comments

@hakonhagland
Copy link

I am still testing PAR::Packer to generate an exe from the Perl script in issue #21:

#! /usr/bin/env perl

use feature qw(say);
use strict;
use warnings;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
my $res = $ua->get(
    'https://metacpan.org/pod/pp'
);
if ($res->is_success) {
    print "ok\n";
}
else {
    die $res->status_line;
}

This time I am using perl version 5.30.0 on Ubuntu 20.04. I run:

$ perl /home/hakon/perlbrew/perls/perl-5.30.0/bin/pp_autolink.pl -o p2.exe p.pl
# Use of runtime loader module Module::Implementation detected.  Results of static scanning may be incomplete.
# Use of runtime loader module Module::Runtime detected.  Results of static scanning may be incomplete.
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/B/B.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Compress/Raw/Bzip2/Bzip2.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Compress/Raw/Zlib/Zlib.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Cwd/Cwd.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Data/Dumper/Dumper.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Digest/MD5/MD5.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Encode/Encode.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Fcntl/Fcntl.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/File/Glob/Glob.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/I18N/Langinfo/Langinfo.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/IO/IO.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/List/Util/Util.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/MIME/Base64/Base64.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/POSIX/POSIX.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Socket/Socket.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/Storable/Storable.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/mro/mro.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/bin/../lib/5.30.0/x86_64-linux/auto/re/re.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/x86_64-linux/auto/HTML/Parser/Parser.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/x86_64-linux/auto/Net/SSLeay/SSLeay.so
ldd /home/hakon/perlbrew/perls/perl-5.30.0/lib/site_perl/5.30.0/x86_64-linux/auto/Params/Validate/XS/XS.so
ldd /lib/x86_64-linux-gnu/libm.so.6
ldd /lib/x86_64-linux-gnu/libssl.so.1.1
ldd /lib/x86_64-linux-gnu/libpthread.so.0
ldd /lib/x86_64-linux-gnu/libdl.so.2
ldd /lib/x86_64-linux-gnu/libcrypto.so.1.1
Alien sys dlls added: 
Detected link list: --link /lib/x86_64-linux-gnu/libpthread.so.0 --link /lib/x86_64-linux-gnu/libm.so.6 --link /lib/x86_64-linux-gnu/libcrypto.so.1.1 --link /lib/x86_64-linux-gnu/libssl.so.1.1 --link /lib/x86_64-linux-gnu/libdl.so.2
CMD:pp --link /lib/x86_64-linux-gnu/libpthread.so.0 --link /lib/x86_64-linux-gnu/libm.so.6 --link /lib/x86_64-linux-gnu/libcrypto.so.1.1 --link /lib/x86_64-linux-gnu/libssl.so.1.1 --link /lib/x86_64-linux-gnu/libdl.so.2 -o p2.exe p.pl
# Use of runtime loader module Module::Implementation detected.  Results of static scanning may be incomplete.
# Use of runtime loader module Module::Runtime detected.  Results of static scanning may be incomplete.

If I now transfer the p2.exe to a docker container running Ubuntu 16.04 and perl version 5.22.1 and execute it:

$ ./p2.exe
/tmp/par-68616b6f6e64/cache-989af1af4fb03c158b4acd9bdb3bfa54daf511f5/p2.exe: /lib/x86_64-linux-gnu/libcrypt.so.1: version `XCRYPT_2.0' not found (required by /tmp/par-68616b6f6e64/cache-989af1af4fb03c158b4acd9bdb3bfa54daf511f5/p2.exe)
/tmp/par-68616b6f6e64/cache-989af1af4fb03c158b4acd9bdb3bfa54daf511f5/p2.exe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/par-68616b6f6e64/cache-989af1af4fb03c158b4acd9bdb3bfa54daf511f5/p2.exe)
/tmp/par-68616b6f6e64/cache-989af1af4fb03c158b4acd9bdb3bfa54daf511f5/p2.exe: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /tmp/par-68616b6f6e64/cache-989af1af4fb03c158b4acd9bdb3bfa54daf511f5/p2.exe)

So this did not work. Seems like pp_autolink detected libcrypto.so.1.1 but is this the same as libcrypt.so (note the missing o) from the error message? For the other error from libm.so.6, does it mean that --link /lib/x86_64-linux-gnu/libm.so.6 somehow did not work properly? Or that it should also link with libc.so ? Any ideas?

@rschupp
Copy link
Owner

rschupp commented Jun 20, 2020

No, libcrypt and libcrypto aren't the same. The latter is comes from OpenSSL (together with libssl) while the former used to be part of libc (the original passwd hash) and nowadays contains several other hash functions.

But that's not what the error messages are about. Your perl (or stuff that it's linked to) uses stuff from libc that is too "new" for the libc of your target system (libm, libcrypt, too). Ubuntu 16.04 uses libc 2.23 so the highest symbol version in its libc is GLIBC_2.23. You're out of luck here - it's the same reason why an arbitrary binary from Ubuntu 20.04 (libc 2.31) won't run on Ubuntu 16.04. If you have wildly different libc versions on source and target you must pack on the older version.

@shawnlaffan: Is it really a good idea for autolink to pp --link libm, libphtread and libdl from the source system?

@shawnlaffan
Copy link

pp_autolink should probably not be packing anything from system dirs that are expected to be on all machines. I'll add an exclude for /lib/x86_64-linux-gnu, or perhaps /lib to be more complete.

@shawnlaffan
Copy link

@hakonhagland - I've pushed a change to the github repo to exclude /lib, followed by a version bump in shawnlaffan/perl-pp-autolink@2ae0b12

Can you give that a test?

@hakonhagland
Copy link
Author

@rschupp

you must pack on the older version

Interesting. Can you explain a little bit more? I would think the packing the newer version (not the older) would work..

@rschupp
Copy link
Owner

rschupp commented Jun 21, 2020

Read about symbol versioning, e.g. this blog or in depth (chapter 3).
That's one of the reasons why Python chose CentOS 6 as OS baseline ("manylinux2014") for their binary package format ("wheel").

@hakonhagland
Copy link
Author

@rschupp Thanks, I will check it out. BTW the last link in your previous comment refers to the same blog post as the first link.

@rschupp
Copy link
Owner

rschupp commented Jun 21, 2020

Thanks, corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants