Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

SQLite.c: loadable library and perl binaries are mismatched

by aplonis (Pilgrim)
on Mar 25, 2019 at 01:38 UTC ( #1231638=perlquestion: print w/replies, xml ) Need Help??

aplonis has asked for the wisdom of the Perl Monks concerning the following question:

Here's the issue and what little I know about it so far. Occurs after an upgrade of Ubuntu from 16.04 to 18.04. It happens like so...

guest@guest-Precision-M6700:~$ perl -e 'use DBD::SQLite'; SQLite.c: loadable library and perl binaries are mismatched (got hands +hake key 0xdb00080, needed 0xde00080)

And I knew first thing you all would ask this...

guest@guest-Precision-M6700:~$ env | grep PERL PERL_MB_OPT=--install_base "/home/guest/perl5" PERL_MM_OPT=INSTALL_BASE=/home/guest/perl5 PERL_LOCAL_LIB_ROOT=/home/guest/perl5 PERL5LIB=/home/guest/perl5/lib/perl5

And also this...

guest@guest-Precision-M6700:~$ perl -v This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-li +nux-gnu-thread-multi (with 67 registered patches, see perl -V for more detail) ... guest@guest-Precision-M6700:~$

Replies are listed 'Best First'.
Re: SQLite.c: loadable library and perl binaries are mismatched
by marto (Archbishop) on Mar 25, 2019 at 07:36 UTC

    The OS upgrade has installed a newer version of perl, XS modules need to be rebuilt against the target version of perl. Perl 5 and Binary Compatibility. You will need to reinstall the XS modules.

    This is one of the reasons I avoid using the system perl where possible. You could use your OS package manager to install modules, which would prevent the mismatch in upgrade situations. I tend to install my own perl elsewhere. A manual install is trivial, but there are also tools such as perlbrew to assist.

Re: SQLite.c: loadable library and perl binaries are mismatched
by bliako (Vicar) on Mar 25, 2019 at 01:58 UTC

    it looks to me that there is some mismatch between the whatever Perl executable you are currently using and the Perl libraries the DBD::SQLite binary library was linked to when you first installed it. You probably have 2 versions (or more) of Perl in your system (that means not only a Perl binary but also a perl library e.g. /usr/lib64/

    How to fix this: hmmmm, very simplistic: how about installing perlbrew and then once you select the Perl of your choice you cpanm install the module you want.

    Or, if you want to have only one Perl version in your system, erase all other binaries, libraries and cpan[m]'s of any other Perl. I would take this approach but if you had been installing modules using 2 different Perls you have a serious problem and probably you do not want to start erasing files as root.

    bw, bliako

      DBD::SQLite builds against its own copy of SQLite by default. Use of the system copy needs manual intervention in the Makefile.PL.

      That said, it's not clear if this implementation uses the packaged or system version, though, and the recommendation to use perlbrew is good advice in any case.

      edit: I'm too used to Strawberry perl where it comes as a vendor package. It's not core so if the system perl is used, and packages are installed outside the perl tree, then they will need to be updated when perl is updated. More reason to use perlbrew or similar.

Re: SQLite.c: loadable library and perl binaries are mismatched
by aplonis (Pilgrim) on Mar 26, 2019 at 01:21 UTC

    I discover this... I look in the path /Home/perl5/5.22.2/x86_64-linux-gnu-thread-multi and find it totally empty. And I go, 'Hm...'.

    But still in /Home/perl5/x86_64-linux-gnu-thread-multi/DBD/SQLite there were both DBD and DBI

    So as not to do anything irreversible, I rename perl5 to _perl5 in /Home and try perl -e 'use DBD::SQLite'; and now it works.

    Could it be that among the "many packages removed" portion of the upgrade from Unbutu 16.04 to 18.04 my local Perl got wiped away? Or is that effect a residual issue that had no bearing?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1231638]
Approved by Athanasius
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2019-07-20 03:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found