Project

General

Profile

Actions

Backport #6021

closed

TestDBM#test_aref test fails

Added by vo.x (Vit Ondruch) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
[ruby-core:42613]

Description

Testing with Fedora 17/Rawhide, I get following test error:

TestDBM#test_aref = ./ruby: symbol lookup error: /builddir/build/BUILD/ruby-1.9.3-p105/.ext/x86_64-linux/dbm.so: undefined symbol: dbm_open

rpm -q gdbm

gdbm-1.10-2.fc17.x86_64


Files

mkmf.log (9.63 KB) mkmf.log Anonymous, 02/15/2012 08:54 PM
dbm.patch (688 Bytes) dbm.patch Anonymous, 02/16/2012 03:55 PM

Updated by naruse (Yui NARUSE) almost 13 years ago

I don't have an environment whose gdbm is 1.10.
Could you inspect deeper?

Updated by nobu (Nobuyoshi Nakada) almost 13 years ago

  • Status changed from Open to Feedback

=begin
Can't you show ((|mkmf.log|)) file under ((|ext/dbm|))?

And the shared library which that dbm.so is linked against has
"(({dbm_open}))" or similar symbol?
=end

Updated by Anonymous almost 13 years ago

Attaching mkmf.log.
Fails also with gdbm-1.8.3-9.fc15.x86_64. What seems to be causing the problem is the added 'libc' for Berkeley (see the mkmf.log for complaints about it). If it is deleted out from extconf.rb (both lines 8 and 12), everything works fine, including the tests.

Updated by Anonymous almost 13 years ago

OK, sorry for kidding, removing the 'libc' stuff doesn't affect it. I'll try to investigate this further. The problem is probably in the new gdbm functionality.

Updated by akr (Akira Tanaka) almost 13 years ago

2012/2/15 Bohuslav Kabrda :

OK, sorry for kidding, removing the 'libc' stuff doesn't affect it. I'll try to investigate this further. The problem is probably in the new gdbm functionality.

I guess the problem is header/library mismatch.
Fro example, gdbm header file and Berkeley DB library.

Ruby 2.0 should work better but the improvement may be too big for Ruby 1.9.3.

Tanaka Akira

Updated by naruse (Yui NARUSE) almost 13 years ago

I confirmed Ruby 1.9.3-p121 works with libgdbm 1.10 on NetBSD 5.99.60.

Akira Tanaka wrote:

2012/2/15 Bohuslav Kabrda :

OK, sorry for kidding, removing the 'libc' stuff doesn't affect it. I'll try to investigate this further. The problem is probably in the new gdbm functionality.

I guess the problem is header/library mismatch.
Fro example, gdbm header file and Berkeley DB library.

So this seems correct and maybe resolved by --dbm-type or changing order of dblib in extconf.rb.

Ruby 2.0 should work better but the improvement may be too big for Ruby 1.9.3.

I partly backported it to improve DBM::VERSION without advanced searching for headers.

Updated by Anonymous almost 13 years ago

Got another idea, but that doesn't seem to fix the issue either: the priority in checking condition in db_check2 in extconf.rb seems wrong - the attached patch adds braces that fix this. Still, I think that this patch is valid, as you probably want to check for presence of dbm_open function everytime. In the current condition, the expression gets evaluated like ((x AND y) or z), so that only z needs to be true to work, but I think it should be (x AND (y OR z)).

With the attached patch, I was able to achieve the same thing as with the old gdbm - the "-ldb" flag was passed during linking of dbm.so. But now the mentioned test fails, and also the tests seem to hang after "DB->del: attempt to modify a read-only database". Investigating further :)

Updated by naruse (Yui NARUSE) almost 13 years ago

I'm thinking to merge following patch...
https://gist.github.com/1843273

Actions #9

Updated by naruse (Yui NARUSE) almost 13 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
Actions #10

Updated by naruse (Yui NARUSE) almost 13 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34641.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/dbm/extconf.rb: merge trunk's ext/dbm/extconf.rb and
    related functions of lib/mkmf.rb. [Backport #6021]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0