-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
@dotnet/jit-contrib - can someone familiar with the jit take a look? |
@JosephTremoulet @BruceForstall Can you take a peek? |
I wonder if this failure exists/existed in our older ARM32 Windows builds/products. I believe this failure wouldn't occur then because the unwinder always subtracted 2 from LR when unwinding, which would put the PC address after unwind in the middle of the "bl " instruction, which would be in the correct EH region. The AMD64 OS unwinder didn't do this, hence this is required on AMD64. It's not clear why this code you're copying is required on ARM64; from my software archaeology it looks like it might have been put there unconditionally (that is, the |
(BTW, it looks like the CLR ABI doc could be improved to be more explicit and detailed about the various padding requirements) |
@jkotas @rahku Do you remember where the logic is/was for ARM to "always subtract two from PC after unwind to a frame"? I don't immediately see it in the unwinder_arm.cpp in the repo, and I'm not sure where I would look for this in the VM itself. I also don't have access to Windows sources to see if it really is there (which I assume would be copied in unwinder_arm.cpp). |
I don't recall seeing this |
Ok, the code is in ExceptionTracker::InitializeCrawlFrame():
For ARM, it's defined in src\debug\inc\arm\primitives.h:
|
@BruceForstall When I checked the execution trace, the code that you mentioned is not executed since Here is the content of
|
@BruceForstall I tried to find when
|
I looks like that the change of
|
I general, I think this later fix is closer to what should be done. It looks like both UnwindManagedExceptionPass1 and UnwindManagedExceptionPass2 call ProcessCLRException, so both probably need to be changed. I don't think you want to change it where you specify, though, because I think it only needs to be TRUE after the first unwind (and I'm not sure the RtlVirtualUnwind that is done to find the caller-sp counts). You'll presumably need to #ifdef this for ARM. I see that this is PAL-only code, which is why we probably didn't see it on Windows, which sets up the DISPATCHER_CONTEXT correctly before calling the per-frame personality routine during a RtlUnwind, that the PAL code is simulating. @janvorli - what do you think? |
When we get to one of the UnwindManagedExceptionPassX, we have already unwound the context to the first managed frame in the DispatchManagedException and so the PC would point right after a call except for the case when the exception was a hardware exception. |
@BruceForstall @janvorli I would like to ask your opinion on the following patch:
In my understanding, PC should be adjusted if the frame comes from any function call, and CONTEXT_UNWOUND_TO_CALL seems to be the flag that indicates such a case. When I checked, the above patch also resolves this issue (without the first patch that inserts bkpt after throw instruction). |
I like the change suggested by @janvorli better, because it isolates it to the PAL case, and doesn't affect the Windows side, and also makes PAL unwind work "more" like Windows already does. |
@BruceForstall @janvorli I revised the patch per feedback. It also resolves this issue when I checked. |
Enable the patch only for ARM32 in order to fix build break in other architecture.
Looks good to me, but @janvorli should have the final say. |
LGTM |
@mmitche something weird started to happen for the Ubuntu tests - bunch of them started to fail due to an attempt to load windows dll api-ms-win-core-file-l1-1-0.dll. So it seems that we're somehow using windows assemblies instead of the Linux ones for the test. Do you have any idea how that could happen? |
@dotnet-bot test Ubuntu x64 Checked Build and Test please |
@dotnet-bot test OSX x64 Checked Build and Test please |
@janvorli Is there any issue with Ubuntu x64 Checked Build and Test? I tried to find the details why it fails, but I can't find. Please let me know how to check the issue. |
Yes, we have issue with failing tests on Ubuntu and MacOSX. To find more info about the failures, click: Details / Console Output / . You will see that there are about 20 tests failing because of they are trying to load Windows .dlls - it is the known issue. |
@jkotas Oh, thank you. I finally find the log that shows why it fails. |
@parjong, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
@dotnet-bot test Ubuntu x64 Checked Build and Test please |
@dotnet-bot test OSX x64 Checked Build and Test please |
@janvorli @jkotas It looks like that CI works for Ubuntu x64 Checked, but does not work for OSX x64. For OSX x64, it seems that CI failed to access required artifacts:
Is there any update on OSX CI? |
The OS X failures look like infrastructure issue. Sorry about that... . |
@jkotas Thank you for kind answer 👍 |
* Fix dotnet/coreclr#4496 This commit revises legecy codegen to inserts a bkpt instruction if the current BB and next BB is not in the same exception handling region. This code is backported from ARM64 codegen. * Update ControlPcIsUnwound in UnwindManagedExceptionPassX * Enable only for ARM32 Enable the patch only for ARM32 in order to fix build break in other architecture. Commit migrated from dotnet/coreclr@0a88936
This commit revises legecy codegen to insert a bkpt instruction if the current BB
and next BB is not in the same exception handling region.
This code is backported from ARM64 codegen to fix #4496.