Bug #7801

Segfault with block called from continuation

Added by Chris McGrath about 1 year ago. Updated about 1 year ago.

[ruby-core:51991]
Status:Third Party's Issue
Priority:Normal
Assignee:-
Category:ext
Target version:-
ruby -v:ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin11.4.2] Backport:

Description

I'm getting a crash on OSX with 1.9.3-p385. I've also had the same crash on all the releases since at least -p194. I've seen some similar crash reports but nothing quite the same. Unfortunately this only happens intermittently when running my rails test suite and I haven't been able to make a simple reproduction.

The code where the crash occurs is in a model that uses the statemachine gem, specifically an aroundtransition which uses continuations internally. It's calling a block so given the intermittent nature of the crash perhaps the block is being GC'd at some point?

Our code looks like:

aroundtransition do |item, block|
item.changing
state = true
block.call
item.changing_state = false
end

crash_output.txt Magnifier - partial output from rake (351 KB) Chris McGrath, 02/08/2013 12:44 AM

ruby_2013-02-07-145034_luath.crash - osx crash report (25.2 KB) Chris McGrath, 02/08/2013 12:44 AM

History

#1 Updated by Koichi Sasada about 1 year ago

  • Category set to ext
  • Status changed from Open to Third Party's Issue

Simply, do not use continuation.

It is difficult to make an extension library with continuation.

Also available in: Atom PDF