Project

General

Profile

Actions

Bug #17668

open

Large RUBY_THREAD_VM_STACK_SIZE causes segmentation fault (again)

Added by ciel (T Yamada) 4 months ago. Updated 4 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
[ruby-core:102700]

Description

  • How to reproduce: RUBY_THREAD_VM_STACK_SIZE=100000000 ./ruby --disable-gems -e 'p 1'
  • Expected: only 1 is shown.
  • Observed:
./ruby: [BUG] Segmentation fault at 0x0000000000000018
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]

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


-- Machine register context ------------------------------------------------
 RIP: 0x000055f8798bbb04 RBP: 0x0000000000006ed1 RSP: 0x00007ffd18a01128
 RAX: 0x0000000000000008 RBX: 0x00000000000006ed RCX: 0x000055f87bc97f60
 RDX: 0x0073726f74636172 RDI: 0x0000000000000000 RSI: 0x0000000000000003
  R8: 0x0000000000000001  R9: 0x000055f87bc97f70 R10: 0x406773628cfa2e29
 R11: 0x00007fa88f349060 R12: 0x00000000006ed10c R13: 0x000055f87bc97f60
 R14: 0x0000000000000003 R15: 0x0000000000000005 EFL: 0x0000000000010283

-- C level backtrace information -------------------------------------------
/home/***/devel/ruby/build/ruby(rb_print_backtrace+0x11) [0x55f8798a2d6a] ../vm_dump.c:758
/home/***/devel/ruby/build/ruby(rb_vm_bugreport) ../vm_dump.c:998
/home/***/devel/ruby/build/ruby(rb_bug_for_fatal_signal+0x1b6) [0x55f879945506] ../error.c:786
/home/***/devel/ruby/build/ruby(sigsegv+0x4b) [0x55f8798004ab] ../signal.c:960
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7fa89015a0e0] ../sysdeps/pthread/funlockfile.c:28
/home/***/devel/ruby/build/ruby(rb_ary_entry_internal+0x1c) [0x55f8798bbb04] ../internal/array.h:66
/home/***/devel/ruby/build/ruby(rb_ary_entry) ../array.c:1674
/home/***/devel/ruby/build/ruby(set_id_entry+0x29) [0x55f8798354ea] ../symbol.c:429
/home/***/devel/ruby/build/ruby(register_static_symid_str) ../symbol.c:558
/home/***/devel/ruby/build/ruby(intern_str+0xd8) [0x55f879836808] ../symbol.c:774
/home/***/devel/ruby/build/ruby(rb_intern_str+0x13d) [0x55f87983803d] ../symbol.c:799
/home/***/devel/ruby/build/ruby(ibf_load_object_symbol+0xdc) [0x55f8798e44ec] ../compile.c:11572
/home/***/devel/ruby/build/ruby(ibf_load_object+0xeb) [0x55f8798e23eb] ../compile.c:11734
/home/***/devel/ruby/build/ruby(ibf_load_object+0xc) [0x55f8799044e4] ../compile.c:10176
/home/***/devel/ruby/build/ruby(ibf_load_id) ../compile.c:10179
/home/***/devel/ruby/build/ruby(ibf_load_local_table) ../compile.c:10634
/home/***/devel/ruby/build/ruby(ibf_load_iseq_each) ../compile.c:11044
/home/***/devel/ruby/build/ruby(rb_ibf_load_iseq_complete) ../compile.c:11915
/home/***/devel/ruby/build/ruby(ibf_load_iseq+0xd1) [0x55f879905951] ../compile.c:11970
/home/***/devel/ruby/build/ruby(ibf_load_code+0x1ba) [0x55f8799051c9] ../compile.c:10419
/home/***/devel/ruby/build/ruby(ibf_load_iseq_each) ../compile.c:11049
/home/***/devel/ruby/build/ruby(rb_ibf_load_iseq_complete) ../compile.c:11915
/home/***/devel/ruby/build/ruby(ibf_load_iseq+0xd1) [0x55f879905951] ../compile.c:11970
/home/***/devel/ruby/build/ruby(ibf_load_code+0x1ba) [0x55f8799051c9] ../compile.c:10419
/home/***/devel/ruby/build/ruby(ibf_load_iseq_each) ../compile.c:11049
/home/***/devel/ruby/build/ruby(rb_ibf_load_iseq_complete) ../compile.c:11915
/home/***/devel/ruby/build/ruby(ibf_load_iseq+0xd1) [0x55f879905951] ../compile.c:11970
/home/***/devel/ruby/build/ruby(rb_iseq_ibf_load_bytes+0x187) [0x55f879905e17] ../compile.c:12090
/home/***/devel/ruby/build/ruby(rb_load_with_builtin_functions+0xd4) [0x55f8798ae594] ../builtin.c:50
/home/***/devel/ruby/build/ruby(rb_call_builtin_inits+0xe) [0x55f8796edc2e] ../inits.c:89
/home/***/devel/ruby/build/ruby(ruby_init_prelude+0x0) [0x55f8797f9ce5] ../ruby.c:1514
/home/***/devel/ruby/build/ruby(ruby_opt_init) ../ruby.c:1515
/home/***/devel/ruby/build/ruby(process_options+0x1228) [0x55f8797fefb8] ../ruby.c:1852
/home/***/devel/ruby/build/ruby(ruby_process_options+0x12c) [0x55f8797ff85c] ../ruby.c:2571
/home/***/devel/ruby/build/ruby(ruby_options+0x101) [0x55f8796b7261] ../eval.c:138
/home/***/devel/ruby/build/ruby(main+0x53) [0x55f8796b2563] ../error.c:424

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

* Loaded script: ./ruby

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 ruby2_keywords.rb

* Process memory map:

55f879687000-55f879a5c000 r-xp 00000000 08:01 16802121                   /home/***/devel/ruby/build/ruby
55f879c5c000-55f879c62000 r--p 003d5000 08:01 16802121                   /home/***/devel/ruby/build/ruby
55f879c62000-55f879c63000 rw-p 003db000 08:01 16802121                   /home/***/devel/ruby/build/ruby
55f879c63000-55f879c74000 rw-p 00000000 00:00 0 
55f87bbd9000-55f87bbfa000 rw-p 00000000 00:00 0                          [heap]
55f87bbfa000-55f87bd0e000 rw-p 00000000 00:00 0                          [heap]
7fa883e1a000-7fa883fb7000 r--s 00000000 08:01 10244061                   /lib/x86_64-linux-gnu/libc-2.24.so
7fa883fb7000-7fa884199000 r--s 00000000 08:01 12202043                   /usr/lib/debug/.build-id/16/d609487bcc4acbac29a4eaa2dda0d2f56211ec.debug
7fa884199000-7fa885985000 r--s 00000000 08:01 16802121                   /home/***/devel/ruby/build/ruby
7fa885985000-7fa88599b000 r-xp 00000000 08:01 10223947                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fa88599b000-7fa885b9a000 ---p 00016000 08:01 10223947                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fa885b9a000-7fa885b9b000 r--p 00015000 08:01 10223947                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fa885b9b000-7fa885b9c000 rw-p 00016000 08:01 10223947                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7fa885b9c000-7fa885b9d000 ---p 00000000 00:00 0 
7fa885b9d000-7fa885c3e000 rw-p 00000000 00:00 0 
7fa885c3e000-7fa885c3f000 ---p 00000000 00:00 0 
7fa885c3f000-7fa885ce0000 rw-p 00000000 00:00 0 
7fa885ce0000-7fa885ce1000 ---p 00000000 00:00 0 
7fa885ce1000-7fa885d82000 rw-p 00000000 00:00 0 
7fa885d82000-7fa885d83000 ---p 00000000 00:00 0 
7fa885d83000-7fa885e24000 rw-p 00000000 00:00 0 
7fa885e24000-7fa885e25000 ---p 00000000 00:00 0 
7fa885e25000-7fa885ec6000 rw-p 00000000 00:00 0 
7fa885ec6000-7fa885ec7000 ---p 00000000 00:00 0 
7fa885ec7000-7fa885f68000 rw-p 00000000 00:00 0 
7fa885f68000-7fa885f69000 ---p 00000000 00:00 0 
7fa885f69000-7fa88600a000 rw-p 00000000 00:00 0 
7fa88600a000-7fa88600b000 ---p 00000000 00:00 0 
7fa88600b000-7fa8860ac000 rw-p 00000000 00:00 0 
7fa8860ac000-7fa8860ad000 ---p 00000000 00:00 0 
7fa8860ad000-7fa88614e000 rw-p 00000000 00:00 0 
7fa88614e000-7fa88614f000 ---p 00000000 00:00 0 
7fa88614f000-7fa8861f0000 rw-p 00000000 00:00 0 
7fa8861f0000-7fa8861f1000 ---p 00000000 00:00 0 
7fa8861f1000-7fa886292000 rw-p 00000000 00:00 0 
7fa886292000-7fa886293000 ---p 00000000 00:00 0 
7fa886293000-7fa886334000 rw-p 00000000 00:00 0 
7fa886334000-7fa886335000 ---p 00000000 00:00 0 
7fa886335000-7fa8863d6000 rw-p 00000000 00:00 0 
7fa8863d6000-7fa8863d7000 ---p 00000000 00:00 0 
7fa8863d7000-7fa886478000 rw-p 00000000 00:00 0 
7fa886478000-7fa886479000 ---p 00000000 00:00 0 
7fa886479000-7fa88651a000 rw-p 00000000 00:00 0 
7fa88651a000-7fa88651b000 ---p 00000000 00:00 0 
7fa88651b000-7fa8865bc000 rw-p 00000000 00:00 0 
7fa8865bc000-7fa8865bd000 ---p 00000000 00:00 0 
7fa8865bd000-7fa88665e000 rw-p 00000000 00:00 0 
7fa88665e000-7fa88665f000 ---p 00000000 00:00 0 
7fa88665f000-7fa886700000 rw-p 00000000 00:00 0 
7fa886700000-7fa886701000 ---p 00000000 00:00 0 
7fa886701000-7fa8867a2000 rw-p 00000000 00:00 0 
7fa8867a2000-7fa8867a3000 ---p 00000000 00:00 0 
7fa8867a3000-7fa886844000 rw-p 00000000 00:00 0 
7fa886844000-7fa886845000 ---p 00000000 00:00 0 
7fa886845000-7fa8868e6000 rw-p 00000000 00:00 0 
7fa8868e6000-7fa8868e7000 ---p 00000000 00:00 0 
7fa8868e7000-7fa886988000 rw-p 00000000 00:00 0 
7fa886988000-7fa886989000 ---p 00000000 00:00 0 
7fa886989000-7fa886a2a000 rw-p 00000000 00:00 0 
7fa886a2a000-7fa886a2b000 ---p 00000000 00:00 0 
7fa886a2b000-7fa886acc000 rw-p 00000000 00:00 0 
7fa886acc000-7fa886acd000 ---p 00000000 00:00 0 
7fa886acd000-7fa886b6e000 rw-p 00000000 00:00 0 
7fa886b6e000-7fa886b6f000 ---p 00000000 00:00 0 
7fa886b6f000-7fa886c10000 rw-p 00000000 00:00 0 
7fa886c10000-7fa886c11000 ---p 00000000 00:00 0 
7fa886c11000-7fa886cb2000 rw-p 00000000 00:00 0 
7fa886cb2000-7fa886cb3000 ---p 00000000 00:00 0 
7fa886cb3000-7fa886d54000 rw-p 00000000 00:00 0 
7fa886d54000-7fa886d55000 ---p 00000000 00:00 0 
7fa886d55000-7fa886df6000 rw-p 00000000 00:00 0 
7fa886df6000-7fa886df7000 ---p 00000000 00:00 0 
7fa886df7000-7fa886e98000 rw-p 00000000 00:00 0 
7fa886e98000-7fa886e99000 ---p 00000000 00:00 0 
7fa886e99000-7fa886f3a000 rw-p 00000000 00:00 0 
7fa886f3a000-7fa886f3b000 ---p 00000000 00:00 0 
7fa886f3b000-7fa88ef45000 rw-p 00000000 00:00 0 
7fa88ef45000-7fa88f1df000 r--p 00000000 08:01 9048286                    /usr/lib/locale/locale-archive
7fa88f1df000-7fa88f374000 r-xp 00000000 08:01 10244061                   /lib/x86_64-linux-gnu/libc-2.24.so
7fa88f374000-7fa88f574000 ---p 00195000 08:01 10244061                   /lib/x86_64-linux-gnu/libc-2.24.so
7fa88f574000-7fa88f578000 r--p 00195000 08:01 10244061                   /lib/x86_64-linux-gnu/libc-2.24.so
7fa88f578000-7fa88f57a000 rw-p 00199000 08:01 10244061                   /lib/x86_64-linux-gnu/libc-2.24.so
7fa88f57a000-7fa88f57e000 rw-p 00000000 00:00 0 
7fa88f57e000-7fa88f681000 r-xp 00000000 08:01 10244066                   /lib/x86_64-linux-gnu/libm-2.24.so
7fa88f681000-7fa88f880000 ---p 00103000 08:01 10244066                   /lib/x86_64-linux-gnu/libm-2.24.so
7fa88f880000-7fa88f881000 r--p 00102000 08:01 10244066                   /lib/x86_64-linux-gnu/libm-2.24.so
7fa88f881000-7fa88f882000 rw-p 00103000 08:01 10244066                   /lib/x86_64-linux-gnu/libm-2.24.so
7fa88f882000-7fa88f88a000 r-xp 00000000 08:01 10244064                   /lib/x86_64-linux-gnu/libcrypt-2.24.so
7fa88f88a000-7fa88fa8a000 ---p 00008000 08:01 10244064                   /lib/x86_64-linux-gnu/libcrypt-2.24.so
7fa88fa8a000-7fa88fa8b000 r--p 00008000 08:01 10244064                   /lib/x86_64-linux-gnu/libcrypt-2.24.so
7fa88fa8b000-7fa88fa8c000 rw-p 00009000 08:01 10244064                   /lib/x86_64-linux-gnu/libcrypt-2.24.so
7fa88fa8c000-7fa88faba000 rw-p 00000000 00:00 0 
7fa88faba000-7fa88fabd000 r-xp 00000000 08:01 10244065                   /lib/x86_64-linux-gnu/libdl-2.24.so
7fa88fabd000-7fa88fcbc000 ---p 00003000 08:01 10244065                   /lib/x86_64-linux-gnu/libdl-2.24.so
7fa88fcbc000-7fa88fcbd000 r--p 00002000 08:01 10244065                   /lib/x86_64-linux-gnu/libdl-2.24.so
7fa88fcbd000-7fa88fcbe000 rw-p 00003000 08:01 10244065                   /lib/x86_64-linux-gnu/libdl-2.24.so
7fa88fcbe000-7fa88fd3f000 r-xp 00000000 08:01 9048832                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
7fa88fd3f000-7fa88ff3f000 ---p 00081000 08:01 9048832                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
7fa88ff3f000-7fa88ff40000 r--p 00081000 08:01 9048832                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
7fa88ff40000-7fa88ff41000 rw-p 00082000 08:01 9048832                    /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
7fa88ff41000-7fa88ff48000 r-xp 00000000 08:01 10244085                   /lib/x86_64-linux-gnu/librt-2.24.so
7fa88ff48000-7fa890147000 ---p 00007000 08:01 10244085                   /lib/x86_64-linux-gnu/librt-2.24.so
7fa890147000-7fa890148000 r--p 00006000 08:01 10244085                   /lib/x86_64-linux-gnu/librt-2.24.so
7fa890148000-7fa890149000 rw-p 00007000 08:01 10244085                   /lib/x86_64-linux-gnu/librt-2.24.so
7fa890149000-7fa890161000 r-xp 00000000 08:01 10244081                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7fa890161000-7fa890360000 ---p 00018000 08:01 10244081                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7fa890360000-7fa890361000 r--p 00017000 08:01 10244081                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7fa890361000-7fa890362000 rw-p 00018000 08:01 10244081                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7fa890362000-7fa890366000 rw-p 00000000 00:00 0 
7fa890366000-7fa89037f000 r-xp 00000000 08:01 10223706                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7fa89037f000-7fa89057e000 ---p 00019000 08:01 10223706                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7fa89057e000-7fa89057f000 r--p 00018000 08:01 10223706                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7fa89057f000-7fa890580000 rw-p 00019000 08:01 10223706                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7fa890580000-7fa8905a3000 r-xp 00000000 08:01 10224056                   /lib/x86_64-linux-gnu/ld-2.24.so
7fa8906e2000-7fa890743000 rw-p 00000000 00:00 0 
7fa890743000-7fa890747000 rw-p 00000000 00:00 0 
7fa89076f000-7fa890791000 r--s 00000000 08:01 10244081                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7fa890791000-7fa890796000 r--p 00000000 08:01 10223715                   /lib/x86_64-linux-gnu/libsnoopy.so.0.0.0
7fa890796000-7fa89079b000 r-xp 00005000 08:01 10223715                   /lib/x86_64-linux-gnu/libsnoopy.so.0.0.0
7fa89079b000-7fa89079d000 r--p 0000a000 08:01 10223715                   /lib/x86_64-linux-gnu/libsnoopy.so.0.0.0
7fa89079d000-7fa89079e000 ---p 0000c000 08:01 10223715                   /lib/x86_64-linux-gnu/libsnoopy.so.0.0.0
7fa89079e000-7fa89079f000 r--p 0000c000 08:01 10223715                   /lib/x86_64-linux-gnu/libsnoopy.so.0.0.0
7fa89079f000-7fa8907a0000 rw-p 0000d000 08:01 10223715                   /lib/x86_64-linux-gnu/libsnoopy.so.0.0.0
7fa8907a1000-7fa8907a3000 rw-p 00000000 00:00 0 
7fa8907a3000-7fa8907a4000 r--p 00023000 08:01 10224056                   /lib/x86_64-linux-gnu/ld-2.24.so
7fa8907a4000-7fa8907a5000 rw-p 00024000 08:01 10224056                   /lib/x86_64-linux-gnu/ld-2.24.so
7fa8907a5000-7fa8907a6000 rw-p 00000000 00:00 0 
7ffd18209000-7ffd18a08000 rw-p 00000000 00:00 0                          [stack]
7ffd18be8000-7ffd18bea000 r--p 00000000 00:00 0                          [vvar]
7ffd18bea000-7ffd18bec000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]


Aborted

It seems that https://bugs.ruby-lang.org/issues/16616 happened again. gdb bt includes Init_builtin_ractor () at ../ractor.rbinc:710, so Ractor might be related.


Related issues

Is duplicate of Ruby master - Bug #17583: Segfault on large stack(RUBY_THREAD_VM_STACK_SIZE)Assignedko1 (Koichi Sasada)Actions

Updated by xtkoba (Tee KOBAYASHI) 4 months ago

I suppose this is a duplicate of Bug #17583.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) 4 months ago

  • Is duplicate of Bug #17583: Segfault on large stack(RUBY_THREAD_VM_STACK_SIZE) added
Actions

Also available in: Atom PDF