Memory allocation bug with index.search

Hi Dave ( again ! )

I’ve been searching for a while into my extension code to understand
what was the matter, and Florent S. who hasn’t got my extension has
the same problem, so it figured to be a ferret problem… Unfortunately,
we’re unable at the moment to reproduce it in a little code so you could
debug easilier… I’m working on it.

Heres the issue :

In the index, there are a lot of stuff with a type field, and we’re
experiencing the same bug with just type => hardware or mixed datas.
We’ve got around 12400 docs with this type, here are the queries (THEY
ARE ALL LAUNCHED IN A NEW INSTANCE OF FERRET ! (with the same index of
course)):

this one works fine :

INDEX.search(‘type:hardware’).to_s
=> “TopDocs: total_hits = 12490, max_score = 1.751220 [\n\t13997
“61426”: 1.751220\n\t13998 “61427”: 1.751220\n\t13999 “61428”:
1.751220\n\t14000 “61429”: 1.751220\n\t14001 “61430”:
1.751220\n\t14002 “61431”: 1.751220\n\t14003 “61432”:
1.751220\n\t14004 “61433”: 1.751220\n\t14005 “61434”:
1.751220\n\t14006 “61435”: 1.751220\n]\n”

and this one doesn’t… :

INDEX.search(‘type:hardware’, :limit => :all).to_s
/usr/local/lib/site_ruby/1.8/ferret/index.rb:718: [BUG] rb_gc_mark():
unknown data type 0x18(0x89b4268) non objectruby 1.8.4 (2005-12-24)
[i486-linux]
Aborted

i tried to get to the limit point and got it :
works :

INDEX.search(‘type:hardware’, :limit => 9719).to_s
don’t work :

INDEX.search(‘type:hardware’, :limit => 9720).to_s
/usr/local/lib/site_ruby/1.8/ferret/index.rb:718: [BUG] Segmentation
fault
ruby 1.8.4 (2005-12-24) [i486-linux]

BUT ! if, IN THE SAME INSTANCE OF RUBY, i do the first and then the
second one, it works !

INDEX.search(‘type:hardware’, :limit => 9719).to_s
…works

INDEX.search(‘type:hardware’, :limit => 9720).to_s
…works

INDEX.search(‘type:hardware’, :limit => :all).to_s
WORKS.

So i guess there’s a problem in result memory allocation, i don’t know
what i could add to help you, i’m trying to reproduce it in a little
code…

Ah, just another detail, this is how our index is created :
INDEX_OPTIONS = {
:path => path,
:auto_flush => false,
:max_buffer_memory => 0x4000000,
:max_buffered_docs => 100000,
:use_compound_file => false}
INDEX = Ferret::Index::Index.new(INDEX_OPTIONS)

but i tried without any max_* and it’s the same…

Tell me what i can do to help if i don’t manage to reproduce it in a
pastable code.

Thanks by advance,
Regards,
Jeremie ‘ahFeel’ BORDIER