You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NativeAOT symbols are broken on linux when publishing Release #77407
I would expect symbols to be worse, but not broken in this configuration.
It looks like change is caused by passing -O to clang when linking the binaries. Without -O, debugging symbols are present and functional. With -O, all symbols and stacks are broken.
Repro is in an Ubuntu 22.04 WSL instance with RC2, publishing helloworld using dotnet publish -r linux-x64 -c Release -bl.
Afterwards I open up the exe in GDB and I get the following:
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Reading symbols from ./bin/Release/net7.0/linux-x64/publish/aot1...
Dwarf Error: Could not find abbrev number 94 in CU at offset 0x0 [in module /home/andy/tmp/aot1/bin/Release/net7.0/linux-x64/publish/aot1]
(No debugging symbols found in ./bin/Release/net7.0/linux-x64/publish/aot1)
Function names are still around, but line number and file info is lost, as well as the symbol table.
You're right about -O though, I can't see that in the command line. I must have accidentally added that manually when altering the linking command to build against local bits. My clang invocation is
Did this fix make it into .NET 7.0.1? I'm still running into this problem in a non-trivial project with the 7.0.1 tooling.
(Interestingly, upgrading from 7.0.0 to 7.0.1 did fix this issue for a simple Hello World app, but I'm not sure if it's a direct result of this change or if it was a complete fluke.)
Activity
MichalStrehovsky commentedon Oct 27, 2022
Do you have repro steps? I just debugged a coredump in #77522 (comment) and stacks looked fine.
I can't find where we would be passing
-Oto clang in our build targets.agocke commentedon Oct 27, 2022
Repro is in an Ubuntu 22.04 WSL instance with RC2, publishing helloworld using
dotnet publish -r linux-x64 -c Release -bl.Afterwards I open up the exe in GDB and I get the following:
Function names are still around, but line number and file info is lost, as well as the symbol table.
You're right about
-Othough, I can't see that in the command line. I must have accidentally added that manually when altering the linking command to build against local bits. My clang invocation isagocke commentedon Oct 27, 2022
AH, my mistake, it's not the linking command that makes a difference, it's passing
-Oto ILC. Without it, debugging info is fine.Fix off-by-one error in DWARF reg-reg location (dotnet#317)
agocke commentedon Nov 17, 2022
Re-opening to track servicing fix.
Fix off-by-one error in DWARF reg-reg location (#317) (#321)
MichalStrehovsky commentedon Dec 23, 2022
The fix is in the LLVM objwriter release branch and we picked up the change in release/7.0 of this repo. I think this can be closed.
TheSpydog commentedon Jan 4, 2023
Did this fix make it into .NET 7.0.1? I'm still running into this problem in a non-trivial project with the 7.0.1 tooling.
(Interestingly, upgrading from 7.0.0 to 7.0.1 did fix this issue for a simple Hello World app, but I'm not sure if it's a direct result of this change or if it was a complete fluke.)
MichalStrehovsky commentedon Jan 5, 2023
I think it will only be in 7.0.2.
7.0.1 happened in mid-november: https://github.com/dotnet/runtime/milestone/107?closed=1 and this change only landed after: dotnet/llvm-project#321
Merge ObjWriter into dotnet/main and update to LLVM 14 API (#287)