Ferret crashing Ruby


#1

I’ve gotten several problems with C ferret crashing ruby. Here’s the
stack trace of my latest case:

#0 0x00000050 in ?? ()
#1 0xb74028ab in iw_close (iw=0x8685a40) at index_rw.c:947
#2 0xb7414359 in index_destroy (self=0x829ebc0) at ind.c:89
#3 0xb73f00bc in frt_ind_free (p=0x829ebc0) at r_search.c:1564
#4 0xb7f04dca in rb_gc_call_finalizer_at_exit ()
from /usr/lib/libruby1.8.so.1.8
#5 0xb7ee627d in is_ruby_native_thread ()
from /usr/lib/libruby1.8.so.1.8
#6 0xb7efe2b5 in ruby_cleanup () from /usr/lib/libruby1.8.so.1.8
#7 0xb7efe3cc in ruby_stop () from /usr/lib/libruby1.8.so.1.8
#8 0xb7efeabf in ruby_run () from /usr/lib/libruby1.8.so.1.8
#9 0x080486b1 in main ()

This was while doing several identical searches ordered by a field.

The same code without the extensions throws this exception:

RuntimeError: no terms in field start_date to sort by
/usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/search/field_cache.rb:189:in
get_auto_index' /usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/search/field_sorted_hit_queue.rb:172:incomparator_auto’
/usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/search/field_sorted_hit_queue.rb:123:in
get_cached_comparator' /usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/search/field_sorted_hit_queue.rb:26:ininitialize’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/whiny_nil.rb:35:in
each_with_index' /usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/search/field_sorted_hit_queue.rb:25:ininitialize’
/usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/search/index_searcher.rb:115:in
search' /usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/index/index.rb:660:indo_search’
/usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/index/index.rb:316:in
search' /usr/lib/ruby/1.8/monitor.rb:229:insynchronize’
/usr/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/index/index.rb:315:in
search' /home/pedrocr/eadexer/config/../app/models/description.rb:233:infind_by_text’
/home/pedrocr/eadexer/config/…/app/controllers/descr_controller.rb:67:in
find' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:inprocess_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in
process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:inprocess_without_test’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:16:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:363:inprocess’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:336:in
get' test/functional/descr_controller_test.rb:88:intest_find_order_by’
test/functional/descr_controller_test.rb:87:in `test_find_order_by’

With the C extension this search actually works fine. But if I surround
it with a 2.times do; …search… end; block it bombs.

I’m using ferret 0.9.1. Should I be using SVN? Any ideas?

Greetings,

Pedro Côrte-Real.


#2

Hi Pedro, I believe this is fixed in my working copy. I’m going to get
a release out as soon as possible. I’m currently trying to build on
Windows. When that’s done I’ll put 0.9.2 out.

Cheers,
Dave