Project

General

Profile

Actions

Bug #11047

closed

SEGV in ruby_yyparse

Added by mcarpenter (Martin Carpenter) about 9 years ago. Updated about 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.2p88 (2015-03-25 revision 50085) [x86_64-linux]
[ruby-core:<unknown>]

Description

Hello,

Please find attached half a dozen test cases that cause the ruby parser (either in a script or via eval as below) to throw a segmentation violation due to stack corruption. Using 2.2-head on Ubuntu 14.04.

To reproduce:

ruby -e 'eval STDIN.read' < input_file

Expected result:

"Syntax error" or similar.

Backtrace:

All backtraces point only to ruby_yyparse() and I have not dug deeper:

/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(rb_vm_bugreport+0x51f) [0x7f5e164af7ff] vm_dump.c:693
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(rb_bug_context+0xcb) [0x7f5e1634390b] error.c:425
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(sigsegv+0x3e) [0x7f5e1642305e] signal.c:879
/lib/x86_64-linux-gnu/libc.so.6 [0x7f5e15f35d40]
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(ruby_yyparse+0x77d4) [0x7f5e163ca714] parse.y:2103
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(yycompile0+0xef) [0x7f5e163d2e0f] parse.y:5514
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(rb_suppress_tracing+0xf7) [0x7f5e164b4de7] vm_trace.c:406
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(rb_parser_compile_file_path+0xa5) [0x7f5e163c2105] parse.y:5547
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(load_file_internal2+0xc5) [0x7f5e16421255] ruby.c:1655
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(rb_protect+0x100) [0x7f5e1634be40] eval.c:876
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(load_file_internal+0xd2) [0x7f5e1641ef02] ruby.c:1709
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(rb_ensure+0xb8) [0x7f5e1634c068] eval.c:907
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(process_options+0x9e1) [0x7f5e164223d1] ruby.c:1751
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(ruby_process_options+0xe8) [0x7f5e16422968] ruby.c:1966
/home/martin/.rvm/rubies/ruby-2.2-head/lib/libruby.so.2.2(ruby_options+0xb2) [0x7f5e1634d482] eval.c:100
/home/martin/.rvm/rubies/ruby-2.2-head/bin/ruby(main+0x43) [0x400883] main.c:36

Files

crashes.tar.gz (387 Bytes) crashes.tar.gz mcarpenter (Martin Carpenter), 04/07/2015 09:36 PM
Actions #1

Updated by mcarpenter (Martin Carpenter) about 9 years ago

ps. originally discovered under 2.1.5

Actions #2

Updated by cremno (cremno phobia) about 9 years ago

I believe this already has been fixed, but not yet backported to 2.2. See #10957.

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

  • Status changed from Open to Closed
  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED
Actions #4

Updated by nagachika (Tomoyuki Chikanaga) about 9 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

r49964 and r50265 were backported into ruby_2_2 branch at r50277.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0