新手问题 You may have encountered a bug in the Ruby interpreter or extension libraries.

string2020 · 2014年11月26日 · 最后由 luikore 回复于 2014年11月27日 · 6623 次阅读
ly@hadoop:~/src/ruby$ ruby server.rb 
server.rb:15: warning: already initialized constant DEFAULT_PORT
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38: [BUG] Segmentation fault
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]

-- control frame ----------
c:0014 p:---- s:0049 b:0049 l:000048 d:000048 CFUNC  :resume
c:0013 p:0021 s:0046 b:0046 l:001308 d:001ac8 BLOCK  /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38
c:0012 p:---- s:0044 b:0044 l:000043 d:000043 FINISH
c:0011 p:---- s:0042 b:0042 l:000041 d:000041 CFUNC  :call
c:0010 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC  :run_machine
c:0009 p:0325 s:0037 b:0037 l:000036 d:000036 METHOD /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/eventmachine-1.0.0/lib/eventmachine.rb:187
c:0008 p:0118 s:0030 b:0030 l:001308 d:001308 METHOD /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38
c:0007 p:0033 s:0025 b:0025 l:000e30 d:000e30 METHOD /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/server.rb:73
c:0006 p:0079 s:0021 b:0021 l:000020 d:000020 METHOD /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/runner.rb:296
c:0005 p:0172 s:0016 b:0016 l:000015 d:000015 METHOD /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/runner.rb:221
c:0004 p:0184 s:0013 b:0013 l:000012 d:000012 METHOD /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/application.rb:111
c:0003 p:0048 s:0006 b:0006 l:001af8 d:000005 BLOCK  /home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/application.rb:129
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001d98 d:001d98 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/application.rb:129:in `block in <module:Goliath>'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/application.rb:111:in `run!'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/runner.rb:221:in `run'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/runner.rb:296:in `run_server'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/goliath-1.0.1/lib/goliath/server.rb:73:in `start'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38:in `synchrony'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `call'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38:in `block in synchrony'
/home/ly/.rvm/gems/ruby-1.9.2-p320/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38:in `resume'

-- C level backtrace information -------------------------------------------
/home/ly/.rvm/rubies/ruby-1.9.2-p320/lib/libruby.so.1.9(rb_vm_bugreport+0x5e) [0x7f7a4643aade]
/home/ly/.rvm/rubies/ruby-1.9.2-p320/lib/libruby.so.1.9(+0x659ee) [0x7f7a4630a9ee]
/home/ly/.rvm/rubies/ruby-1.9.2-p320/lib/libruby.so.1.9(rb_bug+0xa5) [0x7f7a4630b605]
/home/ly/.rvm/rubies/ruby-1.9.2-p320/lib/libruby.so.1.9(+0x122074) [0x7f7a463c7074]
/lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f7a45f15c30]

[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

已放弃 (核心已转储)

这是 ruby 的 bug 吗?,怎么解决

为何要用那么老的 ruby 版本?

是比较 RP 的问题,em-synchrony 把 socket 的主要函数 monkey patch 了,但如果数据库驱动里用了 socket 什么的就很可能出错。现在 em 系的逐渐被 celluloid 系的取代了

gdb core 可能能找到问题...

需要 登录 后方可回复, 如果你还没有账号请 注册新账号