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.

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

Associated revisions

gc.c: Use the non-recursive marking instead of recursion. The
recursion marking of CRuby needs checking stack overflow and the
fail-safe system, but these systems not good at partial points,
for example, marking deep tree structures.
[Feature #7095]

gc.c: Use the non-recursive marking instead of recursion. The
recursion marking of CRuby needs checking stack overflow and the
fail-safe system, but these systems not good at partial points,
for example, marking deep tree structures.
[Feature #7095]

I also get a segmentation fault in 1.9.3 (p0 and p268), especially when doing UI operations in our complex Rails App. The bug vanishes whenever I switch off the garbage collector. Is this the case for you as well, then it might be the same bug...

We also have a model using state_machine with an around transition and during testing it will crash with a segmentation fault in the GC stack about 10% of the time. If we remove the around_transition there are no longer any crashes when running tests.

However, I'm the only one in my team to experience it. I'm using OSX 10.7.3 and other on my team are using a mix of 10.7.4, 10.7.5 and 10.8.x. This has happened with Ruby 1.9.3 p125 and p194. I've attached the crash log for the error.

gc.c: Use the non-recursive marking instead of recursion. The
recursion marking of CRuby needs checking stack overflow and the
fail-safe system, but these systems not good at partial points,
for example, marking deep tree structures.
[Feature #7095]