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

ndbm gdbm problem in make test #6906

Closed
p5pRT opened this issue Nov 7, 2003 · 13 comments
Closed

ndbm gdbm problem in make test #6906

p5pRT opened this issue Nov 7, 2003 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 7, 2003

Migrated from rt.perl.org#24444 (status was 'resolved')

Searchable as RT24444$

@p5pRT
Copy link
Author

p5pRT commented Nov 7, 2003

From warrend@mdhost.cse.tek.com

Created by warren.dodge@tek.com

I am mailing this on Solaris because the Linux email is not working.
I cut-n-pasted the meat of the Linux bug into this solaris report.

I just built perl-5.8.1 and had the following error five times during the make
test

perl​: relocation error​:
./lib/auto/NDBM_File/NDBM_File.so​: undefined symbol​: dbm_open

In looking at NDBM_File.so with ldd I see

  libgdbm.so.3 => /proj/wdt/i686_linux2.4/lib/libgdbm.so.3 (0x40009000)
  libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
  /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Notice it is using the libgdbm (gnu) library. This doesn't seem right. There
is not a dbm_open function in that lib file.

Ther is a /usr/lib/libndbm.so file on Linux. I have installed gdbm as seen
above.

I found this in the following file ext/NDBM_File/hints/linux.pl

# Some distributions have both gdbm and ndbm
# Prefer gdbm to avoid the broken ndbm in some distributions
# (no null key support)
# Jonathan Stowe <gellyfish@​gellyfish.com>
use Config;
$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;

Perhaps there is a logic problem in here somewhere??

This is the first time I have built perl on Linux so I can't tell you if it
has worked previously.

Let me know what information I can provide or what I can do to help solve
this problem.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.8.1:

Configured by warrend at Fri Nov  7 12:00:08 PST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.20-20.7bigmem, archname=i686-linux-thread-multi
    uname='linux zephyr 2.4.20-20.7bigmem #1 smp mon aug 18 14:34:37 edt 2003 i686 unknown unknown gnulinux '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/proj/wdt/i686_linux2.4/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/proj/wdt/i686_linux2.4/include -I/usr/include/gdbm'
    ccversion='', gccversion='3.3.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib /proj/wdt/i686_linux2.4/lib
    libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.2.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/proj/wdt/gnu_i686_linux2.4/perl-5.8.1/lib/5.8.1/i686-linux-thread-multi/CORE'
    cccdlflags='-fpic', lddlflags='-shared'

Locally applied patches:
    


@INC for perl v5.8.1:
    /proj/wdt/gnu_i686_linux2.4/perl-5.8.1/lib/5.8.1/i686-linux-thread-multi
    /proj/wdt/gnu_i686_linux2.4/perl-5.8.1/lib/5.8.1
    /proj/wdt/gnu_i686_linux2.4/perl-5.8.1/addons/lib/site_perl/5.8.1/i686-linux-thread-multi
    /proj/wdt/gnu_i686_linux2.4/perl-5.8.1/addons/lib/site_perl/5.8.1
    /proj/wdt/gnu_i686_linux2.4/perl-5.8.1/addons/lib/site_perl
    .


Environment for perl v5.8.1:
    HOME=/login/warrend/lxhome
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=.:/proj/wdt/bin:/proj/wdt/i686_linux2.4/bin:/usr/X11R6/bin:/login/warrend:/login/warrend/bin:/login/warrend/bin/i686_linux2.4:/bin:/usr/bin:/etc:/usr/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Nov 8, 2003

From @rgs

Warren L Dodge (via RT) wrote​:

I just built perl-5.8.1 and had the following error five times during the make
test

perl​: relocation error​:
./lib/auto/NDBM_File/NDBM_File.so​: undefined symbol​: dbm_open

In looking at NDBM_File.so with ldd I see

    libgdbm\.so\.3 => /proj/wdt/i686\_linux2\.4/lib/libgdbm\.so\.3 \(0x40009000\)
    libc\.so\.6 => /lib/i686/libc\.so\.6 \(0x42000000\)
    /lib/ld\-linux\.so\.2 => /lib/ld\-linux\.so\.2 \(0x80000000\)

Notice it is using the libgdbm (gnu) library. This doesn't seem right. There
is not a dbm_open function in that lib file.

Ther is a /usr/lib/libndbm.so file on Linux. I have installed gdbm as seen
above.

You have two options :
- don't build NDBM_File, by passing the -Ui_ndbm command line flag to Configure
- try to delete the linux NDBM_File hint file and see if it can figure out
  to link NDBM_File with libndbm -- and if it works correctly.

It depends on your need for NDBM_File.

I found this in the following file ext/NDBM_File/hints/linux.pl

# Some distributions have both gdbm and ndbm
# Prefer gdbm to avoid the broken ndbm in some distributions
# (no null key support)
# Jonathan Stowe <gellyfish@​gellyfish.com>
use Config;
$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;

Perhaps there is a logic problem in here somewhere??

API compatibility between *dbm libraries is left as an exercise to the
reader :) I'm not familiar enough with these to comment.

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2003

From warren.dodge@tektronix.com

Ok, I tried two things in this ndbm/gdbm area.

I turned off the ext/NDBM_File/hints/linux.pl file. I did a new configure and
build. This did change the test results but there were still errors. It fixed
the ndbm using the gdbm library file.

So the new errors are like this one.

lib/AnyDBM_File......................ndbm store returned -1, errno 22, key ""
at ../lib/AnyDBM_File.t line 111.

I also did a new configure and removed ndbm info from the list of libs and
from the loaded extensions. This made and tested with no errors by skipping
all the tests that had to do with ndbm.

So, I don't know what to do/think. I would think, if each of the libraries
are available, that perl should sort things out and "just work". When
hundreds of people use a build, it is very difficult to know what they are
doing.

Also, this all works fine on Solaris 8 using all the default choices in the
configure.

Date​: 8 Nov 2003 10​:06​:29 -0000
From​: Rafael Garcia-Suarez (via RT) <perlbug-followup@​perl.org>
Reply-To​: perlbug-followup@​perl.org
X-RT-Loop-Prevention​: perl
RT-Ticket​: perl #24444
Managed-by​: RT 2.0.14 (http​://bestpractical.com/rt/)
RT-Originator​: rgarciasuarez@​free.fr
Content-Disposition​: inline

Warren L Dodge (via RT) wrote​:

I just built perl-5.8.1 and had the following error five times during the make
test

perl​: relocation error​:
./lib/auto/NDBM_File/NDBM_File.so​: undefined symbol​: dbm_open

In looking at NDBM_File.so with ldd I see

    libgdbm\.so\.3 => /proj/wdt/i686\_linux2\.4/lib/libgdbm\.so\.3 \(0x40009000\)
    libc\.so\.6 => /lib/i686/libc\.so\.6 \(0x42000000\)
    /lib/ld\-linux\.so\.2 => /lib/ld\-linux\.so\.2 \(0x80000000\)

Notice it is using the libgdbm (gnu) library. This doesn't seem right. There
is not a dbm_open function in that lib file.

Ther is a /usr/lib/libndbm.so file on Linux. I have installed gdbm as seen
above.

You have two options :
- don't build NDBM_File, by passing the -Ui_ndbm command line flag to Configure
- try to delete the linux NDBM_File hint file and see if it can figure out
to link NDBM_File with libndbm -- and if it works correctly.

It depends on your need for NDBM_File.

I found this in the following file ext/NDBM_File/hints/linux.pl

# Some distributions have both gdbm and ndbm
# Prefer gdbm to avoid the broken ndbm in some distributions
# (no null key support)
# Jonathan Stowe <gellyfish@​gellyfish.com>
use Config;
$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;

Perhaps there is a logic problem in here somewhere??

API compatibility between *dbm libraries is left as an exercise to the
reader :) I'm not familiar enough with these to comment.

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2003

From @Tux

On Tue 11 Nov 2003 21​:41, Warren L Dodge <warrend@​mdhost.cse.tek.com> wrote​:

Ok, I tried two things in this ndbm/gdbm area.

<bells ringin'>

Do you get anything like this​:

# nm /usr/lib/libndbm.a
nm​: libndbm.a​: File format not recognized

Remove /usr/lib/libndbm.a and /usr/lib/libndbm.so, both likely to be of size
182/184. They are just (invalid) placeholders

I turned off the ext/NDBM_File/hints/linux.pl file. I did a new configure and
build. This did change the test results but there were still errors. It fixed
the ndbm using the gdbm library file.

So the new errors are like this one.

lib/AnyDBM_File......................ndbm store returned -1, errno 22, key ""
at ../lib/AnyDBM_File.t line 111.

I also did a new configure and removed ndbm info from the list of libs and
from the loaded extensions. This made and tested with no errors by skipping
all the tests that had to do with ndbm.

So, I don't know what to do/think. I would think, if each of the libraries
are available, that perl should sort things out and "just work". When
hundreds of people use a build, it is very difficult to know what they are
doing.

Also, this all works fine on Solaris 8 using all the default choices in the
configure.

Date​: 8 Nov 2003 10​:06​:29 -0000
From​: Rafael Garcia-Suarez (via RT) <perlbug-followup@​perl.org>
Reply-To​: perlbug-followup@​perl.org
X-RT-Loop-Prevention​: perl
RT-Ticket​: perl #24444
Managed-by​: RT 2.0.14 (http​://bestpractical.com/rt/)
RT-Originator​: rgarciasuarez@​free.fr
Content-Disposition​: inline

Warren L Dodge (via RT) wrote​:

I just built perl-5.8.1 and had the following error five times during the make
test

perl​: relocation error​:
./lib/auto/NDBM_File/NDBM_File.so​: undefined symbol​: dbm_open

In looking at NDBM_File.so with ldd I see

    libgdbm\.so\.3 => /proj/wdt/i686\_linux2\.4/lib/libgdbm\.so\.3 \(0x40009000\)
    libc\.so\.6 => /lib/i686/libc\.so\.6 \(0x42000000\)
    /lib/ld\-linux\.so\.2 => /lib/ld\-linux\.so\.2 \(0x80000000\)

Notice it is using the libgdbm (gnu) library. This doesn't seem right. There
is not a dbm_open function in that lib file.

Ther is a /usr/lib/libndbm.so file on Linux. I have installed gdbm as seen
above.

You have two options :
- don't build NDBM_File, by passing the -Ui_ndbm command line flag to Configure
- try to delete the linux NDBM_File hint file and see if it can figure out
to link NDBM_File with libndbm -- and if it works correctly.

It depends on your need for NDBM_File.

I found this in the following file ext/NDBM_File/hints/linux.pl

# Some distributions have both gdbm and ndbm
# Prefer gdbm to avoid the broken ndbm in some distributions
# (no null key support)
# Jonathan Stowe <gellyfish@​gellyfish.com>
use Config;
$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;

Perhaps there is a logic problem in here somewhere??

API compatibility between *dbm libraries is left as an exercise to the
reader :) I'm not familiar enough with these to comment.

--
H.Merijn Brand Amsterdam Perl Mongers (http​://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0, & 5.9.x, and 806 on HP-UX 10.20 & 11.00, 11i,
  AIX 4.3, SuSE 8.2, and Win2k. http​://www.cmve.net/~merijn/
http​://archives.develooper.com/daily-build@​perl.org/ perl-qa@​perl.org
send smoke reports to​: smokers-reports@​perl.org, QA​: http​://qa.perl.org

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2003

From warrend@mdhost.cse.tek.com

ll /usr/lib/libndb*
lrwxrwxrwx 1 root root 8 Aug 19 08​:02 /usr/lib/libndbm.a -> libdb2.a
lrwxrwxrwx 1 root root 11 Aug 19 08​:02 /usr/lib/libndbm.so -> libdb2.so.3

ll -L /usr/lib/libndb*
-rw-r--r-- 1 root root 392034 Apr 2 2002 /usr/lib/libndbm.a
-rwxr-xr-x 1 root root 277324 Apr 2 2002 /usr/lib/libndbm.so*

Each of these do the nm just fine.

The system I am using is a "standard" linux distribution. It is also a
backroom machine where I can't do anything as root.

Here is the output of one test run

./perl lib/AnyDBM_File.t
1..12
ok 1 - Tie
ok 2 - File permissions
ok 3 - Hash created empty
ok 4 - Re-tie hash
ok 5 - $\#keys == $\#values
ok 6 - keys and values match
ok 7 - Correct number of keys
ndbm store returned -1, errno 22, key "" at lib/AnyDBM_File.t line 111.

This is doing $h{''} = 'bar';

I can't figure out how to trace this error down.

I really don't understand all the "dbm" formats or how to use them so I am
not much help in this area.

In the past on solaris I just ran the default Configure and everything
worked. On Linux is where the default doesn't pass the tests.

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2003

From @nwc10

On Wed, Nov 12, 2003 at 09​:28​:57AM -0800, Warren L Dodge wrote​:

ndbm store returned -1, errno 22, key "" at lib/AnyDBM_File.t line 111.

This is doing $h{''} = 'bar';

I can't figure out how to trace this error down.

Was there ever a version of ndbm that didn't allow empty keys?
I know that one or other DBM implementation didn't (for a while, until
they were convinced that this was a silly thing to disallow)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Nov 13, 2003

From @schwern

On Wed, Nov 12, 2003 at 09​:28​:57AM -0800, Warren L Dodge wrote​:

The system I am using is a "standard" linux distribution. It is also a
backroom machine where I can't do anything as root.

The great thing about standard Linux distributions is there's so many to
choose from! :)

Knowing which Linux distribution you're using would help.

--
Michael G Schwern schwern@​pobox.com http​://www.pobox.com/~schwern/
Remember, any tool can be the right tool.
  -- Red Green

@p5pRT
Copy link
Author

p5pRT commented Nov 13, 2003

From warrend@mdhost.cse.tek.com

If you are asking me about this, I have no idea.

Date​: 12 Nov 2003 21​:46​:39 -0000
From​: Nicholas Clark (via RT) <perlbug-followup@​perl.org>
Reply-To​: perlbug-followup@​perl.org
X-RT-Loop-Prevention​: perl
RT-Ticket​: perl #24444
Managed-by​: RT 2.0.14 (http​://bestpractical.com/rt/)
RT-Originator​: nick@​ccl4.org
Content-Disposition​: inline

On Wed, Nov 12, 2003 at 09​:28​:57AM -0800, Warren L Dodge wrote​:

ndbm store returned -1, errno 22, key "" at lib/AnyDBM_File.t line 111.

This is doing $h{''} = 'bar';

I can't figure out how to trace this error down.

Was there ever a version of ndbm that didn't allow empty keys?
I know that one or other DBM implementation didn't (for a while, until
they were convinced that this was a silly thing to disallow)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2004

From swtaylor@gentoo.org

gdbm-1.8.3 moved the "old" ndbm functions from libgdbm.so to
libgdbm_compat.so - I've had good luck making the following change​:

--- perl-5.8.2/ext/NDBM_File/hints/linux.pl.orig 2003-11-11
00​:50​:43.924885744 -0700
+++ perl-5.8.2/ext/NDBM_File/hints/linux.pl 2003-11-11
00​:51​:05.631585824 -0700
@​@​ -3,4 +3,4 @​@​
# (no null key support)
# Jonathan Stowe <gellyfish@​gellyfish.com>
use Config;
-$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;
+$self->{LIBS} = ['-lgdbm -lgdbm_compat'] if $Config{libs} =~
/(?​:^|\s)-lgdbm(?​:\s|$)/;

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2004

From warren.dodge@tektronix.com

This seemed to work fine. I also had to adjust the ODBM hints file to make
those tests pass.

What I found was that the Redhat release we are using does not provide the
libgdbm-compat library. Or at least we could not find it.

I built gdbm and installed the compat lib to make it work.

Perhaps this is an omission in the Linux release?

uname -a
Linux tekcs22 2.4.21-4.ELhugemem #1 SMP Fri Oct 3 17​:31​:20 EDT 2003 i686 i686 i386 GNU/Linux
with libc-2.3.2.so

Date​: 21 Jan 2004 22​:33​:27 -0000
From​: "Scott Taylor via RT" <perlbug-followup@​perl.org>
Reply-To​: perlbug-followup@​perl.org
X-RT-Loop-Prevention​: perl
RT-Ticket​: perl #24444
Managed-by​: RT 3.0.8 (http​://www.bestpractical.com/rt/)
RT-Originator​: scott@​303underground.com

gdbm-1.8.3 moved the "old" ndbm functions from libgdbm.so to
libgdbm_compat.so - I've had good luck making the following change​:

--- perl-5.8.2/ext/NDBM_File/hints/linux.pl.orig 2003-11-11
00​:50​:43.924885744 -0700
+++ perl-5.8.2/ext/NDBM_File/hints/linux.pl 2003-11-11
00​:51​:05.631585824 -0700
@​@​ -3,4 +3,4 @​@​
# (no null key support)
# Jonathan Stowe <gellyfish@​gellyfish.com>
use Config;
-$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;
+$self->{LIBS} = ['-lgdbm -lgdbm_compat'] if $Config{libs} =~ /(?​:^|\s)-lgdbm(?​:\s|$)/;

@p5pRT
Copy link
Author

p5pRT commented Jan 23, 2004

From swtaylor@gentoo.org

I ran into this issue when gdbm-1.8.3 was added to the unstable tree of
gentoo. It was rather quickly just masked and moved to the back burner.
gdbm-1.8.2 still had all the ndbm calls in its main library. A number of
things seem to still be using things moved into the gdbm_compat
(spamassassin's bayes database was the most obvious one i was hit by)

Blue root # uname -a
Linux Blue 2.6.1-gentoo #2 Mon Jan 12 16​:07​:11 MST 2004 i686 AMD
Athlon(tm) XP 1500+ AuthenticAMD GNU/Linux
Blue root # emerge -p gdbm perl

These are the packages that I would merge, in order​:

Calculating dependencies ...done!
[ebuild R ] sys-libs/gdbm-1.8.3
[ebuild R ] dev-lang/perl-5.8.3-r1

[warren.dodge@​tektronix.com - Thu Jan 22 15​:37​:27 2004]​:
This seemed to work fine. I also had to adjust the ODBM hints file to
make those tests pass.

What I found was that the Redhat release we are using does not provide
the libgdbm-compat library. Or at least we could not find it.

I built gdbm and installed the compat lib to make it work.

Perhaps this is an omission in the Linux release?

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2008

@smpeters - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Nov 14, 2008
@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2008

From @smpeters

On Thu Jan 22 16​:16​:05 2004, swtaylor wrote​:

I ran into this issue when gdbm-1.8.3 was added to the unstable tree of
gentoo. It was rather quickly just masked and moved to the back burner.
gdbm-1.8.2 still had all the ndbm calls in its main library. A number of
things seem to still be using things moved into the gdbm_compat
(spamassassin's bayes database was the most obvious one i was hit by)

Blue root # uname -a
Linux Blue 2.6.1-gentoo #2 Mon Jan 12 16​:07​:11 MST 2004 i686 AMD
Athlon(tm) XP 1500+ AuthenticAMD GNU/Linux
Blue root # emerge -p gdbm perl

These are the packages that I would merge, in order​:

Calculating dependencies ...done!
[ebuild R ] sys-libs/gdbm-1.8.3
[ebuild R ] dev-lang/perl-5.8.3-r1

[warren.dodge@​tektronix.com - Thu Jan 22 15​:37​:27 2004]​:
This seemed to work fine. I also had to adjust the ODBM hints file to
make those tests pass.

What I found was that the Redhat release we are using does not provide
the libgdbm-compat library. Or at least we could not find it.

I built gdbm and installed the compat lib to make it work.

Perhaps this is an omission in the Linux release?

This was resolved with change #22892.

Steve

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

1 participant