[DRE-maint] Bug#741576: ruby-bdb: FTBFS (on AMD64): Test failures

2014-03-20 Thread David Suárez
Hi !

Yes, this is 64 bits specific issue.

 According to the documentation, set_h_hash is meant to «specify a
 hashing function». ./examples/func.rb is the only other file to make
 use of this parameter, in exactly the same way as this test (and thus
 will likely fail).

 The most I can dig into the issue right now (as I'm tired and my brain
 does not want to parse C↔Ruby interaction) is that behaviour related
 to set_h_hash is found in lines 666-677 of src/common.h.

The problem is in the hashing function callback;

 static u_int32_t
 #if BDB_OLD_FUNCTION_PROTO
 bdb_h_hash(const void *bytes, u_int32_t length)
 #else
 bdb_h_hash(DB *dbbd, const void *bytes, u_int32_t length)

BDB states that the callback should return a u_int32_t. C code tries to 
convert the ruby number that the returns the (ruby level) hashing function 
into an unsigned int (using the NUM2INT helper), on 64 bits systems this could 
overflow.

 res = rb_funcall(dbst-h_hash, bdb_id_call, 1, st);
 
 return NUM2INT(res);

I dunno how to procede here. Could simply switch to use NUM2ULONG function to 
evade the overflow but I need to return an u_int32_t due to the callback 
function constrainsts (this could leads to strange behaviour on 64 bits 
system).

___
Pkg-ruby-extras-maintainers mailing list
Pkg-ruby-extras-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers

[DRE-maint] Bug#741576: ruby-bdb: FTBFS (on AMD64): Test failures

2014-03-13 Thread Gunnar Wolf
Source: ruby-bdb
Version: 0.6.6-1
Severity: serious
Justification: FTBFS on amd64

Attempting to build this package on AMD64, I got the following
results:

88
/usr/bin/install -c -m 0755 bdb.so ./.gem.20140313-22704-1exw4lh
make[1]: Leaving directory `/home/gwolf/vcs/build-area/ruby-bdb-0.6.6/src'
Running tests for ruby1.9.1 using debian/ruby-tests.rb...

VERSION of BDB is Berkeley DB 5.3.28: (September  9, 2013)
Run options: 

# Running tests:



Finished tests in 0.561218s, 21.3821 tests/s, 4124.9583 assertions/s.

12 tests, 2315 assertions, 0 failures, 0 errors, 0 skips

VERSION of BDB is Berkeley DB 5.3.28: (September  9, 2013)
Run options: 

# Running tests:

...

Finished tests in 4.073800s, 5.6458 tests/s, 1880.0627 assertions/s.

  1) Error:
test_18_hash_delete(TestHash):
RangeError: integer -1893907612379325628 too small to convert to `unsigned int'
tests/hash.rb:387:in `initialize'
tests/hash.rb:387:in `new'
tests/hash.rb:387:in `open'
tests/hash.rb:387:in `test_18_hash_delete'

  2) Error:
test_18_index(TestHash):
BDB::Fatal: closed DB
tests/hash.rb:400:in `index'
tests/hash.rb:400:in `block in test_18_index'
tests/hash.rb:397:in `times'
tests/hash.rb:397:in `test_18_index'

  3) Error:
test_19_convert(TestHash):
BDB::Fatal: closed DB
tests/hash.rb:409:in `to_hash'
tests/hash.rb:409:in `test_19_convert'

  4) Error:
test_20_blurb(TestHash):
BDB::Fatal: closed DB
tests/hash.rb:426:in `each'
tests/hash.rb:426:in `test_20_blurb'

23 tests, 7659 assertions, 0 failures, 4 errors, 0 skips
ERROR: Test ruby1.9.1 failed. Exiting.
dh_auto_install: dh_ruby --install 
/home/gwolf/vcs/build-area/ruby-bdb-0.6.6/debian/ruby-bdb returned exit code 1
make: *** [binary] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
88

Setting $VERBOSE=1 in tests/hash.rb yields the following results with
Ruby 1.9.1:

88
$ ruby1.9.1  -e 
'$:../../build-area/ruby-bdb-0.6.6/debian/ruby-bdb/usr/lib/ruby/vendor_ruby/1.9.1//x86_64-linux/;
 require ./tests/hash'

VERSION of BDB is Berkeley DB 5.3.28: (September  9, 2013)
Run options: 

# Running tests:

..E/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:400: 
warning: Hash#index is deprecated; use Hash#key
EE.

Finished tests in 3.898375s, 5.6434 tests/s, 1967.7432 assertions/s.

  1) Error:
test_18_hash_delete(TestHash):
RangeError: integer -3058836581575265859 too small to convert to `unsigned int'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in `initialize'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in `new'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in `open'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in 
`test_18_hash_delete'

  2) Error:
test_18_index(TestHash):
BDB::Fatal: closed DB
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:400:in `index'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:400:in `block in 
test_18_index'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:397:in `times'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:397:in 
`test_18_index'

  3) Error:
test_19_convert(TestHash):
BDB::Fatal: closed DB
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:409:in `to_hash'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:409:in 
`test_19_convert'

22 tests, 7671 assertions, 0 failures, 3 errors, 0 skips
88

And with Ruby 2.0:

88
$ ruby2.0  -e 
'$:../../build-area/ruby-bdb-0.6.6/debian/ruby-bdb/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.0.0/;
 require ./tests/hash'

VERSION of BDB is Berkeley DB 5.3.28: (September  9, 2013)
Run options: 

# Running tests:

[19/22] TestHash#test_18_hash_delete = 0.00 s  
  1) Error:
test_18_hash_delete(TestHash):
RangeError: integer 3180312599820893546 too big to convert to `unsigned int'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in `initialize'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in `new'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in `open'
/home/gwolf/vcs/pkg-ruby-extras/ruby-bdb/tests/hash.rb:387:in 
`test_18_hash_delete'
/usr/lib/ruby/2.0.0/minitest/unit.rb:1301:in `run'
/usr/lib/ruby/2.0.0/test/unit/testcase.rb:17:in `run'
/usr/lib/ruby/2.0.0/minitest/unit.rb:919:in `block in _run_suite'
/usr/lib/ruby/2.0.0/minitest/unit.rb:912:in `map'
/usr/lib/ruby/2.0.0/minitest/unit.rb:912:in `_run_suite'
/usr/lib/ruby/2.0.0/test/unit.rb:657:in `block in _run_suites'
/usr/lib/ruby/2.0.0/test/unit.rb:655:in `each'
/usr/lib/ruby/2.0.0/test/unit.rb:655:in