Skip to content

Missing IL offset information sometimes causes bad stack traces #11027

Open
@evgrud

Description

@evgrud

The repro is here: https://github.com/evgrud/dotnet-stack-trace-offsets-issue

When running it on Release (with tiered compilation disabled) you will see that the stack trace of the exception that is thrown points to the beginning of the function while the correct location is at its end.

I tested it on Windows 10 x64.

I ran it with JITDump and it seems that during impImportCall some of the statements aren't getting IL offsets which later during the inlining are expanded into new basic blocks without IL offsets, which eventually during runtime results in a bad stack trace when an exception is thrown within those basic blocks.

I don't know if this issue should be fixed, but I can suggest reporting native offsets in those cases instead of pointing to the top of the function which could be way off.

category:implementation
theme:debug-info
skill-level:intermediate
cost:small

Metadata

Metadata

Assignees

Labels

JitUntriagedCLR JIT issues needing additional triagearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions