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

Exception handling not working correctly with InlinedCallFrames #34524

Closed
fadimounir opened this issue Apr 3, 2020 · 1 comment
Closed

Exception handling not working correctly with InlinedCallFrames #34524

fadimounir opened this issue Apr 3, 2020 · 1 comment
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI area-ExceptionHandling-coreclr GCStress tenet-reliability Reliability/stability related issue (stress, load problems, etc.)

Comments

@fadimounir
Copy link
Contributor

This bug was discovered based on the GC-Stress results I got from #33733

What's very interesting about it is that I wasn't able to see failing results (on Windows at least) in the Helix gcstress runs using the master branch (twice), however I can consistently and easily reproduce the failures locally.

The main issue here is a disconnect between what the JIT produces, and the assumption we had around it in the EH code:
https://github.com/dotnet/runtime/blob/master/src/coreclr/src/vm/exceptionhandling.cpp#L1824

Clearly this is not what the JIT does:
https://github.com/dotnet/runtime/blob/master/src/coreclr/src/jit/lower.cpp#L3497

This means that it is not correct to limit this define to only 32-bit targets:
https://github.com/dotnet/runtime/blob/master/src/coreclr/src/vm/exceptionhandling.h#L16

To fix this issue, we should have one standard for all targets (which is the case today anyways): The ICF is always initialized and linked in the prolog of any method that contains PInvokes, and unlinked at the method epilog for jitted code (R2R is a slightly different story)

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Apr 3, 2020
@fadimounir fadimounir self-assigned this Apr 3, 2020
@fadimounir fadimounir added area-ExceptionHandling-coreclr GCStress tenet-reliability Reliability/stability related issue (stress, load problems, etc.) and removed untriaged New issue has not been triaged by the area owner labels Apr 3, 2020
@fadimounir
Copy link
Contributor Author

Fixed

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI area-ExceptionHandling-coreclr GCStress tenet-reliability Reliability/stability related issue (stress, load problems, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants