Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)

by bliako (Prior)
on Jul 29, 2020 at 06:31 UTC ( #11119939=note: print w/replies, xml ) Need Help??


in reply to XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)

there must be remains of another Perl installation - libraries specifically - in the system.

Compilation of module is successful which denotes that gcc is looking for libraries at the correct places and with the correct order - if there was any need re:-shared. What fails is running the module. Because it was compiled as "shared" which means it must look for and link with the Perl libraries during runtime. And this is where it fails, not because it can't find any libraries but because it (i.e. the operating system's linker responsible for finding shared components at runtime) finds the wrong versions (the handshake mismatch, btw it is cool of perl to make its own checks for its library versions).

I suggest you make a thorough search of old-version Perl libraries in your system. Also, run this: echo $LD_LIBRARY_PATH to tell you the linker's search path, although it can be empty meaning it follows a default which most likely is not aware of your local installation at /home/rg8239. In fact, it looks weird to me that you installed Perl in your home dir but its libraries are searched, by Perl's Makefiles, in a system dir. The guess is that older Perl is installed in system dir and you tried to install a newer version in your homedir. This will mess up Perl for you. Don't worry, this being Linux, unless you installed as root, your system Perl is safe. Which possibly means, another guess, that you did not upgrade the system Perl but you installed a newer version in your homedir. This is tricky when you do it without the help of something like perlbrew. This will enable root-free multiple/parallel Perl versions in a system. You should use it if you want to have Perl in your home dir. This is preferred than upgrading as root the system Perl. Leave the system Perl to the system and install a "user" Perl in your homedir via perlbrew

Edit: to make it clear: your problem is not with compiling. Compilation succeeded. Running (the tests) failed because system runtime linker links to a different Perl library. Perl detects that and complains (handshake failed).

bw, biako

  • Comment on Re: XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)
  • Download Code

Replies are listed 'Best First'.
Re^2: XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)
by Fletch (Chancellor) on Jul 29, 2020 at 13:48 UTC

    This is one of the many instances where strace can be your friend. You can use something along the lines of strace -e open,stat,lstat to prefix your perl blah blah invocation and see exactly what files it's trying to open as well as actually opening and then work back from there.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      yep

Re^2: XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)
by rgren925 (Sexton) on Jul 30, 2020 at 01:05 UTC

    LD_LIBRARY_PATH was set to /usr/lib. I set the following:

    PERL5LIB=/home/rg8239/perl/lib/site_perl/5.30.3:/home/rg8239/perl/lib/ +site_perl/5.30.3/x86_64-linux:/home/rg8239/perl/lib/5.30.3:/home/rg82 +39/perl/lib/5.30.3/x86_64-linux LD_LIBRARY_PATH=/home/rg8239/perl/lib/site_perl/5.30.3:/home/rg8239/pe +rl/lib/site_perl/5.30.3/x86_64-linux:/home/rg8239/perl/lib/5.30.3:/ho +me/rg8239/perl/lib/5.30.3/x86_64-linux

    Then I reinstalled perl 5.30.3 and tried to use cpan to install List::MoreUtils. No change. Still get the mismatch.

      I think you are convoluting the problem and your system even more. I would go the opposite direction and blank out both env vars you set.

      If you have not installed 5.30 as root just erase it from your home dir including all additional packages it installed and make sure about that. Then use perlbrew to re-install perl 5.30. Then ask perlbrew to use 5.30 as the default perl for your account. Then install additional packages. Perhaps starting with cpanm. And report back if there is a problem. perlbrew will make sure that one perl's libraries and packages do not pollute another's.

      If you have installed 5.30 as root, your problems are only surfacing now... I hope you are able to remove it and all its packages and restore the system perl and its packages.

      If you want to investigate further before a re-install then use strace as Fletch suggested to see which libraries are causing the bad handshake.

      you did neither of these

      btw, it seems you posted already this to stackoverflow with very poor answers. None-the-less perhaps you could edit this post to notify us of it.

        Yes. I posted this on stackoverflow several weeks ago and didn't get anywhere. I try to reserve only the really hard issues for perlmonks. It appears that this turned out to be one of those

        So, I deleted perl-5.30.3 and removed all associated environment variables. I installed perlbrew (which I had never used before--it's very cool). I used perlbrew to install perl-5.32.0. I then installed cpanm and tried to install List::MoreUtils. It failed.

        Here's the output from command strace -e open,stat,lstat cpanm List::MoreUtils

        (edited)...FYI, I appear to have run into a length limit on the output below. Not sure how to post the rest of the output

      None of those paths should be in PERL5LIB.

      None of those paths should be in LD_LIBRARY_PATH.

      Unset both.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11119939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2020-11-26 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?