Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: With the rebase of gdb to version 13.1, gdb on AArch64 is broken. The broken commit is https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=d88cb738e6a aarch64_remove_non_address_bits calls get_thread_regcache and that explodes when current_thread is NULL (e.g. in a codepath where there is no current thread yet). Reverting the commit fixes gdb. Version-Release number of selected component (if applicable): 13.1-1.fc38 Additional info: I'm forwarding this issue from a report in the Fedora Asahi Matrix room by Hector Martin (Cc'd to this BZ).
The repro on Arch Linux ARM is simply `gdb --args /usr/bin/plasmashell` and then `run`. I haven't had a chance to actually test on Fedora yet but I'd be very surprised if this works there, since it's an upstream bug (I'm trying to track down the issue that let me to use gdb in the first place before switching to Fedora to confirm everything).
Also to clarify: you probably need a machine that supports PAC for this to repro (e.g. an Apple M1/M2). I tested on an M2.
This issue was able to be reproduced on F37 and gdb-13.1-1 on both an M1 and M2 Macbook Air. gdb --args /usr/bin/plasmashell GNU gdb (GDB) Fedora Linux 13.1-1.fc37 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "aarch64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/plasmashell... Reading symbols from /usr/lib/debug/usr/bin/plasmashell-5.27.2-1.fc37.aarch64.debug... (gdb) run Starting program: /usr/bin/plasmashell This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.fedoraproject.org/> Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". ../../gdb/thread.c:85: internal-error: inferior_thread: Assertion `current_thread_ != nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0xaaaae004645f ??? 0xaaaae04ad127 ??? 0xaaaae04ad39b ??? 0xaaaae062bdf3 ??? 0xaaaae043095b ??? 0xaaaae0431313 ??? 0xaaaae032fcd3 ??? 0xaaaadff7dfbf ??? 0xaaaae042a4ab ??? 0xaaaae042aa0b ??? 0xaaaae042aab3 ??? 0xaaaae02cbe5f ??? 0xffff41385b1f ??? 0xffff41382683 ??? 0xaaaae022df0b ??? 0xaaaae022f643 ??? 0xaaaae042dcb7 ??? 0xaaaae01ecaef ??? 0xaaaae01fc18f ??? 0xaaaae062c2eb ??? 0xaaaae062ce7b ??? 0xaaaae0241e27 ??? 0xaaaae0243d37 ??? 0xaaaadff7178f ??? 0xffff815cb587 ??? 0xffff815cb65f ??? 0xaaaadff7a9af ??? 0xffffffffffffffff ??? --------------------- ../../gdb/thread.c:85: internal-error: inferior_thread: Assertion `current_thread_ != nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) y This is a bug, please report it. For instructions, see: <https://www.gnu.org/software/gdb/bugs/>. ../../gdb/thread.c:85: internal-error: inferior_thread: Assertion `current_thread_ != nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable.
I spoke to Luis (author of the PAC patch referenced in comment #1). He's aware of a couple of issues in this area which result in the above assert, and is actively working on these issues.
(In reply to Andrew Burgess from comment #4) > I spoke to Luis (author of the PAC patch referenced in comment #1). He's > aware of a couple of issues in this area which result in the above assert, > and is actively working on these issues. Do you have a timeline for a fix, or can we get a temporary revert while it's being worked on? It's a problem for Fedora Asahi development. :(
I think this is the fix: https://sourceware.org/pipermail/gdb-patches/2023-March/198000.html I don't know if we should wait for this to merge upstream before backporting though.
(In reply to Andrew Burgess from comment #6) > I think this is the fix: > > https://sourceware.org/pipermail/gdb-patches/2023-March/198000.html > > I don't know if we should wait for this to merge upstream before backporting > though. I'd prefer to wait for it to land upstream before backporting it.
After further discussion, I'll do a scratch build with a backport of the proposed patch and make it available to the reporter for testing.
I attempted to apply the patch mentioned by Andrew in Comment 6. However, it won't (and can't) apply because that patch modifies aarch64_remove_non_address_bits in gdb/aarch64-tdep.c. But, in GDB 13.1, this function is absent. The function aarch64_remove_non_address_bits() was introduced to upstream in the commit that Neal mentions in the Description. So... since that commit doesn't exist in GDB 13.1, I can neither revert it nor can I add a patch intended to fix it. I'd like to understand why Neal says that reverting that commit fixes this problem for GDB 13.1. Was that determined by building upstream GDB and reverting the commit? Or am I mistaken about GDB 13.1 not having that commit?
I found that I was mistaken in my remarks in Comment 9. Commit d88cb738e6a introduces aarch64_remove_non_address_bits to gdb/aarch64-linux-tdep.c. Upstream commit 6d0020873de moves it from the linux specific tdep file to gdb/aarch64-tdep.c. This latter file is the one that Luis's proposed upstream patch modifies. I'll try cherry-picking 6d0020873de and then applying Luis's proposed patch...
I have a scratch build which might fix this bug. I cherry-picked 6d0020873de and then applied this patch: https://sourceware.org/pipermail/gdb-patches/2023-March/198000.html. Please test the aarch64 RPMs whose links may be found on this page: https://koji.fedoraproject.org/koji/taskinfo?taskID=98780957 Here are direct links for the gdb and gdb-headless packages: https://kojipkgs.fedoraproject.org//work/tasks/957/98780957/gdb-13.1-2.fc38.aarch64.rpm https://kojipkgs.fedoraproject.org//work/tasks/957/98780957/gdb-headless-13.1-2.fc38.aarch64.rpm Please let me know if this (scratch) build fixes the bug.
I ran into the same issue running the python3.11 gdb tests on the COPR AArch64 machines. (In reply to Kevin Buettner from comment #11) > I have a scratch build which might fix this bug. I cherry-picked > 6d0020873de and then applied this patch: > https://sourceware.org/pipermail/gdb-patches/2023-March/198000.html. > > Please test the aarch64 RPMs whose links may be found on this page: > > https://koji.fedoraproject.org/koji/taskinfo?taskID=98780957 > This build fixes the failure for me.
FEDORA-2023-b771537e6e has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-b771537e6e
FEDORA-2023-36b5f94a63 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-36b5f94a63
FEDORA-2023-36b5f94a63 has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-36b5f94a63` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-36b5f94a63 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2023-b771537e6e has been pushed to the Fedora 38 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-b771537e6e See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2023-b771537e6e has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2023-36b5f94a63 has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report.
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days