-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NativeAOT: dwarfdump --verify produces thousands of warnings and errors #72552
Comments
When I have issues with DWARF, I add following lines to
Approximately at this position Then I start from there and debug actual DWARF generation code. Since I'm debugging inside VS on Windows, so when working with Linux ARM JIT, I was passing |
Start with building the ObjWriter locally: Like @kant2002 said - ILC can crosscompile so you can debug on Windows, passing Dwarf generation is done here: https://github.com/dotnet/runtimelab/tree/feature/NativeAOT/src/coreclr/tools/aot/ObjWriter/debugInfo/dwarf I recommend glancing over the Dwarf spec - on a high level Dwarf involves a dictionary - the executable defines it's own vocabulary of abbreviations and the debug info refers to entries in the abbreviation list. E.g. here's a couple DW_TAG_subprogram abbreviations with DW_CHILDREN_yes set: |
Fixes https://github.com/dotnet/runtimelab/issues/1535. No warnings left with llvm-dwarfdump from LLVM 12.
Fixed in dotnet/runtimelab#164.
|
Reopened as the previous fix was just papering over the problems. One interesting thing I noticed was that many of the methods with errors called runtime intrinsics, so there may be something broken with DWARF info for intrinsics. |
At this point I think everything except for the overlapping ranges are resolved, which I've created a separate issue for: #72552 I'm going to close this broader issue as complete. |
I think this is the issue you meant to link: #83233 |
Running
llvm-dwarfdump-12 --verify
on NativeAOT-generated linux object files produces a tremendous number of validation warnings and errors. I first noticed this on my Switch project, but I was able to reproduce the problem even when testing with the basic "Hello World" program created bydotnet new console
.A full Hello World validation log for linux-x64 can be found in this gist if you want to wade through 236,000+ lines of dwarfdump output. 😄
Thankfully despite the verbosity of the output, there are only a few unique types of warnings and errors generated.
warning: DW_TAG_subprogram has DW_CHILDREN_yes but DIE has no children
(occurs 2585 times)error: Unable to resolve location list offset pair: Base address not defined
(occurs 17599 times)error: DIEs have overlapping address ranges:
(occurs 1683 times)error: DIE address ranges are not contained in its parent's ranges:
(occurs 793 times)The latter two appear to be related to exception handling, since they're almost always proceeded by a DW_TAG_try_block or DW_TAG_catch_block.
I'm pretty out of my depth here, but I would like to at least try to debug and fix these issues. Any recommendations for what I should be looking at in ObjWriter?
The text was updated successfully, but these errors were encountered: