From: "xtkoba (Tee KOBAYASHI)" Date: 2021-08-16T19:46:02+00:00 Subject: [ruby-core:104931] [Ruby master Bug#17052] Ruby with LTO enabled has issues with SIGSEGV handler Issue #17052 has been updated by xtkoba (Tee KOBAYASHI). Aren't there any subtle differences in GDB outputs? If fixed as intended, the value of `abstract_origin` can't get such large as 760312297580551 (0x2b380006a6807). ---------------------------------------- Bug #17052: Ruby with LTO enabled has issues with SIGSEGV handler https://bugs.ruby-lang.org/issues/17052#change-93297 * Author: vo.x (Vit Ondruch) * Status: Open * Priority: Normal * ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [powerpc64le-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- Fedora aims to enable link time optimization (LTO) of packages in next release. The specific changes in configuration options are available here [1]. Since that time, I observe following errors [2] at least on {aarch64,ppc64le} (and possibly also other architectures): ~~~ 1) Failure: TestBugReporter#test_bug_reporter_add [/builddir/build/BUILD/ruby-2.7.1/test/-ext-/bug_reporter/test_bug_reporter.rb:22]: pid 32395 killed by SIGSEGV (signal 11) (core dumped) | -:1: [BUG] Segmentation fault at 0x000003e800007e8b | ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [powerpc64le-linux] | | -- Control frame information ----------------------------------------------- | c:0003 p:---- s:0012 e:000011 CFUNC :kill | c:0002 p:0021 s:0006 e:000005 EVAL -:1 [FINISH] | c:0001 p:0000 s:0003 E:000f80 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -:1:in `
' | -:1:in `kill' | | -- C level backtrace information ------------------------------------------- .. 1. [2/2] Assertion for "stderr" | Expected /Sample bug reporter: 12345/ | to match | "-- Control frame information -----------------------------------------------\n"+ | "c:0003 p:---- s:0012 e:000011 CFUNC :kill\n"+ | "c:0002 p:0021 s:0006 e:000005 EVAL -:1 [FINISH]\n"+ | "c:0001 p:0000 s:0003 E:000f80 (none) [FINISH]\n\n"+ | "-- Ruby level backtrace information ----------------------------------------\n"+ | "-:1:in `
'\n"+ | "-:1:in `kill'\n\n"+ | "-- C level backtrace information -------------------------------------------\n" | after 4 patterns with 120 characters. 2) Failure: TestRubyOptions#test_segv_loaded_features [/builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:735]: pid 38444 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x000003e80000962c | ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [powerpc64le-linux] | | -- Control frame information ----------------------------------------------- | c:0003 p:---- s:0012 e:000011 CFUNC :kill | c:0002 p:0016 s:0006 e:000005 BLOCK -e:1 [FINISH] | c:0001 p:0000 s:0003 E:002460 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -e:1:in `block in
' | -e:1:in `kill' | | -- C level backtrace information ------------------------------------------- .. 1. [2/2] Assertion for "stderr" | <""> expected but was | <"-- C level backtrace information -------------------------------------------\n">. 3) Failure: TestRubyOptions#test_segv_setproctitle [/builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:749]: pid 38451 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x000003e800009633 | ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [powerpc64le-linux] | | -- Control frame information ----------------------------------------------- | c:0003 p:---- s:0012 e:000011 CFUNC :kill | c:0002 p:0029 s:0006 e:000005 EVAL -e:1 [FINISH] | c:0001 p:0000 s:0003 E:000480 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -e:1:in `
' | -e:1:in `kill' | | -- C level backtrace information ------------------------------------------- .. 1. [2/2] Assertion for "stderr" | <""> expected but was | <"-- C level backtrace information -------------------------------------------\n">. 4) Failure: TestRubyOptions#test_segv_test [/builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:729]: pid 38460 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x000003e80000963c | ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [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:0006a0 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -e:1:in `
' | -e:1:in `kill' | | -- C level backtrace information ------------------------------------------- .. 1. [2/2] Assertion for "stderr" | <""> expected but was | <"-- C level backtrace information -------------------------------------------\n">. Finished tests in 840.600443s, 25.0047 tests/s, 3238.9681 assertions/s. 21019 tests, 2722678 assertions, 4 failures, 0 errors, 70 skips ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [powerpc64le-linux] ~~~ When I raised the issue on fedora-devel ML [3], there was suggestion that it might happen when signal handler modifies any global variable. Now I am not sure if that is the case. Can somebody confirm? Or investigate/fix this, please? [1]: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/5baaf4a99cc77572d3496a7000674098bef7ed68?branch=master [2]: https://koschei.fedoraproject.org/package/ruby [3]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/D6YUXPU5C2RWIQMNHLT4HBYXUGVKKPOW/ ---Files-------------------------------- ruby-addr2line-DW_FORM_ref_addr.patch (651 Bytes) ruby-addr2line-read_abstract_origin.patch (1.37 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: