From: v.ondruch@... Date: 2021-08-11T17:02:51+00:00 Subject: [ruby-core:104886] [Ruby master Bug#18062] Ruby with enabled LTO segfaults during build Issue #18062 has been updated by vo.x (Vit Ondruch). So I have tried to get more details about the #17052: ~~~ $ gdb --args ./miniruby -e'Process.kill("SIGSEGV",$$)' GNU gdb (GDB) Fedora 10.2-6.fc35 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "ppc64le-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./miniruby... warning: File "/builddir/build/BUILD/ruby-3.0.2/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". To enable execution of this file add add-auto-load-safe-path /builddir/build/BUILD/ruby-3.0.2/.gdbinit line to your configuration file "/builddir/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/builddir/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" (gdb) r Starting program: /builddir/build/BUILD/ruby-3.0.2/miniruby -eProcess.kill\(\"SIGSEGV\",\$\$\) Download failed: No route to host. Continuing without debug info for /lib64/libz.so.1. Download failed: No route to host. Continuing without debug info for /lib64/libgmp.so.10. Download failed: No route to host. Continuing without debug info for /lib64/libcrypt.so.2. Download failed: No route to host. Continuing without debug info for /lib64/libm.so.6. Download failed: No route to host. Continuing without debug info for /lib64/libc.so.6. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7aa8810 in kill () from /lib64/libc.so.6 Missing separate debuginfos, use: dnf debuginfo-install glibc-2.34-1.fc35.ppc64le gmp-6.2.0-7.fc35.ppc64le libxcrypt-4.4.24-1.fc35.ppc64le zlib-1.2.11-30.fc35.ppc64le (gdb) c Continuing. -e:1: [BUG] Segmentation fault at 0x590fb15c0000001f ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [powerpc64le-linux] -- Control frame information ----------------------------------------------- c:0003 p:---- s:0012 e:000011 CFUNC :kill c:0002 p:0015 s:0006 e:000005 EVAL -e:1 [FINISH] c:0001 p:0000 s:0003 E:0013f0 (none) [FINISH] -- Ruby level backtrace information ---------------------------------------- -e:1:in `
' -e:1:in `kill' -- C level backtrace information ------------------------------------------- Program received signal SIGSEGV, Segmentation fault. 0x000000010031fa44 in uleb128 (p=0x1005986a0) at addr2line.c:200 200 unsigned char b = *(unsigned char *)(*p)++; (gdb) bt #0 0x000000010031fa44 in uleb128 (p=0x1005986a0) at addr2line.c:200 #1 di_read_die (reader=0x100598668, die=0x100598588) at addr2line.c:1335 #2 0x0000000100337d4c in read_abstract_origin (line=0x1005985f8, abstract_origin=760312297580551, reader=0x100598668) at addr2line.c:1604 #3 debug_info_read (traces=, offset=, lines=, num_traces=, reader=) at addr2line.c:1668 #4 fill_lines (num_traces=num_traces@entry=19, check_debuglink=check_debuglink@entry=1, objp=0x100599010, objp@entry=0x1005990a0, lines=lines@entry=0x1005e2c50, offset=0, offset@entry=-1, traces=) at addr2line.c:1888 #5 0x0000000100338d1c in rb_dump_backtrace_with_lines.constprop.0 (num_traces=, traces=) at addr2line.c:2287 #6 0x000000010031dfec in rb_print_backtrace () at vm_dump.c:760 #7 0x00000001003356a8 in rb_vm_bugreport.constprop.0 (ctx=) at vm_dump.c:998 #8 0x00000001000cd8c4 in rb_bug_for_fatal_signal (default_sighandler=0x0, sig=, ctx=, fmt=0x100383a98 "Segmentation fault at %p") at error.c:786 #9 0x0000000100256388 in sigsegv (sig=, info=0x10059a330, ctx=0x1005995b0) at signal.c:960 #10 #11 0x00007ffff7aa8810 in kill () from /lib64/libc.so.6 #12 0x000000010025ad70 in rb_f_kill (argc=, argv=0x7ffff78e0050) at signal.c:439 #13 0x00000001001fb448 in proc_rb_f_kill (c=, v=, _=) at process.c:8605 #14 0x00000001002e92d8 in ractor_safe_call_cfunc_m1 (recv=, argc=, argv=, func=) at vm_insnhelper.c:2739 #15 0x00000001002f2120 in vm_call_cfunc_with_frame (ec=0x100491ac0, reg_cfp=0x7fffffffe170, calling=) at vm_insnhelper.c:2929 #16 0x00000001002f4f34 in vm_sendish (ec=0x100491ac0, reg_cfp=0x7ffff79dffa0, cd=0x1005c2eb0, block_handler=, method_explorer=) at vm_insnhelper.c:4530 #17 0x00000001002fa2ac in vm_exec_core (ec=0x100491ac0, initial=) at insns.def:789 #18 0x0000000100315200 in rb_vm_exec (ec=0x100491ac0, mjit_enable_p=) at vm.c:2172 #19 0x0000000100317040 in rb_iseq_eval_main (iseq=0x1004a9fb0) at vm.c:2420 #20 0x00000001000d7c8c in rb_ec_exec_node (ec=ec@entry=0x100491ac0, n=n@entry=0x1004a9fb0) at eval.c:317 #21 0x00000001000d7df4 in ruby_run_node (n=0x1004a9fb0) at eval.c:375 #22 0x000000010002afb8 in main (argc=, argv=) at ./main.c:50 (gdb) ~~~ ---------------------------------------- Bug #18062: Ruby with enabled LTO segfaults during build https://bugs.ruby-lang.org/issues/18062#change-93245 * Author: vo.x (Vit Ondruch) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: REQUIRED ---------------------------------------- After a while, I am trying to enable LTO for Ruby in Fedora. Previously I hit #17052, but now I observe issues much earlier during compliation already: ~~~ ./miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc :240: [BUG] Segmentation fault at 0x0000000000000004 ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] -- Control frame information ----------------------------------------------- c:0003 p:0008 s:0011 e:000008 CLASS :240 c:0002 p:0015 s:0006 e:000005 TOP :235 [FINISH] c:0001 p:0000 s:0003 E:000230 (none) [FINISH] -- Ruby level backtrace information ---------------------------------------- :235:in `' :240:in `' -- Machine register context ------------------------------------------------ RIP: 0x00005585da1c832a RBP: 0x000022f100140003 RSP: 0x00007ffd6460a6a0 RAX: 0x0000000000000001 RBX: 0x00000000000022f1 RCX: 0x00005585dade5d90 RDX: 0x000022f100140003 RDI: 0x00005585dae0c2d8 RSI: 0x0000000000000000 R8: 0x0000000000000000 R9: 0x00007ffd6460a6e0 R10: 0x00005585daebbe50 R11: 0x00007f00a785baa0 R12: 0x0000000000000000 R13: 0x00005585dade5d90 R14: 0x00005585dae0c2d8 R15: 0x00005585dade5d90 EFL: 0x0000000000010202 -- C level backtrace information ------------------------------------------- ./miniruby(rb_print_backtrace+0x19) [0x5585da1cdba9] ./miniruby(rb_vm_bugreport+0x215) [0x5585da1d1a05] ./miniruby(rb_bug_for_fatal_signal+0xf4) [0x5585da004fc4] ./miniruby(sigsegv+0x4d) [0x5585da13709d] [0x7f00a76a4760] ./miniruby(vm_ccs_push.part.0.lto_priv.0+0x2a) [0x5585da1c832a] ./miniruby(vm_search_cc+0xfe) [0x5585da1a7b7e] ./miniruby(vm_search_method_slowpath0.lto_priv.0+0x40) [0x5585da1a7d30] ./miniruby(vm_sendish.lto_priv.0+0x6e4) [0x5585da1aeff4] ./miniruby(vm_exec_core.lto_priv.0+0xa8) [0x5585da1b25b8] ./miniruby(rb_vm_exec+0x110) [0x5585da1c9ea0] ./miniruby(ruby_opt_init+0x6f) [0x5585da1355af] ./miniruby(load_file_internal+0x4b2) [0x5585da1376e2] ./miniruby(rb_ensure+0x106) [0x5585da00d5a6] ./miniruby(process_options+0x19e5) [0x5585da139a65] ./miniruby(ruby_process_options+0x151) [0x5585da13a551] ./miniruby(ruby_options+0x119) [0x5585da012de9] ./miniruby(main+0x57) [0x5585d9f8a1e7] -- Other runtime information ----------------------------------------------- * Loaded script: ./miniruby * Loaded features: 0 enumerator.so 1 thread.rb 2 rational.so 3 complex.so 4 ruby2_keywords.rb * Process memory map: 5585d9f5d000-5585d9f85000 r--p 00000000 fc:05 137001366 /builddir/build/BUILD/ruby-3.0.2/miniruby 5585d9f85000-5585da1f2000 r-xp 00028000 fc:05 137001366 /builddir/build/BUILD/ruby-3.0.2/miniruby 5585da1f2000-5585da2f6000 r--p 00295000 fc:05 137001366 /builddir/build/BUILD/ruby-3.0.2/miniruby 5585da2f6000-5585da2fd000 r--p 00398000 fc:05 137001366 /builddir/build/BUILD/ruby-3.0.2/miniruby 5585da2fd000-5585da2fe000 rw-p 0039f000 fc:05 137001366 /builddir/build/BUILD/ruby-3.0.2/miniruby 5585da2fe000-5585da30e000 rw-p 00000000 00:00 0 5585dad8d000-5585daed3000 rw-p 00000000 00:00 0 [heap] 7f00a28ae000-7f00a409b000 r--s 00000000 fc:05 137001366 /builddir/build/BUILD/ruby-3.0.2/miniruby 7f00a409b000-7f00a409e000 r--p 00000000 fc:05 270435464 /usr/lib64/libgcc_s-11-20210728.so.1 7f00a409e000-7f00a40b0000 r-xp 00003000 fc:05 270435464 /usr/lib64/libgcc_s-11-20210728.so.1 7f00a40b0000-7f00a40b3000 r--p 00015000 fc:05 270435464 /usr/lib64/libgcc_s-11-20210728.so.1 7f00a40b3000-7f00a40b4000 r--p 00017000 fc:05 270435464 /usr/lib64/libgcc_s-11-20210728.so.1 7f00a40b4000-7f00a40b5000 rw-p 00018000 fc:05 270435464 /usr/lib64/libgcc_s-11-20210728.so.1 7f00a40b5000-7f00a40b6000 ---p 00000000 00:00 0 7f00a40b6000-7f00a4157000 rw-p 00000000 00:00 0 7f00a4157000-7f00a4158000 ---p 00000000 00:00 0 7f00a4158000-7f00a41f9000 rw-p 00000000 00:00 0 7f00a41f9000-7f00a41fa000 ---p 00000000 00:00 0 7f00a41fa000-7f00a429b000 rw-p 00000000 00:00 0 7f00a429b000-7f00a429c000 ---p 00000000 00:00 0 7f00a429c000-7f00a433d000 rw-p 00000000 00:00 0 7f00a433d000-7f00a433e000 ---p 00000000 00:00 0 7f00a433e000-7f00a43df000 rw-p 00000000 00:00 0 7f00a43df000-7f00a43e0000 ---p 00000000 00:00 0 7f00a43e0000-7f00a4481000 rw-p 00000000 00:00 0 7f00a4481000-7f00a4482000 ---p 00000000 00:00 0 7f00a4482000-7f00a4523000 rw-p 00000000 00:00 0 7f00a4523000-7f00a4524000 ---p 00000000 00:00 0 7f00a4524000-7f00a45c5000 rw-p 00000000 00:00 0 7f00a45c5000-7f00a45c6000 ---p 00000000 00:00 0 7f00a45c6000-7f00a4667000 rw-p 00000000 00:00 0 7f00a4667000-7f00a4668000 ---p 00000000 00:00 0 7f00a4668000-7f00a4709000 rw-p 00000000 00:00 0 7f00a4709000-7f00a470a000 ---p 00000000 00:00 0 7f00a470a000-7f00a47ab000 rw-p 00000000 00:00 0 7f00a47ab000-7f00a47ac000 ---p 00000000 00:00 0 7f00a47ac000-7f00a484d000 rw-p 00000000 00:00 0 7f00a484d000-7f00a484e000 ---p 00000000 00:00 0 7f00a484e000-7f00a48ef000 rw-p 00000000 00:00 0 7f00a48ef000-7f00a48f0000 ---p 00000000 00:00 0 7f00a48f0000-7f00a4991000 rw-p 00000000 00:00 0 7f00a4991000-7f00a4992000 ---p 00000000 00:00 0 7f00a4992000-7f00a4a33000 rw-p 00000000 00:00 0 7f00a4a33000-7f00a4a34000 ---p 00000000 00:00 0 7f00a4a34000-7f00a4ad5000 rw-p 00000000 00:00 0 7f00a4ad5000-7f00a4ad6000 ---p 00000000 00:00 0 7f00a4ad6000-7f00a4b77000 rw-p 00000000 00:00 0 7f00a4b77000-7f00a4b78000 ---p 00000000 00:00 0 7f00a4b78000-7f00a4c19000 rw-p 00000000 00:00 0 7f00a4c19000-7f00a4c1a000 ---p 00000000 00:00 0 7f00a4c1a000-7f00a4cbb000 rw-p 00000000 00:00 0 7f00a4cbb000-7f00a4cbc000 ---p 00000000 00:00 0 7f00a4cbc000-7f00a4d5d000 rw-p 00000000 00:00 0 7f00a4d5d000-7f00a4d5e000 ---p 00000000 00:00 0 7f00a4d5e000-7f00a4dff000 rw-p 00000000 00:00 0 7f00a4dff000-7f00a4e00000 ---p 00000000 00:00 0 7f00a4e00000-7f00a4ea1000 rw-p 00000000 00:00 0 7f00a4ea1000-7f00a4ea2000 ---p 00000000 00:00 0 7f00a4ea2000-7f00a4f43000 rw-p 00000000 00:00 0 7f00a4f43000-7f00a4f44000 ---p 00000000 00:00 0 7f00a4f44000-7f00a4fe5000 rw-p 00000000 00:00 0 7f00a4fe5000-7f00a4fe6000 ---p 00000000 00:00 0 7f00a4fe6000-7f00a5087000 rw-p 00000000 00:00 0 7f00a5087000-7f00a5088000 ---p 00000000 00:00 0 7f00a5088000-7f00a5129000 rw-p 00000000 00:00 0 7f00a5129000-7f00a512a000 ---p 00000000 00:00 0 7f00a512a000-7f00a51cb000 rw-p 00000000 00:00 0 7f00a51cb000-7f00a51cc000 ---p 00000000 00:00 0 7f00a51cc000-7f00a526d000 rw-p 00000000 00:00 0 7f00a526d000-7f00a526e000 ---p 00000000 00:00 0 7f00a526e000-7f00a530f000 rw-p 00000000 00:00 0 7f00a530f000-7f00a5310000 ---p 00000000 00:00 0 7f00a5310000-7f00a53b1000 rw-p 00000000 00:00 0 7f00a53b1000-7f00a53b2000 ---p 00000000 00:00 0 7f00a53b2000-7f00a5453000 rw-p 00000000 00:00 0 7f00a5453000-7f00a5454000 ---p 00000000 00:00 0 7f00a5454000-7f00a7662000 rw-p 00000000 00:00 0 7f00a7662000-7f00a768e000 r--p 00000000 fc:05 270939738 /usr/lib64/libc.so.6 7f00a768e000-7f00a7803000 r-xp 0002c000 fc:05 270939738 /usr/lib64/libc.so.6 7f00a7803000-7f00a7857000 r--p 001a1000 fc:05 270939738 /usr/lib64/libc.so.6 7f00a7857000-7f00a7858000 ---p 001f5000 fc:05 270939738 /usr/lib64/libc.so.6 7f00a7858000-7f00a785b000 r--p 001f5000 fc:05 270939738 /usr/lib64/libc.so.6 7f00a785b000-7f00a785e000 rw-p 001f8000 fc:05 270939738 /usr/lib64/libc.so.6 7f00a785e000-7f00a786b000 rw-p 00000000 00:00 0 7f00a786b000-7f00a787a000 r--p 00000000 fc:05 270939741 /usr/lib64/libm.so.6 7f00a787a000-7f00a78eb000 r-xp 0000f000 fc:05 270939741 /usr/lib64/libm.so.6 7f00a78eb000-7f00a7945000 r--p 00080000 fc:05 270939741 /usr/lib64/libm.so.6 7f00a7945000-7f00a7946000 r--p 000d9000 fc:05 270939741 /usr/lib64/libm.so.6 7f00a7946000-7f00a7947000 rw-p 000da000 fc:05 270939741 /usr/lib64/libm.so.6 7f00a7947000-7f00a7949000 r--p 00000000 fc:05 271023995 /usr/lib64/libcrypt.so.2.0.0 7f00a7949000-7f00a795d000 r-xp 00002000 fc:05 271023995 /usr/lib64/libcrypt.so.2.0.0 7f00a795d000-7f00a7976000 r--p 00016000 fc:05 271023995 /usr/lib64/libcrypt.so.2.0.0 7f00a7976000-7f00a7977000 ---p 0002f000 fc:05 271023995 /usr/lib64/libcrypt.so.2.0.0 7f00a7977000-7f00a7978000 r--p 0002f000 fc:05 271023995 /usr/lib64/libcrypt.so.2.0.0 7f00a7978000-7f00a7981000 rw-p 00000000 00:00 0 7f00a7981000-7f00a7992000 r--p 00000000 fc:05 271068897 /usr/lib64/libgmp.so.10.4.0 7f00a7992000-7f00a7a0a000 r-xp 00011000 fc:05 271068897 /usr/lib64/libgmp.so.10.4.0 7f00a7a0a000-7f00a7a21000 r--p 00089000 fc:05 271068897 /usr/lib64/libgmp.so.10.4.0 7f00a7a21000-7f00a7a23000 r--p 0009f000 fc:05 271068897 /usr/lib64/libgmp.so.10.4.0 7f00a7a23000-7f00a7a24000 rw-p 000a1000 fc:05 271068897 /usr/lib64/libgmp.so.10.4.0 7f00a7a24000-7f00a7a27000 r--p 00000000 fc:05 271023970 /usr/lib64/libz.so.1.2.11 7f00a7a27000-7f00a7a35000 r-xp 00003000 fc:05 271023970 /usr/lib64/libz.so.1.2.11 7f00a7a35000-7f00a7a3b000 r--p 00011000 fc:05 271023970 /usr/lib64/libz.so.1.2.11 7f00a7a3b000-7f00a7a3c000 ---p 00017000 fc:05 271023970 /usr/lib64/libz.so.1.2.11 7f00a7a3c000-7f00a7a3d000 r--p 00017000 fc:05 271023970 /usr/lib64/libz.so.1.2.11 7f00a7a3d000-7f00a7a3e000 rw-p 00000000 00:00 0 7f00a7a41000-7f00a7a43000 rw-p 00000000 00:00 0 7f00a7a43000-7f00a7a44000 r--p 00000000 fc:05 270939734 /usr/lib64/ld-linux-x86-64.so.2 7f00a7a44000-7f00a7a69000 r-xp 00001000 fc:05 270939734 /usr/lib64/ld-linux-x86-64.so.2 7f00a7a69000-7f00a7a73000 r--p 00026000 fc:05 270939734 /usr/lib64/ld-linux-x86-64.so.2 7f00a7a73000-7f00a7a75000 r--p 0002f000 fc:05 270939734 /usr/lib64/ld-linux-x86-64.so.2 7f00a7a75000-7f00a7a77000 rw-p 00031000 fc:05 270939734 /usr/lib64/ld-linux-x86-64.so.2 7ffd63e17000-7ffd64616000 rw-p 00000000 00:00 0 [stack] 7ffd64762000-7ffd64766000 r--p 00000000 00:00 0 [vvar] 7ffd64766000-7ffd64768000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] make: *** [uncommon.mk:1096: encdb.h] Aborted (core dumped) ~~~ ---Files-------------------------------- 0001-Get-rid-of-type-punning-pointer-cast.patch (1.41 KB) 4716.patch (7.33 KB) jaruga_make_cflags_with_O2_lto_flags.log (16.2 KB) jaruga_make_check.log (263 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: