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" not informative #15861

Open
p5pRT opened this issue Feb 4, 2017 · 22 comments
Open

"loadable library and perl binaries are mismatched" not informative #15861

p5pRT opened this issue Feb 4, 2017 · 22 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 4, 2017

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

Searchable as RT130718$

@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2017

From frederik@ofb.net

Created by frederik@ofb.net

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
Copy link
Author

p5pRT commented Feb 5, 2017

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
Copy link
Author

p5pRT commented Feb 5, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Feb 5, 2017

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
Copy link
Author

p5pRT commented Feb 5, 2017

From frederik@ofb.net

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
Copy link
Author

p5pRT commented Feb 5, 2017

From frederik@ofb.net

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
Copy link
Author

p5pRT commented Feb 5, 2017

From frederik@ofb.net

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
Copy link
Author

p5pRT commented Feb 6, 2017

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 2bfbbba 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
Copy link
Author

p5pRT commented Feb 6, 2017

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
Copy link
Author

p5pRT commented Feb 6, 2017

From frederik@ofb.net

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
Copy link
Author

p5pRT commented Feb 6, 2017

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
Copy link
Author

p5pRT commented Feb 6, 2017

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
Copy link
Author

p5pRT commented Feb 6, 2017

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
Copy link
Author

p5pRT commented Feb 6, 2017

From frederik@ofb.net

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

@swajime
Copy link

swajime commented Oct 10, 2020

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.

@PrincessRTFM
Copy link

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).

@swajime
Copy link

swajime commented Oct 11, 2020

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

@PrincessRTFM
Copy link

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!

@aditi17142
Copy link

aditi17142 commented Apr 6, 2021

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.

@novacadian
Copy link

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.

@tonycoz
Copy link
Contributor

tonycoz commented Nov 1, 2021

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.

@barracuda156
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants