分段错误 - Ruby 1.8.7和Rails 3.1.3

时间:2011-12-28 12:00:40

标签: ruby ruby-on-rails-3.1 segmentation-fault ruby-1.8

我使用ruby 1.8.7有一段美好的时光,而且自从发布此版本的rails以来,我使用了这个版本的ruby和rails 3.0.x.我从来没有遇到过分段错误。但是现在,在开始使用rails 3.1.3开发ruby 1.8.7之后,当我执行webrick并且我浏览应用程序时,我有以下错误:

/usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/utils.rb:380: [BUG] Segmentation fault
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]

错误是非常不稳定的,有时会发生在webrick的httputils上,有时会发生在机架上。 也许错误与资产管道线有一些关系,因为错误发生在某些过程之前:

Started GET "/assets/wymeditor/wymeditor/lang/zh_cn.js?body=1" for 127.0.0.1 at Wed Dec 28 09:22:23 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/zh_cn.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/zh_cn.js - 304 Not Modified (1ms)


Started GET "/assets/wymeditor/wymeditor/plugins/embed/jquery.wymeditor.embed.js?body=1" for 127.0.0.1 at Wed Dec 28 09:22:23 -0200 2011

任何人都可以帮我解决这个问题。从现在开始,我感谢您的帮助。

由于

开发日志:

Started GET "/assets/wymeditor/wymeditor/lang/he.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/he.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/he.js - 304 Not Modified (0ms)
Started GET "/assets/wymeditor/wymeditor/lang/hr.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/hr.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/hr.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/hu.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/hu.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/hu.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/it.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/it.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/it.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/nb.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/nb.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/nb.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/nl.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/nl.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/nl.js - 304 Not Modified (4ms)
Started GET "/assets/wymeditor/wymeditor/lang/pl.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/pl.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/pl.js - 304 Not Modified (0ms)
Started GET "/assets/wymeditor/wymeditor/lang/pt-br.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/pt-br.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/pt-br.js - 304 Not Modified (3ms)
Started GET "/assets/wymeditor/wymeditor/lang/pt.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/pt.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/pt.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/ru.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
/usr/lib/ruby/gems/1.8/gems/rack-cache-1.1/lib/rack/cache/metastore.rb:232: [BUG] Segmentation fault
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
Abortado

Abortado in English is Aborted

我所有宝石的清单:

  • 动作管理器(3.1.3)
    • actionpack(3.1.3)
    • activemodel(3.1.3)
    • activerecord(3.1.3)
    • activeresource(3.1.3)
    • activesupport(3.1.3)
    • arel(2.2.1)
    • bcrypt-ruby(3.0.1)
    • brI18n(3.0.4)
    • brazilian-rails(3.0.4)
    • brcep(3.0.4)
    • brcpfcnpj(3.0.4)
    • brdata(3.0.4)
    • brdinheiro(3.0.4)
    • brhelper(3.0.4)
    • brnumeros(3.0.4)
    • brstring(3.0.4)
    • builder(3.0.0)
    • bundler(1.0.15)
    • capybara(1.1.1)
    • childprocess(0.2.2)
    • coffee-rails(3.1.1)
    • coffee-script(2.2.0)
    • coffee-script-source(1.1.3)
    • columnize(0.3.4)
    • 黄瓜(1.1.0)
    • cucumber-rails(1.1.1)
    • database_cleaner(0.6.7)
    • 设计(1.4.8)
    • diff-lcs(1.1.3)
    • 蜻蜓(0.9.8)
    • erubis(2.7.0)
    • execjs(1.2.12)
    • factory_girl(2.2.0)
    • factory_girl_rails(1.3.0)
    • ffi(1.0.9)
    • 小黄瓜(2.5.1)
    • hike(1.2.1)
    • i18n(0.6.0)
    • jquery-rails(1.0.19)
    • json(1.6.3)
    • json_pure(1.6.1)
    • linecache(0.46)
    • mail(2.3.0)
    • mime-types(1.17.2)
    • multi_json(1.0.4)
    • mysql2(0.3.11)
    • nokogiri(1.5.0)
    • orm_adapter(0.0.5)
    • 多语言(0.3.3)
    • rack(1.3.5)
    • rack-cache(1.1)
    • 机架式(0.8.3)
    • rack-ssl(1.3.2)
    • rack-test(0.6.1)
    • rails(3.1.3)
    • railties(3.1.3)
    • rake(0.9.2.2)
    • rbx-require-relative(0.0.5)
    • rdoc(3.11)
    • rspec(2.6.0)
    • rspec-core(2.6.4)
    • rspec-expectations(2.6.0)
    • rspec-mocks(2.6.0)
    • rspec-rails(2.6.1)
    • ruby​​-debug(0.10.4)
    • ruby​​-debug-base(0.10.4)
    • ruby​​zip(0.9.4)
    • sass(3.1.11)
    • sass-rails(3.1.5)
    • selenium-client(1.2.18)
    • selenium-webdriver(2.8.0)
    • 链轮(2.0.3)
    • term-ansicolor(1.0.7)
    • thor(0.14.6)
    • 倾斜(1.3.3)
    • treetop(1.4.10)
    • tzinfo(0.3.31)
    • uglifier(1.1.0)
    • warden(1.0.6)
    • webrat(0.7.3)
    • wymeditor(0.5.0.rc2)
    • xpath(0.1.4)

Ruby版本: ruby 1.8.7(2010-06-23 patchlevel 299) 拱: [i686的Linux的]

我得到的唯一堆栈跟踪:

/usr/lib/ruby/1.8/webrick/httpserver.rb:50
while timeout > 0
(rdb:2) n
[2011-12-28 16:22:52] ERROR #<Class:0xb6614868>: execution expired
   /usr/lib/ruby/1.8/timeout.rb:64:in `timeout'
   /usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
   /usr/lib/ruby/1.8/webrick/httprequest.rb:326:in `_read_data'
   /usr/lib/ruby/1.8/webrick/httprequest.rb:337:in `read_line'
   /usr/lib/ruby/1.8/webrick/httprequest.rb:240:in `read_header'
   /usr/lib/ruby/1.8/webrick/httprequest.rb:88:in `parse'
   /usr/lib/ruby/1.8/webrick/httpserver.rb:56:in `run'
   /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
   /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
   /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
   /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
   /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
   /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
   /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
   /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
   /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/handler/webrick.rb:13:in `run'
   /usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/server.rb:265:in `start'
   /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands/server.rb:70:in `start'
   /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:54
   /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
   /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:49
   script/rails:6:in `require'
   script/rails:6
/usr/lib/ruby/1.8/webrick/httpserver.rb:51
break if IO.select([sock], nil, nil, 0.5)

在调试模式下,逐行轻松地发生错误。我确实只有一个堆栈跟踪,而且我没有超过一次。

此时我禁用了资产管道,coffeescript和sass。我没有得到更多错误,但我没有更多这些功能。

1 个答案:

答案 0 :(得分:0)

来自guides.rubyonrails.org的说明:

  

请注意,Ruby 1.8.7 p248和p249具有导致Rails 3.0崩溃的编组错误。 Ruby Enterprise Edition自1.8.7-2010.02版本开始就已经修复了。在1.9版本中,Ruby 1.9.1不可用,因为它在Rails 3.0上完全是段错误,所以如果你想使用1..9开启的Rails 3和1.9.2的顺畅航行。

我在1.9.2上运气很好,而且rvm可以很容易地在多个版本的ruby之间切换。你能尝试一下吗?