Some more on this issue. I can narrow the crash down to an index with
just one document, and ferret crashes after getting its term vector a
number of times, perhaps as few as 2 or 3. The version below is tuned to
crash quickly on my system, others may find it necessary to give other
numbers in the command line argument in order to make the crash happen
sooner. See below for the code.
Some fiddling with the ferret source code reveals that disabling the
call to tv_destroy() in frt_ir_term_vector() (which is the implmentation
of #term_vector) seems to make the problem go away. Experimenting with
tv_destroy(), I found that disabling just the frees of offsets and
positions is enough to keep the crash away. This suggests that there's a
mismanagement of the allocation of the associated variables, but if so I
was unable to spot it in the source....
This is further than I've gotten in investigating this problem in a
while, but I'm unsure where to go next.
require 'rubygems'
require 'ferret'
fields = Ferret::Index::FieldInfos.new
fields.add_field :text, :store => :no
scale=(ARGV.first||662).to_i #rand(1000)
s = {:text => "foo bar baz "*scale }
i = Ferret::I.new :field_infos => fields
i << s
9999999999.times do|j|
tv = i.reader.term_vector(0, :text)
print "."; STDOUT.flush
end
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk