Issue #8230 has been reported by gojpeg (Peter Leonov).

----------------------------------------
Bug #8230: Segmentation fault: at_exit
https://bugs.ruby-lang.org/issues/8230

Author: gojpeg (Peter Leonov)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]


Got segfault usin TextMate run script window. Thought it up to TextMate and started to digg.
Ended up with heisenbug in at_exit.

STEPS:

Download two files:
* at_exit.rb
* big_file.rb

save these to some dir, chdir there and run:

    ruby -r ./at_exit.rb -e 'q'


EXPECTED:

Error message like this:

    -e:1:in `<main>': undefined local variable or method `q' for main:Object (NameError)


RESULT:

A segmentation fault. Output of the crash can be found in crash-output.txt attached below.


NOTES:

I have gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00).

If you look at the content of the files you could see lots of useless statements. It is OK, bug shows itself with all that garbage only.

While Ruby 2.0 couldn't be built on Mac OS X today I can't test this issue in it. But, it is ease to see about this bug it is all about stack corruption. If necessary, I can help with debugging on my box. 


-- 
http://bugs.ruby-lang.org/