Issue #5661 has been updated by Hiroshi Nakamura.


formatting
----------------------------------------
Bug #5661: Segfault in Random.rand with Spork gem
http://redmine.ruby-lang.org/issues/5661

Author: Andrew France
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]


When running my Rails 3.1 RSpec suite with the Spork gem I get a Segmentation Fault caused by the Random.rand method.

The full debug output is attached. Sorry I have not been able to isolate the code to a minimum test case. Suggestions on reproducing with less code would be welcome.

The offending code is in a Factory Girl factory definition:

   trait :with_messages do
      after_create do |mt|
        user = FactoryGirl.create(:user)  # To prevent creating 1 user per message
        FactoryGirl.create_list(:message, 1 + Random.rand(4), thread: mt, created_by: user)
      end 
   end

Spork is loaded with: bundle exec spork rspec
The fault occurs when the test run is executed with: bundle exec rspec spec
It works fine when not running in the Spork process.



-- 
http://redmine.ruby-lang.org