[x86/Linux] Emit proper frame for ArrayOpStub #9688
Conversation
\CC @wateret @seanshpark |
@dotnet-bot test Windows_NT x86 Checked Build and Test please |
@parjong what was the problem in the unwind? Was it just unable to get past the frame of the asm helper (getting wrong EIP, ESP or both)? If that's the case, we should be able to fix it by adding CFI instructions to the asm helpers instead to teach the unwinder how to unwind from these. |
@janvorli An exception is throw inside Here is the stack trace when hitting the issue:
|
@parjong oh, thanks for the explanation. But then the fixed worries me. The thing is that we unwind the stub that's generated as asm as native code using the libunwind. But that stub has no DWARF unwind info and it seems that the fact that libunwind can unwind through it is kind of luck (it probably has a fallback to use ebp if it doesn't find DWARF unwind info). |
I do not see any problems with it |
@janvorli As you pointed out, it seems that libunwind runs in fallback mode (based on minimal ebp frame). Non-volatile register fixup using helper frame (in 2nd pass) seems to mitigate the issues from incorrect register values (May this explain why this patch works), but I agree with you that it would be better to enable FEATURE_ARRAY_STUBS_AS_IL. I'll take a look. |
In x86/Linux, C++ unwinder failed to unwind the frame by ArrayOpStub as the current implementation does not emit a proper frame (discussed in #9687).
This commit revises ArrayOpStub to have a ebp frame to fix #9687.