From: "yopp (Alex Yopp)" Date: 2013-07-11T07:37:10+09:00 Subject: [ruby-core:55937] [Backport93 - Backport #7123] Segmentation fault in ruby 1.9.3-p194 Issue #7123 has been updated by yopp (Alex Yopp). It's also reproducible on release version of OSX: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0] 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64 I suggest to reopen this issue to validate applied patches. According to current 1.9.3 ChangeLog, they should be included in p392 and higher. Thank you. ---------------------------------------- Backport #7123: Segmentation fault in ruby 1.9.3-p194 https://bugs.ruby-lang.org/issues/7123#change-40432 Author: mscottford (M. Scott Ford) Status: Closed Priority: Normal Assignee: authorNari (Narihiro Nakamura) Category: Target version: Example source for this issue is posted at https://github.com/mscottford/segfault-test, with reproduction instructions. I'm encountering a segmentation fault in ruby 1.9.3-p194 on a project using Rails 3.2.8. The issue is only happening on Mac OS X. Members of my team that are running Linux do not have the same issue. The issue does not occur consistently; it sometimes takes several (20+) runs for the crash to happen. test: ``` require 'spec_helper' describe Widget do it "removes widget on rejection" do widget = Widget.create! expect do widget.reject! end.to change { described_class.count }.by(-1) GC.start end end ``` model: ``` class Widget < ActiveRecord::Base attr_accessor :check_rejection_reason state_machine :initial => :requested do # I suspect that the issue is related to the issue being accessed in this closure after it has been deleted around_transition :requested => :none do |gm, transition, blk| gm.check_rejection_reason = true blk.call gm.check_rejection_reason = false end # This closure deletes the instance, but it is still being accessed by the `around_transition` above. after_transition any => :none do |gm, transition| gm.destroy end on :reject do transition :requested => :none end end end ``` -- http://bugs.ruby-lang.org/