igrigorik/em-synchrony — Issue #85: Segfault when calling EM.synchrony block
Author: rclosner
Created: 2011-11-15 06:19:45+00:00
State: open

Not entirely sure what's going on here, but I can't seem to call the ``EM.synchrony`` block without it crashing.

I'm using version 1.0.0 with em-http-request version 1.0.0, and eventmachine version 1.0.0.beta.4. I'm attempting to run it on a Mac (Lion) using RVM and Ruby 1.9.2p290. Here's the backtrace from the segfault:

```
ruby-1.9.2-p290 :003 > EM.synchrony {}
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]

-- control frame ----------
c:0035 p:---- s:0127 b:0127 l:000126 d:000126 CFUNC :resume
c:0034 p:0021 s:0124 b:0124 l:001fb8 d:002418 BLOCK /Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25
c:0033 p:---- s:0122 b:0122 l:000121 d:000121 FINISH
c:0032 p:---- s:0120 b:0120 l:000119 d:000119 CFUNC :call
c:0031 p:---- s:0118 b:0118 l:000117 d:000117 CFUNC :run_machine
c:0030 p:0248 s:0115 b:0115 l:000114 d:000114 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179
c:0029 p:0056 s:0108 b:0108 l:001fb8 d:001fb8 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:27
c:0028 p:0015 s:0101 b:0101 l:001d98 d:0007d8 EVAL (irb):3
c:0027 p:---- s:0099 b:0099 l:000098 d:000098 FINISH
c:0026 p:---- s:0097 b:0097 l:000096 d:000096 CFUNC :eval
c:0025 p:0028 s:0090 b:0090 l:000089 d:000089 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80
c:0024 p:0033 s:0083 b:0082 l:000081 d:000081 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/context.rb:254
c:0023 p:0031 s:0077 b:0077 l:0005d8 d:000076 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:159
c:0022 p:0042 s:0069 b:0069 l:000068 d:000068 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:273
c:0021 p:0011 s:0064 b:0064 l:0005d8 d:000063 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:156
c:0020 p:0144 s:0060 b:0060 l:000043 d:000059 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:243
c:0019 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0018 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC :loop
c:0017 p:0009 s:0052 b:0052 l:000043 d:000051 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229
c:0016 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
c:0015 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :catch
c:0014 p:0023 s:0044 b:0044 l:000043 d:000043 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228
c:0013 p:0046 s:0041 b:0041 l:0005d8 d:0005d8 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:155
c:0012 p:0011 s:0038 b:0038 l:0005b8 d:000037 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:70
c:0011 p:---- s:0036 b:0036 l:000035 d:000035 FINISH
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 CFUNC :catch
c:0009 p:0183 s:0030 b:0030 l:0005b8 d:0005b8 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69
c:0008 p:0222 s:0025 b:0025 l:001d70 d:001d70 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/railties-3.1.1/lib/rails/commands/console.rb:45
c:0007 p:0019 s:0021 b:0021 l:000020 d:000020 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/railties-3.1.1/lib/rails/commands/console.rb:8
c:0006 p:0615 s:0017 b:0017 l:000016 d:000016 TOP /Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/railties-3.1.1/lib/rails/commands.rb:40
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :require
c:0003 p:0061 s:0006 b:0006 l:000b38 d:000308 EVAL script/rails:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000b38 d:000b38 TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `

'
script/rails:6:in `require'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/railties-3.1.1/lib/rails/commands.rb:40:in `'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `start'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `catch'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:70:in `block in start'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/context.rb:254:in `evaluate'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80:in `eval'
(irb):3:in `irb_binding'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:27:in `synchrony'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `call'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25:in `block in synchrony'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290@bookswapped/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25:in `resume'

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

Sorry for the vague issue... it's my first time using synchrony, but it looks great and I'd love to get it up and running. Any ideas?

Ryan