Backport #6021

TestDBM#test_aref test fails

Added by Vit Ondruch about 2 years ago. Updated about 2 years ago.

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

Description

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

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

rpm -q gdbm

gdbm-1.10-2.fc17.x86_64

mkmf.log (9.63 KB) Bohuslav Kabrda, 02/15/2012 08:54 PM

dbm.patch Magnifier (688 Bytes) Bohuslav Kabrda, 02/16/2012 03:55 PM

Associated revisions

Revision 34641
Added by Yui NARUSE about 2 years ago

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

Revision 34649
Added by Yui NARUSE about 2 years ago

Fix debug line of ext/dbm/extconf.rb in r34641. [Backport #6021]

History

#1 Updated by Yui NARUSE about 2 years ago

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

#2 Updated by Nobuyoshi Nakada about 2 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

#3 Updated by Bohuslav Kabrda about 2 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.

#4 Updated by Bohuslav Kabrda about 2 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.

#5 Updated by Akira Tanaka about 2 years ago

2012/2/15 Bohuslav Kabrda bkabrda@redhat.com:

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

#6 Updated by Yui NARUSE about 2 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 bkabrda@redhat.com:

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.

#7 Updated by Bohuslav Kabrda about 2 years ago

Got another idea, but that doesn't seem to fix the issue either: the priority in checking condition in dbcheck2 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 dbmopen 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 :)

#8 Updated by Yui NARUSE about 2 years ago

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

#9 Updated by Yui NARUSE about 2 years ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport93

#10 Updated by Yui NARUSE about 2 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]

Also available in: Atom PDF