2012-03-17 20 views
12

Sto usando un Mac OS con Snow Leopard 10.6.8 e RVM 1.10.3, Ruby 1.9.3-p125, Ruby on Rails 3.2.2 e rspec-rails-2.8.1. Ho correttamente installato e configurato tutte le gemme, ma quando nella finestra di Terminale faccio funzionare l'ordine rake spec ottengo il seguente:Come risolvere il "[BUG] errore di segmentazione"?

$ rake spec 
/<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:10: [BUG] Segmentation fault 
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] 

-- Control frame information ----------------------------------------------- 
c:0045 p:0011 s:0136 b:0136 l:000135 d:000135 CLASS /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:10 
c:0044 p:0011 s:0134 b:0134 l:000133 d:000133 CLASS /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:4 
c:0043 p:0021 s:0132 b:0132 l:000131 d:000131 TOP /<ABSOLUT_PATH>/.rvm/gems/ruby- 
1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:3 
c:0033 p:0220 s:0104 b:0104 l:0020f0 d:0020f0 TOP /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard.rb:57 
c:0032 p:---- s:0101 b:0101 l:000100 d:000100 FINISH 
c:0031 p:---- s:0099 b:0099 l:000098 d:000098 CFUNC :require 
c:0030 p:0026 s:0095 b:0095 l:000380 d:000470 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:68 
c:0029 p:---- s:0092 b:0092 l:000091 d:000091 FINISH 
c:0028 p:---- s:0090 b:0090 l:000089 d:000089 CFUNC :each 
c:0027 p:0091 s:0087 b:0087 l:000380 d:000408 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:66 
c:0026 p:---- s:0081 b:0081 l:000080 d:000080 FINISH 
c:0025 p:---- s:0079 b:0079 l:000078 d:000078 CFUNC :each 
c:0024 p:0046 s:0076 b:0076 l:000380 d:000380 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:55 
c:0023 p:0021 s:0072 b:0072 l:0004e0 d:0004e0 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler.rb:118 
c:0022 p:0089 s:0068 b:0068 l:000548 d:000548 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/config/application.rb:7 
c:0021 p:---- s:0066 b:0066 l:000065 d:000065 FINISH 
c:0020 p:---- s:0064 b:0064 l:000063 d:000063 CFUNC :require 
c:0019 p:0026 s:0060 b:0060 l:0005a8 d:0005a8 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/config/environment.rb:2 
c:0018 p:---- s:0058 b:0058 l:000057 d:000057 FINISH 
c:0017 p:---- s:0056 b:0056 l:000055 d:000055 CFUNC :require 
c:0016 p:0058 s:0052 b:0052 l:000608 d:000608 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/spec/spec_helper.rb:3 
c:0015 p:---- s:0050 b:0050 l:000049 d:000049 FINISH 
c:0014 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :require 
c:0013 p:0011 s:0044 b:0044 l:000668 d:000668 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/spec/controllers/users_controller_spec.rb:1 
c:0012 p:---- s:0042 b:0042 l:000041 d:000041 FINISH 
c:0011 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :load 
c:0010 p:0025 s:0036 b:0036 l:0006c8 d:000730 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698 
c:0009 p:---- s:0033 b:0033 l:000032 d:000032 FINISH 
c:0008 p:---- s:0031 b:0031 l:000030 d:000030 CFUNC :map 
c:0007 p:0023 s:0028 b:0028 l:0006c8 d:0006c8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698 
c:0006 p:0074 s:0025 b:0025 l:0007a8 d:0007a8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22 
c:0005 p:0055 s:0020 b:0020 l:000820 d:000820 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80 
c:0004 p:0101 s:0014 b:0014 l:0008a8 d:0008a8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69 
c:0003 p:0021 s:0007 b:0006 l:001788 d:000908 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10 
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH 
c:0001 p:0000 s:0002 b:0002 l:002388 d:002388 TOP 

-- C level backtrace information ------------------------------------------- 

    See Crash Report log file under ~/Library/Logs/CrashReporter or 
    /Library/Logs/CrashReporter, for the more detail of. 

-- Other runtime information ----------------------------------------------- 

* Loaded script: /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/bin/rspec 

* Loaded features: 

    0 enumerator.so 
    1 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle 
    2 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle 
    3 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb 
    ... 

[NOTE] 
You may have encountered a bug in the Ruby interpreter or extension libraries. 
Bug reports are welcome. 
For details: http://www.ruby-lang.org/bugreport.html 

rake aborted! 
/<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/controllers/users_controller_spec.rb ... failed 

Come posso risolvere il problema?

Nota: Ho notato che il problema si verifica a volte, a caso!


Nel mio Gemfile ho:

... 

group :development, :test do 
    gem "rspec-rails" 
    gem 'webrat' 
end 

group :test do 
    gem 'factory_girl_rails' 
    gem 'cucumber-rails' 
    gem 'turn', :require => false 
end 

... 

risposta

4

CURA: Sulla base delle informazioni che ci ha fornito fino ad ora, sembra aver trovato un bug in Ruby 1.9.3. Vi consiglio di segnalarlo al team principale di Ruby.

Fino a quando questo errore non viene risolto, è necessario trovare un modo per aggirarlo. Per trovare un modo per aggirarlo, è necessario ottenere maggiori dettagli su esattamente ciò che fa e non lo innesca.

Nella traccia stack che hai postato, sembra che la riga 68 di bundler/runtime.rb richieda la gemma del cantiere. Usando Ruby 1.9.3, prova a richiedere la gemma del cantiere, da IRB o da un semplice script di test. Questo fa scattare l'errore? In caso contrario, andare al metodo che "realer" chiama in "bundler" (bundler.rb, riga 118). Prova a chiamare quel metodo (qualunque esso sia) da uno script di test. Questo fa scattare l'errore? ...e così via.

Fortunatamente, quando si installano gemme di Ruby, il codice sorgente è disponibile nella directory "gems" e si può studiarlo e modificarlo. Ho anche dovuto "hackerare" il codice sorgente delle mie gemme prima di risolvere i problemi (fino a quando una versione fissa della gemma è stata rilasciata).

+1

BTW, io sono solo l'installazione di questo gioiello così posso guardare il codice sorgente e vedere la linea dove il vostro segfault provenienza. –

+0

Ho notato che il problema si verifica a volte, in modo casuale. – Backo

+0

Ho appena guardato il codice sorgente per "yard" ... è difficile vedere come la linea a cui si riferisce il tuo messaggio di errore possa causare un problema. Pensando ... –

5

Ho lo stesso problema, arresti anomali casuali relativi a Yard quando si esegue rspec.

Ho trovato un altro post che ha risolto il problema per me. Rimossa la dipendenza da "pry-doc".

StackOverflow Post

Problemi correlati