# Test/functional/thread\_safety\_index\_test.rb failures - segfa

**URL:** <https://www.ruby-forum.com/t/test-functional-thread-safety-index-test-rb-failures-segfa/83636>\
**Category:** Ferret\
**Created:** [January 28, 2007, 2:59am UTC](https://www.ruby-forum.com/t/test-functional-thread-safety-index-test-rb-failures-segfa/83636 "2007-01-28T02:59:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 28, 2007, 2:59am UTC](https://www.ruby-forum.com/t/test-functional-thread-safety-index-test-rb-failures-segfa/83636/1 "2007-01-28T02:59:09Z")

</div>

Hi,

I just checked out ferret 0.10.14 from subversion and am getting  
intermittent failures from the thread\_safety\_index\_test.rb script.

Sometimes it runs through to the end with no errors, but other times I  
get errors, including segfaults.

I reported the bug here: [http://ferret.davebalmain.com/trac/ticket/153](http://ferret.davebalmain.com/trac/ticket/153)

Can anyone else reproduce this?

svn co svn://davebalmain.com/ferret/tags/REL-0.10.14/ ferret-0.10.14  
cd ferret-0.10.14  
rake ext  
ruby test/functional/thread\_safety\_index\_test.rb

You’ll need to run it a few times though (just the last line).  
Sometimes it returns successful, sometimes it returns weird and random  
test errors, and every so often it actually segfaults.

Additionally, I encountered problems running “rake ext” on a box that  
already has Ferret 0.10.14 installed as a gem. You may need to do this  
on a box without Ferret already installed (or figure out why it fails to  
build and fix it 🙂

I’m on Ubuntu Edgy.

Thanks,

## John.

[http://johnleach.co.uk](http://johnleach.co.uk)

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 28, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/test-functional-thread-safety-index-test-rb-failures-segfa/83636/2 "2007-01-28T20:58:36Z")

</div>

Hi,

I’ve tweaked the test script to almost guarantee a segfault now. I’ve  
also simplified it to try help rule out a few things. It no longer  
deletes or optimizes the index: just one thread for adding docs and one  
thread for searching docs.

[http://johnleach.co.uk/downloads/ruby/ferret/thread\_safety\_read\_write\_test.rb](http://johnleach.co.uk/downloads/ruby/ferret/thread_safety_read_write_test.rb)

You’ll need to drop it in the directory “test/functional/” in an  
unpacked Ferret source package.

## John.

[http://johnleach.co.uk](http://johnleach.co.uk)
