Subject: pkg/23535: perl berkely DB incompatible.
To: None <gnats-bugs@gnats.netbsd.org>
From: Karsten <karsten@igwe.vub.ac.be>
List: netbsd-bugs
Date: 11/23/2003 00:14:30
>Number: 23535
>Category: pkg
>Synopsis: perl DB_File.so is miscompiled. BSD databases inconsistent
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Nov 22 23:15:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Karsten
>Release: NetBSD 1.6.1_STABLE
>Organization:
Infogroep
>Environment:
System: NetBSD igwe 1.6.1_STABLE NetBSD 1.6.1_STABLE (IGWE) #1: Wed Sep 17 11:28:28 CEST 2003 root@igwe:/usr/src/sys/arch/i386/compile/IGWE i386
Architecture: i386
Machine: i386
>Description:
The perl DB_File package was misconfigured during compilation. As a
result libdb and friends can't open perl berkely databases.
Also database migration from say linux to bsd becomes impossible.
To test for the bug:
igwe:~$ ldd /usr/pkg/lib/perl5/5.6.1/i386-netbsd/auto/DB_File/DB_File.so
/usr/pkg/lib/perl5/5.6.1/i386-netbsd/auto/DB_File/DB_File.so:
-lperl => /usr/pkg/lib/perl5/5.6.1/i386-netbsd/CORE/libperl.so
Admit it's odd for a berkely db package to not be linked against
libdb. Also db4_dump and other berkely db tools will not work on
perl generated berkely databases.
To put it short: NetBSD has inconsistent databases.
A correctly compiled DB_File would act like this:
igwe:~$ ldd fixed/DB_File.so
fixed/DB_File.so:
-lperl => /usr/pkg/lib/perl5/5.6.1/i386-netbsd/CORE/libperl.so
-ldb4.1 => /usr/pkg/lib/libdb4.so.1
I even traced the problem. Apparently the guy that compiled DB_File
neglected to fill in the paths in the makefile.
So to fix the problem: get the DB_File package from CPAN. Actually
read the install and readme files. Change the Makefile and fill in
the correct paths for the libdb4 includes and libs.
Recompile.
It seems perl uses it's own propietary database format when it can't
find the libdb4.so files. It also neglects to warn it does so.
Do note that fixing this in the portage will break all existing perl
databases! However they will become compatible with other OS's and
other libs again.
To see if you compiled it correctly this time, run ldd on the new
lib.
>How-To-Repeat:
get a linux perl database and open it on BSD
get a berkely database and try to open it in perl.
get a perl database and try to examine with BSD commands as db4_dump
>Fix:
recompile DB_File for perl.
Do fill in the correct paths for libdb4.so and it's includes in the
Makefile this time.
>Release-Note:
>Audit-Trail:
>Unformatted: