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

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

by bliako (Prior)
on Aug 04, 2020 at 08:49 UTC ( #11120279=note: print w/replies, xml ) Need Help??


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

OK this looks like another problem. First as I suggested and ikegami too: blank the 2 env vars PERL5LIB and LD_LIBRARY_PATH. I think it is not enough to do that in the shell because perlbrew *may* make decisions based on these. So, make sure that in your shell init (e.g. ~/.bashrc and system-wide /etc/bashrc or something) the first is blank. The 2nd I also believe it should be blank but I am not aware of your local settings or other packages changing it. A good rule of thumb is that the 2nd should not have anything perl-related set during shell init. Later of course perlbrew may set these I am not sure but that's ok.

From the output you cited above, it's weird that the include dirs are taken into account but not the library's (EDIT: not sure whether -L/perbrew/perl/... should be present or not during XS.c compilation.). So, still a mixup. Here is what happens in my linux system without perlbrew:

cp lib/List/MoreUtils/XS.pm blib/lib/List/MoreUtils/XS.pm Running Mkbootstrap for XS () chmod 644 "XS.bs" "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib +/arch/auto/List/MoreUtils/XS/XS.bs 644 "/usr/bin/perl" "/usr/share/perl5/vendor_perl/ExtUtils/xsubpp" -typem +ap '/usr/share/perl5/ExtUtils/typemap' XS.xs > XS.xsc mv XS.xsc XS.c gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=form +at-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexcep +tions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/ +rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-anno +bin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clas +h-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/loca +l/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -DVERSION=\ +"0.428\" -DXS_VERSION=\"0.428\" -fPIC "-I/usr/lib64/perl5/CORE" XS. +c

Notice that there are quite a few perl-version related things like "/usr/bin/perl", "/usr/share/perl5/vendor_perl/ExtUtils/xsubpp", '/usr/share/perl5/ExtUtils/typemap'. Do all these paths agree with your perlbrew'ed Perl?

P.S. I think you should also send a message to syphilis too about this last error.

EDIT: Bottomline: now that you have perlbrew perhaps start fresh from the beginning to see a) how it is compiled using the new settings (for example to confirm if correct binaries and library paths are used), b) where it fails if it does, c) strace output filtering out noise to see the fullpath of the library failing the handshake. It is important to filter noise and irrelevant bits like the ENOENTs but give us the important bits like what binary creates the XS.xsc - also, it is more convenient for me to deal with this issue with as little delay as possible between replies. It is difficult to me to switch back and forth contexts.

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

Replies are listed 'Best First'.
Re^8: XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)
by syphilis (Bishop) on Aug 04, 2020 at 14:03 UTC
    P.S. I think you should also send a message to syphilis too about this last error.

    Which error is that ?

    I don't understand how it happens that the XS module Test::LeakTrace is fine for the OP, but the XS module List::MoreUtils::XS is not.
    I keep thinking that should be giving us a clue ... but I don't see any clues.
    I compared the way both modules built on the OP's perl-5.30.3 and both build in essentially the same way. In the (below) copy'n'paste, the first line of each pair of lines is from the Test::LeakTrace build, the second line is from the List::MoreUtils::XS build:
    Running Mkbootstrap for LeakTrace () Running Mkbootstrap for XS () chmod 644 "LeakTrace.bs" chmod 644 "XS.bs" "/home/rg8239/perl/bin/perl" "-Iinc" -MExtUtils::Command::MM -e 'cp_no +nempty' -- LeakTrace.bs blib/arch/auto/Test/LeakTrace/LeakTrace.bs 64 +4 "/home/rg8239/perl/bin/perl" -MExtUtils::Command::MM -e 'cp_no +nempty' -- XS.bs blib/arch/auto/List/MoreUtils/XS/XS.bs 644 "/home/rg8239/perl/bin/perl" "-Iinc" "/home/rg8239/perl/lib/5.30.3/Ext +Utils/xsubpp" -typemap '/home/rg8239/perl/lib/5.30.3/ExtUtils/typema +p' LeakTrace.xs > LeakTrace.xsc "/home/rg8239/perl/bin/perl" "/home/rg8239/perl/lib/5.30.3/Ext +Utils/xsubpp" -typemap '/home/rg8239/perl/lib/5.30.3/ExtUtils/typema +p' XS.xs > XS.xsc mv LeakTrace.xsc LeakTrace.c mv XS.xsc XS.c gcc -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFI +LE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.16\" -DXS_VERSI +ON=\"0.16\" -fPIC "-I/home/rg8239/perl/lib/5.30.3/x86_64-linux/CORE" + LeakTrace.c gcc -c -I. -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFI +LE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.428\" -DXS_VERSI +ON=\"0.428\" -fPIC "-I/home/rg8239/perl/lib/5.30.3/x86_64-linux/CORE" + XS.c rm -f blib/arch/auto/Test/LeakTrace/LeakTrace.so rm -f blib/arch/auto/List/MoreUtils/XS/XS.so gcc -shared -O2 -L/usr/local/lib LeakTrace.o -o blib/arch/auto/Test +/LeakTrace/LeakTrace.so \ gcc -shared -O2 -L/usr/local/lib XS.o -o blib/arch/auto/List +/MoreUtils/XS/XS.so \ \ \ chmod 755 blib/arch/auto/Test/LeakTrace/LeakTrace.so chmod 755 blib/arch/auto/List/MoreUtils/XS/XS.so Manifying 3 pod documents Manifying 1 pod document LEEJO/Test-LeakTrace-0.16.tar.gz REHSACK/List-MoreUtils-XS-0.428.tar.gz /usr/bin/make -- OK /usr/bin/make -- OK
    In both cases we see the same process, and the same flags - yet one results in a runtime mismatch and the other doesn't.
    The L::MU::XS build inserts a -I. in a couple of spots (needed to load headers that are located in the L::MU::XS top-level source directory), and the T::LT build inserts a "-Iinc" in a couple of spots - but I don't see anything telling in those minor differences.
    And, apart from those 2 minor discrepancies, the builds are identical.
    How can one module incur a mismatch, and the other not ?

    Cheers,
    Rob

        I will delete the perl and start over again after ensuring there are no environment variables that pertain to perl things (anything else I should consider there?)

        BTW, the messed up XS.c I posted the other day was due to a posting length limitation on this site. The site truncated the lion's share of the module and my closing code tag as well. FWIW, I edited that post to enter as much as I could without truncation. Sadly, the "preview" tool gives no indication of the truncation, so it all looked pretty rosy to me when I submitted it. Lesson learned

        Also, I just want you all to know how much I appreciate the time you are taking to help me out and, hopefully, others will be able to learn from this

        Rick

        One more thing... I'll be out for the remainder of the week and will pick this back up Monday

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2020-12-01 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (10 votes). Check out past polls.

    Notices?