ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: xtkoba+ruby@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:103640] [Ruby master Bug#17585] DWARF5 support?
Date: Wed, 28 Apr 2021 11:24:08 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-91736.20210428112408.703@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17585.20210126171131.703@ruby-lang.org

Issue #17585 has been updated by xtkoba (Tee KOBAYASHI).


GCC 11 is released yesterday, and in [Changes, New Features, and Fixes](https://gcc.gnu.org/gcc-11/changes.html) it is said that:

```
To take full advantage of DWARF version 5 GCC needs to be build against binutils version 2.35.2 or higher. When GCC is build against earlier versions of binutils GCC will still emit DWARF version 5 for most debuginfo data, but will generate version 4 debug line tables (even when explicitly given `-gdwarf-5`).
```

Though I have not yet tested the released version of GCC 11, there will be (at least) three cases according to the version of GCC and binutils when GCC is supplied with the `-gdwarf-5` option (which is the default for GCC 11).

1. GCC 10 (+ binutils with any version?): version 5 `.debug_info`, **version 3** `.debug_line` (as noted in #note-6)
 * This case is what I aimed at in the main issue.
2. GCC 11 + binutils with version >= 2.35.2: version 5 `.debug_info`, **version 5** `.debug_line`
 * As I wrote in #note-6, version 5 `.debug_line` is just skipped in the current `addr2line.c`, and so I suppose there will be no new issue in this case other than that `filename:lineno` information is not shown in C backtrace.
3. GCC 11 + binutils with version < 2.35.2: version 5 `.debug_info`, **version <= 4** `.debug_line`
 * The binutils in my environment is up to date, and so I will not be able to test this case. Hopefully the same as case 1.

To summarize, I hope there will be no new issue with the released version of GCC 11. Anyway, feel free to reopen this ticket whenever a segfault is observed in `addr2line.c` with DWARF 5.

----------------------------------------
Bug #17585: DWARF5 support?
https://bugs.ruby-lang.org/issues/17585#change-91736

* Author: vo.x (Vit Ondruch)
* Status: Closed
* 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: REQUIRED
----------------------------------------
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 `<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:000480 (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 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 <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-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 `<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-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 `<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 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 `<main>'
| -: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 `<main>'\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 <main>'
| -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 `<main>'
| -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 `<main>'
| -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/

  parent reply	other threads:[~2021-04-28 11:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 17:11 [ruby-core:102256] [Ruby master Bug#17585] DWAR5 support? v.ondruch
2021-01-26 17:12 ` [ruby-core:102257] " v.ondruch
2021-02-03  5:50 ` [ruby-core:102387] [Ruby master Bug#17585] DWARF5 support? xtkoba+ruby
2021-02-03  6:00 ` [ruby-core:102388] " mame
2021-02-05  5:13 ` [ruby-core:102400] " xtkoba+ruby
2021-02-10 16:39 ` [ruby-core:102448] " xtkoba+ruby
2021-02-16 12:00 ` [ruby-core:102532] " v.ondruch
2021-02-16 15:38 ` [ruby-core:102544] " v.ondruch
2021-02-17  8:32 ` [ruby-core:102553] " xtkoba+ruby
2021-02-17 15:53 ` [ruby-core:102562] " xtkoba+ruby
2021-02-25 21:18 ` [ruby-core:102607] " xtkoba+ruby
2021-02-27  0:32 ` [ruby-core:102633] " xtkoba+ruby
2021-03-02 17:43 ` [ruby-core:102722] " v.ondruch
2021-03-03 21:39 ` [ruby-core:102732] " xtkoba+ruby
2021-03-05 15:08 ` [ruby-core:102742] " mame
2021-04-06  8:21 ` [ruby-core:103250] " v.ondruch
2021-04-28 11:24 ` xtkoba+ruby [this message]
2021-04-28 17:11 ` [ruby-core:103643] " v.ondruch
2021-05-29  4:46 ` [ruby-core:104091] " nagachika00

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-91736.20210428112408.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).