ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "vo.x (Vit Ondruch)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:105067] [Ruby master Bug#17052] Ruby with LTO enabled has issues with SIGSEGV handler
Date: Wed, 25 Aug 2021 09:43:10 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-93474.20210825094304.703@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17052.20200727122732.703@ruby-lang.org

Issue #17052 has been updated by vo.x (Vit Ondruch).


xtkoba (Tee KOBAYASHI) wrote in #note-31:
> I might have been misleading. The patch in #note-9 is necessary for correctly reading `DW_FORM_ref_addr` values in `.debug_info` sections, even if those values are kept uninterpreted by the patch in #note-11. Both patches have been merged in master already. The rest of the patches I posted here won't be necessary.

This is is the Fedora commit:

https://src.fedoraproject.org/rpms/ruby/c/1170d812fe0cd43aeddf7f15a63c2e6db3af8059

The two patches you have mentioned are enough to pass the test suite. I leave the rest to be backported eventually (BTW this was reported against Ruby 2.7 originally and it is likely still affected, but I don't think we are going to enable LTO for Ruby 2.7 at this stage, so the 2.7 backport is low priority for me).

So this is resolved from my POV unless you want to apply the ruby-addr2line-abbrev_table-r1.patch

Thx once again.

----------------------------------------
Bug #17052: Ruby with LTO enabled has issues with SIGSEGV handler
https://bugs.ruby-lang.org/issues/17052#change-93474

* Author: vo.x (Vit Ondruch)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [powerpc64le-linux]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: REQUIRED
----------------------------------------
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 `<main>'
| -: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 `<main>'\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 <main>'
| -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 `<main>'
| -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 `<main>'
| -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)
ruby-addr2line-abbrev_table.patch (1.49 KB)
ruby-addr2line-abbrev_table-r1.patch (2.81 KB)
ruby-addr2line-debug_info_read-debug-code-0001.patch (1.11 KB)


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

  parent reply	other threads:[~2021-08-25  9:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 12:27 [ruby-core:99351] [Ruby master Bug#17052] Ruby with LTO enabled on {aarch64, ppc64le} architectures v.ondruch
2020-07-27 15:02 ` [ruby-core:99353] [Ruby master Bug#17052] Ruby with LTO enabled has issues with SIGSEGV handler v.ondruch
2020-08-20  3:52 ` [ruby-core:99651] " shyouhei
2020-08-20  3:53 ` [ruby-core:99652] " shyouhei
2020-08-20  7:43 ` [ruby-core:99653] " v.ondruch
2020-08-20  7:44 ` [ruby-core:99654] " v.ondruch
2021-08-09 10:22 ` [ruby-core:104839] " v.ondruch
2021-08-09 10:33 ` [ruby-core:104841] " v.ondruch
2021-08-12 15:59 ` [ruby-core:104900] " v.ondruch
2021-08-12 22:04 ` [ruby-core:104903] " xtkoba+ruby
2021-08-13 11:14 ` [ruby-core:104908] " xtkoba+ruby
2021-08-13 13:45 ` [ruby-core:104911] " xtkoba+ruby
2021-08-16 18:44 ` [ruby-core:104929] " vo.x (Vit Ondruch)
2021-08-16 19:46 ` [ruby-core:104931] " xtkoba (Tee KOBAYASHI)
2021-08-16 22:00 ` [ruby-core:104933] " vo.x (Vit Ondruch)
2021-08-16 22:02 ` [ruby-core:104934] " vo.x (Vit Ondruch)
2021-08-17  7:52 ` [ruby-core:104947] " xtkoba (Tee KOBAYASHI)
2021-08-17 10:06 ` [ruby-core:104953] " xtkoba (Tee KOBAYASHI)
2021-08-17 14:16 ` [ruby-core:104955] " xtkoba (Tee KOBAYASHI)
2021-08-18 17:34 ` [ruby-core:104973] " vo.x (Vit Ondruch)
2021-08-18 18:08 ` [ruby-core:104974] " xtkoba (Tee KOBAYASHI)
2021-08-18 20:20 ` [ruby-core:104975] " vo.x (Vit Ondruch)
2021-08-18 21:29 ` [ruby-core:104979] " xtkoba (Tee KOBAYASHI)
2021-08-19  4:50 ` [ruby-core:104988] " vo.x (Vit Ondruch)
2021-08-19 12:52 ` [ruby-core:105007] " xtkoba (Tee KOBAYASHI)
2021-08-23 13:55 ` [ruby-core:105049] " vo.x (Vit Ondruch)
2021-08-23 14:20 ` [ruby-core:105050] " xtkoba (Tee KOBAYASHI)
2021-08-23 15:41 ` [ruby-core:105051] " vo.x (Vit Ondruch)
2021-08-23 16:06 ` [ruby-core:105052] " xtkoba (Tee KOBAYASHI)
2021-08-23 16:46 ` [ruby-core:105053] " vo.x (Vit Ondruch)
2021-08-23 17:07 ` [ruby-core:105054] " xtkoba (Tee KOBAYASHI)
2021-08-23 18:08 ` [ruby-core:105055] " vo.x (Vit Ondruch)
2021-08-25  9:43 ` vo.x (Vit Ondruch) [this message]
2021-08-25 14:13 ` [ruby-core:105068] " xtkoba (Tee KOBAYASHI)
2021-09-11  4:55 ` [ruby-core:105193] " nagachika (Tomoyuki Chikanaga)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-93474.20210825094304.703@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).