stevegraham/slanger — Issue #12: Slanger segfaults after handshake
Author: ianmurrays
Created: 2012-01-03 21:19:44+00:00
State: open

After the JS library makes the handshake, slanger crashes with the following output:

```
[[:initialize]]

[[:receive_data,
"GET /app/f97381306669f7ca9ab7?client=js&version=1.9.6 HTTP/1.1\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nHost: localhost:8080\r\nOrigin: http://localhost:3000\r\nCookie: __utma=111872281.2084250568.1285442273.1285610794.1287248686.4; _linkchat_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTAzNTg5NDlhZTI3YzlmZjEwODEyZjM4MDgzODE5NWRkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUYyaUxmRXFMS29pSGdWcmowUFVMem00NzE4R2hzZFY1MGwyTCtPenRXUkU9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkGSSIiJDJhJDEwJHkyQnVYRVlES2YuMFRkZS9lUC83R2UGOwBU--b6c93b6ed241603c0615836343547fe1af5b3f6d\r\nSec-WebSocket-Key1: 13&Hl69 J j O2x0%9G6Y33\r\nSec-WebSocket-Key2: 302 !2481>h8 1I!6\r\n\r\n\xAC\x1D\xE3F\xA2\xCDjc"]]

[[:inbound_headers,
"GET /app/f97381306669f7ca9ab7?client=js&version=1.9.6 HTTP/1.1\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nHost: localhost:8080\r\nOrigin: http://localhost:3000\r\nCookie: __utma=111872281.2084250568.1285442273.1285610794.1287248686.4; _linkchat_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTAzNTg5NDlhZTI3YzlmZjEwODEyZjM4MDgzODE5NWRkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUYyaUxmRXFMS29pSGdWcmowUFVMem00NzE4R2hzZFY1MGwyTCtPenRXUkU9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkGSSIiJDJhJDEwJHkyQnVYRVlES2YuMFRkZS9lUC83R2UGOwBU--b6c93b6ed241603c0615836343547fe1af5b3f6d\r\nSec-WebSocket-Key1: 13&Hl69 J j O2x0%9G6Y33\r\nSec-WebSocket-Key2: 302 !2481>h8 1I!6\r\n\r\n\xAC\x1D\xE3F\xA2\xCDjc"]]

[[:upgrade_headers,
"HTTP/1.1 101 WebSocket Protocol Handshake\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nSec-WebSocket-Location: ws://localhost:8080/app/f97381306669f7ca9ab7?client=js&version=1.9.6\r\nSec-WebSocket-Origin: http://localhost:3000\r\n\r\n\xFB\x06\xCA\"\xF0\xD9s\x9F\xCD\x18\x97I}\x9C\xD89"]]

[[:sending_text_frame,
"{\"channel\":null,\"event\":\"pusher:connection_established\",\"data\":{\"socket_id\":\"636bda45-05f2-4de5-a976-e828abc879ea\"}}"]]

/Users/ianmurrays/.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.2.0]

-- control frame ----------
c:0022 p:---- s:0081 b:0081 l:000080 d:000080 CFUNC :resume
c:0021 p:0067 s:0077 b:0077 l:000076 d:000076 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:75
c:0020 p:0026 s:0072 b:0072 l:000e98 d:000e98 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/rack/fiber_pool.rb:23
c:0019 p:0015 s:0067 b:0067 l:000066 d:000066 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/head.rb:9
c:0018 p:0018 s:0060 b:0060 l:001680 d:000059 BLOCK /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.8/lib/sinatra/base.rb:1295
c:0017 p:0032 s:0058 b:0058 l:000057 d:000057 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.8/lib/sinatra/base.rb:1326
c:0016 p:0011 s:0054 b:0054 l:001680 d:001680 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.8/lib/sinatra/base.rb:1295
c:0015 p:0020 s:0050 b:0050 l:000041 d:000049 BLOCK /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:84
c:0014 p:---- s:0048 b:0048 l:000047 d:000047 FINISH
c:0013 p:---- s:0046 b:0046 l:000045 d:000045 CFUNC :catch
c:0012 p:0135 s:0042 b:0042 l:000041 d:000041 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:82
c:0011 p:0088 s:0037 b:0036 l:000035 d:000035 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:57
c:0010 p:0036 s:0033 b:0033 l:000032 d:000032 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:42
c:0009 p:---- s:0028 b:0028 l:000027 d:000027 FINISH
c:0008 p:---- s:0026 b:0026 l:000025 d:000025 CFUNC :run_machine
c:0007 p:0248 s:0023 b:0023 l:000022 d:000022 METHOD /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-0.12.10/lib/eventmachine.rb:256
c:0006 p:0118 s:0016 b:0016 l:0001d0 d:0001d0 TOP /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/slanger-0.1.1/bin/slanger:46
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:000d38 d:0002c0 EVAL /Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/bin/slanger:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000d38 d:000d38 TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/bin/slanger:19:in `

'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/bin/slanger:19:in `load'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/slanger-0.1.1/bin/slanger:46:in `'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:57:in `process'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/thin-1.2.11/lib/thin/connection.rb:84:in `block in pre_process'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.8/lib/sinatra/base.rb:1295:in `call'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.8/lib/sinatra/base.rb:1326:in `synchronize'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.2.8/lib/sinatra/base.rb:1295:in `block in call'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/head.rb:9:in `call'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/rack/fiber_pool.rb:23:in `call'
/Users/ianmurrays/.rvm/gems/ruby-1.9.2-p290/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:75:in `spawn'
/Users/ianmurrays/.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
```