Bug 30240 - (linux/aarch) thread.c:86: internal-error: inferior_thread: Assertion `current_thread_ != nullptr' failed.
Summary: (linux/aarch) thread.c:86: internal-error: inferior_thread: Assertion `curren...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 13.2
Assignee: Luis Machado
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-17 15:49 UTC by Dmitry Neverov
Modified: 2023-05-08 01:12 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2023-03-17 00:00:00


Attachments
gdb.output (1.04 KB, text/plain)
2023-03-17 15:49 UTC, Dmitry Neverov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Neverov 2023-03-17 15:49:20 UTC
Created attachment 14755 [details]
gdb.output

Cannot debug simple hello world with gdb 13.1 or gdb built on commit bf8d2f92356768d329430c08dc81025243db636d (note that it includes the last commit fixing https://sourceware.org/bugzilla/show_bug.cgi?id=26761). Gdb 12.1 which comes with ubuntu 22.04 works fine. If that matters, it happens on ubuntu installed in parallels on mac.
Comment 1 Simon Marchi 2023-03-17 17:18:19 UTC
I think this is being addressed here:

https://inbox.sourceware.org/gdb-patches/20230316103904.1947447-1-luis.machado@arm.com/
Comment 2 Luis Machado 2023-03-17 17:34:55 UTC
Just to confirm, does the target machine support Pointer Authentication? When you say mac, is this M2-based?
Comment 3 Luis Machado 2023-03-17 17:36:40 UTC
For the record, I've seen this particular internal error happening in other cases, so it may not be exactly the issue with pauth handling for the aarch64 backend, hence why I wanted to confirm.
Comment 4 Dmitry Neverov 2023-03-20 08:28:46 UTC
I use Apple M1 Max. According to [1], Pointer Authentication is disabled by default and I didn't enable it. The document says it should work inside a linux VM anyway. Disasm for main or _start doesn't contain any pacio/autia instructions.

[1]: https://github.com/lelegard/arm-cpusysregs/blob/main/docs/arm64e-on-macos.md
Comment 5 Luis Machado 2023-03-23 10:45:44 UTC
Thanks for the info. For the pauth-related problem, a fix is under review and should hopefully make its way to master and gdb 13 soon.
Comment 6 Luis Machado 2023-03-27 05:31:15 UTC
I've pushed a fix to gdb master and gdb 13 for the pauth issue. Could you please verify it works now (if this is the bug you were hitting).
Comment 7 Dmitry Neverov 2023-03-31 08:33:53 UTC
Tried the commit 6967633c8b4902a7576e64c4ecf2ab6098c888f0, and it works! Thank you!
Comment 8 Luis Machado 2023-04-03 08:21:52 UTC
Great. I'm closing this one then. Please let us know if you see something off.
Comment 9 Joel Brobecker 2023-05-08 01:12:53 UTC
Setting the target milestone to 13.2 as a way to record that this fix was included in the upcoming GDB 13.2 release.