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

loadable library and perl binaries are mismatched #687

Closed
fluca1978 opened this issue Mar 5, 2019 · 7 comments
Closed

loadable library and perl binaries are mismatched #687

fluca1978 opened this issue Mar 5, 2019 · 7 comments
Assignees
Labels

Comments

@fluca1978
Copy link
Contributor

Running pgbackrest 2.10 release on Ubuntu 18.10 I got the following when doing a simple check:

% pgbackrest check --stanza=traf
./perl/libc.auto.c: loadable library and perl binaries are mismatched (got handshake key 0xc200000, needed 0xc280000)

Some information about the system:

% uname -a
Linux n261732 4.18.0-15-generic #16-Ubuntu SMP Thu Feb 7 10:56:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

% perl -v
This is perl 5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-gnu-thread-multi
(with 63 registered patches, see perl -V for more detail)

% pgbackrest version
pgBackRest 2.10
% env | grep PERL5

I've compiled pgbackrest both with perlbrew enabled or not, nothing changes. Am I missing something?

@dwsteele dwsteele self-assigned this Mar 5, 2019
@dwsteele dwsteele added this to the 2.11 milestone Mar 5, 2019
@dwsteele
Copy link
Member

dwsteele commented Mar 5, 2019

It seems that your libperl version and your perl version are not the same.

Try this to get the libperl version:

ls -lah /usr/lib/x86_64-linux-gnu/libperl.so

@fluca1978
Copy link
Contributor Author

@dwsteele you may be right since I found:

% locate libperl.so
/usr/lib/x86_64-linux-gnu/libperl.so.5.26
/usr/lib/x86_64-linux-gnu/libperl.so.5.26.2

while perl is 5.28 (without perlbrew). But I don't know how to fix it, since I was expecting the system was keeping coherent libraries and executables. Suggestions?

@fluca1978
Copy link
Contributor Author

Sorry, I did not get my coffee!
With perlbrew turned off I've system Perl 5.26 and therefore the libraries are the correct ones (!). But trying to recompile I got an error:

% make -s -C src
/usr/bin/ld: cannot find -lperl
collect2: error: ld returned 1 exit status
make: *** [Makefile:163: pgbackrest] Error 1

which I suspect is due to the fact that libperl.so is named differently. Linking with a name libperl.so produces me another longer compile error:

% make 
gcc -o pgbackrest command/archive/common.o command/archive/get/file.o command/archive/get/get.o command/archive/push/push.o command/help/help.o command/info/info.o command/command.o command/control/control.o common/debug.o common/encode.o common/encode/base64.o common/error.o common/exec.o common/exit.o common/fork.o common/io/bufferRead.o common/io/bufferWrite.o common/io/filter/buffer.o common/io/filter/filter.o common/io/filter/group.o common/io/filter/size.o common/io/handleRead.o common/io/handleWrite.o common/io/http/client.o common/io/http/common.o common/io/http/header.o common/io/http/query.o common/io/io.o common/io/read.o common/io/tls/client.o common/io/write.o common/ini.o common/lock.o common/log.o common/memContext.o common/regExp.o common/stackTrace.o common/time.o common/type/buffer.o common/type/convert.o common/type/json.o common/type/keyValue.o common/type/list.o common/type/string.o common/type/stringList.o common/type/variant.o common/type/variantList.o common/type/xml.o common/wait.o compress/gzip.o compress/gzipCompress.o compress/gzipDecompress.o config/config.o config/define.o config/exec.o config/load.o config/parse.o crypto/cipherBlock.o crypto/hash.o crypto/crypto.o info/info.o info/infoArchive.o info/infoBackup.o info/infoManifest.o info/infoPg.o perl/config.o perl/exec.o postgres/interface.o postgres/interface/v083.o postgres/interface/v084.o postgres/interface/v090.o postgres/interface/v091.o postgres/interface/v092.o postgres/interface/v093.o postgres/interface/v094.o postgres/interface/v095.o postgres/interface/v096.o postgres/interface/v100.o postgres/interface/v110.o postgres/pageChecksum.o protocol/client.o protocol/helper.o storage/driver/posix/storage.o storage/driver/posix/common.o storage/driver/posix/fileRead.o storage/driver/posix/fileWrite.o storage/driver/remote/fileRead.o storage/driver/remote/storage.o storage/driver/s3/fileRead.o storage/driver/s3/storage.o storage/fileRead.o storage/fileWrite.o storage/helper.o storage/storage.o main.o -lcrypto -lssl -lxml2 -lz `perl -MExtUtils::Embed -e ldopts` 
/usr/bin/ld: perl/exec.o: in function `XS_pgBackRest__LibC_decodeToBin':
exec.c:(.text+0x29b): undefined reference to `PL_markstack_ptr'
/usr/bin/ld: exec.c:(.text+0x2a2): undefined reference to `PL_stack_sp'
/usr/bin/ld: exec.c:(.text+0x2ad): undefined reference to `PL_markstack_ptr'
/usr/bin/ld: exec.c:(.text+0x2b4): undefined reference to `PL_stack_base'
/usr/bin/ld: exec.c:(.text+0x35f): undefined reference to `PL_stack_base'
/usr/bin/ld: exec.c:(.text+0x36a): undefined reference to `PL_stack_base'
/usr/bin/ld: exec.c:(.text+0x375): undefined reference to `PL_stack_sp'
...

so something is messed up with my environment. Suggestions?

@fluca1978
Copy link
Contributor Author

Apparently one problem was about the need to clean up compiled objects (I've also proposed a change to the Makefile, see #689). Now I've a problem on DBD::Pg that I'm trying to solve.

@fluca1978
Copy link
Contributor Author

I do confirm that, after having cleaned compilation objects and compiled with system-wide perl, I can run it.

@dwsteele
Copy link
Member

dwsteele commented Mar 7, 2019

Glad to hear it. I'll have a look at your PRs.

@lock
Copy link

lock bot commented Jul 22, 2019

This thread has been automatically locked. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 22, 2019
@dwsteele dwsteele removed this from the 2.11 milestone Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants