运行配置文件测试时Ruby划分错误

时间:2012-08-22 16:10:39

标签: ruby-on-rails ruby segmentation-fault ruby-prof

当我运行rake test:profile时,我得到了下面的分段错误错误。我正在使用ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]。但它也发生在Ruby 1.9.2的p320版本中,并且Ruby 1.9.3也会发生类似的错误。

active_support/testing/performance/ruby.rb:36实际上只是说RubyProf.pause。我正在使用配置文件选项:runs => 5, :metrics => [:cpu_time], :formats => [:tree]运行测试。请看帖子末尾的我的宝石列表。

任何建议都将受到赞赏。

错误追踪:

/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance/ruby.rb:36: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

-- control frame ----------
c:0017 p:0058 s:0062 b:0062 l:000061 d:000061 METHOD /home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance/ruby.rb:36
c:0016 p:0060 s:0059 b:0059 l:000058 d:000058 METHOD /home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:140
c:0015 p:0044 s:0053 b:0053 l:000043 d:000052 BLOCK  /home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:52
c:0014 p:---- s:0049 b:0049 l:000048 d:000048 FINISH
c:0013 p:---- s:0047 b:0047 l:000046 d:000046 CFUNC  :each
c:0012 p:0056 s:0044 b:0044 l:000043 d:000043 METHOD /home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:50
c:0011 p:0091 s:0039 b:0039 l:000020 d:000038 BLOCK  /home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:656
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 FINISH
c:0009 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC  :each
c:0008 p:0026 s:0029 b:0029 l:000020 d:000028 BLOCK  /home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:650
c:0007 p:---- s:0026 b:0026 l:000025 d:000025 FINISH
c:0006 p:---- s:0024 b:0024 l:000023 d:000023 CFUNC  :each
c:0005 p:0082 s:0021 b:0021 l:000020 d:000020 METHOD /home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:649
c:0004 p:0188 s:0016 b:0016 l:000015 d:000015 METHOD /home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:609
c:0003 p:0057 s:0007 b:0007 l:001a1c d:000360 BLOCK  /home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:508
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00207c d:00207c TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:508:in `block in autorun'
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:609:in `run'
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:649:in `run_test_suites'
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:649:in `each'
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:650:in `block in run_test_suites'
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:650:in `each'
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:656:in `block (2 levels) in run_test_suites'
/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:50:in `run'
/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:50:in `each'
/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:52:in `block in run'
/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance.rb:140:in `run_profile'
/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/activesupport-3.2.8/lib/active_support/testing/performance/ruby.rb:36:in `run'

-- C level backtrace information -------------------------------------------
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_vm_bugreport+0x72) [0xb76aef72]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x54123) [0xb758b123]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_bug+0x33) [0xb758be13]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1090c3) [0xb76400c3]
[0xb775440c]
/home/manuel/.rvm/gems/ruby-1.9.2-p290@dev3dynamic/gems/ruby-prof-0.11.2/lib/ruby_prof.so(+0x32c1) [0xb5f8a2c1]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_threadptr_exec_event_hooks+0xe4) [0xb76b3434]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16ca1d) [0xb76a3a1d]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d460) [0xb76a4460]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_yield+0x55) [0xb76a92a5]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_ary_each+0x4a) [0xb755981a]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16345d) [0xb769a45d]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1711f0) [0xb76a81f0]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x167ea0) [0xb769eea0]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d460) [0xb76a4460]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_yield+0x55) [0xb76a92a5]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_ary_each+0x4a) [0xb755981a]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16345d) [0xb769a45d]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1711f0) [0xb76a81f0]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x167ea0) [0xb769eea0]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d460) [0xb76a4460]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_yield+0x55) [0xb76a92a5]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_ary_each+0x4a) [0xb755981a]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16345d) [0xb769a45d]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1711f0) [0xb76a81f0]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x167ea0) [0xb769eea0]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x16d460) [0xb76a4460]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_vm_invoke_proc+0xf9) [0xb76a5459]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_proc_call+0x57) [0xb7596d87]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_call_end_proc+0x24) [0xb758f294]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_exec_end_proc+0x208) [0xb7591af8]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x5abb9) [0xb7591bb9]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(ruby_cleanup+0x128) [0xb7591d38]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(ruby_run_node+0x3e) [0xb759209e]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/bin/ruby(main+0x68) [0x8048668]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xb73b8113]
/home/manuel/.rvm/rubies/ruby-1.9.2-p290/bin/ruby() [0x8048691]

[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

Aborted
rake aborted!
Command failed with status (134): [/home/manuel/.rvm/rubies/ruby-1.9.2-p290/b...]

Tasks: TOP => test:profile
(See full trace by running task with --trace)

宝石清单:

actionmailer (3.2.8)
actionpack (3.2.8)
active_scaffold_vho (3.1.4)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
acts_as_versioned (0.2.3)
addressable (2.2.8)
airbrake (3.1.2)
analytics-logger (0.3.7)
ancestry (1.3.0)
annotate (2.5.0)
archive-tar-minitar (0.5.2)
arel (3.0.2)
authlogic (3.1.3)
authlogic_device_tokens (0.1.1)
aws-sdk (1.5.8)
best_in_place (0.2.3)
bootstrap-will_paginate (0.0.7)
bson (1.6.4)
bson_ext (1.6.4)
builder (3.0.0)
bundler (1.1.5)
capybara (1.1.2)
central_logger (0.3.2)
childprocess (0.3.4)
columnize (0.3.6)
daemons (1.1.8)
database_cleaner (0.8.0)
deadlock_retry (1.0.2)
delayed_job (3.0.3)
delayed_job_active_record (0.3.2)
diff-lcs (1.1.3)
engineyard (1.4.29)
engineyard-serverside-adapter (1.6.4)
erubis (2.7.0)
escape (0.0.4)
factory_girl (3.6.0)
fast_xs (0.8.0)
fastercsv (1.5.5)
ffi (1.1.2)
formtastic (2.2.1)
headless (0.3.1)
highline (1.6.13)
hike (1.2.1)
hpricot (0.8.6)
httparty (0.8.3)
i18n (0.6.0)
imagesize (0.1.1)
journey (1.0.4)
jquery-rails (2.0.2)
json (1.7.5)
json_pure (1.7.4)
kgio (2.7.4)
launchy (2.0.5)
libwebsocket (0.1.5)
linecache19 (0.5.12)
liquid (2.3.0)
macaddr (1.6.1)
mail (2.4.4)
memcache-client (1.8.5)
mime-types (1.19)
mongo (1.6.2)
mongoid (2.4.11)
multi_json (1.3.6)
multi_xml (0.5.1)
multipart-post (1.1.5)
mysql2 (0.3.11)
net-ssh (2.2.2)
newrelic_rpm (3.4.1)
nokogiri (1.5.5)
open4 (1.3.0)
polyglot (0.3.3)
pr_geohash (1.0.0)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.8)
railties (3.2.8)
raindrops (0.10.0)
rake (0.9.2.2)
rdoc (3.12)
recurly (0.4.14)
redcarpet (2.1.1)
redis (3.0.1)
render_component_vho (3.2.1)
rest-client (1.6.7)
rinku (1.7.0)
rsolr (1.0.6)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.1)
rspec-rails (2.11.0)
ruby-dbus (0.7.2)
ruby-debug-base19 (0.11.25)
ruby-debug19 (0.11.6)
ruby-prof (0.11.2)
ruby_core_source (0.1.5)
rubyzip (0.9.9)
selenium-webdriver (2.25.0)
shotgun (0.9)
spork (0.9.2)
sprockets (2.1.3)
sqlite3 (1.3.6)
stringex (1.4.0)
sunspot (1.3.0)
sunspot_cell (0.1.2)
sunspot_index_queue (1.1.3)
sunspot_rails (1.3.0)
sunspot_solr (1.3.3)
systemu (2.5.2)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
unicorn (4.3.1)
uuid (2.3.5)
uuidtools (2.1.3)
validatable (1.6.7)
watir-webdriver (0.6.1)
will_paginate (3.0.3)
workflow (0.8.1)
xpath (0.1.4)
yajl-ruby (1.1.0)
yard (0.8.2.1)

1 个答案:

答案 0 :(得分:0)

known issues with ruby-prof on 1.9.2。如果由于某种原因你仍然坚持使用1.9.2,你可以尝试使用wycat's fork of ruby-prof,这应该可以改善段错误。