Double free or corruption while garbage collecting #65

Closed
j0hnds opened this Issue May 21, 2012 · 7 comments

Projects

None yet

3 participants

@j0hnds

We have an application that serializes a Ruby Hash to yaml and places it in a beanstalkd queue. The Ruby worker (named 'ayl_worker_abaqis_dev_1' below) receives the yaml message off the beanstalkd queue and processes it. When the Ruby GC kicks in, we get this message (below) and our worker dies. To verify this, I switched the yamler back to 'syck' and re-ran our processes and everything is back to normal.

For the moment, we simply ensure that we set the yamler to 'syck' to hold us over.

*** glibc detected *** ayl_worker_abaqis_dev_1: double free or corruption (fasttop): 0x0000000009c481b0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x30ce875296]
/usr/lib64/libyaml-0.so.2(yaml_event_delete+0xcb)[0x7fab8161f6fb]
/usr/lib64/libyaml-0.so.2(yaml_emitter_emit+0x7a2)[0x7fab81636412]
/usr/local/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-linux/psych.so(+0x2cf5)[0x7fab81849cf5]
ayl_worker_abaqis_dev_1[0x507f92]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_yield+0x66)[0x51c2e6]
ayl_worker_abaqis_dev_1(rb_ary_each+0x45)[0x52da25]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1[0x51450c]
ayl_worker_abaqis_dev_1(rb_f_eval+0xd6)[0x514aa6]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]
ayl_worker_abaqis_dev_1[0x513a7a]
ayl_worker_abaqis_dev_1(rb_iseq_eval+0x1ee)[0x5140ce]
ayl_worker_abaqis_dev_1[0x563298]
ayl_worker_abaqis_dev_1[0x5633fb]
ayl_worker_abaqis_dev_1[0x50d717]
ayl_worker_abaqis_dev_1[0x50fb96]

... truncated listing...
@tenderlove
Ruby Programming Language member

What version of Ruby are you using? And version of psych?

@j0hnds
@tenderlove
Ruby Programming Language member

Is it possible to try with the latest patch release of Ruby, or with the latest psych gem? I think I've fixed this problem already, but it would be good to test! :-)

@j0hnds
@tenderlove
Ruby Programming Language member

Make sure you're trying with the latest Ruby 1.9.3, or with the latest psych gem. Thanks!

@gautamc

I saw this issue too recently for one of my applications - I had tried using psych-1.3.4 with ruby-1.9.2p290. For now, I forced my application to use psych (1.2.2) via bundler and things are fine. I will be moving my application to Ruby 1.9.3 in the coming days since that looks like the best thing to do.

@tenderlove
Ruby Programming Language member

Hi, I'm closing this issue for now. If someone can give me a script to reproduce the problem, then I will reopen and fix this. Thanks!

@tenderlove tenderlove closed this Jul 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment