Crash on repeated search

I have found another crash in ferret; this one just uses a regular
search. It’s similar to an issue reported by Matt S. a while ago,
but unlike his, mine does not go away if I turn off omit_norms. It does
go away if I turn on the garbage collector more often, but I’m not sure
that’s a stable workaround under the circumstances.

This one isn’t a segfault, but more complicated versions have been. This
bug manifests as a error in the garbage collector:

$ ruby rw_ferret_test.rb
…rw_ferret_test.rb:20: [BUG] rb_gc_mark(): unknown data type
0x28(0x402ba3a4) non object
ruby 1.8.2 (2005-04-11) [i386-linux]

Aborted

Here’s the code:

require ‘rubygems’
require ‘ferret’
include Ferret

def phrase(num)
“a_fairly_long_phrase%05d”%num
end

LOOPS=(ARGV[1]||40).to_i

_fields = Index::FieldInfos.new
_fields.add_field :phrase, :term_vector => :no, :store => :no, :index =>
:untokenized
$phrases=I.new(:field_infos=>_fields)

phrase(0).upto(phrase(LOOPS)){|phrase| $phrases << {:phrase=> phrase} }

@phrases=Ferret::Search::Searcher.new $phrases.reader
count=0
loop{
@phrases.search(
Search::TermQuery.new(:phrase,
“a_fairly_long_phrase%05d”%rand(LOOPS+1))
)

 if ((count+=1)%1000).zero? #1309
   print '.'
   STDOUT.flush

GC.start #enable this to workaround

 end

}
$phrases.close

On 07.12.2006, at 10:38, Caleb C. wrote:

bug manifests as a error in the garbage collector:

$ ruby rw_ferret_test.rb
…rw_ferret_test.rb:20: [BUG] rb_gc_mark(): unknown data type
0x28(0x402ba3a4) non object
ruby 1.8.2 (2005-04-11) [i386-linux]

Aborted

I tried your code and I get lots of dots but no error :wink:

Maybe you should use a newer Ruby version. I’m using

ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]

Cheers,
Andy

Hi,

I tried your code and I get lots of dots but no error :wink:

Maybe you should use a newer Ruby version. I’m using

ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]
I get the same crash on ruby 1.8.5 (2006-08-25) [i386-cygwin], perhaps
it’s specific to certain architectures?

Cheers!
Patrick

On 07.12.2006, at 14:56, Patrick R. wrote:

[BUG] rb_gc_mark(): unknown data type 0x28(0x402ba3a4) non object
ruby 1.8.2 (2005-04-11) [i386-linux] Aborted
I tried your code and I get lots of dots but no error :wink: Maybe you
should use a newer Ruby version. I’m using ruby 1.8.5 (2006-08-25)
[powerpc-darwin8.8.0]
I get the same crash on ruby 1.8.5 (2006-08-25) [i386-cygwin],
perhaps it’s specific to certain architectures?

Not sure if this is of any use, but I tried it on two other machines.

Linux (Ubuntu):

…test.rb:21: [BUG] rb_gc_mark():
unknown data type 0x0(0xb7d9e208) non object
ruby 1.8.4 (2005-12-24) [i486-linux]

Linux (Debian):

ruby 1.8.5 (2006-08-25) [i486-linux]

All test (including the first one on Mac OS X) were run with Ferret
0.10.13

Which version of Ferret are you using? The combination Ruby 1.8.5/
Ferret 0.10.13 seems to work best.


Andy

Hi Ben!

On 07.12.2006, at 15:44, Benjamin K. wrote:

Which version of Ferret are you using? The combination Ruby 1.8.5/
Ferret 0.10.13 seems to work best.

1.8.4 and 0.10.13 is fine, too :slight_smile:

Yes, I used that combo successfully on my staging system for quite
some time. However, the test case that Caleb posted fails on that
same machine.

…test.rb:21: [BUG] rb_gc_mark():
unknown data type 0x0(0xb7d9e208) non object
ruby 1.8.4 (2005-12-24) [i486-linux]

Perhaps David should take a look at this. BTW, any news from him? Is
he still missing in the outbacks down under?

Cheers,
Andreas

Perhaps David should take a look at this. BTW, any news from him? Is
he still missing in the outbacks down under?

Hey …

Well, no news… just some very short notices that he’s still lost and
without an internet connection… If I hear anything i’ll send it to this
list.

A bunch of things are left on Daves agenda and he wanted to implement a
lot of great features this year, to finally reach a 1.0 status. But I
guess we will need to wait a couple of more weeks until a new ferret
release will be available.

Ben

I met the same problem before,i thought it caused by ruby
Multithreading.
So i make a new searcher before search every time,it works well,maybe
you should try this.

Which version of Ferret are you using? The combination Ruby 1.8.5/
Ferret 0.10.13 seems to work best.

1.8.4 and 0.10.13 is fine, too :slight_smile:

for other test results take a look at

http://camping.davebalmain.com/smoke_alarm/

Ben

On 12/7/06, Caleb C. [email protected] wrote:

…rw_ferret_test.rb:20: [BUG] rb_gc_mark(): unknown data type
include Ferret
$phrases=I.new(:field_infos=>_fields)

 if ((count+=1)%1000).zero? #1309
   print '.'
   STDOUT.flush

GC.start #enable this to workaround

 end

}
$phrases.close

This problem has been fixed.

Dave Balmain wrote:

This problem has been fixed.

Nice! Thanks, Dave.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs