I'm getting a segfault when I try to use EM.enable_proxy in a little web app I built. (github: hdgarrood/multicopter)
I've attached all stderr output -- to reproduce it, clone the repository, run `bundle install`, and then `bundle exec ruby main.rb`
Here's a link to the tree at the relevant commit:
https://github.com/hdgarrood/multicopter/tree/c1052e1deac7e412e6691b403be996080786faccBackground:
There are two parts to my app, a plain HTTP part, and a websocket part (see main.rb). Until now, they've been running on two different ports. Now I'm trying to make it so that all traffic goes over the same port. I tried to make a third server which looks at incoming requests and chooses whether to send them to the plain HTTP server or the WebSocket one (based on whether they have an 'upgrade: websocket' header) using EM.enable_proxy (see app/controllers/proxy_server.rb). I'm not sure if I've done this correctly -- the ProxyConnection module is taken verbatim from the EM.enable_proxy docs. I don't really understand it.
Anyway, since adding this proxy server, the app behaves a bit weirdly:
* Starts ok
* Serves one request ok
* Dies directly afterwards
It dies in the call to release_machine on line 194 of eventmachine.rb. (this is in the attached log)
I'm using EventMachine 1.0.3. I've checked in Gemfile.lock so you can see there what versions of all the other things I'm using.