Segmentation fault with ruby 1.9.3p328 (2012-11-13) [x86_64-linux]
|ruby -v:||ruby 1.9.3p328 (2012-11-13) [x86_64-linux]||Backport:|
I'm experiencing sporadic segmentation faults in a ruby daemon running with:
ruby 1.9.3p328 (2012-11-13) [x86_64-linux]
The daemon in question sits in a loop pulling messages out of an ActiveMQ server using the stomp gem; DOM parsing a file locally using libxml-ruby; then stuffing another message back on to the server using the same stomp client. I haven't been able to isolate the problem into a smaller block; but I can reproduce it in ~15 minutes on an AWS test server.
I've included two examples of crash output, I have several more from 1.9.3p286.
Happy to try patches or anything further to help debug/diagnose the issue.
#2 Updated by Geoffrey Giesemann over 2 years ago
Argh, my bad - I think it's a problem with how we were using libxml-ruby rather thank a ruby bug.
We had an area of code where we weren't correctly importing nodes into documents (see "Memory Management" in http://libxml.rubyforge.org/rdoc/) which looks like it caused bizarro heap corruption :S
For some reason this is much easier to replicate when you have a deeper call stack - like if you're inside a stomp gem handling a message frame - than it is with a vanilla code sample.
I have a reasonably small code sample to reproduce this, but you'll need a STOMP server to make it work.