Skip to content
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

Access to origin (without optimizations) Stack Trace in .NET 8+ with PGO #45826

Open
djfoxer opened this issue Jan 9, 2025 · 3 comments
Open
Assignees
Labels
untriaged Request triage from a team member

Comments

@djfoxer
Copy link

djfoxer commented Jan 9, 2025

Hi, with .NET8+ and PGO enabled code might be changed in runtime. So when we check Stack Trace at Environment.StackTrace or Exception.StackTrace we have stack changed by PGO and other optimizations. Can we somehow get access to origin Stack Trace (without optimizations)?

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jan 9, 2025
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Forgind
Copy link
Member

Forgind commented Jan 14, 2025

Hi @djfoxer!

I'm not 100% sure I understand your question, so please correct me if this doesn't make sense.

Enabling PGO means it should just spend more time optimizing certain code paths and predicting conditions more accurately based on your data. That might mean rearranging the order that it tries to execute things—not sure about that—but I imagine it ensures that any variable accesses have the right data at the time of access regardless of optimizations, or else it isn't an optimization but a bug.

What do you need the stack traces for? Most uses of stack traces I can think of are in testing or debugging, and for that I'd just disable optimizations in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants