Forum: Ruby-core [ruby-trunk - Bug #7801][Open] Segfault with block called from continuation

Posted by chrismcg (Chris McGrath) (Guest)
on 2013-02-07 16:54
(Received via mailing list)
Issue #7801 has been reported by chrismcg (Chris McGrath).

----------------------------------------
Bug #7801: Segfault with block called from continuation
https://bugs.ruby-lang.org/issues/7801

Author: chrismcg (Chris McGrath)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p385 (2013-02-06 revision 39114) 
[x86_64-darwin11.4.2]


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 
state_machine gem, specifically an around_transition 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:

around_transition do |item, block|
  item.changing_state = true
  block.call
  item.changing_state = false
end
Posted by ko1 (Koichi Sasada) (Guest)
on 2013-02-17 06:21
(Received via mailing list)
Issue #7801 has been updated by ko1 (Koichi Sasada).

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.
----------------------------------------
Bug #7801: Segfault with block called from continuation
https://bugs.ruby-lang.org/issues/7801#change-36376

Author: chrismcg (Chris McGrath)
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]


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 
state_machine gem, specifically an around_transition 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:

around_transition do |item, block|
  item.changing_state = true
  block.call
  item.changing_state = false
end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.