# Segmentation Faults

**URL:** <https://www.ruby-forum.com/t/segmentation-faults/77072>\
**Category:** Ferret\
**Created:** [November 24, 2006, 1:16am UTC](https://www.ruby-forum.com/t/segmentation-faults/77072 "2006-11-24T01:16:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdellaringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@tdellaringa](https://www.ruby-forum.com/u/tdellaringa)\
**Post date:** [November 24, 2006, 1:16am UTC](https://www.ruby-forum.com/t/segmentation-faults/77072/1 "2006-11-24T01:16:20Z")

</div>

Hi,

I am using Ferret 0.9.4 and my index appears to be corrupt as any  
attempt to read or write it causes a segmentation fault. I had been  
using it with minimal problems for the past few months.

Is there a way to fix this without rebuilding the entire index? Since  
I am on a shared host ferret takes too much memory to rebuild these  
roughly 8500 records in one go and in the past I have had to rebuild  
them in batches.

Also, is there a way to trap when ferret segfaults using rescue? I  
have had to disable searching for the time being on my site until I  
get this worked out since every search will segfault and kill my fcgi.

I am actually considering switching to Mysql full text search just for  
stability reasons, but if there was a good technique for combating  
these segfaults I would rather stick with Ferret.

NOTE: I did try running with ferret 0.10.13 but I was getting a bunch  
of segfaults just rebuilding my indexes.

Thanks,  
Tom D.

[http://atomgiant.com](http://atomgiant.com)  
[http://gifthat.com](http://gifthat.com)

---

<div class="post-metadata">

**Author:** ![tdellaringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@tdellaringa](https://www.ruby-forum.com/u/tdellaringa)\
**Post date:** [November 24, 2006, 11:37am UTC](https://www.ruby-forum.com/t/segmentation-faults/77072/2 "2006-11-24T11:37:25Z")

</div>

Hi!

On Thu, Nov 23, 2006 at 06:57:01PM -0500, Tom D. wrote:

> Hi,
> 
> I am using Ferret 0.9.4 and my index appears to be corrupt as any  
> attempt to read or write it causes a segmentation fault. I had been  
> using it with minimal problems for the past few months.
> 
> Is there a way to fix this without rebuilding the entire index? Since  
> I am on a shared host ferret takes too much memory to rebuild these  
> roughly 8500 records in one go and in the past I have had to rebuild  
> them in batches.

I don’t know of a way to fix the index without rebuilding it.

> Also, is there a way to trap when ferret segfaults using rescue? I  
> have had to disable searching for the time being on my site until I  
> get this worked out since every search will segfault and kill my fcgi.

Imho a seg fault is far too low level to be caught on the ruby side.

> I am actually considering switching to Mysql full text search just for  
> stability reasons, but if there was a good technique for combating  
> these segfaults I would rather stick with Ferret.
> 
> NOTE: I did try running with ferret 0.10.13 but I was getting a bunch  
> of segfaults just rebuilding my indexes.

that’s strange, maybe we should try to find the problem in this area.  
Ferret’s API changed in sometimes subtle ways from 0.9 to 0.10, and  
segfaults often happen when using the API in a wrong way (i.e.  
unexpected argument types and things like that).

cheers,  
Jens

–  
webit! Gesellschaft für neue Medien mbH [www.webit.de](http://www.webit.de)  
Dipl.-Wirtschaftsingenieur Jens Krämer removed\_email\_address@domain.invalid  
Schnorrstraße 76 Tel +49 351 46766 0  
D-01069 Dresden Fax +49 351 46766 66

---

<div class="post-metadata">

**Author:** ![tdellaringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@tdellaringa](https://www.ruby-forum.com/u/tdellaringa)\
**Post date:** [November 24, 2006, 3:38pm UTC](https://www.ruby-forum.com/t/segmentation-faults/77072/3 "2006-11-24T15:38:01Z")

</div>

Hi Jens,

When I tried switching to 0.10.13 I did have to rewrite portions to  
work with the new API and I had it working using a small number of  
documents. It was only when I tried to do the entire import of my  
existing records that it would routinely seg fault.

Also, one other odd thing I noticed is on both 0.9.4 and 0.10.13 I  
will always get a segfault if I try to rebuild the index using the  
script/runner.

Due to the lack of being able to handle seg faults from the Rails code  
I may have no choice but to switch to mysql full text for the time  
being just for stability. Otherwise, all it takes is a seg fault to  
bring my whole application down. And in this case, since it corrupted  
the index my app will permanently seg fault until I rebuild it.

Thanks for your help.

Tom D.

[http://atomgiant.com](http://atomgiant.com)  
[http://gifthat.com](http://gifthat.com)
