Skip Menu |
Report information

To: perlbug [...] perl.org
Subject: "loadable library and perl binaries are mismatched" not informative
From: frederik [...] ofb.net
Date: Sat, 04 Feb 2017 14:51:43 -0800
Download (untitled) / with headers
text/plain 4.4k
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. [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
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 867b
On Sat, 04 Feb 2017 23:08:09 GMT, frederik@ofb.net wrote: Show quoted text
> > 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.perl.org/Ticket/Display.html?id=124201 help you understand the problem better? Thank you very much. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 4.9k
On Sat, 04 Feb 2017 23:08:09 GMT, frederik@ofb.net wrote: Show quoted text
> > 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 Show quoted text
> [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)
Date: Sat, 4 Feb 2017 17:18:04 -0800
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
From: frederik [...] ofb.net
To: James E Keenan via RT <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 5.8k
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: Show quoted text
> 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) >
Download old-perl-V.out
text/plain 3.6k

Message body is not shown because sender requested not to inline it.

Download new-perl-V.out
text/plain 3.8k

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.7k
On Sat, 04 Feb 2017 18:06:42 -0800, frederik@ofb.net wrote: Show quoted text
> 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
Date: Mon, 6 Feb 2017 11:30:13 +0000
From: Dave Mitchell <davem [...] iabyn.com>
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
To: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.5k
On Sat, Feb 04, 2017 at 03:08:09PM -0800, via RT wrote: Show quoted text
> 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. Show quoted text
> 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
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
From: frederik [...] ofb.net
To: Dave Mitchell via RT <perlbug-followup [...] perl.org>
Date: Mon, 6 Feb 2017 09:53:13 -0800
Show quoted text
> 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
Date: Mon, 6 Feb 2017 13:17:34 -0500
CC: Dave Mitchell via RT <perlbug-followup [...] perl.org>
From: Dan Book <grinnz [...] gmail.com>
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
To: frederik [...] ofb.net
On Mon, Feb 6, 2017 at 12:53 PM, <frederik@ofb.net> wrote: Show quoted text
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 

From: Leon Timmermans <fawaka [...] gmail.com>
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
To: Dave Mitchell <davem [...] iabyn.com>
Date: Mon, 6 Feb 2017 19:47:59 +0100
CC: Perl5 Porters <perl5-porters [...] perl.org>
Download (untitled) / with headers
text/plain 964b
On Mon, Feb 6, 2017 at 12:30 PM, Dave Mitchell <davem@iabyn.com> wrote:
Show quoted text
>     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 bootstrap function already received the arguments to DynaLoader/XSLoader, and xs_handshake has access to the stack (even if it's awkward).

Leon
Date: Mon, 06 Feb 2017 19:54:09 +0100
CC: Dave Mitchell via RT <perlbug-followup [...] perl.org>
To: frederik [...] ofb.net
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
Download (untitled) / with headers
text/plain 302b
Show quoted text
>>>>> On Mon, 6 Feb 2017 09:53:13 -0800, frederik@ofb.net said:
Show quoted text
> 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
Date: Mon, 6 Feb 2017 12:07:26 -0800
CC: Dave Mitchell via RT <perlbug-followup [...] perl.org>
To: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
From: frederik [...] ofb.net
Subject: Re: [perl #130718] "loadable library and perl binaries are mismatched" not informative
Download (untitled) / with headers
text/plain 1009b
On Mon, Feb 06, 2017 at 07:54:09PM +0100, Andreas Koenig wrote: Show quoted text
> >>>>> 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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org