perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

"loadable library and perl binaries are mismatched" not informative

Open p5pRT opened this issue 8 years ago • 26 comments

Migrated from rt.perl.org#130718 (status was 'open')

Searchable as RT130718$

p5pRT avatar Feb 04 '17 23:02 p5pRT

From [email protected]

Created by [email protected]

I have a number of modules which I've installed via 'cpanm'. Sometimes when I upgrade Perl I get an error message like this​:

  $ some-script-of-mine   XS.c​: loadable library and perl binaries are mismatched (got handshake key 0x7ec0080, needed 0x7f00080)

This message would be more helpful to me if it specified the module which is being loaded when the message is generated.

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.24.0:

Configured by builduser at Thu Sep  8 16:15:56 CEST 2016.

Summary of my perl5 (revision 5 version 24 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=4.7.3-1-arch, archname=i686-linux-thread-multi
    uname='linux flo-32 4.7.3-1-arch #1 smp preempt wed sep 7 17:57:38 cest 2016 i686 gnulinux '
    config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dlddlflags=-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Dldflags=-Wl,-O1,--sort-common,--as-needed,-z,relro'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion='', gccversion='6.1.1 20160802', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12, longdblkind=3
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/i686-pc-linux-gnu/6.1.1/include-fixed /usr/lib /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.24.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.24'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -fstack-protector-strong'



@INC for perl 5.24.0:
    /home/frederik/scripts-misc/perl
    /home/frederik/.local/lib/perl5/i686-linux-thread-multi
    /home/frederik/.local/lib/perl5
    /usr/lib/perl5/site_perl
    /usr/share/perl5/site_perl
    /usr/lib/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib/perl5/core_perl
    /usr/share/perl5/core_perl
    .


Environment for perl 5.24.0:
    HOME=/home/frederik
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/frederik/.local/arch/i386/lib:/home/frederik/.local/lib:/usr/local/lib
    LOGDIR (unset)
    PATH=/home/frederik/.local/bin:/home/frederik/scripts-misc:/home/frederik/.local/arch/i386/bin:/usr/bin/core_perl:/usr/bin/vendor_perl:/usr/bin/site_perl:/usr/local/bin:/usr/local/sbin:/usr/bin
    PERL5LIB=/home/frederik/scripts-misc/perl:/home/frederik/.local/lib/perl5:
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=/home/frederik/.local/:/home/frederik/.local/
    PERL_MB_OPT=--install_base "/home/frederik/.local/"
    PERL_MM_OPT=INSTALL_BASE=/home/frederik/.local/
    SHELL=/bin/zsh

p5pRT avatar Feb 04 '17 23:02 p5pRT

From @jkeenan

On Sat, 04 Feb 2017 23​:08​:09 GMT, frederik@​ofb.net wrote​:

This is a bug report for perl from frederik@​ofb.net, generated with the help of perlbug 1.40 running under perl 5.24.0.

----------------------------------------------------------------- [Please describe your issue here]

I have a number of modules which I've installed via 'cpanm'. Sometimes when I upgrade Perl I get an error message like this​:

$ some-script-of-mine XS.c​: loadable library and perl binaries are mismatched (got handshake key 0x7ec0080, needed 0x7f00080)

This message would be more helpful to me if it specified the module which is being loaded when the message is generated.

Does the discussion in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=124201 help you understand the problem better?

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT avatar Feb 05 '17 00:02 p5pRT

The RT System itself - Status changed from 'new' to 'open'

p5pRT avatar Feb 05 '17 00:02 p5pRT

From @jkeenan

On Sat, 04 Feb 2017 23​:08​:09 GMT, frederik@​ofb.net wrote​:

This is a bug report for perl from frederik@​ofb.net, generated with the help of perlbug 1.40 running under perl 5.24.0.

----------------------------------------------------------------- [Please describe your issue here]

I have a number of modules which I've installed via 'cpanm'. Sometimes when I upgrade Perl I get an error message like this​:

$ some-script-of-mine XS.c​: loadable library and perl binaries are mismatched (got handshake key 0x7ec0080, needed 0x7f00080)

This message would be more helpful to me if it specified the module which is being loaded when the message is generated.

Also, can you supply the output of 'perl -V' for both the version of perl against which your module was originally compiled, as well as that for the perl to which you upgraded (assuming that the 'perl -V' attached to this ticket is neither)?

Thank you very much. Jim Keenan

[Please do not change anything below this line] ----------------------------------------------------------------- --- Flags​: category=core severity=low --- Site configuration information for perl 5.24.0​:

Configured by builduser at Thu Sep 8 16​:15​:56 CEST 2016.

Summary of my perl5 (revision 5 version 24 subversion 0) configuration​:

Platform​: osname=linux, osvers=4.7.3-1-arch, archname=i686-linux-thread-multi uname='linux flo-32 4.7.3-1-arch #1 smp preempt wed sep 7 17​:57​:38 cest 2016 i686 gnulinux ' config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dlddlflags=- shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Dldflags=-Wl,-O1,-- sort-common,--as-needed,-z,relro' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler​: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict- aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-march=i686 -mtune=generic -O2 -pipe -fstack-protector- strong', cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='6.1.1 20160802', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12, longdblkind=3 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries​: ld='cc', ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/i686-pc-linux-gnu/6.1.1/include- fixed /usr/lib /lib libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.24.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.24' Dynamic Linking​: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE' cccdlflags='-fPIC', lddlflags='-shared -Wl,-O1,--sort-common,--as- needed,-z,relro -L/usr/local/lib -fstack-protector-strong'

--- @​INC for perl 5.24.0​: /home/frederik/scripts-misc/perl /home/frederik/.local/lib/perl5/i686-linux-thread-multi /home/frederik/.local/lib/perl5 /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .

--- Environment for perl 5.24.0​: HOME=/home/frederik LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH=/home/frederik/.local/arch/i386/lib​:/home/frederik/.local/lib​:/usr/local/lib LOGDIR (unset) PATH=/home/frederik/.local/bin​:/home/frederik/scripts- misc​:/home/frederik/.local/arch/i386/bin​:/usr/bin/core_perl​:/usr/bin/vendor_perl​:/usr/bin/site_perl​:/usr/local/bin​:/usr/local/sbin​:/usr/bin PERL5LIB=/home/frederik/scripts- misc/perl​:/home/frederik/.local/lib/perl5​: PERL_BADLANG (unset) PERL_LOCAL_LIB_ROOT=/home/frederik/.local/​:/home/frederik/.local/ PERL_MB_OPT=--install_base "/home/frederik/.local/" PERL_MM_OPT=INSTALL_BASE=/home/frederik/.local/ SHELL=/bin/zsh

-- James E Keenan (jkeenan@​cpan.org)

p5pRT avatar Feb 05 '17 00:02 p5pRT

From [email protected]

Thank you James. Your link describes the problem but I think I understood it already?

I'm just making a feature request for a better error message. TBH, I could catch the module name with 'strace' or looking in the script's 'use' statements, but these things stretch my tired brain a bit, and I imagine lazier users or harder situations exist.

I run Arch and I'm attaching 'perl -V' on the old system (same as generated the bug report) and on an upgraded system. But the upgraded system is 64 bit and the non-upgraded system is 32 bit, I hope that's not a problem for you. Thanks.

On Sat, Feb 04, 2017 at 04​:27​:55PM -0800, James E Keenan via RT wrote​:

On Sat, 04 Feb 2017 23​:08​:09 GMT, frederik@​ofb.net wrote​:

This is a bug report for perl from frederik@​ofb.net, generated with the help of perlbug 1.40 running under perl 5.24.0.

----------------------------------------------------------------- [Please describe your issue here]

I have a number of modules which I've installed via 'cpanm'. Sometimes when I upgrade Perl I get an error message like this​:

$ some-script-of-mine XS.c​: loadable library and perl binaries are mismatched (got handshake key 0x7ec0080, needed 0x7f00080)

This message would be more helpful to me if it specified the module which is being loaded when the message is generated.

Also, can you supply the output of 'perl -V' for both the version of perl against which your module was originally compiled, as well as that for the perl to which you upgraded (assuming that the 'perl -V' attached to this ticket is neither)?

Thank you very much. Jim Keenan

[Please do not change anything below this line] ----------------------------------------------------------------- --- Flags​: category=core severity=low --- Site configuration information for perl 5.24.0​:

Configured by builduser at Thu Sep 8 16​:15​:56 CEST 2016.

Summary of my perl5 (revision 5 version 24 subversion 0) configuration​:

Platform​: osname=linux, osvers=4.7.3-1-arch, archname=i686-linux-thread-multi uname='linux flo-32 4.7.3-1-arch #1 smp preempt wed sep 7 17​:57​:38 cest 2016 i686 gnulinux ' config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dlddlflags=- shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Dldflags=-Wl,-O1,-- sort-common,--as-needed,-z,relro' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler​: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict- aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-march=i686 -mtune=generic -O2 -pipe -fstack-protector- strong', cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='6.1.1 20160802', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12, longdblkind=3 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries​: ld='cc', ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/i686-pc-linux-gnu/6.1.1/include- fixed /usr/lib /lib libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.24.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.24' Dynamic Linking​: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE' cccdlflags='-fPIC', lddlflags='-shared -Wl,-O1,--sort-common,--as- needed,-z,relro -L/usr/local/lib -fstack-protector-strong'

--- @​INC for perl 5.24.0​: /home/frederik/scripts-misc/perl /home/frederik/.local/lib/perl5/i686-linux-thread-multi /home/frederik/.local/lib/perl5 /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .

--- Environment for perl 5.24.0​: HOME=/home/frederik LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH=/home/frederik/.local/arch/i386/lib​:/home/frederik/.local/lib​:/usr/local/lib LOGDIR (unset) PATH=/home/frederik/.local/bin​:/home/frederik/scripts- misc​:/home/frederik/.local/arch/i386/bin​:/usr/bin/core_perl​:/usr/bin/vendor_perl​:/usr/bin/site_perl​:/usr/local/bin​:/usr/local/sbin​:/usr/bin PERL5LIB=/home/frederik/scripts- misc/perl​:/home/frederik/.local/lib/perl5​: PERL_BADLANG (unset) PERL_LOCAL_LIB_ROOT=/home/frederik/.local/​:/home/frederik/.local/ PERL_MB_OPT=--install_base "/home/frederik/.local/" PERL_MM_OPT=INSTALL_BASE=/home/frederik/.local/ SHELL=/bin/zsh

-- James E Keenan (jkeenan@​cpan.org)

p5pRT avatar Feb 05 '17 02:02 p5pRT

From [email protected]

Summary of my perl5 (revision 5 version 24 subversion 0) configuration​:  
  Platform​:   osname=linux, osvers=4.7.3-1-arch, archname=i686-linux-thread-multi   uname='linux flo-32 4.7.3-1-arch #1 smp preempt wed sep 7 17​:57​:38 cest 2016 i686 gnulinux '   config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dlddlflags=-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Dldflags=-Wl,-O1,--sort-common,--as-needed,-z,relro'   hint=recommended, useposix=true, d_sigaction=define   useithreads=define, usemultiplicity=define   use64bitint=undef, use64bitall=undef, uselongdouble=undef   usemymalloc=n, bincompat5005=undef   Compiler​:   cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',   optimize='-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong',   cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'   ccversion='', gccversion='6.1.1 20160802', gccosandvers=''   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12, longdblkind=3   ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8   alignbytes=4, prototype=define   Linker and Libraries​:   ld='cc', ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib'   libpth=/usr/local/lib /usr/lib/gcc/i686-pc-linux-gnu/6.1.1/include-fixed /usr/lib /lib   libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat   perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc   libc=libc-2.24.so, so=so, useshrplib=true, libperl=libperl.so   gnulibc_version='2.24'   Dynamic Linking​:   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE'   cccdlflags='-fPIC', lddlflags='-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:   Compile-time options​: HAS_TIMES MULTIPLICITY PERLIO_LAYERS   PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV   PERL_HASH_FUNC_ONE_AT_A_TIME_HARD   PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP   PERL_PRESERVE_IVUV USE_ITHREADS USE_LARGE_FILES   USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE   USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO   USE_PERL_ATOF USE_REENTRANT_API   Built under linux   Compiled at Sep 8 2016 16​:16​:30   %ENV​:   PERL5LIB="/home/frederik/scripts-misc/perl​:/home/frederik/.local/lib/perl5​:"   PERL_LOCAL_LIB_ROOT="/home/frederik/.local/"   PERL_MB_OPT="--install_base "/home/frederik/.local/""   PERL_MM_OPT="INSTALL_BASE=/home/frederik/.local/"   @​INC​:   /home/frederik/scripts-misc/perl   /home/frederik/.local/lib/perl5/i686-linux-thread-multi   /home/frederik/.local/lib/perl5   /usr/lib/perl5/site_perl   /usr/share/perl5/site_perl   /usr/lib/perl5/vendor_perl   /usr/share/perl5/vendor_perl   /usr/lib/perl5/core_perl   /usr/share/perl5/core_perl   .

p5pRT avatar Feb 05 '17 02:02 p5pRT

From [email protected]

Summary of my perl5 (revision 5 version 24 subversion 1) configuration​:  
  Platform​:   osname=linux, osvers=4.9.3-1-arch, archname=x86_64-linux-thread-multi   uname='linux flo-64 4.9.3-1-arch #1 smp preempt thu jan 12 21​:34​:12 cet 2017 x86_64 gnulinux '   config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dcccdlflags='-fPIC' -Dlddlflags=-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Dldflags=-Wl,-O1,--sort-common,--as-needed,-z,relro'   hint=recommended, useposix=true, d_sigaction=define   useithreads=define, usemultiplicity=define   use64bitint=define, use64bitall=define, uselongdouble=undef   usemymalloc=n, bincompat5005=undef   Compiler​:   cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',   optimize='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong',   cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'   ccversion='', gccversion='6.3.1 20170109', gccosandvers=''   intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3   ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8   alignbytes=8, prototype=define   Linker and Libraries​:   ld='cc', ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib'   libpth=/usr/local/lib /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/include-fixed /usr/lib /lib/../lib /usr/lib/../lib /lib /lib64 /usr/lib64   libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat   perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc   libc=libc-2.24.so, so=so, useshrplib=true, libperl=libperl.so   gnulibc_version='2.24'   Dynamic Linking​:   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE'   cccdlflags='-fPIC', lddlflags='-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:   Compile-time options​: HAS_TIMES MULTIPLICITY PERLIO_LAYERS   PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV   PERL_HASH_FUNC_ONE_AT_A_TIME_HARD   PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP   PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT   USE_ITHREADS USE_LARGE_FILES USE_LOCALE   USE_LOCALE_COLLATE USE_LOCALE_CTYPE   USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO   USE_PERL_ATOF USE_REENTRANT_API   Built under linux   Compiled at Jan 15 2017 14​:53​:40   %ENV​:   PERL5LIB="/home/frederik/scripts-misc/perl​:/home/frederik/.local/lib/perl5​:"   PERL_LOCAL_LIB_ROOT="/home/frederik/.local/​:/home/frederik/.local/​:/home/frederik/.local/"   PERL_MB_OPT="--install_base "/home/frederik/.local/""   PERL_MM_OPT="INSTALL_BASE=/home/frederik/.local/"   @​INC​:   /home/frederik/scripts-misc/perl   /home/frederik/.local/lib/perl5/x86_64-linux-thread-multi   /home/frederik/.local/lib/perl5   /usr/lib/perl5/site_perl   /usr/share/perl5/site_perl   /usr/lib/perl5/vendor_perl   /usr/share/perl5/vendor_perl   /usr/lib/perl5/core_perl   /usr/share/perl5/core_perl   .

p5pRT avatar Feb 05 '17 02:02 p5pRT

From @tonycoz

On Sat, 04 Feb 2017 18​:06​:42 -0800, frederik@​ofb.net wrote​:

Thank you James. Your link describes the problem but I think I understood it already?

I'm just making a feature request for a better error message. TBH, I could catch the module name with 'strace' or looking in the script's 'use' statements, but these things stretch my tired brain a bit, and I imagine lazier users or harder situations exist.

I run Arch and I'm attaching 'perl -V' on the old system (same as generated the bug report) and on an upgraded system. But the upgraded system is 64 bit and the non-upgraded system is 32 bit, I hope that's not a problem for you. Thanks.

This might be a (conceptual) bug in Perl_xs_handshake().

The XS handshake uses the size of the interpreter structure as part of a "signature" for the perl build, assuming that a change in size means that the versions of perl are incompatible.

But maintenance releases *can* safely add members to the end of the interpreter structure, and 2bfbbbaf9ef1783ba914ff9e9270e877fbbb6aba does just that.

The handshake values in frederick's error message​:

(got handshake key 0x7ec0080, needed 0x7f00080)

extract the structure sizes​:

got 0x7ec

needed 0x7f0

which differ in sizeof(STRLEN) on the 32-bit system in the original -V output.

So I think Perl_xs_handshake() should only be checking that the size has not shrunk in maintenance releases.

One problem with that is it signifcantly reduces the strength of that check - Perl_xs_handshake() would no longer be detecting the type of problems we want it to detect - differences in sizes of the interpreter structure due to changes to the sizes of it's members (eg use64bitint changes) or due to build options (PERL_HASH_RANDOMIZE_KEYS for example) which may weaken the current interface to near uselessness.

Tony

p5pRT avatar Feb 06 '17 03:02 p5pRT

From @iabyn

On Sat, Feb 04, 2017 at 03​:08​:09PM -0800, via RT wrote​:

I have a number of modules which I've installed via 'cpanm'. Sometimes when I upgrade Perl I get an error message like this​:

$ some\-script\-of\-mine
XS\.c​: loadable library and perl binaries are mismatched \(got handshake key 0x7ec0080\, needed 0x7f00080\)

This message would be more helpful to me if it specified the module which is being loaded when the message is generated.

Leaving aside the discussions elsewhere in this thread about the handshake key, as regards displaying the name if the module being loaded, it already does, kinda.

XS\.c​: loadable library and perl binaries are mismatched \.\.\.

XS.c is the name of the src file from which the loadable lib was compiled; which isn't same as the name of the perl module, but may hint at it; for example​:

  $ ./perl -I../perl-5.24.1t/lib -MPerlIO​::scalar -e 1   scalar.c​: loadable library and perl binaries are mismatched ...   $

The error is given at the point when a dynamic library is loaded; this *may* have been triggered by a use/require, but not necessary. I suppose we could examine the context stack for an active require, and if so include that in the error message, e.g.

  while loading MPerlIO​::scalar​: scalar.c​: loadable library and perl binaries are mismatched ...

-- The Enterprise's efficient long-range scanners detect a temporal vortex distortion in good time, allowing it to be safely avoided via a minor course correction.   -- Things That Never Happen in "Star Trek" #21

p5pRT avatar Feb 06 '17 11:02 p5pRT

From [email protected]

The error is given at the point when a dynamic library is loaded; this *may* have been triggered by a use/require, but not necessary. I suppose we could examine the context stack for an active require, and if so include that in the error message, e.g.

while loading MPerlIO​::scalar​: scalar\.c​: loadable library and perl binaries are mismatched \.\.\.

That's more or less what I had in mind. Up to you if it's too much work / complexity. Would it be easier to just print the full path to the dynamic library, which would reveal both the module name and where it is installed?

I guess one could argue that I should just have a command to recompile all the locally-installed modules which need recompilation, whenever I upgrade Perl; since it may not be workable to test each of my scripts individually to see if it produces this message. Module dependencies are handled automatically by my distro package manager, but how to do this recompilation with e.g. all 'cpanm'-installed modules, I don't know.

Thanks,

Frederick

p5pRT avatar Feb 06 '17 17:02 p5pRT

From @grinnz

On Mon, Feb 6, 2017 at 12​:53 PM, <frederik@​ofb.net> wrote​:

I guess one could argue that I should just have a command to recompile all the locally-installed modules which need recompilation, whenever I upgrade Perl; since it may not be workable to test each of my scripts individually to see if it produces this message. Module dependencies are handled automatically by my distro package manager, but how to do this recompilation with e.g. all 'cpanm'-installed modules, I don't know.

Thanks,

Frederick

Generally, the preferred approach is not installing to a package-managed perl using CPAN.pm or cpanm, and instead installing to a local​::lib which can be blown-away and reinstalled easily upon upgrading perl. (Or by installing your own separate perl for development use, using perl-build, perlbrew, or plenv.) CPAN.pm and cpanm both default to installing to a local​::lib if run without write permission to the perl's lib directories, it's just a matter of setting it up for your user, usually involving adding a line to .bashrc.

-Dan

p5pRT avatar Feb 06 '17 18:02 p5pRT

From @Leont

On Mon, Feb 6, 2017 at 12​:30 PM, Dave Mitchell <davem@​iabyn.com> wrote​:

XS\.c&#8203;: loadable library and perl binaries are mismatched \.\.\.

XS.c is the name of the src file from which the loadable lib was compiled; which isn't same as the name of the perl module, but may hint at it; for example​:

$ \./perl \-I\.\./perl\-5\.24\.1t/lib \-MPerlIO&#8203;::scalar \-e 1
scalar\.c&#8203;: loadable library and perl binaries are mismatched \.\.\.
$

The error is given at the point when a dynamic library is loaded; this *may* have been triggered by a use/require, but not necessary. I suppose we could examine the context stack for an active require, and if so include that in the error message, e.g.

while loading MPerlIO&#8203;::scalar&#8203;: scalar\.c&#8203;: loadable library and perl

binaries are mismatched ...

The bootstrap function already received the arguments to DynaLoader/XSLoader, and xs_handshake has access to the stack (even if it's awkward).

Leon

p5pRT avatar Feb 06 '17 18:02 p5pRT

From @andk

On Mon, 6 Feb 2017 09​:53​:13 -0800, frederik@​ofb.net said​:

I guess one could argue that I should just have a command to recompile all the locally-installed modules which need recompilation, whenever I upgrade Perl;

CPAN.pm has a command for that. It's called 'recompile'.

-- andreas

p5pRT avatar Feb 06 '17 18:02 p5pRT

From [email protected]

On Mon, Feb 06, 2017 at 07​:54​:09PM +0100, Andreas Koenig wrote​:

On Mon, 6 Feb 2017 09​:53​:13 -0800, frederik@​ofb.net said​:

I guess one could argue that I should just have a command to recompile all the locally-installed modules which need recompilation, whenever I upgrade Perl;

CPAN.pm has a command for that. It's called 'recompile'.

I knew about CPAN​::recompile but I had thought I would need a cpanminus-specific solution. Now I find that it seems to work with my setup. I don't think I've configured CPAN other than that I have something in ~/.zprofile like this​:

  eval $(perl -Mlocal​::lib=.local)

I ran the command

  perl -MCPAN -e 'recompile()'

and after fetching metadata it seems to be doing the recompilation without any trouble (aside from very occasionally stopping and asking questions).

So another possibility for the error message would be to have it suggest the user recompile all local modules, and point them to CPAN(3perl)...?

Thanks,

Frederick

p5pRT avatar Feb 06 '17 20:02 p5pRT

Thank you for this: perl -MCPAN -e 'recompile()'

That was hard to find ...

Upgrading to Ubuntu 20.04 from 18.04 wreaked havoc on my Perl setup.

swajime avatar Oct 10 '20 12:10 swajime

Same problem, but command perl -MCPAN -e 'recompile()' fails with ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xde00080, needed 0xcd00080).

VariableVixen avatar Oct 10 '20 22:10 VariableVixen

Found more info. For an offending package: perldoc -l Moose # offending package is in my .local cpanm --uninstall Moose # removes offending package feom .local perldoc -l Moose # updated package is already in root system per ubuntu upgrade If not, you can install it via apt: aptitude search Moose sudo apt-get install libmoose-perl

I had to do this for a handful of modules, and then I was fine.

If you don't know which module is bad do a find: find / -iname ListUtil.c 2>/dev/null

swajime avatar Oct 11 '20 00:10 swajime

I wound up renaming my ~/perl5 folder, installing App::MigrateModules via cpan, and using perl-migrate-modules --from ~/perl5broken /usr/bin/perl to fix it. Hope that helps someone else!

VariableVixen avatar Oct 11 '20 05:10 VariableVixen

Hi! I updated my OS from Ubuntu 16 to Ubuntu 18 While using the tools, the below error is showing up

Damn.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)

Also, I was trying to implement the solution mentioned by @princessRTFM. While doing that accidently deleted the perl folder. Though the executable file "perl" is witnessed in /usr/local. I tried mending it and its not working. Please guide how to go about it.

Thank you.

aditi17142 avatar Apr 06 '21 06:04 aditi17142

Just wanted to mention that this problem had me stumped for some time when working through the process of setting up a Lightning Node. It was finally overcome when using the command "sudo ./autogen.sh" as opposed to "./autogen.sh". Obviously there was some permission issue deep in the Perl libraries.

This solution may be unique to my Ubuntu setup. It's mentioned as a possible last resort solution.

novacadian avatar Oct 29 '21 16:10 novacadian

I think it could be improved by having EU::PXS creating a macro with the module name (as from the MODULE keyword) and combining that with the FILE to supply to Perl_xs_handshake() instead of just FILE.

It would require untangling the maze of macros in XSUB.h though to define new macros that accept the new string instead of just supplying FILE.

tonycoz avatar Nov 01 '21 02:11 tonycoz

I get this error when trying to upgrade help2man:

gettext.c: loadable library and perl binaries are mismatched (got handshake key 0xcf00080, needed 0xce40080)

https://trac.macports.org/ticket/64712

barracuda156 avatar Feb 25 '22 19:02 barracuda156

> uname -a
OpenBSD server.local 7.6 GENERIC.MP#338 amd64

This is a fresh installation:

> doas pkg_add p5-Mail-SpamAssassin
quirks-7.50 signed on 2024-10-15T23:10:48Z
p5-Mail-SpamAssassin-4.0.1:libksba-1.6.7: ok
p5-Mail-SpamAssassin-4.0.1:libassuan-2.5.5: ok
p5-Mail-SpamAssassin-4.0.1:npth-1.6p0: ok
p5-Mail-SpamAssassin-4.0.1:libsecret-0.21.4: ok
p5-Mail-SpamAssassin-4.0.1:pinentry-1.3.0: ok
p5-Mail-SpamAssassin-4.0.1:gnupg-2.4.5: ok
p5-Mail-SpamAssassin-4.0.1:p5-Encode-Detect-1.01p8: ok
p5-Mail-SpamAssassin-4.0.1:p5-IO-String-1.08p3: ok
p5-Mail-SpamAssassin-4.0.1:re2c-3.1: ok
p5-Mail-SpamAssassin-4.0.1:p5-Net-LibIDN2-1.02: ok
p5-Mail-SpamAssassin-4.0.1:p5-Net-CIDR-Lite-0.22: ok
p5-Mail-SpamAssassin-4.0.1:p5-Net-Patricia-1.22p2: ok
p5-Mail-SpamAssassin-4.0.1:p5-BSD-Resource-1.2911p0: ok
p5-Mail-SpamAssassin-4.0.1:p5-Archive-Zip-1.68: ok
useradd: Warning: home directory `/var/db/spamassassin' doesn't exist, and -m was not specified
p5-Mail-SpamAssassin-4.0.1: ok
The following new rcscripts were installed: /etc/rc.d/spamassassin
See rcctl(8) for details.
New and changed readme(s):
/usr/local/share/doc/pkg-readmes/gnupg
/usr/local/share/doc/pkg-readmes/p5-Mail-SpamAssassin

> doas /usr/local/bin/spamd --help | head -4
SpamAssassin Server version 4.0.1
running on Perl 5.38.2
with SSL support (IO::Socket::SSL 2.089)
with zlib support (Compress::Zlib 2.204)

OK

This is on a system with previous installations of perl stuff:

> doas /usr/local/bin/spamd --help
Encode.c: loadable library and perl binaries are mismatched (got first handshake key 0xeb80000, needed 0xf280000)

So, there is a conflict, but the error message does not help tracking down the root cause of it.

patch-work avatar Oct 19 '24 10:10 patch-work

I haven't read the rest of the ticket, but your error message says "Encode.c: loadable library and perl binaries are mismatched", so the Encode module on your system was compiled for a different (incompatible) version of perl and needs to be reinstalled.

mauke avatar Oct 19 '24 10:10 mauke

I haven't read the rest of the ticket, but your error message says "Encode.c: loadable library and perl binaries are mismatched", so the Encode module on your system was compiled for a different (incompatible) version of perl and needs to be reinstalled.

So it seems, according to perldiag:

%s: loadable library and perl binaries are mismatched (got %s handshake key %p, needed %p)
   (P) A dynamic loading library ".so" or ".dll" was being loaded into the process that was built 
   against a different build of perl than the said library was compiled against. Reinstalling the
   XS module will likely fix this error.

However, I was able to solve the problem by removing collisions, namely uninstalling packages.

See https://github.com/fastmail/authentication_milter/issues/161 for a similar example, and related struggle.

patch-work avatar Oct 20 '24 17:10 patch-work

doas /usr/local/bin/spamd --help Encode.c: loadable library and perl binaries are mismatched (got first handshake key 0xeb80000, needed 0xf280000)


So, there is a conflict, but the error message does not help tracking down the root cause of it.

0xeb80 and 0xf280 are sizes of the interp struct/my_perl. The 2 numbers are so far apart, this isn't even a CCFLAGS -D dropout by Makefile.PL. I will guess you have 5.30.0 perl.bin competing with 5.40.0 perl.bin. .30 and .40 are randomly picked guesses. Just use strace and identify the abs path of the perl bin, and where that XS .so is on your disk. You are using 2 different package managers, or your package manager is pointed at 2 different major release OSes, or you have 2 different perls or a mismatched perl vs libperl.so

bulk88 avatar Oct 24 '24 06:10 bulk88

doas /usr/local/bin/spamd --help Encode.c: loadable library and perl binaries are mismatched (got first handshake key 0xeb80000, needed 0xf280000)


So, there is a conflict, but the error message does not help tracking down the root cause of it.

0xeb80 and 0xf280 are sizes of the interp struct/my_perl. The 2 numbers are so far apart, this isn't even a CCFLAGS -D dropout by Makefile.PL. I will guess you have 5.30.0 perl.bin competing with 5.40.0 perl.bin. .30 and .40 are randomly picked guesses. Just use strace and identify the abs path of the perl bin, and where that XS .so is on your disk. You are using 2 different package managers, or your package manager is pointed at 2 different major release OSes, or you have 2 different perls or a mismatched perl vs libperl.so

There is a single perl.bin in the whole system. However, this is an updated OS, so perhaps there are old libraries lying around.

patch-work avatar Oct 28 '24 11:10 patch-work

As a general note: I find the end-user experience here very poor. As a core perl developer I can justabout guess what's happened, but a more casual end user would have almost no hope at all.

I would greatly prefer (for the sake of not confusing users) if the handshake and message had something to say about the Perl version. 99 times in 100, that'll remind people what is going on.

I.e. instead of the message:

XS.c​: loadable library and perl binaries are mismatched (got handshake
key 0x7ec0080, needed 0x7f00080)

We got

XS.c: loadable library and perl binaries are mismatched (perl version is 5.40.0, library wanted 5.30.0)

To an end-user, that second message is much more useful and much more likely to trigger them into knowing what is going on and how to fix it.

leonerd avatar Oct 28 '24 12:10 leonerd

+1000 from me too

khwilliamson avatar Oct 28 '24 18:10 khwilliamson

As a general note: I find the end-user experience here very poor. As a core perl developer I can justabout guess what's happened, but a more casual end user would have almost no hope at all.

XS.c: loadable library and perl binaries are mismatched (perl version is 5.40.0, library wanted 5.30.0)

To an end-user, that second message is much more useful and much more likely to trigger them into knowing what is going on and how to fix it.

The code to emit that is later on but very unlikely to be reaching b/c previous checks, and if "friendlyness" matters, how do you prevent the even worse message?

 XS.c: loadable library and perl binaries are mismatched (perl version is 5.40.0, library wanted 5.40.0)

OS vendor or some 3rd party packer changed 1 random -D or Configure option in perl or added their not-P5P known "security patch". Float/NV length for example. Interp struct size not agreeing is fatal, none of the offsets can be trusted between perl.bin and module.so if interp structs don't agree.

I never thought back when I added this feature, that Linux people would hit the error, and that my SEGVs were Win32-unique to me keeping 2 perl.bin libperl.so'es and misc build trash in my PATH.

   usage:
       Perl_xs_handshake(U32 key, void * v_my_perl, const char * file,
            [U32 items, U32 ax], [char * api_version], [char * xs_version])

Checking Perl API string, before check interp size, is API impossible, unless you remove info (module name/package) from the existing message and switch to "Foo.c", b/c module name comes as SV * on Perl stack which is unusable/UB memory for mismatch.

https://github.com/Perl/perl5/blob/f2cb455cf7a4a7415dde08eb0999afcf37cb6a4a/util.c#L5624

It is possible to check Perl API string before interp size, but 1% risky if the arg is explicitly missing by XS module's author's demand since char * api_version is optional but 99% of CPAN modules will be supplying that arg. IIRC back in 5.20 or 5.12 when I added the API there were module authors or OS vendors that were bypassing Perl API version on purpose, either "demanding" ABI compat 5.8-5.12-5.infinity from P5P (request perm denied by P5P/P5P policy), or their module's Makefile.PL/Makefile was badly broken and stripping CCFLAGS and all -D'es or hard coding perl/lib/CORE or that module refused to use Makefile.PL and just included a hand written Makefile. I think that all has been fixed and char * api_version could be checked before interp size but then 2 Perl_croak_nocontext("Perl API version %s of %" SVf " does not match %s", api_p, SVfARG(PL_stack_base[ax + 0]),"v" PERL_API_VERSION_STRING); statements exist, noperl_die( variety and Perl_croak_nocontext( variety. Maybe Perl_croak_nocontext( variety can be removed forever as it is almost unreachable without dieing on interp size mismatch first.

Note for future, SV * is UB for ABI mismatch, it used to be 3 PTRs big before sv_any was added. version obj is UB ABI also. SV * could be 5 PTRs big in future, or SV * could be a Firefox or Chrome ptr in the future. FF NaN boxing (all SV's are NaN floats, hardware float exception OS signal, triggers "SV magic"). Or Chrome's "real objects, lowest 2 bits are always zero", if low 2 bits are not zero, the value is IMMORTAL.

bulk88 avatar Oct 28 '24 19:10 bulk88