mperham / rack-fiber_pool

Rack middleware to execute each request in a Fiber
MIT License
244 stars 24 forks source link

Segmentation Fault #12

Closed cmelbye closed 13 years ago

cmelbye commented 13 years ago

Am I the only one running into a Segmentation Fault error when running the example Sinatra code?

Charlies-MacBook-Pro:~ charlie$ rackup -s thin app.rb 
>> Thin web server (v1.2.11 codename Bat-Shit Crazy)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9292, CTRL+C to stop
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:75: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]

-- control frame ----------
c:0034 p:---- s:0152 b:0152 l:000151 d:000151 CFUNC  :resume
c:0033 p:0067 s:0148 b:0148 l:000147 d:000147 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:75
c:0032 p:0026 s:0143 b:0143 l:000eb8 d:000eb8 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/rack/fiber_pool.rb:23
c:0031 p:0015 s:0138 b:0138 l:000137 d:000137 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/head.rb:9
c:0030 p:0015 s:0131 b:0131 l:000130 d:000130 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/showexceptions.rb:21
c:0029 p:0018 s:0123 b:0123 l:002480 d:000122 BLOCK  /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272
c:0028 p:0032 s:0121 b:0121 l:000120 d:000120 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/base.rb:1303
c:0027 p:0011 s:0117 b:0117 l:002480 d:002480 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272
c:0026 p:0103 s:0113 b:0113 l:001270 d:001270 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/lint.rb:48
c:0025 p:0022 s:0107 b:0107 l:000106 d:000106 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/lint.rb:36
c:0024 p:0015 s:0103 b:0103 l:000102 d:000102 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/showexceptions.rb:24
c:0023 p:0032 s:0095 b:0095 l:000094 d:000094 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/commonlogger.rb:20
c:0022 p:0015 s:0087 b:0087 l:000086 d:000086 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/chunked.rb:41
c:0021 p:0015 s:0080 b:0080 l:000079 d:000079 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/content_length.rb:14
c:0020 p:0020 s:0071 b:0071 l:000062 d:000070 BLOCK  /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:84
c:0019 p:---- s:0069 b:0069 l:000068 d:000068 FINISH
c:0018 p:---- s:0067 b:0067 l:000066 d:000066 CFUNC  :catch
c:0017 p:0135 s:0063 b:0063 l:000062 d:000062 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:82
c:0016 p:0088 s:0058 b:0057 l:000056 d:000056 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:57
c:0015 p:0036 s:0054 b:0054 l:000053 d:000053 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:42
c:0014 p:---- s:0049 b:0049 l:000048 d:000048 FINISH
c:0013 p:---- s:0047 b:0047 l:000046 d:000046 CFUNC  :run_machine
c:0012 p:0248 s:0044 b:0044 l:000043 d:000043 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-0.12.10/lib/eventmachine.rb:256
c:0011 p:0066 s:0037 b:0037 l:000b80 d:000b80 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/backends/base.rb:61
c:0010 p:0143 s:0033 b:0033 l:000032 d:000032 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/server.rb:159
c:0009 p:0081 s:0030 b:0030 l:000029 d:000029 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/handler/thin.rb:13
c:0008 p:0269 s:0024 b:0024 l:0019e8 d:0019e8 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/server.rb:265
c:0007 p:0022 s:0019 b:0019 l:000018 d:000018 METHOD /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/server.rb:137
c:0006 p:0029 s:0015 b:0015 l:000014 d:000014 TOP    /Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/bin/rackup:4
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :load
c:0003 p:0127 s:0007 b:0007 l:0015e8 d:001b90 EVAL   /Users/charlie/.rvm/gems/ruby-1.9.2-p290/bin/rackup:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0015e8 d:0015e8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/bin/rackup:19:in `<main>'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/bin/rackup:19:in `load'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/bin/rackup:4:in `<top (required)>'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/server.rb:137:in `start'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/server.rb:265:in `start'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/handler/thin.rb:13:in `run'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:57:in `process'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:84:in `block in pre_process'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/content_length.rb:14:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/chunked.rb:41:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/commonlogger.rb:20:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/showexceptions.rb:24:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/lint.rb:36:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/lint.rb:48:in `_call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/base.rb:1303:in `synchronize'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272:in `block in call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.6/lib/sinatra/showexceptions.rb:21:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.2/lib/rack/head.rb:9:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/rack/fiber_pool.rb:23:in `call'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:75:in `spawn'
/Users/charlie/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:75:in `resume'

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

[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

Abort trap: 6
bnferguson commented 13 years ago

+1 - I'm also seeing this. Not sure if it's related to the Lion upgrade or Ruby patch level. Both have changed since I last ran tests in async.

bnferguson commented 13 years ago

Looks like it's a Ruby + Lion issue?

 f = Fiber.new { puts "foo" }
 f.resume 

breaks it just the same as the gem does.

http://www.ruby-forum.com/topic/2034186 Some chatter about this issue.

cmelbye commented 13 years ago

Yeah, it definitely is a Ruby+Lion issue. I'm not at home right now, but I believe I installed a Ruby 1.9.3 prerelease, and fibers and rack-fiber_pool are both working great on that. I'll go ahead and close this.