Bug 1881888

Summary: Support for .zdebug_info
Product: Red Hat Enterprise Linux 8 Reporter: Vít Ondruch <vondruch>
Component: rpmAssignee: Michal Domonkos <mdomonko>
Status: CLOSED INSUFFICIENT_DATA QA Contact: swm-qe
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: cqi, jskeoch, mdomonko, mjw, mjw, pmatilai, ppisar, rpmdiff-maint, ryang, sthaha, tools-bugs, xuliu
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1881860 Environment:
Last Closed: 2020-11-24 08:04:52 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:
Bug Depends On: 1881860, 1881950    
Bug Blocks:    

Description Vít Ondruch 2020-09-23 10:21:13 UTC
While RPMDiff reports "missing [.debug_info]", trying to check manually, this is what I get:

~~~
$ readelf -a git-lfs.debug | grep debug_info
  [29] .zdebug_info      PROGBITS         000000000110ea7e  000eed50
~~~

So obviously there is compressed debug_info. It seems that Fedora automatically decompress such sections. I think it would make sense do the same for RHEL.


How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:
`missing [.debug_info]` is reported, while .zdebug_info is available.


Expected results:
The .zdebug_info should be expanded by /usr/lib/rpm/find-debuginfo.sh


Additional info:
Please note that while this is reported against RHEL8, I met the original issue on RHEL7. Please consider the fix there as well.

Comment 2 Panu Matilainen 2020-09-29 08:55:25 UTC
So AIUI, we're speaking about backporting this commit: https://github.com/rpm-software-management/rpm/commit/1c3bf3d6495c4b7d585d931fbac4b1f894833f89 and nothing more. In that case:

elfutils in RHEL-8 is new enough for that to work, the patch has been in Fedora all along so it can be considered well tested, so there should be no technical obstacles so this is more of a "should we?" policy question. Mark?

Comment 3 Mark Wielaard 2020-09-29 09:56:25 UTC
(In reply to Panu Matilainen from comment #2)
> So AIUI, we're speaking about backporting this commit:
> https://github.com/rpm-software-management/rpm/commit/
> 1c3bf3d6495c4b7d585d931fbac4b1f894833f89 and nothing more. In that case:
> 
> elfutils in RHEL-8 is new enough for that to work, the patch has been in
> Fedora all along so it can be considered well tested, so there should be no
> technical obstacles so this is more of a "should we?" policy question. Mark?

Note that I never intended for that patch to be a real solution, I only suggested it as quick workaround for breakage in Fedora at the time. I am slightly surprised Igor marked and committed it as Authored by me. Also note that as far as I know this is a Fedora only workaround and isn't actually in rpm upstream where you reverted it as part of https://github.com/rpm-software-management/rpm/pull/473

That said it doesn't seem to harm things, so if you want RHEL to behave more like Fedora it should be fine.

It isn't a real solution (and the explicit echo makes it very verbose), it simply works around the real issue that we don't want compressed ELF sections in .debug files. So in that sense it resolves the policy issue.

Comment 5 Michal Domonkos 2020-11-09 09:57:59 UTC
(In reply to Mark Wielaard from comment #3)
> Also note that as far as I know this is a Fedora only workaround and isn't actually in
> rpm upstream where you reverted it as part of
> https://github.com/rpm-software-management/rpm/pull/473

The revert was done due to the suid issue tracked in Bug 1607044, which got fixed and backported into RHEL-8 in the meantime, so backporting the original find-debuginfo.sh patch into RHEL-8 wouldn't be an issue in this regard.

Anyway,

@Vito, it seems you've made a decision to fix this in the git-lfs software collection by not shipping the compressed .zdebug_info section in the first place:
https://bugzilla.redhat.com/show_bug.cgi?id=1607044

That makes me think you no longer need our patch in RHEL-8, is that correct?

If so, I'd say let's close this BZ as WONTFIX then.  While it certainly would be a usable workaround, it seems the proper way is to handle this at the package level (preferably by not shipping compressed ELF sections in .debug files at all), along the lines of Mark's Comment 3 as well as Bug 1394759.

Comment 6 Michal Domonkos 2020-11-09 09:59:35 UTC
(In reply to Michal Domonkos from comment #5)
> @Vito, it seems you've made a decision to fix this in the git-lfs software
> collection by not shipping the compressed .zdebug_info section in the first
> place:
> https://bugzilla.redhat.com/show_bug.cgi?id=1607044

Correction: https://bugzilla.redhat.com/show_bug.cgi?id=1881950

Comment 7 Vít Ondruch 2020-11-09 10:30:10 UTC
I spent the time with all the research, discussions, preparing workarounds, etc. Therefore if you ask me, I want this to be "fixed" not because it helps to my original case, but because it might help future me or some else to avoid undergoing the same again. Sure, you won't ever know if fixing this changed anything, maybe nobody would not hit this prior RHEL8 EOL, but that it not my call.

Comment 8 Michal Domonkos 2020-11-09 10:43:00 UTC
Thanks for the feedback.

The real question is, what does "fixed" mean here?  If it's "don't use compressed sections", then there's nothing to fix on our side.  I'm no expert, though, which is why I tend to trust people like Mark who said:

"It isn't a real solution (and the explicit echo makes it very verbose), it simply works around the real issue that we don't want compressed ELF sections in .debug files. So in that sense it resolves the policy issue."

Mark, could you please clarify why using compressed ELF sections in .debug files is to be avoided?

Comment 9 Michal Domonkos 2020-11-09 10:50:14 UTC
(In reply to Vít Ondruch from comment #7)
> I spent the time with all the research, discussions, preparing workarounds,
> etc.

And just to be clear, it is highly appreciated that you tracked down the issue and filed this BZ, regardless of whether the outcome was to make adjustments to your own package or us making changes in rpm.  Either way is a successful outcome in my book :)

Comment 10 Mark Wielaard 2020-11-09 10:54:12 UTC
(In reply to Michal Domonkos from comment #8)
> Mark, could you please clarify why using compressed ELF sections in .debug
> files is to be avoided?

Because, according to this bug, rpm debugedit doesn't support it :)

But generally because we already compress the debuginfo for distribution in rpms (all rpms are compressed), so it is in general redundant. Also we would like programs that use on-disk .debug files and .debug_* sections to be able to quickly read them and/or mmap them and not have to decompress the whole file or section upon use which would use extra resources, time and memory. Which is especially troublesome for profilers and tracers which have to act quickly. So if they were compressed then programs would probably have to setup some uncompressed cache of these files.

Comment 13 Vít Ondruch 2020-11-09 14:12:27 UTC
(In reply to Michal Domonkos from comment #9)
> (In reply to Vít Ondruch from comment #7)
> > I spent the time with all the research, discussions, preparing workarounds,
> > etc.
> 
> And just to be clear, it is highly appreciated that you tracked down the
> issue and filed this BZ, regardless of whether the outcome was to make
> adjustments to your own package or us making changes in rpm.  Either way is
> a successful outcome in my book :)

Don't worry, I am fine with whatever decision. You just asked ;)