Add missing pin to two tests and re-enable for GC stress (dotnet/coreclr#24738)
authorAndy Ayers <andya@microsoft.com>
Thu, 23 May 2019 17:35:15 +0000 (10:35 -0700)
committerGitHub <noreply@github.com>
Thu, 23 May 2019 17:35:15 +0000 (10:35 -0700)
Test was evidently assuming that because an object that referred to an array
was pinned, so was the array. Failure was intermittent, GC is not guaranteed
to move objects or to render their former contents inaccessible.

Fixes dotnet/coreclr#24173.
Fixes dotnet/coreclr#24464.

Commit migrated from https://github.com/dotnet/coreclr/commit/9271757d2c917c5650c459a4c3fa648c2968a591

src/coreclr/tests/src/JIT/Methodical/ELEMENT_TYPE_IU/_il_dbgu_fld.ilproj
src/coreclr/tests/src/JIT/Methodical/ELEMENT_TYPE_IU/_il_relu_fld.ilproj
src/coreclr/tests/src/JIT/Methodical/ELEMENT_TYPE_IU/u_fld.il

index b727f39..e4cfb9f 100644 (file)
@@ -10,9 +10,6 @@
     <OutputType>Exe</OutputType>
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
-
-    <!-- Test currently fails under GCStress. https://github.com/dotnet/coreclr/issues/24173 -->
-    <GCStressIncompatible>true</GCStressIncompatible>
   </PropertyGroup>
   <!-- Default configurations to help VS understand the configurations -->
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
index f58d18a..266aaf5 100644 (file)
@@ -10,8 +10,6 @@
     <OutputType>Exe</OutputType>
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
-    <!-- https://github.com/dotnet/coreclr/issues/24464 -->
-    <GCStressIncompatible>true</GCStressIncompatible>
   </PropertyGroup>
   <!-- Default configurations to help VS understand the configurations -->
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
index 4accb54..d93ee0f 100644 (file)
     {
                .entrypoint
                .maxstack  8
-               .locals (class Test.AA pinned, native unsigned int[0...], native unsigned int, int32)
+               .locals (class Test.AA pinned, native unsigned int[0...], native unsigned int, int32, native unsigned int[0...] pinned)
                newobj instance void Test.AA::.ctor()
                stloc.0
 
+               // test bug fix: make sure to pin Test.AA::m_ai
+               ldloc.0
+               ldfld native unsigned int[0...] Test.AA::m_ai
+               stloc 4
+
                ldc.i4 18
                stloc.2