Bug 1961214 - Backport or upstream the patch to decompress DWARF compressed ELF sections
Summary: Backport or upstream the patch to decompress DWARF compressed ELF sections
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: debugedit
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mark Wielaard
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-17 14:26 UTC by Robert-André Mauchin 🐧
Modified: 2021-05-17 15:39 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-05-17 15:39:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Robert-André Mauchin 🐧 2021-05-17 14:26:19 UTC
Before the introduction of debugedit, RPM had a patch for find-debuginfo.sh to decompress DWARF compressed ELF sections:

https://src.fedoraproject.org/rpms/rpm/blob/rawhide/f/0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch

From f2bc669cd0a080792522dd1bb7f50ef7025f16f0 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark>
Date: Sat, 21 Jul 2018 10:13:04 +0200
Subject: [PATCH] find-debuginfo.sh: decompress DWARF compressed ELF sections

debugedit and dwz do not support DWARF compressed ELF sections, let's
just decompress those before extracting debuginfo.

Tested-by: Igor Gnatenko <i.gnatenko.brain>
---
 scripts/find-debuginfo.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 90a44942d..7b01bc036 100755
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -357,6 +357,9 @@ do_file()
   get_debugfn "$f"
   [ -f "${debugfn}" ] && return
 
+  echo "explicitly decompress any DWARF compressed ELF sections in $f"
+  eu-elfcompress -q -p -t none "$f"
+
   echo "extracting debug info from $f"
   # See also cpio SOURCEFILE copy. Directories must match up.
   debug_base_name="$RPM_BUILD_DIR"
-- 
2.18.0


This patch is critical for Golang programs as go uses compressed DWARF by default, and thus find-debuginfo.sh fails to extract these debug infos resulting in a failed build.

See for example https://koji.fedoraproject.org/koji/taskinfo?taskID=68136231 

Panu Matilainen has activated debugedit by default 4 hours ago, and thus all my Go apps are failing to build since then.

Could you backport the aforementioned patch for debugedit or send it upstream?

Best regards,

Robert-André

Comment 1 Robert-André Mauchin 🐧 2021-05-17 14:36:34 UTC
Note that Panu had reverted the patch:

https://sourceware.org/git/?p=debugedit.git;a=commit;h=3601089cfc38c5f1ed8beb85fa701a261a8cb2e6

Bug Igor Raits added it to the RPM package.

Comment 2 Mark Wielaard 2021-05-17 14:37:00 UTC
That patch was only ever intended to be a quick and dirty workaround for go apps that uses elf compressed debug sections. The real fix is to get golang to not do that.

Comment 3 Robert-André Mauchin 🐧 2021-05-17 15:39:05 UTC
(In reply to Mark Wielaard from comment #2)
> That patch was only ever intended to be a quick and dirty workaround for go
> apps that uses elf compressed debug sections. The real fix is to get golang
> to not do that.

All right, I have disabled DWARF compression for Rawhide.


Note You need to log in before you can comment on or make changes to this bug.