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-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no 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 993321F9FD for ; Thu, 25 Feb 2021 21:18:24 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 23B69120AC4; Fri, 26 Feb 2021 06:17:27 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 19B54120AB9 for ; Fri, 26 Feb 2021 06:17:24 +0900 (JST) Received: by filterdrecv-p3iad2-fdf5ff85d-npw2l with SMTP id filterdrecv-p3iad2-fdf5ff85d-npw2l-18-60381419-4F 2021-02-25 21:18:17.588385005 +0000 UTC m=+1377047.396482145 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-0 (SG) with ESMTP id Z7kwhC02T6KXphNknKwZ-A for ; Thu, 25 Feb 2021 21:18:17.577 +0000 (UTC) Date: Thu, 25 Feb 2021 21:18:17 +0000 (UTC) From: xtkoba+ruby@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78603 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17585 X-Redmine-Issue-Author: vo.x X-Redmine-Sender: xtkoba 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-SG-EID: =?us-ascii?Q?75w3+RXRrinEP3ykAS=2F1WzD2vTMrJdTeEiaFbXc9IwUdYuFvK8TxdqMo2zKHKl?= =?us-ascii?Q?=2Ffl53orUZYehoNdNFQA=2FfdKIrsVMD0ndg13pSJu?= =?us-ascii?Q?SKma0oWFZOaYqY52cHuYnRf9nnIhk8NxOM3FVYe?= =?us-ascii?Q?FiUcrSDMoZOhRW71Q3bcqKzcMW6NyOIK=2FeUQd66?= =?us-ascii?Q?S=2FnKC4RNGzCCzpAmxQR2nMjgXayFpsUGZylH2xX?= =?us-ascii?Q?5OryUSZ448BkdrARg=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102607 Subject: [ruby-core:102607] [Ruby master Bug#17585] DWARF5 support? 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 #17585 has been updated by xtkoba (Tee KOBAYASHI). File ruby-dwarf5-avoid_crash-r1.patch added A (revised) patch is attached to avoid segfaults with GCC's DWARF 5. In summary, there are three changes: (1) correct the interpretation of `DW_LNS_advance_pc` statements when the minimum instruction length is not equal to 1 (which is the case for aarch64, arm and powerpc64le), (2) skip `DW_FORM_implicit_const` attributes properly, and (3) read and use the `.debug_rnglists` section if available. When applied together with the patch for Bug #17656, this patch will make `addr2line.c` correctly extract `function+offset` and `file:line` information from GCC's DWARF 5 sections, except that some "inlined by" information is not shown. Note that in the above changes, (3) is minimal and only `DW_RLE_base_address` and `DW_RLE_offset_pair` are interpreted, because other range list entries seem unnecessary for now. It is highly probable that other entries become necessary in the future. I hope that the workaround in #note-3 would be no longer needed. #note-5 is deleted to avoid confusion. ---------------------------------------- Bug #17585: DWARF5 support? https://bugs.ruby-lang.org/issues/17585#change-90593 * Author: vo.x (Vit Ondruch) * Status: Open * Priority: Normal * ruby -v: ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv7hl-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Fedora recently switched from DWARF4 to DWARF5 and since that time, I observe test suite errors on ppc64le: ~~~ 1) Failure: TestBugReporter#test_bug_reporter_add [/builddir/build/BUILD/ruby-3.0.0/test/-ext-/bug_reporter/test_bug_reporter.rb:24]: pid 1691449 killed by SIGSEGV (signal 11) (core dumped) | -:1: [BUG] Segmentation fault at 0x000003e80019cf39 | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [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:000480 (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:000480 (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 119 characters. 2) Failure: TestRubyOptions#test_segv_loaded_features [/builddir/build/BUILD/ruby-3.0.0/test/ruby/test_rubyoptions.rb:748]: pid 1721938 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x000003e8001a4652 | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [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:000f80 (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-3.0.0/test/ruby/test_rubyoptions.rb:762]: pid 1721957 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x000003e8001a4665 | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [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:0015c0 (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-3.0.0/test/ruby/test_rubyoptions.rb:742]: pid 1721966 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x000003e8001a466e | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [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:001fa0 (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 1111.355067s, 18.8689 tests/s, 2396.5689 assertions/s. 20970 tests, 2663439 assertions, 4 failures, 0 errors, 60 skips ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [powerpc64le-linux] ~~~ And similar issues on armv7hl: ~~~ 1) Failure: TestBugReporter#test_bug_reporter_add [/builddir/build/BUILD/ruby-3.0.0/test/-ext-/bug_reporter/test_bug_reporter.rb:24]: pid 722 killed by SIGSEGV (signal 11) (core dumped) | -:1: [BUG] Segmentation fault at 0x000002d2 | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv7hl-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:000c98 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -:1:in `
' | -:1:in `kill' | | -- Machine register context ------------------------------------------------ | "r0: 0x00000000 "r1: 0x0000000b "r2: 0x00000001 "r3: 0x00000001 "r4: 0x000002d2 | "r5: 0xb689a028 "r6: 0x0000000b "r7: 0x00000025 "r8: 0x00000002 "r9: 0x000002d2 | "r1: 0x00000001 "sp: 0xbe846d1c "fa: 0x00000000 | | -- 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:000c98 (none) [FINISH]\n\n"+ | "-- Ruby level backtrace information ----------------------------------------\n"+ | "-:1:in `
'\n"+ | "-:1:in `kill'\n\n"+ | "-- Machine register context ------------------------------------------------\n"+ | " \"r0: 0x00000000 \"r1: 0x0000000b \"r2: 0x00000001 \"r3: 0x00000001 \"r4: 0x000002d2\n"+ | " \"r5: 0xb689a028 \"r6: 0x0000000b \"r7: 0x00000025 \"r8: 0x00000002 \"r9: 0x000002d2\n"+ | " \"r1: 0x00000001 \"sp: 0xbe846d1c \"fa: 0x00000000\n\n"+ | "-- C level backtrace information -------------------------------------------\n" | after 4 patterns with 107 characters. 2) Failure: TestRubyOptions#test_segv_loaded_features [/builddir/build/BUILD/ruby-3.0.0/test/ruby/test_rubyoptions.rb:748]: pid 8085 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x00001f95 | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv7hl-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:000660 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -e:1:in `block in
' | -e:1:in `kill' | | -- Machine register context ------------------------------------------------ | "r0: 0x00000000 "r1: 0x0000000b "r2: 0x00000001 "r3: 0x00000001 "r4: 0x00001f95 | "r5: 0xb68e3028 "r6: 0x0000000b "r7: 0x00000025 "r8: 0x00000002 "r9: 0x00001f95 | "r1: 0x00000001 "sp: 0xbe8c5ac4 "fa: 0x00000000 | | -- 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-3.0.0/test/ruby/test_rubyoptions.rb:762]: pid 8092 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x00001f9c | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv7hl-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:000550 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -e:1:in `
' | -e:1:in `kill' | | -- Machine register context ------------------------------------------------ | "r0: 0x00000000 "r1: 0x0000000b "r2: 0x00000001 "r3: 0x00000001 "r4: 0x00001f9c | "r5: 0xb685d028 "r6: 0x0000000b "r7: 0x00000025 "r8: 0x00000002 "r9: 0x00001f9c | "r1: 0x00000001 "sp: 0xbef7acfc "fa: 0x00000000 | | -- 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-3.0.0/test/ruby/test_rubyoptions.rb:742]: pid 8101 killed by SIGSEGV (signal 11) (core dumped) | -e:1: [BUG] Segmentation fault at 0x00001fa5 | ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv7hl-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:001f50 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -e:1:in `
' | -e:1:in `kill' | | -- Machine register context ------------------------------------------------ | "r0: 0x00000000 "r1: 0x0000000b "r2: 0x00000001 "r3: 0x00000001 "r4: 0x00001fa5 | "r5: 0xb68bc028 "r6: 0x0000000b "r7: 0x00000025 "r8: 0x00000002 "r9: 0x00001fa5 | "r1: 0x00000001 "sp: 0xbee96d3c "fa: 0x00000000 | | -- C level backtrace information ------------------------------------------- .. 1. [2/2] Assertion for "stderr" | <""> expected but was | <"-- C level backtrace information -------------------------------------------\n">. Finished tests in 1428.305544s, 14.6810 tests/s, 1866.1553 assertions/s. 20969 tests, 2665440 assertions, 4 failures, 0 errors, 56 skips ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [armv7hl-linux] ~~~ So is it really due to DWARF5? Why is that just on two platforms? ---Files-------------------------------- ruby-addr2line-dwarf5.patch (1.92 KB) ruby-dwarf5-debug_line.patch (11 KB) ruby-dwarf5-avoid_crash-r1.patch (6.14 KB) -- https://bugs.ruby-lang.org/