Bug 1465170 - debuginfo regression in kernel with 4.13.0.1-25.fc27
Summary: debuginfo regression in kernel with 4.13.0.1-25.fc27
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-26 21:22 UTC by Laura Abbott
Modified: 2017-06-28 13:44 UTC (History)
6 users (show)

Fixed In Version: rpm-4.13.0.1-27.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-28 13:44:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Laura Abbott 2017-06-26 21:22:59 UTC
Today's kernel build failed due to debuginfo

https://koji.fedoraproject.org/koji/taskinfo?taskID=20186886

error: Missing build-id in /builddir/build/BUILDROOT/kernel-4.12.0-0.rc7.git0.1.fc27.x86_64/usr/lib/debug/lib/modules/4.12.0-0.rc7.git0.1.fc27.x86_64+debug/vmlinux
error: Generating build-id links failed
RPM build errors:
    Missing build-id in /builddir/build/BUILDROOT/kernel-4.12.0-0.rc7.git0.1.fc27.x86_64/usr/lib/debug/lib/modules/4.12.0-0.rc7.git0.1.fc27.x86_64+debug/vmlinux
    Generating build-id links failed

This seems to have started with 4.13.0.1-25.fc27, considering https://src.fedoraproject.org/cgit/rpms/rpm.git/commit/?id=da3af5788be55bca0ab93e911ec817063df61605 came in as well.

When I do a local build and check the file:
$ file vmlinux
/home/labbott/rpmbuild/BUILDROOT/kernel-4.12.0-0.rc7.git0.1.ba.fc27.x86_64/usr/lib/debug/lib/modules/4.12.0-0.rc7.git0.1.ba.fc27.x86_64+debug/vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, bad note name size 0x81000003, not stripped 

The kernel does a lot of custom debuginfo settings:

%global _build_id_links alldebug
%undefine _include_minidebuginfo
%undefine _find_debuginfo_dwz_opts
%undefine _unique_build_ids
%undefine _unique_debug_names
%undefine _unique_debug_srcs
%global _find_debuginfo_opts -r
%global _missing_build_ids_terminate_build 1
%global _no_recompute_build_ids 1

Comment 1 Mark Wielaard 2017-06-26 22:19:43 UTC
Thanks for the report, trying to replicate locally now.

> This seems to have started with 4.13.0.1-25.fc27, considering https://src.fedoraproject.org/cgit/rpms/rpm.git/commit/?id=da3af5788be55bca0ab93e911ec817063df61605 came in as well.

That might be it, because that adds the sub-debuginfo package support. But the kernel already does that itself. It should be disabled by default, but apparently it does interact with what the kernel.spec does. Sorry about that.

> https://koji.fedoraproject.org/koji/taskinfo?taskID=20186886

I notice it only failed the x86_64 and i686 builds, all other arches succeeded.

The x86_64 failure is with the +debug sub-debuginfo package, the i686 failure is with the +PAE sub-debuginfo package. Do other arches not have sub-debuginfo packages?

Comment 2 Laura Abbott 2017-06-26 22:44:35 UTC
Yes, currently only x86 targets do debug kernels:

# don't do debug builds on anything but i686 and x86_64
%ifnarch i686 x86_64
%define with_debug 0
%endif

Comment 3 Mark Wielaard 2017-06-27 16:23:30 UTC
Sorry this is taking a bit. I was convinced it was the new sub-debuginfo package patch for rpm. But it looks like it isn't. The message about the "Missing build-id" is kind of correct. Your original description included:

> When I do a local build and check the file:
> $ file vmlinux
> /home/labbott/rpmbuild/BUILDROOT/kernel-4.12.0-0.rc7.git0.1.ba.fc27.x86_64/usr/lib/debug/lib/modules/4.12.0-0.rc7.git0.1.ba.fc27.x86_64+debug/vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, bad note name size 0x81000003, not stripped 

And indeed. The NOTE section does seem to be corrupted. And so the build-id cannot be read.

I am still trying to figure out what corrupted the NOTE/build-id in this case.
It is still suspicious that it is for the vmlinux from a secondary debuginfo subpackage.

Comment 4 Mark Wielaard 2017-06-27 20:02:41 UTC
It seems to have been caused by an earlier change in rpm 4.13.0.1-24 which added:

# Parallel debuginfo processing
Patch281: find-debuginfo-split-traversal-and-extraction.patch
Patch282: find-debuginfo-process-files-in-parallel.patch

One of these (or the combination) seems to have caused this debug/vmlinux build failure. But I haven't figured out how yet.

Comment 5 Mark Wielaard 2017-06-28 12:12:33 UTC
Looks like the issue was staring at us in the build.log all this time:

/usr/lib/rpm/find-debuginfo.sh: line 353: continue: only meaningful in a `for', `while', or `until' loop

This comes from:
Patch281: find-debuginfo-split-traversal-and-extraction.patch

Which extracted the body of a for loop into its own shell function.

Now trying the following fix:

--- rpm-4.13.0.1/scripts/find-debuginfo.sh.orig	2017-06-28 13:00:10.780609617 +0200
+++ rpm-4.13.0.1/scripts/find-debuginfo.sh	2017-06-28 13:00:38.331005393 +0200
@@ -351,7 +351,7 @@
   # just has its file names collected and adjusted.
   case "$dn" in
   /usr/lib/debug/*)
-    continue ;;
+    return ;;
   esac
 
   mkdir -p "${debugdn}"

This should make sure that we won't try to modify the vmlinux file already placed under /usr/lib/debug/lib/modules (and apparently corrupt the build-id note) but just add it as is to the debuginfo file list.

Comment 6 Mark Wielaard 2017-06-28 13:38:02 UTC
Fixed in rpm-4.13.0.1-27.fc27. Patch also sent upstream:
http://lists.rpm.org/pipermail/rpm-maint/2017-June/005824.html


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