Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by syphilis (Archbishop)
on Aug 14, 2020 at 01:20 UTC ( [id://11120702]=note: print w/replies, xml ) Need Help??


in reply to Re^15: 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)

I encountered the same thing

I got excited there for a moment, thinking that you had encountered the same problem as the OP ;-)
But, after further consideration, I realized you had probably merely encountered the same problem as I did.

That problem (ie ours, not the OP's) turns out to be fairly simple to resolve.
In HiRes.xs at lines 142 and 143 we have:
/* Visual C++ 2013 and older don't have the timespec structure */ # if defined(MSC_VER) && _MSC_VER < 1900
Turns out that gcc-3.4.5 also doesn't have the timespec structure, so I just changed line 143 to:
# if defined(_WIN32)
which is not a portable solution, but is good enough to get the job done if the version of gcc is 3.4.5.
The portable solution would be:
Updated (ie checked and corrected): #if (defined(MSC_VER) && _MSC_VER < 1900) || (defined(__MINGW32__) && +__GNUC__ < 4)
Anyway, List::MoreUtils::XS-0.428 builds and tests fine on my gcc-3.4.5 built perl-5.32.0.
At least I now have a functional gcc-3.4.5 build of perl-5.32.0.
Imagine how useful that will be !! (Not very..)

BTW, this gcc-3.4.5 build of perl-5.32.0 tested fairly well (IMO).
The cpan/IO-Compress/t/105oneshot-gzip.t script hangs and has to be slaughtered - but then the same thing happens for me with 64-bit gcc-8.3.0 builds of perl, too.
Test Summary Report ------------------- porting/pod_rules.t (Wsta +t: 0 Tests: 8 Failed: 1) Failed test: 2 porting/regen.t (Wsta +t: 65280 Tests: 13 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 45 tests but ran 13. ../cpan/IO-Compress/t/105oneshot-gzip.t (Wsta +t: 256 Tests: 239 Failed: 0) Non-zero exit status: 1 Parse errors: Bad plan. You planned 1007 tests but ran 239. ../ext/IPC-Open3/t/IPC-Open3.t (Wsta +t: 0 Tests: 45 Failed: 0) TODO passed: 25 ../ext/XS-APItest/t/call_checker.t (Wsta +t: 256 Tests: 78 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=2678, Tests=1148685, 2459 wallclock secs (71.23 usr + 4.68 sys += 75.91 CPU) Result: FAIL dmake: Error code 130, while making 'test'

Cheers,
Rob
  • Comment on Re^16: 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^17: XS.c: loadable library and perl binaries are mismatched (got handshake key 0xc100000, needed 0xc180000)
by rgren925 (Beadle) on Aug 18, 2020 at 20:45 UTC

    I think the gcc version may have been a red herring. I just got a RHEL 5.11 system with gcc 4.1.2 and received the same handshake mismatch on XS.c when I tried to use cpanm to install List::MoreUtils.

      I think the gcc version may have been a red herring

      Quite possibly, but it seems that there's something about these old RHEL systems and gcc compilers that's triggering a bug - either a bug in List-MoreUtilsXS-0.428 or a bug in the way the handshake compatibility is being established.

      I would suggest building perl with that handshake mechanism disabled - just to see if there is anything that is actually incompatible about XS.c. (Perhaps there's absolutely nothing wrong with XS.c.)
      However, I don't know how to build such a perl without hacking at util.c (in the top level directory of the perl source).
      If you think it's worth the effort, try changing (in util.c):
      noperl_die("%s: loadable library and perl binaries are mismatched"
      to a non-fatal:
      Perl_warn(aTHX_ "%s: loadable library and perl binaries are mismatched +"
      or even just:
      printf("%s: loadable library and perl binaries are mismatched"
      And then rebuild perl and see how List-MoreUtils-XS-0.428 fares.
      (I haven't tested either of those suggested hacks.)

      Could you also post the config.log of the L::MU::XS build that is generated by the perl Makefile.PL step. (You'll find that config.log in the same directory as the Makefile.PL).
      It might provide some clue as to the cause of the problem.
      And it might be worth filing a bug report about this at https://rt.cpan.org/Public/Dist/Display.html?Name=List-MoreUtils-XS in case the author has some ideas.

      Thanks for updating us !!

      Cheers,
      Rob
        If you think it's worth the effort, try changing (in util.c)...

        I don't think it's worth the effort.
        I thought it might be useful to see what happens on your system if the handshake fails but the program is allowed to continue on.
        So I tried (on Windows) changing the "noperl_die" to a "Perl_warn" as I suggested above, but when faced with an XS.dll (from an earlier version of perl) that failed to pass the handshake, the program still died:
        XS.c: loadable library and perl binaries are mismatched (got handshake + key 00000000005487e8, needed 0000000000000000)
        Even making util.c's Perl_xs_handshake() return as soon as the handshake mismatch was detected didn't prevent the fatality.

        I was hoping for a simple, unsophisticated, way of turning the mismatch into nothing more than a warning - but the gestapo have got me snookered on that one ... for the moment, anyway.
        It probably wouldn't have helped much, anyway.

        Cheers,
        Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2024-04-19 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found