From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 2DA1B1F8C6 for ; Wed, 25 Aug 2021 09:43:18 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7E923120C79; Wed, 25 Aug 2021 18:41:56 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 3987E120AFA for ; Wed, 25 Aug 2021 18:41:54 +0900 (JST) Received: by filterdrecv-7c9b89cc6f-pds28 with SMTP id filterdrecv-7c9b89cc6f-pds28-1-612610AE-25 2021-08-25 09:43:10.384757082 +0000 UTC m=+1070727.610807504 Received: from herokuapp.com (unknown) by ismtpd0168p1mdw1.sendgrid.net (SG) with ESMTP id tT9wSQHlTtWpfARV-OzDBQ for ; Wed, 25 Aug 2021 09:43:10.294 +0000 (UTC) Date: Wed, 25 Aug 2021 09:43:10 +0000 (UTC) From: "vo.x (Vit Ondruch)" Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17052 X-Redmine-Issue-Author: vo.x X-Redmine-Sender: vo.x X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 81244 X-SG-EID: =?us-ascii?Q?1BO5E1LXHcjbGn447qx9J3bLqJckwjkYxnet3qAAIKG0Q+gfRSAYCxFkjK=2FtB1?= =?us-ascii?Q?M2=2FIxYQQYM565yajRHmjHwlV5gbPClxsve515Qi?= =?us-ascii?Q?6wOW6l3gErUZKG+NUd1yskoyk0q+UAuoEXMAIJP?= =?us-ascii?Q?fCzR4I6D3IvynkiK3fOaTMhyrRjrSrqtY76JMb1?= =?us-ascii?Q?RwlC6tfJ+oi2fksGZaQn8W1ZEE8Rwq10q+LtCnt?= =?us-ascii?Q?jdKrypVTfLYTAcWTiDlH32uHgHfbsuLQQETBD+3?= =?us-ascii?Q?GK7WeIlfGjc0gATB2fxNw=3D=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 105067 Subject: [ruby-core:105067] [Ruby master Bug#17052] Ruby with LTO enabled has issues with SIGSEGV handler X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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 `
' | -: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) 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/