Issue #15271 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE

ruby_2_5 r65581 merged revision(s) 65460.

----------------------------------------
Bug #15271: Segfault (null pointer deref) in parse.y:1354
https://bugs.ruby-lang.org/issues/15271#change-74771

* Author: bannable (Joe Truba)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0dev (2018-10-26 trunk 65379) [x86_64-linux]
* Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE
----------------------------------------
Reproducer and crash:
~~~
jtruba@dev118:~/rubies/ruby-trunk$ ./ruby -e 'a **{}'
./ruby: [BUG] Segmentation fault at 0x0000000000000028
ruby 2.6.0dev (2018-10-26 trunk 65379) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:000e70 (none) [FINISH]


-- Machine register context ------------------------------------------------
 RIP: 0x0000557e42f36592 RBP: 0x0000000000000002 RSP: 0x00007ffd568445e0
 RAX: 0x00007f4293012630 RBX: 0x0000557e432f0c00 RCX: 0x0000000000000000
 RDX: 0x0000000000000041 RDI: 0x0000000000000043 RSI: 0xfffffffffffffffe
  R8: 0x00007ffd568446f0  R9: 0xfffffffffffffffc R10: 0x000000000000000a
 R11: 0x0000557e435d4d30 R12: 0x00007f4293172800 R13: 0xfffffffffffffffc
 R14: 0x0000000000000000 R15: 0x00007ffd56845408 EFL: 0x0000000000010202

-- C level backtrace information -------------------------------------------
/home/jtruba/rubies/ruby-trunk/ruby(rb_print_backtrace+0x14) [0x557e432df410] vm_dump.c:715
/home/jtruba/rubies/ruby-trunk/ruby(rb_vm_bugreport) vm_dump.c:985
/home/jtruba/rubies/ruby-trunk/ruby(bug_report_end+0x0) [0x557e432ba400] error.c:610
/home/jtruba/rubies/ruby-trunk/ruby(rb_bug_context) error.c:610
/home/jtruba/rubies/ruby-trunk/ruby(sigsegv+0x6f) [0x557e4303546f] signal.c:998
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7f4294bfe890] ../nptl/sysdeps/pthread/funlockfile.c:29
/home/jtruba/rubies/ruby-trunk/ruby(ruby_yyparse+0x12322) [0x557e42f36592] parse.y:1354
/home/jtruba/rubies/ruby-trunk/ruby(yycompile0+0x66c) [0x557e42f4c60c] parse.y:4888
/home/jtruba/rubies/ruby-trunk/ruby(rb_suppress_tracing+0x219) [0x557e4317fc69] vm_trace.c:403
/home/jtruba/rubies/ruby-trunk/ruby(yycompile+0x47) [0x557e42f49c04] parse.y:4932
/home/jtruba/rubies/ruby-trunk/ruby(parser_compile_string) parse.y:5001
/home/jtruba/rubies/ruby-trunk/ruby(rb_parser_compile_string_path) parse.y:5021
/home/jtruba/rubies/ruby-trunk/ruby(rb_parser_compile_string+0x5f) [0x557e42f49aaf] parse.y:5014
/home/jtruba/rubies/ruby-trunk/ruby(process_options+0x25d95b) [0x557e430271a3] ruby.c:1768
/home/jtruba/rubies/ruby-trunk/ruby(ruby_process_options) ruby.c:2346
/home/jtruba/rubies/ruby-trunk/ruby(ruby_options+0x222) [0x557e42df4392] eval.c:118
/home/jtruba/rubies/ruby-trunk/ruby(main+0x90) [0x557e42defe40] ./main.c:42

-- Other runtime information -----------------------------------------------

* Loaded script: ./ruby

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/encdb.so
    5 /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/trans/transdb.so

* Process memory map:

557e42dc7000-557e433d0000 r-xp 00000000 103:00 78000810                  /home/jtruba/rubies/ruby-trunk/ruby
557e435cf000-557e435d5000 rw-p 00608000 103:00 78000810                  /home/jtruba/rubies/ruby-trunk/ruby
557e435d5000-557e435f7000 rw-p 00000000 00:00 0
7f42919e6000-7f4291b8f000 r--s 00000000 103:03 786457                    /lib/x86_64-linux-gnu/libc-2.19.so
7f4291b8f000-7f4291c33000 r--s 00000000 103:03 660408                    /usr/lib/debug/lib/x86_64-linux-gnu/libpthread-2.19.so
7f4291c33000-7f4292be7000 r--s 00000000 103:00 78000810                  /home/jtruba/rubies/ruby-trunk/ruby
7f4292be7000-7f4292bfd000 r-xp 00000000 103:03 786893                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4292bfd000-7f4292dfc000 ---p 00016000 103:03 786893                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4292dfc000-7f4292dfd000 rw-p 00015000 103:03 786893                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4292dfd000-7f4292dff000 r-xp 00000000 103:00 80759003                  /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/trans/transdb.so
7f4292dff000-7f4292fff000 ---p 00002000 103:00 80759003                  /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/trans/transdb.so
7f4292fff000-7f4293000000 rw-p 00002000 103:00 80759003                  /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/trans/transdb.so
7f4293000000-7f4293800000 rw-p 00000000 00:00 0
7f4293843000-7f4293845000 r-xp 00000000 103:00 80759038                  /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/encdb.so
7f4293845000-7f4293a44000 ---p 00002000 103:00 80759038                  /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/encdb.so
7f4293a44000-7f4293a45000 rw-p 00001000 103:00 80759038                  /home/jtruba/.rubies/ruby-trunk/lib/ruby/2.6.0/x86_64-linux/enc/encdb.so
7f4293a45000-7f4293be6000 r-xp 00000000 103:03 786457                    /lib/x86_64-linux-gnu/libc-2.19.so
7f4293be6000-7f4293de6000 ---p 001a1000 103:03 786457                    /lib/x86_64-linux-gnu/libc-2.19.so
7f4293de6000-7f4293dea000 r--p 001a1000 103:03 786457                    /lib/x86_64-linux-gnu/libc-2.19.so
7f4293dea000-7f4293dec000 rw-p 001a5000 103:03 786457                    /lib/x86_64-linux-gnu/libc-2.19.so
7f4293dec000-7f4293df0000 rw-p 00000000 00:00 0
7f4293df0000-7f4293ef0000 r-xp 00000000 103:03 786463                    /lib/x86_64-linux-gnu/libm-2.19.so
7f4293ef0000-7f42940ef000 ---p 00100000 103:03 786463                    /lib/x86_64-linux-gnu/libm-2.19.so
7f42940ef000-7f42940f0000 r--p 000ff000 103:03 786463                    /lib/x86_64-linux-gnu/libm-2.19.so
7f42940f0000-7f42940f1000 rw-p 00100000 103:03 786463                    /lib/x86_64-linux-gnu/libm-2.19.so
7f42940f1000-7f42940f9000 r-xp 00000000 103:03 786461                    /lib/x86_64-linux-gnu/libcrypt-2.19.so
7f42940f9000-7f42942f8000 ---p 00008000 103:03 786461                    /lib/x86_64-linux-gnu/libcrypt-2.19.so
7f42942f8000-7f42942f9000 r--p 00007000 103:03 786461                    /lib/x86_64-linux-gnu/libcrypt-2.19.so
7f42942f9000-7f42942fa000 rw-p 00008000 103:03 786461                    /lib/x86_64-linux-gnu/libcrypt-2.19.so
7f42942fa000-7f4294328000 rw-p 00000000 00:00 0
7f4294328000-7f429432b000 r-xp 00000000 103:03 786462                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f429432b000-7f429452a000 ---p 00003000 103:03 786462                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f429452a000-7f429452b000 r--p 00002000 103:03 786462                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f429452b000-7f429452c000 rw-p 00003000 103:03 786462                    /lib/x86_64-linux-gnu/libdl-2.19.so
7f429452c000-7f42945ad000 r-xp 00000000 103:03 266462                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0
7f42945ad000-7f42947ad000 ---p 00081000 103:03 266462                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0
7f42947ad000-7f42947ae000 r--p 00081000 103:03 266462                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0
7f42947ae000-7f42947af000 rw-p 00082000 103:03 266462                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0
7f42947af000-7f42947e3000 r-xp 00000000 103:03 279726                    /usr/lib/x86_64-linux-gnu/libjemalloc.so.1
7f42947e3000-7f42949e3000 ---p 00034000 103:03 279726                    /usr/lib/x86_64-linux-gnu/libjemalloc.so.1
7f42949e3000-7f42949e5000 r--p 00034000 103:03 279726                    /usr/lib/x86_64-linux-gnu/libjemalloc.so.1
7f42949e5000-7f42949e6000 rw-p 00036000 103:03 279726                    /usr/lib/x86_64-linux-gnu/libjemalloc.so.1
7f42949e6000-7f42949e7000 rw-p 00000000 00:00 0
7f42949e7000-7f42949ee000 r-xp 00000000 103:03 786474                    /lib/x86_64-linux-gnu/librt-2.19.so
7f42949ee000-7f4294bed000 ---p 00007000 103:03 786474                    /lib/x86_64-linux-gnu/librt-2.19.so
7f4294bed000-7f4294bee000 r--p 00006000 103:03 786474                    /lib/x86_64-linux-gnu/librt-2.19.so
7f4294bee000-7f4294bef000 rw-p 00007000 103:03 786474                    /lib/x86_64-linux-gnu/librt-2.19.so
7f4294bef000-7f4294c07000 r-xp 00000000 103:03 786451                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f4294c07000-7f4294e06000 ---p 00018000 103:03 786451                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f4294e06000-7f4294e07000 r--p 00017000 103:03 786451                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f4294e07000-7f4294e08000 rw-p 00018000 103:03 786451                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f4294e08000-7f4294e0c000 rw-p 00000000 00:00 0
7f4294e0c000-7f4294e2d000 r-xp 00000000 103:03 786452                    /lib/x86_64-linux-gnu/ld-2.19.so
7f4294e68000-7f4294e8a000 r--s 00000000 103:03 786451                    /lib/x86_64-linux-gnu/libpthread-2.19.so
7f4294e8a000-7f4295013000 r--p 00000000 103:03 283083                    /usr/lib/locale/locale-archive
7f4295013000-7f4295019000 rw-p 00000000 00:00 0
7f4295029000-7f429502a000 rw-p 00000000 00:00 0
7f429502a000-7f429502c000 rw-p 00000000 00:00 0
7f429502c000-7f429502d000 r--p 00020000 103:03 786452                    /lib/x86_64-linux-gnu/ld-2.19.so
7f429502d000-7f429502e000 rw-p 00021000 103:03 786452                    /lib/x86_64-linux-gnu/ld-2.19.so
7f429502e000-7f429502f000 rw-p 00000000 00:00 0
7ffd5604a000-7ffd56849000 rw-p 00000000 00:00 0                          [stack]
7ffd568f7000-7ffd568f9000 r--p 00000000 00:00 0                          [vvar]
7ffd568f9000-7ffd568fb000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]


[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html

Aborted
~~~



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>