Bug #8230

Segmentation fault: at_exit

Added by Peter Leonov over 2 years ago. Updated 12 months ago.

[ruby-core:54068]
Status:Rejected
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1] Backport:

Description

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.

at_exit.rb Magnifier (545 Bytes) Peter Leonov, 04/07/2013 08:43 AM

big_file.rb Magnifier (21.4 KB) Peter Leonov, 04/07/2013 08:43 AM

crash-output.txt Magnifier (1.43 KB) Peter Leonov, 04/07/2013 08:43 AM

History

#1 Updated by Peter Leonov over 2 years ago

~/Library/Logs/CrashReporter/ is empty, and /Library/Logs/CrashReporter/ doesn't exist.

#2 Updated by Peter Leonov over 2 years ago

(gdb) bt
#0 0x00007fff8c484212 in _pthread_kill ()
#1 0x00007fff8578fb54 in pthread_kill ()
#2 0x00007fff857d3dce in abort ()
#3 0x0000000108970ac9 in rb_bug ()
#4 0x0000000108a15d7f in sigsegv ()
#5
#6 0x0000000108a6e971 in rb_backref_get ()
#7 0x00000001089f660b in rb_reg_search ()
#8 0x00000001089f1797 in rb_reg_match ()
#9 0x0000000108a78753 in vm
exec_core ()
#10 0x0000000108a7971e in vm_exec ()
#11 0x0000000108a7aee1 in rb_vm_invoke_proc ()
#12 0x0000000108973e21 in rb_exec_end_proc ()
#13 0x0000000108973ee5 in ruby_finalize_0 ()
#14 0x0000000108974002 in ruby_cleanup ()
#15 0x0000000108974269 in ruby_run_node ()
#16 0x000000010893d67f in main ()

#3 Updated by Motohiro KOSAKI over 2 years ago

At least i couldn't reproduce on trunk.

% build/ruby-trunk --disable-gems -v -r ./at_exit.rb -e "q"
ruby 2.1.0dev (2013-04-07 trunk 40172) [x86_64-darwin12.3.0]
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:4: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:5: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:6: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:7: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:8: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:9: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:10: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:11: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
/Users/kosaki/ruby/git/at_exit.rb:12: warning: unused literal ignored
-e:1:in <main>': undefined local variable or methodq' for main:Object (NameError)

#4 Updated by Masaki Matsushita over 2 years ago

I couldn't reproduce on trunk r40172 and ruby 1.9.3p392.

#5 Updated by Charlie Somerville over 2 years ago

Reproduced on 1.9.3p392, but not trunk or 2.0.0p0

#6 Updated by Hiroshi SHIBATA 12 months ago

  • Status changed from Open to Rejected

Ruby 1.9.3 is now in the security maintenance phase.

Also available in: Atom PDF