title: RSpec throws segmentation fault
body: <p>sometimes my test suite throws a segmentation fault for no reasons. Here is the output:</p>
  
  <pre><code>/Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:268: [BUG] Bus Error
  ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0]
  
  -- Control frame information -----------------------------------------------
  c:0209 p:---- s:0839 b:0839 l:000838 d:000838 CFUNC  :-
  c:0208 p:0068 s:0835 b:0833 l:000832 d:000832 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:268
  c:0207 p:0031 s:0828 b:0828 l:000827 d:000827 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:260
  c:0206 p:0084 s:0825 b:0825 l:000824 d:000824 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/calculations.rb:196
  c:0205 p:0166 s:0818 b:0818 l:000817 d:000817 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/calculations.rb:159
  c:0204 p:0050 s:0811 b:0811 l:000810 d:000810 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/calculations.rb:58
  c:0203 p:0089 s:0806 b:0806 l:000805 d:000805 METHOD /Users/Test/Dropbox/projects/rails/my_shop/app/models/line_item_decorator.rb:7
  c:0202 p:---- s:0802 b:0802 l:000801 d:000801 FINISH
  c:0201 p:---- s:0800 b:0800 l:000370 d:000799 IFUNC 
  c:0200 p:0008 s:0798 b:0797 l:001cd0 d:000796 BLOCK  /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/calculations.rb:94
  c:0199 p:---- s:0794 b:0794 l:000793 d:000793 FINISH
  c:0198 p:---- s:0792 b:0792 l:000791 d:000791 CFUNC  :map
  c:0197 p:0028 s:0789 b:0789 l:000788 d:000788 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.9/lib/active_support/core_ext/enumerable.rb:60
  c:0196 p:0030 s:0784 b:0784 l:001cd0 d:001cd0 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/calculations.rb:94
  ....
  </code></pre>
  
  <p>We are using Spree Commerce with Ruby 1.9.3 and Rails 3.2.9. Here is the Gemfile.lock:</p>
  
  <pre><code>GIT
    remote: git://github.com/spree/spree.git
    revision: 0d81ee0a2265797641ce90e120ea4fd8b085fc12
    ref: 0d81ee0a2265797641ce90e120ea4fd8b085fc12
    branch: 1-2-stable
    specs:
      spree (1.2.0)
        spree_api (= 1.2.0)
        spree_cmd (= 1.2.0)
        spree_core (= 1.2.0)
        spree_dash (= 1.2.0)
        spree_promo (= 1.2.0)
        spree_sample (= 1.2.0)
      spree_api (1.2.0)
        spree_core (= 1.2.0)
      spree_cmd (1.2.0)
        thor (&gt;= 0.14.6)
      spree_core (1.2.0)
        activemerchant (= 1.28.0)
        acts_as_list (= 0.1.4)
        awesome_nested_set (= 2.1.4)
        aws-sdk (~&gt; 1.3.4)
        cancan (= 1.6.7)
        deface (&gt;= 0.9.0)
        ffaker (~&gt; 1.12.0)
        highline (= 1.6.11)
        jquery-rails (~&gt; 2.0)
        kaminari (= 0.13.0)
        money (= 5.0.0)
        paperclip (~&gt; 2.8)
        rabl (= 0.7.2)
        rails (~&gt; 3.2.9)
        ransack (~&gt; 0.7.0)
        select2-rails (~&gt; 3.0)
        state_machine (= 1.1.2)
        stringex (~&gt; 1.3.2)
      spree_dash (1.2.0)
        httparty (~&gt; 0.8.1)
        spree_core (= 1.2.0)
      spree_promo (1.2.0)
        spree_core (= 1.2.0)
      spree_sample (1.2.0)
        spree_core (= 1.2.0)
  
  GIT
    remote: git://github.com/spree/spree_auth_devise
    revision: d06f95d861d19547b407bc2e50b03667e5572ebd
    branch: 1-2-stable
    specs:
      spree_auth_devise (1.2.0)
        cancan (~&gt; 1.6.7)
        devise (~&gt; 2.2.3)
        devise-encryptable (= 0.1.1)
        spree_core
  
  GIT
    remote: git://github.com/sunspot/sunspot.git
    revision: 5488725cb2587973e7ff809f234eb437a76424f4
    branch: master
    specs:
      sunspot (2.0.0)
        pr_geohash (~&gt; 1.0)
        rsolr (~&gt; 1.0.7)
      sunspot_rails (2.0.0)
        nokogiri
        sunspot (= 2.0.0)
      sunspot_solr (2.0.0)
  
  GIT
    remote: https://github.com/Goltergaul/spree_i18n.git
    revision: 98662fb03d250b920a0d8481fa6448bf56497474
    specs:
      spree_i18n (1.0.0)
        i18n (~&gt; 0.5)
        spree (~&gt; 1.1)
  
  GEM
    remote: https://rubygems.org/
    specs:
      actionmailer (3.2.9)
        actionpack (= 3.2.9)
        mail (~&gt; 2.4.4)
      actionpack (3.2.9)
        activemodel (= 3.2.9)
        activesupport (= 3.2.9)
        builder (~&gt; 3.0.0)
        erubis (~&gt; 2.7.0)
        journey (~&gt; 1.0.4)
        rack (~&gt; 1.4.0)
        rack-cache (~&gt; 1.2)
        rack-test (~&gt; 0.6.1)
        sprockets (~&gt; 2.2.1)
      active_utils (2.0.1)
        activesupport (&gt;= 2.3.11)
        i18n
      activemerchant (1.28.0)
        active_utils (&gt;= 1.0.2)
        activesupport (&gt;= 2.3.11)
        builder (&gt;= 2.0.0)
        i18n
        json (&gt;= 1.5.1)
        money
        nokogiri
      activemodel (3.2.9)
        activesupport (= 3.2.9)
        builder (~&gt; 3.0.0)
      activerecord (3.2.9)
        activemodel (= 3.2.9)
        activesupport (= 3.2.9)
        arel (~&gt; 3.0.2)
        tzinfo (~&gt; 0.3.29)
      activeresource (3.2.9)
        activemodel (= 3.2.9)
        activesupport (= 3.2.9)
      activesupport (3.2.9)
        i18n (~&gt; 0.6)
        multi_json (~&gt; 1.0)
      acts_as_list (0.1.4)
      addressable (2.3.4)
      airbrake (3.1.11)
        activesupport
        builder
        json
      akami (1.2.0)
        gyoku (&gt;= 0.4.0)
        nokogiri (&gt;= 1.4.0)
      arel (3.0.2)
      awesome_nested_set (2.1.4)
        activerecord (&gt;= 3.0.0)
      aws-sdk (1.3.9)
        httparty (~&gt; 0.7)
        json (~&gt; 1.4)
        nokogiri (&gt;= 1.4.4)
        uuidtools (~&gt; 2.1)
      bcrypt-ruby (3.0.1)
      builder (3.0.4)
      cancan (1.6.7)
      capistrano (2.15.2)
        highline
        net-scp (&gt;= 1.0.0)
        net-sftp (&gt;= 2.0.0)
        net-ssh (&gt;= 2.0.14)
        net-ssh-gateway (&gt;= 1.1.0)
      capybara (2.1.0)
        mime-types (&gt;= 1.16)
        nokogiri (&gt;= 1.3.3)
        rack (&gt;= 1.0.0)
        rack-test (&gt;= 0.5.4)
        xpath (~&gt; 2.0)
      childprocess (0.3.9)
        ffi (~&gt; 1.0, &gt;= 1.0.11)
      choice (0.1.6)
      chronic (0.9.1)
      chunky_png (1.2.8)
      climate_control (0.0.3)
        activesupport (&gt;= 3.0)
      cocaine (0.5.2)
        climate_control (&gt;= 0.0.3, &lt; 1.0)
      coffee-rails (3.2.2)
        coffee-script (&gt;= 2.2.0)
        railties (~&gt; 3.2.0)
      coffee-script (2.2.0)
        coffee-script-source
        execjs
      coffee-script-source (1.6.2)
      colorize (0.6.0)
      columnize (0.3.6)
      compass (0.12.2)
        chunky_png (~&gt; 1.2)
        fssm (&gt;= 0.2.7)
        sass (~&gt; 3.1)
      compass-rails (1.0.3)
        compass (&gt;= 0.12.2, &lt; 0.14)
      crack (0.3.2)
      database_cleaner (0.9.1)
      debugger (1.5.0)
        columnize (&gt;= 0.3.1)
        debugger-linecache (~&gt; 1.2.0)
        debugger-ruby_core_source (~&gt; 1.2.0)
      debugger-linecache (1.2.0)
      debugger-ruby_core_source (1.2.0)
      deface (1.0.0)
        colorize (&gt;= 0.5.8)
        nokogiri (~&gt; 1.6.0)
        rails (&gt;= 3.1)
      devise (2.2.3)
        bcrypt-ruby (~&gt; 3.0)
        orm_adapter (~&gt; 0.1)
        railties (~&gt; 3.1)
        warden (~&gt; 1.2.1)
      devise-encryptable (0.1.1)
        devise (&gt;= 2.1.0.rc)
      devise-i18n (0.8.3)
      diff-lcs (1.2.4)
      ean (0.2.0)
      email_spec (1.4.0)
        launchy (~&gt; 2.1)
        mail (~&gt; 2.2)
      erubis (2.7.0)
      eventmachine (1.0.3)
      execjs (1.4.0)
        multi_json (~&gt; 1.0)
      factory_girl (4.2.0)
        activesupport (&gt;= 3.0.0)
      factory_girl_rails (4.2.1)
        factory_girl (~&gt; 4.2.0)
        railties (&gt;= 3.0.0)
      fattr (2.2.1)
      faye-websocket (0.4.7)
        eventmachine (&gt;= 0.12.0)
      ffaker (1.12.1)
      ffi (1.9.0)
      fssm (0.2.10)
      gyoku (1.0.0)
        builder (&gt;= 2.1.2)
      haml (4.0.2)
        tilt
      highline (1.6.11)
      hike (1.2.3)
      http_parser.rb (0.5.3)
      httparty (0.8.3)
        multi_json (~&gt; 1.0)
        multi_xml
      httpi (2.0.2)
        rack
      i18n (0.6.5)
      journey (1.0.4)
      jquery-fileupload-rails (0.4.1)
        actionpack (&gt;= 3.1)
        railties (&gt;= 3.1)
      jquery-rails (2.3.0)
        railties (&gt;= 3.0, &lt; 5.0)
        thor (&gt;= 0.14, &lt; 2.0)
      json (1.8.0)
      kaminari (0.13.0)
        actionpack (&gt;= 3.0.0)
        activesupport (&gt;= 3.0.0)
        railties (&gt;= 3.0.0)
      launchy (2.3.0)
        addressable (~&gt; 2.3)
      libv8 (3.11.8.17)
      mail (2.4.4)
        i18n (&gt;= 0.4.0)
        mime-types (~&gt; 1.16)
        treetop (~&gt; 1.4.8)
      mime-types (1.25)
      mini_portile (0.5.1)
      money (5.0.0)
        i18n (~&gt; 0.4)
        json
      multi_json (1.8.2)
      multi_xml (0.5.5)
      mysql2 (0.3.11)
      net-scp (1.1.0)
        net-ssh (&gt;= 2.6.5)
      net-sftp (2.1.1)
        net-ssh (&gt;= 2.6.5)
      net-ssh (2.6.7)
      net-ssh-gateway (1.2.0)
        net-ssh (&gt;= 2.6.5)
      newrelic_rpm (3.6.7.152)
      nokogiri (1.6.0)
        mini_portile (~&gt; 0.5.0)
      nori (2.1.0)
      options (2.3.0)
        fattr
      orm_adapter (0.4.0)
      paperclip (2.8.0)
        activerecord (&gt;= 2.3.0)
        activesupport (&gt;= 2.3.2)
        cocaine (&gt;= 0.0.2)
        mime-types
      poltergeist (1.2.0)
        capybara (~&gt; 2.1.0)
        faye-websocket (~&gt; 0.4, &gt;= 0.4.4)
        http_parser.rb (~&gt; 0.5.3)
      polyamorous (0.5.0)
        activerecord (~&gt; 3.0)
      polyglot (0.3.3)
      pr_geohash (1.0.0)
      progress_bar (1.0.0)
        highline (~&gt; 1.6.1)
        options (~&gt; 2.3.0)
      rabl (0.7.2)
        activesupport (&gt;= 2.3.14)
        multi_json (~&gt; 1.0)
      rack (1.4.5)
      rack-cache (1.2)
        rack (&gt;= 0.4)
      rack-ssl (1.3.3)
        rack
      rack-test (0.6.2)
        rack (&gt;= 1.0)
      rails (3.2.9)
        actionmailer (= 3.2.9)
        actionpack (= 3.2.9)
        activerecord (= 3.2.9)
        activeresource (= 3.2.9)
        activesupport (= 3.2.9)
        bundler (~&gt; 1.0)
        railties (= 3.2.9)
      rails-erd (1.1.0)
        activerecord (&gt;= 3.0)
        activesupport (&gt;= 3.0)
        choice (~&gt; 0.1.6)
        ruby-graphviz (~&gt; 1.0.4)
      rails-i18n (0.7.3)
        i18n (~&gt; 0.5)
      railties (3.2.9)
        actionpack (= 3.2.9)
        activesupport (= 3.2.9)
        rack-ssl (~&gt; 1.3.2)
        rake (&gt;= 0.8.7)
        rdoc (~&gt; 3.4)
        thor (&gt;= 0.14.6, &lt; 2.0)
      rake (10.1.0)
      ransack (0.7.2)
        actionpack (~&gt; 3.0)
        activerecord (~&gt; 3.0)
        polyamorous (~&gt; 0.5.0)
      rdoc (3.12.2)
        json (~&gt; 1.4)
      ref (1.0.4)
      rsolr (1.0.9)
        builder (&gt;= 2.1.2)
      rspec (2.13.0)
        rspec-core (~&gt; 2.13.0)
        rspec-expectations (~&gt; 2.13.0)
        rspec-mocks (~&gt; 2.13.0)
      rspec-core (2.13.1)
      rspec-expectations (2.13.0)
        diff-lcs (&gt;= 1.1.3, &lt; 2.0)
      rspec-mocks (2.13.1)
      rspec-rails (2.13.0)
        actionpack (&gt;= 3.0)
        activesupport (&gt;= 3.0)
        railties (&gt;= 3.0)
        rspec-core (~&gt; 2.13.0)
        rspec-expectations (~&gt; 2.13.0)
        rspec-mocks (~&gt; 2.13.0)
      ruby-graphviz (1.0.8)
      ruby-prof (0.13.0)
      rubyzip (0.9.9)
      sass (3.2.12)
      sass-rails (3.2.6)
        railties (~&gt; 3.2.0)
        sass (&gt;= 3.1.10)
        tilt (~&gt; 1.3)
      savon (2.2.0)
        akami (~&gt; 1.2.0)
        builder (&gt;= 2.1.2)
        gyoku (~&gt; 1.0.0)
        httpi (~&gt; 2.0.2)
        nokogiri (&gt;= 1.4.0)
        nori (~&gt; 2.1.0)
        wasabi (~&gt; 3.1.0)
      select2-rails (3.5.0)
        thor (~&gt; 0.14)
      selenium-webdriver (2.35.1)
        childprocess (&gt;= 0.2.5)
        multi_json (~&gt; 1.0)
        rubyzip (&lt; 1.0.0)
        websocket (~&gt; 1.0.4)
      simple_form (2.1.0)
        actionpack (~&gt; 3.0)
        activemodel (~&gt; 3.0)
      spree_skrill (1.0.2)
        spree_core (&gt;= 1.0.0)
      spree_usa_epay (1.0.2)
        savon
        spree_core (&gt;= 1.0.0)
      sprockets (2.2.2)
        hike (~&gt; 1.2)
        multi_json (~&gt; 1.0)
        rack (~&gt; 1.0)
        tilt (~&gt; 1.1, != 1.3.0)
      state_machine (1.1.2)
      steak (2.0.0)
        capybara (&gt;= 1.0.0)
        rspec-rails (&gt;= 2.5.0)
      stringex (1.3.3)
      therubyracer (0.11.4)
        libv8 (~&gt; 3.11.8.12)
        ref
      thor (0.18.1)
      tilt (1.4.1)
      timecop (0.6.1)
      treetop (1.4.15)
        polyglot
        polyglot (&gt;= 0.3.1)
      tunnels (1.2.2)
        eventmachine
      tzinfo (0.3.38)
      uglifier (2.0.1)
        execjs (&gt;= 0.3.0)
        multi_json (~&gt; 1.0, &gt;= 1.0.2)
      useragent (0.6.0)
      uuidtools (2.1.4)
      vcr (2.5.0)
      warden (1.2.1)
        rack (&gt;= 1.0)
      wasabi (3.1.0)
        httpi (~&gt; 2.0)
        nokogiri (&gt;= 1.4.0)
      webmock (1.8.11)
        addressable (&gt;= 2.2.7)
        crack (&gt;= 0.1.7)
      websocket (1.0.7)
      whenever (0.8.2)
        activesupport (&gt;= 2.3.4)
        chronic (&gt;= 0.6.3)
      wicked_pdf (0.9.6)
        rails
      xpath (2.0.0)
        nokogiri (~&gt; 1.3)
      zurb-foundation (4.1.2)
        sass (&gt;= 3.2.0)
  
  PLATFORMS
    ruby
  
  DEPENDENCIES
    airbrake
    capistrano
    coffee-rails (~&gt; 3.2.1)
    compass-rails
    database_cleaner
    debugger (~&gt; 1.5.0)
    devise-encryptable
    devise-i18n
    ean
    email_spec
    factory_girl_rails
    haml
    httparty
    jquery-fileupload-rails
    jquery-rails
    kaminari
    launchy
    mysql2
    newrelic_rpm
    poltergeist
    progress_bar
    rails (= 3.2.9)
    rails-erd
    rails-i18n
    rspec
    ruby-prof
    sass-rails (~&gt; 3.2.3)
    selenium-webdriver
    simple_form
    spree!
    spree_auth_devise!
    spree_i18n!
    spree_ipayment!
    spree_paypal_express!
    spree_skrill
    spree_usa_epay
    spree_wirecard!
    steak
    sunspot_rails!
    sunspot_solr!
    therubyracer
    timecop
    tunnels
    uglifier (&gt;= 1.0.3)
    useragent
    vcr
    webmock (~&gt; 1.8.3)
    whenever
    wicked_pdf
    zurb-foundation
  </code></pre>
  
  <p>Sometimes it throws the error, sometimes it don't, and sometimes it is even caused by some file in the state machine gem. At <code>line_item_decorator.rb:7</code> there is only a database query, nothing special.</p>
  
  <p>I'm on Mac OS X 10.8.5, but the error also happens on Ubuntu 13.</p>
  
  <p>Any idea how I can solve this?</p>