Bug 1920533

Summary: DWARF5 (probably) breaks Ruby on armv7hl + ppc64le
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: rubyAssignee: Vít Ondruch <vondruch>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: aoliva, dmalcolm, fweimer, jakub, joe, jwakely, law, mjw, mo, mpolacek, msebor, mtasaka, nickc, pvalena, ruby-packagers-sig, sipoyare, s, strzibny, vanmeeuwen+fedora, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ruby-3.0.0-146.fc35 ruby-3.0.0-146.eln110 ruby-3.0.0-146.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-03 11:08:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vít Ondruch 2021-01-26 13:50:35 UTC
Description of problem:
It seems that since gcc-11.0.0-0.16.fc34, which enables DWARF5, Ruby test suite fils on armv7hl and ppc64 [1]. The specific test cases are checking segfault handler:

~~~
  1) Failure:
TestBugReporter#test_bug_reporter_add [/builddir/build/BUILD/ruby-3.0.0/test/-ext-/bug_reporter/test_bug_reporter.rb:24]:
pid 2308966 killed by SIGSEGV (signal 11) (core dumped)
| -:1: [BUG] Segmentation fault at 0x000003e800233b66
| 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:002330 (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:002330 (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 2316347 killed by SIGSEGV (signal 11) (core dumped)
| -e:1: [BUG] Segmentation fault at 0x000003e80023583b
| 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:000540 (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 2316354 killed by SIGSEGV (signal 11) (core dumped)
| -e:1: [BUG] Segmentation fault at 0x000003e800235842
| 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:000610 (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 2316361 killed by SIGSEGV (signal 11) (core dumped)
| -e:1: [BUG] Segmentation fault at 0x000003e800235849
| 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:000500 (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">.
~~~

These test cases were always flaky and I don't think they are designed for these platforms, but while they typically used to pass, they does not pass anymore.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:



[1] https://koschei.fedoraproject.org/package/ruby?collection=f34

Comment 1 Jakub Jelinek 2021-01-26 13:54:48 UTC
If ruby has its own DWARF reader and that reader doesn't understand DWARF5, then that support should be added, it isn't that hard.
DWARF5 has been published in February 2017, so almost 4 years ago, it is nothing really new.
Unless you have evidence that this is caused by incorrect DWARF5 produced from the GCC side, I don't see what can be done on the GCC side, we are not going to switch back to DWARF4 because of this.

Comment 2 Vít Ondruch 2021-01-26 17:08:26 UTC
Is there a way to switch Ruby back to DWARF4? And why there should be issues just on two platforms?

Comment 3 Jakub Jelinek 2021-01-26 17:09:07 UTC
You can use -gdwarf-4 instead of -g to force DWARF4.  But the system libraries will be still using DWARF5 and so will e.g. libgcc etc. that might be linked into the libraries or binaries.

Comment 4 Jeff Law 2021-01-31 18:27:42 UTC
I think trying the -gdwarf-4 is probably worth the effort to try.  As long as the Ruby stack doesn't need to unwind through system code that should restore proper behavior and give the Ruby project time to implement a complete dwarf-5 solution for the future.

As to why it only fails on some architectures, there's a variety of reasons why this could be happening, but at the core I suspect that's just a red herring.  dwarf-5 support is highly likely the core issue here.

Comment 5 Ben Cotton 2021-02-09 15:43:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 6 Mark Wielaard 2021-02-17 13:59:50 UTC
Might this be related to https://bugzilla.redhat.com/show_bug.cgi?id=1500863 ?

Comment 7 Vít Ondruch 2021-02-17 15:33:57 UTC
(In reply to Mark Wielaard from comment #6)
> Might this be related to https://bugzilla.redhat.com/show_bug.cgi?id=1500863
> ?

You are right, it might. However, previously if failed occasionally, now it seems to fail deterministically. Also the platforms are different. Frankly, for Fedora/RHEL, it would be much better if the SIGSEV handler was completely removed, because such failures should be caught by ABRT instead. But I have never digged deep enough to explore this.

Comment 8 Vít Ondruch 2021-03-03 10:22:28 UTC
Ruby upstream is working on DWARF5 support, therefore I move the ticket to Ruby and going to apply the patch.

Comment 9 Fedora Update System 2021-03-03 11:08:21 UTC
FEDORA-2021-e32e00afb5 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2021-03-03 12:50:23 UTC
FEDORA-2021-358c6949a4 has been pushed to the Fedora ELN stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2021-03-03 13:20:22 UTC
FEDORA-2021-cf72e44fc8 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-cf72e44fc8

Comment 12 Fedora Update System 2021-03-03 15:48:02 UTC
FEDORA-2021-cf72e44fc8 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-cf72e44fc8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-cf72e44fc8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2021-03-19 17:44:55 UTC
FEDORA-2021-cf72e44fc8 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2021-03-19 20:00:49 UTC
FEDORA-2021-cf72e44fc8 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.