jkraemer / ferret

Ferret: the extensible information retrieval library for ruby.
http://ferret.davebalmain.com
MIT License
22 stars 11 forks source link

Test failures with Ruby 1.9.3 #2

Open bkabrda opened 12 years ago

bkabrda commented 12 years ago

Hi, I have some test failures with Ruby 1.9.3 here:

The first one is basically a wrongly used assertion:

test_field_symbol(FieldSymbolTest): ArgumentError: assertion message must be String or Proc, but Symbol was given. /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/test/unit/tc_field_symbol.rb:24:in `test_field_symbol'

the line should not have assert, but assert_equal.

The second one is a weird buffer overflow issue:

* buffer overflow detected *: ["test/test_helper.rb", "test/test_all.rb", "test/test_installed.rb"] terminated ======= Backtrace: ========= /lib64/libc.so.6(__fortify_fail+0x37)[0x3d11508eb7] /lib64/libc.so.6[0x3d11507070] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(frt_std_scan_mb+0x5a4)[0x7ff65f9dcfb4] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(+0x9d860)[0x7ff65f9ee860] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(+0x9d403)[0x7ff65f9ee403] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(+0x9d2ad)[0x7ff65f9ee2ad] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(+0x9d9d4)[0x7ff65f9ee9d4] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(frt_dw_invert_field+0x28b)[0x7ff65f9c8b0b] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(frt_dw_add_doc+0x89)[0x7ff65f9c8c89] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(frt_iw_add_doc+0x24)[0x7ff65f9c8ed4] /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so(+0x67478)[0x7ff65f9b8478] /lib64/libruby.so.1.9[0x3baf94edab] /lib64/libruby.so.1.9[0x3baf9458a1] /lib64/libruby.so.1.9[0x3baf94a3f0] /lib64/libruby.so.1.9(rb_yield+0x178)[0x3baf950958] /lib64/libruby.so.1.9[0x3baf8310ad] /lib64/libruby.so.1.9[0x3baf94edab] /lib64/libruby.so.1.9[0x3baf944d12] /lib64/libruby.so.1.9[0x3baf94a3f0] /lib64/libruby.so.1.9(rb_yield+0x178)[0x3baf950958] /lib64/libruby.so.1.9(rb_ary_each+0x52)[0x3baf82b062] /lib64/libruby.so.1.9[0x3baf94edab] /lib64/libruby.so.1.9[0x3baf944d12] /lib64/libruby.so.1.9[0x3baf94a3f0] /lib64/libruby.so.1.9(rb_yield+0x178)[0x3baf950958] /lib64/libruby.so.1.9(rb_ary_each+0x52)[0x3baf82b062] /lib64/libruby.so.1.9[0x3baf94edab] /lib64/libruby.so.1.9[0x3baf944d12] /lib64/libruby.so.1.9[0x3baf94a3f0] /lib64/libruby.so.1.9(rb_iseq_eval_main+0xad)[0x3baf95175d] /lib64/libruby.so.1.9[0x3baf85b3fa] /lib64/libruby.so.1.9(ruby_exec_node+0x1d)[0x3baf85be9d] /lib64/libruby.so.1.9(ruby_run_node+0x1e)[0x3baf85d92e] ["test/test_helper.rb", "test/test_all.rb", "test/test_installed.rb"][0x40086b] /lib64/libc.so.6(__libc_start_main+0xf5)[0x3d11421735] ["test/test_helper.rb", "test/test_all.rb", "test/test_installed.rb"][0x400899] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 fd:01 3159474 /usr/bin/ruby 00600000-00601000 r--p 00000000 fd:01 3159474 /usr/bin/ruby 00601000-00602000 rw-p 00001000 fd:01 3159474 /usr/bin/ruby 00a39000-025eb000 rw-p 00000000 00:00 0 [heap] 3baf800000-3baf9ef000 r-xp 00000000 fd:01 3156903 /usr/lib64/libruby.so.1.9.1 3baf9ef000-3bafbee000 ---p 001ef000 fd:01 3156903 /usr/lib64/libruby.so.1.9.1 3bafbee000-3bafbf6000 rw-p 001ee000 fd:01 3156903 /usr/lib64/libruby.so.1.9.1 3bafbf6000-3bafc12000 rw-p 00000000 00:00 0 3bc8c00000-3bc8c15000 r-xp 00000000 fd:01 3153649 /usr/lib64/libgcc_s-4.7.0-20120308.so.1 3bc8c15000-3bc8e14000 ---p 00015000 fd:01 3153649 /usr/lib64/libgcc_s-4.7.0-20120308.so.1 3bc8e14000-3bc8e15000 rw-p 00014000 fd:01 3153649 /usr/lib64/libgcc_s-4.7.0-20120308.so.1 3d11000000-3d11020000 r-xp 00000000 fd:01 3147007 /usr/lib64/ld-2.15.so 3d1121f000-3d11220000 r--p 0001f000 fd:01 3147007 /usr/lib64/ld-2.15.so 3d11220000-3d11221000 rw-p 00020000 fd:01 3147007 /usr/lib64/ld-2.15.so 3d11221000-3d11222000 rw-p 00000000 00:00 0 3d11400000-3d115ac000 r-xp 00000000 fd:01 3158353 /usr/lib64/libc-2.15.so 3d115ac000-3d117ab000 ---p 001ac000 fd:01 3158353 /usr/lib64/libc-2.15.so 3d117ab000-3d117af000 r--p 001ab000 fd:01 3158353 /usr/lib64/libc-2.15.so 3d117af000-3d117b1000 rw-p 001af000 fd:01 3158353 /usr/lib64/libc-2.15.so 3d117b1000-3d117b6000 rw-p 00000000 00:00 0 3d11800000-3d11816000 r-xp 00000000 fd:01 3181421 /usr/lib64/libpthread-2.15.so 3d11816000-3d11a16000 ---p 00016000 fd:01 3181421 /usr/lib64/libpthread-2.15.so 3d11a16000-3d11a17000 r--p 00016000 fd:01 3181421 /usr/lib64/libpthread-2.15.so 3d11a17000-3d11a18000 rw-p 00017000 fd:01 3181421 /usr/lib64/libpthread-2.15.so 3d11a18000-3d11a1c000 rw-p 00000000 00:00 0 3d11c00000-3d11cfa000 r-xp 00000000 fd:01 3161604 /usr/lib64/libm-2.15.so 3d11cfa000-3d11ef9000 ---p 000fa000 fd:01 3161604 /usr/lib64/libm-2.15.so 3d11ef9000-3d11efa000 r--p 000f9000 fd:01 3161604 /usr/lib64/libm-2.15.so 3d11efa000-3d11efb000 rw-p 000fa000 fd:01 3161604 /usr/lib64/libm-2.15.so 3d12000000-3d12003000 r-xp 00000000 fd:01 3151483 /usr/lib64/libdl-2.15.so 3d12003000-3d12202000 ---p 00003000 fd:01 3151483 /usr/lib64/libdl-2.15.so 3d12202000-3d12203000 r--p 00002000 fd:01 3151483 /usr/lib64/libdl-2.15.so 3d12203000-3d12204000 rw-p 00003000 fd:01 3151483 /usr/lib64/libdl-2.15.so 3d12800000-3d12807000 r-xp 00000000 fd:01 3181785 /usr/lib64/librt-2.15.so 3d12807000-3d12a06000 ---p 00007000 fd:01 3181785 /usr/lib64/librt-2.15.so 3d12a06000-3d12a07000 r--p 00006000 fd:01 3181785 /usr/lib64/librt-2.15.so 3d12a07000-3d12a08000 rw-p 00007000 fd:01 3181785 /usr/lib64/librt-2.15.so 3d1c000000-3d1c05d000 r-xp 00000000 fd:01 3180763 /usr/lib64/libfreebl3.so 3d1c05d000-3d1c25c000 ---p 0005d000 fd:01 3180763 /usr/lib64/libfreebl3.so 3d1c25c000-3d1c25d000 r--p 0005c000 fd:01 3180763 /usr/lib64/libfreebl3.so 3d1c25d000-3d1c25e000 rw-p 0005d000 fd:01 3180763 /usr/lib64/libfreebl3.so 3d1c25e000-3d1c262000 rw-p 00000000 00:00 0 3d1d000000-3d1d007000 r-xp 00000000 fd:01 3181736 /usr/lib64/libcrypt-2.15.so 3d1d007000-3d1d207000 ---p 00007000 fd:01 3181736 /usr/lib64/libcrypt-2.15.so 3d1d207000-3d1d208000 r--p 00007000 fd:01 3181736 /usr/lib64/libcrypt-2.15.so 3d1d208000-3d1d209000 rw-p 00008000 fd:01 3181736 /usr/lib64/libcrypt-2.15.so 3d1d209000-3d1d237000 rw-p 00000000 00:00 0 7ff644000000-7ff644021000 rw-p 00000000 00:00 0 7ff644021000-7ff648000000 ---p 00000000 00:00 0 7ff648000000-7ff648021000 rw-p 00000000 00:00 0 7ff648021000-7ff64c000000 ---p 00000000 00:00 0 7ff64c000000-7ff64c021000 rw-p 00000000 00:00 0 7ff64c021000-7ff650000000 ---p 00000000 00:00 0 7ff651bd6000-7ff658000000 r--p 00000000 fd:01 9472 /usr/lib/locale/locale-archive 7ff658000000-7ff658021000 rw-p 00000000 00:00 0 7ff658021000-7ff65c000000 ---p 00000000 00:00 0 7ff65e9b8000-7ff65e9b9000 ---p 00000000 00:00 0 7ff65e9b9000-7ff65ea39000 rw-p 00000000 00:00 0 7ff65ea39000-7ff65ea3a000 ---p 00000000 00:00 0 7ff65ea3a000-7ff65eaba000 rw-p 00000000 00:00 0 7ff65eaba000-7ff65eabb000 ---p 00000000 00:00 0 7ff65eabb000-7ff65eb3b000 rw-p 00000000 00:00 0 7ff65eb3b000-7ff65eb3c000 ---p 00000000 00:00 0 7ff65eb3c000-7ff65ecbd000 rw-p 00000000 00:00 0 7ff65ecbd000-7ff65eceb000 r-xp 00000000 fd:01 786477 /usr/lib64/ruby/date_core.so 7ff65eceb000-7ff65eeeb000 ---p 0002e000 fd:01 786477 /usr/lib64/ruby/date_core.so 7ff65eeeb000-7ff65eeec000 r--p 0002e000 fd:01 786477 /usr/lib64/ruby/date_core.so 7ff65eeec000-7ff65eeed000 rw-p 0002f000 fd:01 786477 /usr/lib64/ruby/date_core.so 7ff65eeed000-7ff65eeee000 rw-p 00000000 00:00 0 7ff65eeee000-7ff65eef3000 r-xp 00000000 fd:01 786506 /usr/lib64/ruby/strscan.so 7ff65eef3000-7ff65f0f2000 ---p 00005000 fd:01 786506 /usr/lib64/ruby/strscan.so 7ff65f0f2000-7ff65f0f3000 r--p 00004000 fd:01 786506 /usr/lib64/ruby/strscan.so 7ff65f0f3000-7ff65f0f4000 rw-p 00005000 fd:01 786506 /usr/lib64/ruby/strscan.so 7ff65f0f4000-7ff65f0fa000 r-xp 00000000 fd:01 786505 /usr/lib64/ruby/stringio.so 7ff65f0fa000-7ff65f2f9000 ---p 00006000 fd:01 786505 /usr/lib64/ruby/stringio.so 7ff65f2f9000-7ff65f2fa000 r--p 00005000 fd:01 786505 /usr/lib64/ruby/stringio.so 7ff65f2fa000-7ff65f2fb000 rw-p 00006000 fd:01 786505 /usr/lib64/ruby/stringio.so 7ff65f2fb000-7ff65f31a000 r-xp 00000000 fd:01 3168744 /usr/lib64/libyaml-0.so.2.0.2 7ff65f31a000-7ff65f519000 ---p 0001f000 fd:01 3168744 /usr/lib64/libyaml-0.so.2.0.2 7ff65f519000-7ff65f51a000 r--p 0001e000 fd:01 3168744 /usr/lib64/libyaml-0.so.2.0.2 7ff65f51a000-7ff65f51b000 rw-p 0001f000 fd:01 3168744 /usr/lib64/libyaml-0.so.2.0.2 7ff65f547000-7ff65f54c000 r-xp 00000000 fd:01 786495 /usr/lib64/ruby/psych.so 7ff65f54c000-7ff65f74b000 ---p 00005000 fd:01 786495 /usr/lib64/ruby/psych.so 7ff65f74b000-7ff65f74c000 r--p 00004000 fd:01 786495 /usr/lib64/ruby/psych.so 7ff65f74c000-7ff65f74d000 rw-p 00005000 fd:01 786495 /usr/lib64/ruby/psych.so 7ff65f74d000-7ff65f750000 r-xp 00000000 fd:01 786482 /usr/lib64/ruby/etc.so 7ff65f750000-7ff65f94f000 ---p 00003000 fd:01 786482 /usr/lib64/ruby/etc.so 7ff65f94f000-7ff65f950000 r--p 00002000 fd:01 786482 /usr/lib64/ruby/etc.so 7ff65f950000-7ff65f951000 rw-p 00003000 fd:01 786482 /usr/lib64/ruby/etc.so 7ff65f951000-7ff65fa4a000 r-xp 00000000 fd:03 2228633 /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so 7ff65fa4a000-7ff65fc4a000 ---p 000f9000 fd:03 2228633 /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so 7ff65fc4a000-7ff65fc67000 r--p 000f9000 fd:03 2228633 /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so 7ff65fc67000-7ff65fc70000 rw-p 00116000 fd:03 2228633 /home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/ext/ferret_ext.so 7ff65fc70000-7ff65fc72000 rw-p 00000000 00:00 0 7ff65fc72000-7ff65fc74000 r-xp 00000000 fd:01 1182868 /usr/lib64/ruby/enc/trans/transdb.so 7ff65fc74000-7ff65fe74000 ---p 00002000 fd:01 1182868 /usr/lib64/ruby/enc/trans/transdb.so 7ff65fe74000-7ff65fe75000 r--p 00002000 fd:01 1182868 /usr/lib64/ruby/enc/trans/transdb.so 7ff65fe75000-7ff65fe76000 rw-p 00003000 fd:01 1182868 /usr/lib64/ruby/enc/trans/transdb.so 7ff65fe76000-7ff65fe78000 r-xp 00000000 fd:01 1182826 /usr/lib64/ruby/enc/encdb.so 7ff65fe78000-7ff660077000 ---p 00002000 fd:01 1182826 /usr/lib64/ruby/enc/encdb.so 7ff660077000-7ff660078000 r--p 00001000 fd:01 1182826 /usr/lib64/ruby/enc/encdb.so 7ff660078000-7ff660079000 rw-p 00002000 fd:01 1182826 /usr/lib64/ruby/enc/encdb.so 7ff660079000-7ff660180000 rw-p 00000000 00:00 0 7ff6601a0000-7ff6601a1000 rw-p 00000000 00:00 0 7ff6601a1000-7ff6601a8000 r--s 00000000 fd:01 9715 /usr/lib64/gconv/gconv-modules.cache 7ff6601a8000-7ff6601a9000 ---p 00000000 00:00 0 7ff6601a9000-7ff6601ad000 rw-p 00000000 00:00 0 7fff35660000-7fff35681000 rw-p 00000000 00:00 0 [stack] 7fff3579a000-7fff3579b000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] Stack trace: Not available

2) Error: test_adding_long_url(IndexWriterTest): StandardError: Exiting on signal %s (%d) occured at :423 in sighandler_crash SIGABRT

/home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/test/unit/index/tc_index_writer.rb:67:in `<<'
/home/bkabrda/rpmbuild/BUILD/rubygem-ferret-0.11.8.4/usr/share/gems/gems/ferret-0.11.8.4/test/unit/index/tc_index_writer.rb:67:in `test_adding_long_url'

Maybe it is somehow connected with the new GCC 4.7.0, we've been getting segfaults and memory leaks with that all over Fedora. I myself am no gcc expert, but maybe you could take a look at it?

Thanks!

bkabrda commented 12 years ago

Hi JK, any thoughts on this one? I wasn't able to get my hands on it past few days, but I'll try to provide some more info ASAP.

Thanks.

voxik commented 12 years ago

I am afraid, that the second issue (the SEGV) was present already in older releases and can be reproduce also with Ruby 1.8.

The failing test was introduced by f2b1155794639d069995b45bffe147547cd5f274 and according to the comment [1], it is known regression, but it should not be that severe for regular use, as can be seen if you compare lines [2] and [3].

[1] https://github.com/dbalmain/ferret/blob/master/ruby/test/unit/index/tc_index_writer.rb#L66 [2] https://github.com/dbalmain/ferret/blob/master/ruby/test/unit/index/tc_index_writer.rb#L65 [3] https://github.com/dbalmain/ferret/blob/master/ruby/test/unit/index/tc_index_writer.rb#L67

jarthod commented 12 years ago

I'm also having the SEGV issue with 0.11.8.4 on Ubuntu 12.04. I'll investigate a bit if it's gcc related.

jarthod commented 12 years ago

Tried with gcc 4.6 and gcc 4.4 with the same issue, does not seems to be gcc related. I clones the latest version, tried compiling the gem and running the tests. I got the same buffer overflow issue from the same line: iw << {:content => "http://" + 'x' * 1_000_000}