Bug 2310156
| Summary: | gdb 15.1 regression on .gdb_index generation | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Panu Matilainen <pmatilai> |
| Component: | dwz | Assignee: | Mark Wielaard <mjw> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 40 | CC: | ahajkova, codonell, fweimer, guinevere, jakub, jan, keiths, kevinb, mcermak, mjw, mkolar, mpolacek, suraj.ghimire7 |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | dwz-0.15-8.fc41 dwz-0.15-8.fc40 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2024-10-10 00:17:27 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Panu Matilainen
2024-09-05 08:01:20 UTC
CC'ing Mark Wielaard whose debuginfo-related tests in the rpm upstream test-suite caught this. We upstream rpm test caught this? Recently Keith added error detection to find-debuginfo in upstream debugedit as part of https://sourceware.org/bugzilla/show_bug.cgi?id=30505 That should probably be backported to fedora 40. That might have caught this earlier, but I am afraid that it would break package builds (making this a hard error). (In reply to Mark Wielaard from comment #2) > We upstream rpm test caught this? > > Recently Keith added error detection to find-debuginfo in upstream debugedit > as part of https://sourceware.org/bugzilla/show_bug.cgi?id=30505 > That should probably be backported to fedora 40. That might have caught this > earlier, but I am afraid that it would break package builds (making this a > hard error). If it's a hard error, it's easier to detect in gating in our rebuild tests (assuming that it affects the packages being rebuilt). GDB should really have some of those rebuild tests as required to pass for gating (if it hasn't got them already). (In reply to Florian Weimer from comment #3) > (In reply to Mark Wielaard from comment #2) > > We upstream rpm test caught this? > > > > Recently Keith added error detection to find-debuginfo in upstream debugedit > > as part of https://sourceware.org/bugzilla/show_bug.cgi?id=30505 > > That should probably be backported to fedora 40. That might have caught this > > earlier, but I am afraid that it would break package builds (making this a > > hard error). > > If it's a hard error, it's easier to detect in gating in our rebuild tests > (assuming that it affects the packages being rebuilt). GDB should really > have some of those rebuild tests as required to pass for gating (if it > hasn't got them already). This is only half the solution, though. There's an outstanding RPM part of it, too (https://github.com/rpm-software-management/rpm/issues/3215). The reporter is aware of this, though, I think. Nonetheless, this only helps if gdb-add-index exits with non-zero exit status, since this is what the mass prebuilder can use. We currently have no test to actually verify that indexes get added to packages or whether they are correct. When we use our automated testing, that infra tests DejaGNU target boards unix, native-gdbserver, and native-extended-gdbserver. We are discussing modifying this list to include cc-with-gdb-index or one of the related boards... This needs some investigation to see if this is sufficient, though, and I am starting that investigation immediately. (In reply to Mark Wielaard from comment #2) > We upstream rpm test caught this? Yup, starting here: https://github.com/rpm-software-management/rpm/actions/runs/10697321342/job/29654258846, suddenly failing on a doc-only change. (In reply to Panu Matilainen from comment #5) > (In reply to Mark Wielaard from comment #2) > > Which upstream rpm test caught this? > > Yup, starting here: > https://github.com/rpm-software-management/rpm/actions/runs/10697321342/job/ > 29654258846, suddenly failing on a doc-only change. Could you make the logs public? Oh, I thought these *are* public... I've no idea where that is set.
In any case, the failing test is just:
---
# Build a package that has some debuginfo
rundebug rpmbuild --quiet \
--define "_include_gdb_index 1" \
-ba ${RPMDATA}/SPECS/hello2.spec
# Unpack the debuginfo rpms so we can check the .debug files.
rpm2cpio ${RPMTEST}/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
| cpio -diu --quiet
# Check that gdb-add-index has ran and a .gdb_index section has been added
readelf -S ./usr/lib/debug/usr/local/bin/hello2*.debug \
| grep gdb_index | cut -c8-17
stderr:
1 block
--- - 2024-09-04 07:47:44.314159144 +0000
+++ /srv/rpmtests.dir/at-groups/388/stdout 2024-09-04 07:47:44.311578576 +0000
@@ -1,2 +1 @@
-.gdb_index
388. rpmbuild.at:1831: 388. rpmbuild debuginfo gdb index included (rpmbuild.at:1831): FAILED (rpmbuild.at:1834)
---
Not a whole lot to see, that's why I added the manual reproducer step in the description.
Thanks. So adding some debug output shows at least the actual gdb-add-index going ok: gdb-add-index /home/mark/rpmbuild/BUILDROOT/popt-1.19-7.fc42.x86_64/usr/lib64/libpopt.so.0.0.2 /usr/bin/gdb --batch -nx -iex set auto-load no -iex set debuginfod enabled off -ex file /home/mark/rpmbuild/BUILDROOT/popt-1.19-7.fc42.x86_64/usr/lib64/libpopt.so.0.0.2 -ex save gdb-index /home/mark/rpmbuild/BUILDROOT/popt-1.19-7.fc42.x86_64/usr/lib64 objcopy --add-section .gdb_index=/home/mark/rpmbuild/BUILDROOT/popt-1.19-7.fc42.x86_64/usr/lib64/libpopt.so.0.0.2.gdb-index --set-section-flags .gdb_index=readonly /home/mark/rpmbuild/BUILDROOT/popt-1.19-7.fc42.x86_64/usr/lib64/libpopt.so.0.0.2 /home/mark/rpmbuild/BUILDROOT/popt-1.19-7.fc42.x86_64/usr/lib64/libpopt.so.0.0.2 And it looks like libpopt.so.0.0.2 does contain a .gdb_index But in the end libpopt.so.0.0.2-1.19-7.fc42.x86_64.debug doesn't? It is dwz: dwz -h -r -j 1 -l 10000000 -L 110000000 ./usr/lib64/libpopt.so.0.0.2-1.19-7.fc42.x86_64.debug after which there is no more .gdb_index section And indeed when running the upstream dwz testsuite after the gdb update we get: Running /home/mark/src/dwz/testsuite/dwz.tests/dwz-tests.exp ... FAIL: gdb-add-index.sh === dwz Summary === # of expected passes 57 # of unexpected failures 1 # of unsupported tests 4 The above is with gdb 15.1-1.fc40 and binutils 14.2-3.fc40 With gdb 14.2-3.fc40 and the same binutils the upstream dwz testsuite passes: Running /home/mark/dwz/testsuite/dwz.tests/dwz-tests.exp ... === dwz Summary === # of expected passes 58 # of unsupported tests 4 So, some change in gdb caused dwz to fail updating/adding the .gdb_index. I haven't investigated yet which update or if it is a bug in gdb or dwz. So simpler reproducer:
$ echo "int main() {}" | gcc -xc -g -o frob - && gdb-add-index ./frob && dwz ./frob && eu-readelf -S ./frob | grep gdb_index; echo $?
[33] .gdb_index PROGBITS 0000000000000000 00003452 00002055 0 0 0 1
0
While with new gdb:
$ echo "int main() {}" | gcc -xc -g -o frob - && gdb-add-index ./frob && dwz ./frob && eu-readelf -S ./frob | grep gdb_index; echo $?
1
The "bug" is in dwz. It checks (ver < 4 || ver > 8). And the new gdb generates a gdb_index with version 9. Which dwz simply doesn't handle. Have to look at what the changes are in the new version. Upstream dwz bug https://sourceware.org/bugzilla/show_bug.cgi?id=32146 Untested upstream patch: https://sourceware.org/bugzilla/attachment.cgi?id=15694 FEDORA-2024-2b6731571c (dwz-0.15-8.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2024-2b6731571c FEDORA-2024-db61b51833 (dwz-0.15-8.fc40) has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-db61b51833 FEDORA-2024-2b6731571c has been pushed to the Fedora 41 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-2b6731571c` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-2b6731571c See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2024-db61b51833 has been pushed to the Fedora 40 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-db61b51833` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-db61b51833 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2024-2b6731571c (dwz-0.15-8.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2024-db61b51833 (dwz-0.15-8.fc40) has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report. *** Bug 2317225 has been marked as a duplicate of this bug. *** |