Highlight crashes

I am trying to use highlight, but I am getting this kind of thing:

/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:197:in
`highlight’: IO Error occured at <except.c>:93 in xraise (IOError)
Error occured in index.c:1222 - lazy_df_get_bytes
len = -5, but should be greater than 0

    from

/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:197:in
highlight' from /usr/local/lib/ruby/1.8/monitor.rb:238:insynchronize’
from
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:195:in
highlight' from test.rb:25 from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:385:insearch_each’
from
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:384:in
search_each' from /usr/local/lib/ruby/1.8/monitor.rb:238:insynchronize’
from
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:380:in
`search_each’
from test.rb:22

…as well as segfaults sometimes.

Any ideas? My index is about 130Mb, but I can try to make some test
case if needed.

On 4/9/07, Stephen S. [email protected] wrote:

    from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    from

/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:380:in
`search_each’
from test.rb:22

…as well as segfaults sometimes.

Any ideas? My index is about 130Mb, but I can try to make some test
case if needed.

Hi Stephen,

A test case would be great. If you can give me one I’ll get to work on
it right away.

Cheers,
Dave

David B. wrote:

On 4/9/07, Stephen S. [email protected] wrote:

    from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    from

/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:380:in
`search_each’
from test.rb:22

…as well as segfaults sometimes.

Any ideas? My index is about 130Mb, but I can try to make some test
case if needed.

Hi Stephen,

A test case would be great. If you can give me one I’ll get to work on
it right away.

Cheers,
Dave

Dave, the problem has gone away. I was using some code that put items
in the index as an array of strings - the output of readlines. Like
this:

index.add_document :file => path, :content => file.readlines

When you try to apply highlighting to items like that, it breaks. So
now I just join the output of readlines with a space, and all is well.

Best wishes,
Stephen

On 4/16/07, Stephen S. [email protected] wrote:

…as well as segfaults sometimes.
Dave

Dave, the problem has gone away. I was using some code that put items
in the index as an array of strings - the output of readlines. Like
this:

index.add_document :file => path, :content => file.readlines

When you try to apply highlighting to items like that, it breaks. So
now I just join the output of readlines with a space, and all is well.

Hi Stephen,

This was in fact a bug. It is now fixed and will be released in Ferret
0.11.5.

David B. wrote:

On 4/16/07, Stephen S. [email protected] wrote:

When you try to apply highlighting to items like that, it breaks. So
now I just join the output of readlines with a space, and all is well.

Hi Stephen,

This was in fact a bug. It is now fixed and will be released in Ferret
0.11.5.

Excellent, & thanks for ferret!

Stephen

David,

I am using revision 770 from trunk and notice that the highlight problem
still occurs if a PhraseQuery like ‘“big house”~2000’ is used. The same
works for smaller numbers ((like ‘“big house”~10’) but crashes when used
with larger numbers leaving the following message on the term:

/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4.1/lib/ferret/index.rb:197:
[BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i686-linux]

David B. wrote:

On 4/16/07, Stephen S. [email protected] wrote:

…as well as segfaults sometimes.
Dave

Dave, the problem has gone away. I was using some code that put items
in the index as an array of strings - the output of readlines. Like
this:

index.add_document :file => path, :content => file.readlines

When you try to apply highlighting to items like that, it breaks. So
now I just join the output of readlines with a space, and all is well.

Hi Stephen,

This was in fact a bug. It is now fixed and will be released in Ferret
0.11.5.

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