-
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
Fix VS debugger compensation for the new EH #98847
Conversation
In a recent fix, I've fixed a problem that VS debugger has with the new exception handling reporting correct address for a hardware exception on a stack trace. However, that has broken the JIT/opt/Vectorization/UnrollEqualsStartsWith test when it is run with tiered compilation disabled. In that test, the faulting instruction is the first one in a method and the compensation for the old EH issue has moved the address to the previous method. And then a call to PreserveStackTrace that the new EH ends up calling due to the way it propagates exceptions over internal native boundaries ends up asserting down in the DebugStackTrace::GetStackFramesInternal call chain, because the compensated address and the MethodDesc attached to it in the stack frame didn't match. This change moves the compensation to the DebugStackTrace::GetStackFramesFromException and only for the DAC code. That way only the debugger gets the compensated value.
The CI failure is the #98817 |
The simulation of this bug seems to be causing a cascade of problems. Do you have a plan for deleting the simulation of this bug and fixing the tests? |
@jkotas it will require fixing VS, not a test. The glass test has just uncovered the problem. I will work with VS folks to find out a fix that would still allow VS to work correctly with the older runtimes. And I don't really see a cascade of problems stemming from the previous workaround. The original workaround was correct for debugger but it has caused trouble for the runtime stuff and this change moves the fix to a debugger only place which is more appropriate. I have not caught the runtime trouble during local testing of that fix as it occurs in a specific test only when tiered compilation is off. |
The debugger also special-cases this for x64
@jkotas I have updated it to be x64 specific as the debugger also special cases this for x64 only. |
In a recent fix, I've fixed a problem that VS debugger has with the new exception handling reporting correct address for a hardware exception on a stack trace. However, that has broken the
JIT/opt/Vectorization/UnrollEqualsStartsWith test when it is run with tiered compilation disabled. In that test, the faulting instruction is the first one in a method and the compensation for the old EH issue has moved the address to the previous method. And then a call to PreserveStackTrace that the new EH ends up calling due to the way it propagates exceptions over internal native boundaries ends up asserting down in the DebugStackTrace::GetStackFramesInternal call chain, because the compensated address and the MethodDesc attached to it in the stack frame didn't match.
This change moves the compensation to the
DebugStackTrace::GetStackFramesFromException and only for the DAC code. That way only the debugger gets the compensated value.