ARM64: Fix for recording SP for handler.
authorKyungwoo Lee <kyulee@microsoft.com>
Tue, 12 Apr 2016 16:11:53 +0000 (09:11 -0700)
committerKyungwoo Lee <kyulee@microsoft.com>
Tue, 12 Apr 2016 16:12:15 +0000 (09:12 -0700)
Fixes https://github.com/dotnet/coreclr/issues/3701.

When GC occurs in a catch handler, we compare the current frame with the one
saved before the funclet was invoked.
The recorded SP address was wrong (offset by 16 byte), which caused FindParentStackFrameForStackWalk to null frame.
So, we ended up with assert on `ExceptionTracker::HasFrameBeenUnwoundByAnyActiveException(&m_crawl)`.
The issue was assembly helper, CallEHFunclet records FP instead of SP while SP is adjusted in prolog.

Commit migrated from https://github.com/dotnet/coreclr/commit/63554209e89d38785f2a1241939c490370e3efed

src/coreclr/src/vm/arm64/asmhelpers.asm
src/coreclr/tests/arm64/Tests.lst

index a12a484..55df26a 100644 (file)
@@ -972,7 +972,8 @@ UM2MThunk_WrapperHelper_RegArgumentsSetup
         ; X2 = address of X19 register in CONTEXT record; used to restore the non-volatile registers of CrawlFrame
         ; X3 = address of the location where the SP of funclet's caller (i.e. this helper) should be saved.
         ;
-        ; Save the SP of this function
+        ; Save the SP of this function. We cannot store SP directly.
+        mov fp, sp
         str fp, [x3]
 
         ldr fp, [x2, #80] ; offset of fp in CONTEXT relative to X19
index 4d52ab5..7f209c9 100644 (file)
@@ -2657,7 +2657,7 @@ RelativePath=JIT\Directed\ExcepFilters\fault\fault\fault.cmd
 WorkingDir=JIT\Directed\ExcepFilters\fault\fault
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;JIT;EXPECTED_PASS
 HostStyle=0
 [mixed.cmd_388]
 RelativePath=JIT\Directed\ExcepFilters\mixed\mixed\mixed.cmd
@@ -2685,7 +2685,7 @@ RelativePath=JIT\Directed\FaultHandlers\Nesting\Nesting\Nesting.cmd
 WorkingDir=JIT\Directed\FaultHandlers\Nesting\Nesting
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;JIT;EXPECTED_PASS
 HostStyle=0
 [Simple.cmd_392]
 RelativePath=JIT\Directed\FaultHandlers\Simple\Simple\Simple.cmd
@@ -13101,7 +13101,7 @@ RelativePath=JIT\jit64\regress\ndpw\14888\objectusedonlyinhandler\objectusedonly
 WorkingDir=JIT\jit64\regress\ndpw\14888\objectusedonlyinhandler
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [simple.cmd_1901]
 RelativePath=JIT\jit64\regress\ndpw\160545\simple\simple.cmd
@@ -20549,28 +20549,28 @@ RelativePath=JIT\Methodical\eh\interactions\gcincatch_d\gcincatch_d.cmd
 WorkingDir=JIT\Methodical\eh\interactions\gcincatch_d
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [gcincatch_do.cmd_2994]
 RelativePath=JIT\Methodical\eh\interactions\gcincatch_do\gcincatch_do.cmd
 WorkingDir=JIT\Methodical\eh\interactions\gcincatch_do
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [gcincatch_r.cmd_2995]
 RelativePath=JIT\Methodical\eh\interactions\gcincatch_r\gcincatch_r.cmd
 WorkingDir=JIT\Methodical\eh\interactions\gcincatch_r
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [gcincatch_ro.cmd_2996]
 RelativePath=JIT\Methodical\eh\interactions\gcincatch_ro\gcincatch_ro.cmd
 WorkingDir=JIT\Methodical\eh\interactions\gcincatch_ro
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [rangecheckinfinally_d.cmd_2997]
 RelativePath=JIT\Methodical\eh\interactions\rangecheckinfinally_d\rangecheckinfinally_d.cmd
@@ -21452,28 +21452,28 @@ RelativePath=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_d\
 WorkingDir=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_d
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;GC_GEN0;ISSUE_3701;REL_PASS
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [throwinfinallyrecursive_20_do.cmd_3123]
 RelativePath=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_do\throwinfinallyrecursive_20_do.cmd
 WorkingDir=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_do
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;GC_GEN0;ISSUE_3701;REL_PASS
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [throwinfinallyrecursive_20_r.cmd_3124]
 RelativePath=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_r\throwinfinallyrecursive_20_r.cmd
 WorkingDir=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_r
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;GC_GEN0;ISSUE_3701;REL_PASS
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [throwinfinallyrecursive_20_ro.cmd_3125]
 RelativePath=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_ro\throwinfinallyrecursive_20_ro.cmd
 WorkingDir=JIT\Methodical\eh\nested\nonlocalexit\throwinfinallyrecursive_20_ro
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;GC_GEN0;ISSUE_3701;REL_PASS
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [throwinfinally_50_d.cmd_3126]
 RelativePath=JIT\Methodical\eh\nested\nonlocalexit\throwinfinally_50_d\throwinfinally_50_d.cmd
@@ -23734,7 +23734,7 @@ RelativePath=JIT\Methodical\flowgraph\dev10_bug679008\fgloop\fgloop.cmd
 WorkingDir=JIT\Methodical\flowgraph\dev10_bug679008\fgloop
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS;ISSUE_3701
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [fgloop2.cmd_3449]
 RelativePath=JIT\Methodical\flowgraph\dev10_bug679008\fgloop2\fgloop2.cmd
@@ -36656,7 +36656,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b92289\b92289\b92289.cmd
 WorkingDir=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b92289\b92289
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [b92568.cmd_5330]
 RelativePath=JIT\Regression\CLR-x86-JIT\V1-M13-RTM\b92568\b92568\b92568.cmd
@@ -37174,7 +37174,7 @@ RelativePath=JIT\Regression\CLR-x86-JIT\V1.2-M01\b16473\b16473\b16473.cmd
 WorkingDir=JIT\Regression\CLR-x86-JIT\V1.2-M01\b16473\b16473
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_FAIL;REL_PASS
+Categories=Pri0;EXPECTED_PASS
 HostStyle=0
 [b16570.cmd_5408]
 RelativePath=JIT\Regression\CLR-x86-JIT\V1.2-M01\b16570\b16570\b16570.cmd
@@ -58279,7 +58279,7 @@ RelativePath=Regressions\coreclr\0080\delete_next_card_table\delete_next_card_ta
 WorkingDir=Regressions\coreclr\0080\delete_next_card_table
 Expected=0
 MaxAllowedDurationSeconds=600
-Categories=Pri1;RT;EXPECTED_FAIL;NEED_TRIAGE;ISSUE_3104;ISSUE_3701
+Categories=Pri1;RT;EXPECTED_PASS
 HostStyle=0
 [genrecur.cmd_8426]
 RelativePath=Regressions\coreclr\0211\genrecur\genrecur.cmd