Issue #8230 has been updated by Hiroshi SHIBATA.

Status changed from Open to Rejected

Ruby 1.9.3 is now in the security maintenance phase.

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

* Author: Peter Leonov
* Status: Rejected
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]
* Backport: 
----------------------------------------
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. 

---Files--------------------------------
at_exit.rb (545 Bytes)
big_file.rb (21.4 KB)
crash-output.txt (1.43 KB)


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