From f7f124bc1720a600d6e41d0bff5fa9fe9ad283e7 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Wed, 3 Jul 2024 14:20:28 -0400 Subject: [PATCH 01/19] Error out when field size is too big --- src/coreclr/vm/classlayoutinfo.cpp | 3 +++ .../System.Private.CoreLib/src/Resources/Strings.resx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/coreclr/vm/classlayoutinfo.cpp b/src/coreclr/vm/classlayoutinfo.cpp index 8336f89066032..28e269e4e6869 100644 --- a/src/coreclr/vm/classlayoutinfo.cpp +++ b/src/coreclr/vm/classlayoutinfo.cpp @@ -148,6 +148,9 @@ namespace LayoutRawFieldInfo* pfwalk = *pSortWalk; RawFieldPlacementInfo* placementInfo = &pfwalk->m_placement; + if (placementInfo->m_size > FIELD_OFFSET_LAST_REAL_OFFSET) + COMPlusThrow(kTypeLoadException, W("TypeLoad_FieldSizeTooBig")); + BYTE alignmentRequirement = (BYTE)placementInfo->m_alignment; alignmentRequirement = min(alignmentRequirement, packingSize); diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index 964449ddbd611..ded1c7d9e3d0a 100644 --- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -3653,6 +3653,9 @@ Could not resolve type '{0}' in assembly '{1}'. + + Type load failed, because the size of a field is too big. + Access to the path is denied. From 8f7388e0d36b1fbc4aa79070399682f61ec5b84e Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Mon, 8 Jul 2024 19:08:15 -0400 Subject: [PATCH 02/19] Error out during type loading and add a test --- src/coreclr/vm/classlayoutinfo.cpp | 3 --- src/coreclr/vm/methodtablebuilder.cpp | 6 +++++ .../src/Resources/Strings.resx | 3 --- .../Regress/ExplicitSize/ExplicitSize.cs | 25 +++++++++++++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/coreclr/vm/classlayoutinfo.cpp b/src/coreclr/vm/classlayoutinfo.cpp index 28e269e4e6869..8336f89066032 100644 --- a/src/coreclr/vm/classlayoutinfo.cpp +++ b/src/coreclr/vm/classlayoutinfo.cpp @@ -148,9 +148,6 @@ namespace LayoutRawFieldInfo* pfwalk = *pSortWalk; RawFieldPlacementInfo* placementInfo = &pfwalk->m_placement; - if (placementInfo->m_size > FIELD_OFFSET_LAST_REAL_OFFSET) - COMPlusThrow(kTypeLoadException, W("TypeLoad_FieldSizeTooBig")); - BYTE alignmentRequirement = (BYTE)placementInfo->m_alignment; alignmentRequirement = min(alignmentRequirement, packingSize); diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 3e684a4bab3a1..992b55b89f2cd 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -3805,6 +3805,8 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList, DWORD dwR8Fields = 0; // Number of R8's the class has + UINT32 accumulatedSize = 0; + #ifdef FEATURE_64BIT_ALIGNMENT // Track whether any field in this type requires 8-byte alignment BOOL fFieldRequiresAlign8 = HasParent() ? GetParentMethodTable()->RequiresAlign8() : FALSE; @@ -4311,6 +4313,9 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList, pszFieldName ); + if (pLayoutFieldInfo) + accumulatedSize += pLayoutFieldInfo->m_placement.m_size; + // We're using FieldDesc::m_pMTOfEnclosingClass to temporarily store the field's size. // if (fIsByValue) @@ -4468,6 +4473,7 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList, } } // We processed all fields + IfFailThrow((accumulatedSize > FIELD_OFFSET_LAST_REAL_OFFSET) ? COR_E_TYPELOAD : S_OK); //#SelfReferencingStaticValueTypeField_Checks if (bmtFP->fHasSelfReferencingStaticValueTypeField_WithRVA) diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index ded1c7d9e3d0a..964449ddbd611 100644 --- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -3653,9 +3653,6 @@ Could not resolve type '{0}' in assembly '{1}'. - - Type load failed, because the size of a field is too big. - Access to the path is denied. diff --git a/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs b/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs index a67bc6796b864..fd2a11fc956bb 100644 --- a/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs +++ b/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs @@ -33,4 +33,29 @@ static unsafe void Test(Guid initialGuid, GUID* result) GUID guid = GetGUID(ref g); Unsafe.CopyBlock(result, &guid, (uint)sizeof(GUID)); } + + struct X + { + byte x; + BigArray a; + } + + struct Y + { + BigArray a; + byte y; + } + + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] + struct BigArray + { + } + + [Fact] + public static int TestLargeStructSize() + { + Assert.Equal(int.MaxValue, sizeof(BigArray)); + Assert.Throws(() => { sizeof(X); }); + Assert.Throws(() => { sizeof(Y); }); + } } From 528b73782b34e1fd2f02b9a079e9601c4cd90fdf Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Tue, 9 Jul 2024 11:02:33 -0400 Subject: [PATCH 03/19] Move test to a different file --- .../ManagedSequential/ManagedSequential.cs | 25 +++++++++++++++++++ .../Regress/ExplicitSize/ExplicitSize.cs | 25 ------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs index fd9408e6885ea..5ddfd2e05779d 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs @@ -105,4 +105,29 @@ public static void ManagedSequentialDisqualifiedClassDerivedFromManagedSequentia // Validate that the byte member is placed immediately after the object member. Assert.Equal(sizeof(nint), (int)Unsafe.ByteOffset(ref Unsafe.As(ref o.o), ref o.b)); } + + struct X + { + byte x; + BigArray a; + } + + struct Y + { + BigArray a; + byte y; + } + + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] + struct BigArray + { + } + + [Fact] + public static void TestLargeStructSize() + { + Assert.Equal(int.MaxValue, sizeof(BigArray)); + Assert.Throws(() => sizeof(X)); + Assert.Throws(() => sizeof(Y)); + } } diff --git a/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs b/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs index fd2a11fc956bb..a67bc6796b864 100644 --- a/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs +++ b/src/tests/Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize.cs @@ -33,29 +33,4 @@ static unsafe void Test(Guid initialGuid, GUID* result) GUID guid = GetGUID(ref g); Unsafe.CopyBlock(result, &guid, (uint)sizeof(GUID)); } - - struct X - { - byte x; - BigArray a; - } - - struct Y - { - BigArray a; - byte y; - } - - [StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] - struct BigArray - { - } - - [Fact] - public static int TestLargeStructSize() - { - Assert.Equal(int.MaxValue, sizeof(BigArray)); - Assert.Throws(() => { sizeof(X); }); - Assert.Throws(() => { sizeof(Y); }); - } } From 6c91570dffa7fe73b6fdb3d89cc1d45ed164c2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 11 Jul 2024 17:06:17 +0200 Subject: [PATCH 04/19] Make things loadable in the managed type system --- .../tools/Common/TypeSystem/Common/LayoutInt.cs | 14 ++++++++++++++ .../Common/MetadataFieldLayoutAlgorithm.cs | 2 +- .../TypeSystem/IL/Stubs/ComparerIntrinsics.cs | 5 +++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs b/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs index a2067d042252c..c533d9d12f0e8 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs @@ -92,6 +92,20 @@ public string ToStringInvariant() return new LayoutInt(checked(left._value - right._value)); } + public static LayoutInt AddThrowing(LayoutInt left, LayoutInt right, TypeDesc loadedType) + { + if (left.IsIndeterminate || right.IsIndeterminate) + return Indeterminate; + + int result = left._value + right._value; + + // Overflow if both arguments have the opposite sign of the result + if (((left._value ^ result) & (right._value ^ result)) < 0) + ThrowHelper.ThrowTypeLoadException(loadedType); + + return new LayoutInt(result); + } + public override bool Equals(object obj) { if (obj is LayoutInt) diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs index ff85e36436176..4bd6a3cb7a952 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs @@ -436,7 +436,7 @@ protected ComputedInstanceFieldLayout ComputeSequentialFieldLayout(MetadataType cumulativeInstanceFieldPos = AlignUpInstanceFieldOffset(cumulativeInstanceFieldPos, fieldSizeAndAlignment.Alignment, type.Context.Target); offsets[fieldOrdinal] = new FieldAndOffset(field, cumulativeInstanceFieldPos + offsetBias); - cumulativeInstanceFieldPos = checked(cumulativeInstanceFieldPos + fieldSizeAndAlignment.Size); + cumulativeInstanceFieldPos = LayoutInt.AddThrowing(cumulativeInstanceFieldPos, fieldSizeAndAlignment.Size, type); fieldOrdinal++; } diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs index 8835a98168582..15d4f2c80d7d1 100644 --- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs +++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections; using System.Collections.Generic; using Internal.TypeSystem; @@ -301,11 +302,11 @@ public static bool CanCompareValueTypeBits(MetadataType type, MethodDesc objectE private struct OverlappingFieldTracker { - private bool[] _usedBytes; + private BitArray _usedBytes; public OverlappingFieldTracker(MetadataType type) { - _usedBytes = new bool[type.InstanceFieldSize.AsInt]; + _usedBytes = new BitArray(type.InstanceFieldSize.AsInt); } public bool TrackField(FieldDesc field) From d3f062a75666c6d8701b2c05370c445660ef9b39 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Mon, 15 Jul 2024 12:57:33 -0400 Subject: [PATCH 05/19] Error out when size overflow the value that int could hold --- src/coreclr/vm/methodtablebuilder.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 992b55b89f2cd..2e1ca8dd66010 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -1764,6 +1764,9 @@ MethodTableBuilder::BuildMethodTableThrowing( bmtFP->NumInstanceFieldBytes = GetLayoutInfo()->m_cbManagedSize; + if ((int)bmtFP->NumInstanceFieldBytes != (INT64)bmtFP->NumInstanceFieldBytes) + BuildMethodTableThrowException(IDS_CLASSLOAD_FIELDTOOLARGE); + // For simple Blittable types we still need to check if they have any overlapping // fields and call the method SetHasOverlaidFields() when they are detected. // @@ -3805,8 +3808,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList, DWORD dwR8Fields = 0; // Number of R8's the class has - UINT32 accumulatedSize = 0; - #ifdef FEATURE_64BIT_ALIGNMENT // Track whether any field in this type requires 8-byte alignment BOOL fFieldRequiresAlign8 = HasParent() ? GetParentMethodTable()->RequiresAlign8() : FALSE; @@ -4313,9 +4314,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList, pszFieldName ); - if (pLayoutFieldInfo) - accumulatedSize += pLayoutFieldInfo->m_placement.m_size; - // We're using FieldDesc::m_pMTOfEnclosingClass to temporarily store the field's size. // if (fIsByValue) @@ -4473,7 +4471,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList, } } // We processed all fields - IfFailThrow((accumulatedSize > FIELD_OFFSET_LAST_REAL_OFFSET) ? COR_E_TYPELOAD : S_OK); //#SelfReferencingStaticValueTypeField_Checks if (bmtFP->fHasSelfReferencingStaticValueTypeField_WithRVA) From c843b9015f99fb41f7e39579fb0cd5e964675d32 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Tue, 16 Jul 2024 18:19:36 -0400 Subject: [PATCH 06/19] Update the threshold to FIELD_OFFSET_LAST_REAL_OFFSET --- src/coreclr/vm/methodtablebuilder.cpp | 2 +- .../ManagedSequential/LargeStructSize.cs | 42 +++++++++++++++++++ .../ManagedSequential/LargeStructSize.csproj | 8 ++++ .../ManagedSequential/ManagedSequential.cs | 25 ----------- 4 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs create mode 100644 src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.csproj diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 2e1ca8dd66010..8c95b783ae874 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -1764,7 +1764,7 @@ MethodTableBuilder::BuildMethodTableThrowing( bmtFP->NumInstanceFieldBytes = GetLayoutInfo()->m_cbManagedSize; - if ((int)bmtFP->NumInstanceFieldBytes != (INT64)bmtFP->NumInstanceFieldBytes) + if (bmtFP->NumInstanceFieldBytes > FIELD_OFFSET_LAST_REAL_OFFSET) BuildMethodTableThrowException(IDS_CLASSLOAD_FIELDTOOLARGE); // For simple Blittable types we still need to check if they have any overlapping diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs new file mode 100644 index 0000000000000..eae57ade81815 --- /dev/null +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Xunit; + +[SkipOnMono("This test suite tests CoreCLR and Crossgen2/NativeAOT-specific layout rules.")] +public unsafe class LargeStructSize +{ + struct X + { + byte x; + BigArray1 a; + } + + struct Y + { + BigArray1 a; + byte y; + } + + [StructLayout(LayoutKind.Sequential, Size = (((1<<27)-1)-6))] // FIELD_OFFSET_LAST_REAL_OFFSET is (((1<<27)-1)-6) + struct BigArray1 + { + } + + [StructLayout(LayoutKind.Sequential, Size = (((1<<27)-1)-6+1))] + struct BigArray2 + { + } + + [Fact] + public static void TestLargeStructSize() + { + Assert.Equal((((1<<27)-1)-6), sizeof(BigArray1)); + Assert.Throws(() => sizeof(BigArray2)); + Assert.Throws(() => sizeof(X)); + Assert.Throws(() => sizeof(Y)); + } +} diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.csproj new file mode 100644 index 0000000000000..efc38a9429de5 --- /dev/null +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.csproj @@ -0,0 +1,8 @@ + + + true + + + + + diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs index 5ddfd2e05779d..fd9408e6885ea 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/ManagedSequential.cs @@ -105,29 +105,4 @@ public static void ManagedSequentialDisqualifiedClassDerivedFromManagedSequentia // Validate that the byte member is placed immediately after the object member. Assert.Equal(sizeof(nint), (int)Unsafe.ByteOffset(ref Unsafe.As(ref o.o), ref o.b)); } - - struct X - { - byte x; - BigArray a; - } - - struct Y - { - BigArray a; - byte y; - } - - [StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] - struct BigArray - { - } - - [Fact] - public static void TestLargeStructSize() - { - Assert.Equal(int.MaxValue, sizeof(BigArray)); - Assert.Throws(() => sizeof(X)); - Assert.Throws(() => sizeof(Y)); - } } From 0ca301c13e3b62d9890f0bb0e6df87ba4994d8dd Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Tue, 30 Jul 2024 15:49:42 -0400 Subject: [PATCH 07/19] Change the threashold to int.MaxValue --- src/coreclr/vm/methodtablebuilder.cpp | 2 +- .../ManagedSequential/LargeStructSize.cs | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 8c95b783ae874..2e1ca8dd66010 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -1764,7 +1764,7 @@ MethodTableBuilder::BuildMethodTableThrowing( bmtFP->NumInstanceFieldBytes = GetLayoutInfo()->m_cbManagedSize; - if (bmtFP->NumInstanceFieldBytes > FIELD_OFFSET_LAST_REAL_OFFSET) + if ((int)bmtFP->NumInstanceFieldBytes != (INT64)bmtFP->NumInstanceFieldBytes) BuildMethodTableThrowException(IDS_CLASSLOAD_FIELDTOOLARGE); // For simple Blittable types we still need to check if they have any overlapping diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs index eae57ade81815..28ab31f8fe6fa 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs @@ -12,30 +12,24 @@ public unsafe class LargeStructSize struct X { byte x; - BigArray1 a; + BigArray a; } struct Y { - BigArray1 a; + BigArray a; byte y; } - [StructLayout(LayoutKind.Sequential, Size = (((1<<27)-1)-6))] // FIELD_OFFSET_LAST_REAL_OFFSET is (((1<<27)-1)-6) - struct BigArray1 - { - } - - [StructLayout(LayoutKind.Sequential, Size = (((1<<27)-1)-6+1))] - struct BigArray2 + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] + struct BigArray { } [Fact] public static void TestLargeStructSize() { - Assert.Equal((((1<<27)-1)-6), sizeof(BigArray1)); - Assert.Throws(() => sizeof(BigArray2)); + Assert.Equal(int.MaxValue, sizeof(BigArray)); Assert.Throws(() => sizeof(X)); Assert.Throws(() => sizeof(Y)); } From afd5c8f89865dd8cd49cb26cf0729eed02cd669b Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Thu, 1 Aug 2024 15:34:14 -0400 Subject: [PATCH 08/19] Fix mono struct size overflow issue --- src/mono/mono/metadata/class-init.c | 13 +++++- ...ructSize.cs => LargeStructSize_CoreCLR.cs} | 0 ....csproj => LargeStructSize_CoreCLR.csproj} | 0 .../ManagedSequential/LargeStructSize_Mono.cs | 42 +++++++++++++++++++ .../LargeStructSize_Mono.csproj | 8 ++++ 5 files changed, 61 insertions(+), 2 deletions(-) rename src/tests/Loader/classloader/SequentialLayout/ManagedSequential/{LargeStructSize.cs => LargeStructSize_CoreCLR.cs} (100%) rename src/tests/Loader/classloader/SequentialLayout/ManagedSequential/{LargeStructSize.csproj => LargeStructSize_CoreCLR.csproj} (100%) create mode 100644 src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs create mode 100644 src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index 0f5643e663f0f..9e7970ec1655c 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -310,6 +310,10 @@ mono_class_setup_fields (MonoClass *klass) /* Get the real size */ explicit_size = mono_metadata_packing_from_typedef (klass->image, klass->type_token, &packing_size, &real_size); + + if (real_size > (INT32_MAX - MONO_ABI_SIZEOF (MonoObject))) + mono_class_set_type_load_failure (klass, "Can't load type %s. The size is too big.", m_class_get_name (klass)); + if (explicit_size) instance_size += real_size; @@ -2322,7 +2326,12 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ } /*TypeBuilders produce all sort of weird things*/ g_assert (image_is_dynamic (klass->image) || field_offsets [i] > 0); - real_size = field_offsets [i] + size; + + long raw_real_size = (long)field_offsets [i] + size; + real_size = (int)raw_real_size; + + if (real_size != raw_real_size) + mono_class_set_type_load_failure (klass, "Can't load type %s. The size is too big.", m_class_get_name (klass)); } instance_size = MAX (real_size, instance_size); @@ -2530,7 +2539,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ } /*valuetypes can't be neither bigger than 1Mb or empty. */ - if (klass->valuetype && (klass->instance_size <= 0 || klass->instance_size > (0x100000 + MONO_ABI_SIZEOF (MonoObject)))) { + if (klass->valuetype && (klass->instance_size <= 0 || klass->instance_size > INT32_MAX)) { /* Special case compiler generated types */ /* Hard to check for [CompilerGenerated] here */ if (!strstr (klass->name, "StaticArrayInitTypeSize") && !strstr (klass->name, "$ArrayType")) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs similarity index 100% rename from src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.cs rename to src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj similarity index 100% rename from src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize.csproj rename to src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs new file mode 100644 index 0000000000000..6318b58b56bdb --- /dev/null +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Xunit; + +[SkipOnCoreClr("This test suite tests Mono-specific layout rules.")] +public unsafe class LargeStructSize +{ + struct X + { + byte x; + BigArray1 a; + } + + struct Y + { + BigArray1 a; + byte y; + } + + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 16)] + struct BigArray1 + { + } + + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 15)] + struct BigArray2 + { + } + + [Fact] + public static void TestLargeStructSize() + { + Assert.Equal(int.MaxValue - 16, sizeof(BigArray1)); + Assert.Throws(() => sizeof(BigArray2)); + Assert.Throws(() => sizeof(X)); + Assert.Throws(() => sizeof(Y)); + } +} diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj new file mode 100644 index 0000000000000..efc38a9429de5 --- /dev/null +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj @@ -0,0 +1,8 @@ + + + true + + + + + From b091a2acfb55ba359856dd68999e743ebd53a116 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Thu, 1 Aug 2024 16:26:32 -0400 Subject: [PATCH 09/19] Add signed/unsigned type conversion --- src/mono/mono/metadata/class-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index 9e7970ec1655c..588ab09b0c123 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -311,7 +311,7 @@ mono_class_setup_fields (MonoClass *klass) /* Get the real size */ explicit_size = mono_metadata_packing_from_typedef (klass->image, klass->type_token, &packing_size, &real_size); - if (real_size > (INT32_MAX - MONO_ABI_SIZEOF (MonoObject))) + if (real_size > GINT32_TO_UINT32(INT32_MAX - MONO_ABI_SIZEOF (MonoObject))) mono_class_set_type_load_failure (klass, "Can't load type %s. The size is too big.", m_class_get_name (klass)); if (explicit_size) From 4a57e6c52099421b436e84d80edd09e58a9338da Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 2 Aug 2024 17:34:01 -0400 Subject: [PATCH 10/19] Use gint64 instead of long, due to windows --- src/mono/mono/metadata/class-init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index 588ab09b0c123..22548e39fdb6c 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -2327,8 +2327,8 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ /*TypeBuilders produce all sort of weird things*/ g_assert (image_is_dynamic (klass->image) || field_offsets [i] > 0); - long raw_real_size = (long)field_offsets [i] + size; - real_size = (int)raw_real_size; + gint64 raw_real_size = (gint64)field_offsets [i] + size; + real_size = (gint32)raw_real_size; if (real_size != raw_real_size) mono_class_set_type_load_failure (klass, "Can't load type %s. The size is too big.", m_class_get_name (klass)); From 186acf8dff2bc2c93bc3cbea031cea788a3ba908 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:35:03 -0400 Subject: [PATCH 11/19] Update src/mono/mono/metadata/class-init.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aleksey Kliger (λgeek) --- src/mono/mono/metadata/class-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index 22548e39fdb6c..dfa417389975b 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -2538,7 +2538,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ } } - /*valuetypes can't be neither bigger than 1Mb or empty. */ + /*valuetypes can not be size 0 or bigger than 2gb. */ if (klass->valuetype && (klass->instance_size <= 0 || klass->instance_size > INT32_MAX)) { /* Special case compiler generated types */ /* Hard to check for [CompilerGenerated] here */ From 33145a2af230cb5a3b5bf41e5fca24d632766b83 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Mon, 5 Aug 2024 16:18:00 -0400 Subject: [PATCH 12/19] Fix test --- src/tests/Loader/Loader.csproj | 1 + .../ManagedSequential/LargeStructSize_Mono.cs | 55 +++++++++++++++---- .../LargeStructSize_Mono.csproj | 1 + src/tests/issues.targets | 3 + 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/tests/Loader/Loader.csproj b/src/tests/Loader/Loader.csproj index 31ffe922e6c74..3c4853a06bfc0 100644 --- a/src/tests/Loader/Loader.csproj +++ b/src/tests/Loader/Loader.csproj @@ -13,6 +13,7 @@ + diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs index 6318b58b56bdb..29f4705098929 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs @@ -6,37 +6,68 @@ using System.Runtime.InteropServices; using Xunit; -[SkipOnCoreClr("This test suite tests Mono-specific layout rules.")] public unsafe class LargeStructSize { - struct X + struct X_64 { byte x; - BigArray1 a; + BigArray_64_1 a; } - struct Y + struct Y_64 { - BigArray1 a; + BigArray_64_1 a; + byte y; + } + + struct X_32 + { + byte x; + BigArray_32_1 a; + } + + struct Y_32 + { + BigArray_32_1 a; byte y; } [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 16)] - struct BigArray1 + struct BigArray_64_1 + { + } + + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 16 - 1)] + struct BigArray_64_2 + { + } + + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 8)] + struct BigArray_32_1 { } - [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 15)] - struct BigArray2 + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue - 8 - 1)] + struct BigArray_32_2 { } [Fact] public static void TestLargeStructSize() { - Assert.Equal(int.MaxValue - 16, sizeof(BigArray1)); - Assert.Throws(() => sizeof(BigArray2)); - Assert.Throws(() => sizeof(X)); - Assert.Throws(() => sizeof(Y)); + if (Environment.Is64BitProcess) + { + Assert.Equal(int.MaxValue - (IntPtr.Size * 2), sizeof(BigArray_64_1)); + Assert.Throws(() => sizeof(BigArray_64_2)); + Assert.Throws(() => sizeof(X_64)); + Assert.Throws(() => sizeof(Y_64)); + } + else + { + Assert.Equal(int.MaxValue - (IntPtr.Size * 2), sizeof(BigArray_32_1)); + Assert.Throws(() => sizeof(BigArray_32_2)); + Assert.Throws(() => sizeof(X_32)); + Assert.Throws(() => sizeof(Y_32)); + } } } diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj index efc38a9429de5..2e2064c0d9f09 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj @@ -1,5 +1,6 @@ + true true diff --git a/src/tests/issues.targets b/src/tests/issues.targets index addf9bcf54622..f02a3d9f3b621 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -27,6 +27,9 @@ This test is to verify we are running mono, and therefore only makes sense on mono. + + This test is designed to run on mono only. + https://github.com/dotnet/runtime/issues/83658 From 6e0c43b2f523d67f5f15d28f219717a74ca7fa4b Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Tue, 6 Aug 2024 10:52:45 -0400 Subject: [PATCH 13/19] Add CoreCLR test for Explicit struct --- .../LargeStructSize_CoreCLR.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs index 28ab31f8fe6fa..c33f16c781597 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs @@ -15,12 +15,30 @@ struct X BigArray a; } + [StructLayout(LayoutKind.Explicit)] + struct X_explicit + { + [FieldOffset(0)] + byte x; + [FieldOffset(1)] + BigArray a; + } + struct Y { BigArray a; byte y; } + [StructLayout(LayoutKind.Explicit)] + struct Y_explict + { + [FieldOffset(0)] + BigArray b; + [FieldOffset(int.MaxValue)] + byte y; + } + [StructLayout(LayoutKind.Sequential, Size = int.MaxValue)] struct BigArray { @@ -31,6 +49,8 @@ public static void TestLargeStructSize() { Assert.Equal(int.MaxValue, sizeof(BigArray)); Assert.Throws(() => sizeof(X)); + Assert.Throws(() => sizeof(X_explicit)); Assert.Throws(() => sizeof(Y)); + Assert.Throws(() => sizeof(Y_explict)); } } From b557816e2cf5cfecb741f9e9f79a80b86c9a6341 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Tue, 6 Aug 2024 11:39:02 -0400 Subject: [PATCH 14/19] Address review feedback --- src/coreclr/vm/methodtablebuilder.cpp | 9 ++++++--- .../ManagedSequential/LargeStructSize_CoreCLR.cs | 10 ++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 2e1ca8dd66010..49fe35ce94daf 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -1764,9 +1764,6 @@ MethodTableBuilder::BuildMethodTableThrowing( bmtFP->NumInstanceFieldBytes = GetLayoutInfo()->m_cbManagedSize; - if ((int)bmtFP->NumInstanceFieldBytes != (INT64)bmtFP->NumInstanceFieldBytes) - BuildMethodTableThrowException(IDS_CLASSLOAD_FIELDTOOLARGE); - // For simple Blittable types we still need to check if they have any overlapping // fields and call the method SetHasOverlaidFields() when they are detected. // @@ -1797,6 +1794,12 @@ MethodTableBuilder::BuildMethodTableThrowing( } } + if (IsValueClass()) + { + if ((int)bmtFP->NumInstanceFieldBytes != (INT64)bmtFP->NumInstanceFieldBytes) + BuildMethodTableThrowException(IDS_CLASSLOAD_FIELDTOOLARGE); + } + if (CheckIfSIMDAndUpdateSize()) { totalDeclaredFieldSize = bmtFP->NumInstanceFieldBytes; diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs index c33f16c781597..ebff1d8b06fba 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs @@ -24,6 +24,15 @@ struct X_explicit BigArray a; } + [StructLayout(LayoutKind.Explicit)] + struct X_non_blittable + { + [FieldOffset(0)] + bool x; + [FieldOffset(1)] + BigArray a; + } + struct Y { BigArray a; @@ -50,6 +59,7 @@ public static void TestLargeStructSize() Assert.Equal(int.MaxValue, sizeof(BigArray)); Assert.Throws(() => sizeof(X)); Assert.Throws(() => sizeof(X_explicit)); + Assert.Throws(() => sizeof(X_non_blittable)); Assert.Throws(() => sizeof(Y)); Assert.Throws(() => sizeof(Y_explict)); } From 339bc63c90ddf53f446c408428bf85f69237a089 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Tue, 6 Aug 2024 16:56:59 -0400 Subject: [PATCH 15/19] Fixes Explicit struct size for Mono --- src/mono/mono/metadata/class-init.c | 8 +++++++- .../ManagedSequential/LargeStructSize_Mono.cs | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index dfa417389975b..c9fb03d1baa5c 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -2390,7 +2390,13 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ /* * Calc max size. */ - real_size = MAX (real_size, size + field_offsets [i]); + gint64 raw_real_size = (gint64)field_offsets [i] + size; + gint32 real_size_cast = (gint32)raw_real_size; + + if (real_size_cast != raw_real_size) + mono_class_set_type_load_failure (klass, "Can't load type %s. The size is too big.", m_class_get_name (klass)); + + real_size = MAX (real_size, real_size_cast); } /* check for incorrectly aligned or overlapped by a non-object field */ diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs index 29f4705098929..f99357a223552 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.cs @@ -14,6 +14,15 @@ struct X_64 BigArray_64_1 a; } + [StructLayout(LayoutKind.Explicit)] + struct X_explicit_64 + { + [FieldOffset(0)] + bool x; + [FieldOffset(1)] + BigArray_64_1 a; + } + struct Y_64 { BigArray_64_1 a; @@ -26,6 +35,15 @@ struct X_32 BigArray_32_1 a; } + [StructLayout(LayoutKind.Explicit)] + struct X_explicit_32 + { + [FieldOffset(0)] + bool x; + [FieldOffset(1)] + BigArray_32_1 a; + } + struct Y_32 { BigArray_32_1 a; @@ -60,6 +78,7 @@ public static void TestLargeStructSize() Assert.Equal(int.MaxValue - (IntPtr.Size * 2), sizeof(BigArray_64_1)); Assert.Throws(() => sizeof(BigArray_64_2)); Assert.Throws(() => sizeof(X_64)); + Assert.Throws(() => sizeof(X_explicit_64)); Assert.Throws(() => sizeof(Y_64)); } else @@ -67,6 +86,7 @@ public static void TestLargeStructSize() Assert.Equal(int.MaxValue - (IntPtr.Size * 2), sizeof(BigArray_32_1)); Assert.Throws(() => sizeof(BigArray_32_2)); Assert.Throws(() => sizeof(X_32)); + Assert.Throws(() => sizeof(X_explicit_32)); Assert.Throws(() => sizeof(Y_32)); } } From a0adb6d50b12e1b46dc8841be46e578873b48730 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Wed, 7 Aug 2024 11:26:45 -0400 Subject: [PATCH 16/19] Disable explicit struct tests on 32bit platforms, due to out of memory issue. --- .../ManagedSequential/LargeStructSize_CoreCLR.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs index ebff1d8b06fba..0588a19265b7a 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.cs @@ -58,9 +58,13 @@ public static void TestLargeStructSize() { Assert.Equal(int.MaxValue, sizeof(BigArray)); Assert.Throws(() => sizeof(X)); - Assert.Throws(() => sizeof(X_explicit)); - Assert.Throws(() => sizeof(X_non_blittable)); Assert.Throws(() => sizeof(Y)); - Assert.Throws(() => sizeof(Y_explict)); + if (Environment.Is64BitProcess) + { + // Explicit struct of big size triggers out of memory error instead of type load exception + Assert.Throws(() => sizeof(X_explicit)); + Assert.Throws(() => sizeof(X_non_blittable)); + Assert.Throws(() => sizeof(Y_explict)); + } } } From 39cc6f10cddde1189abcc1a63a28763ab6bcc70d Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Fri, 9 Aug 2024 13:40:58 -0400 Subject: [PATCH 17/19] Disable CoreCLR test for NativeAOT and crossgen --- .../ManagedSequential/LargeStructSize_CoreCLR.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj index efc38a9429de5..52f289a3b577a 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj @@ -1,6 +1,8 @@ true + true + false From 08daa6271951b3ff8fea0c6e38c62b6a20c6a8a7 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Sat, 10 Aug 2024 11:20:01 -0400 Subject: [PATCH 18/19] Fix test --- .../ManagedSequential/LargeStructSize_Mono.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj index 2e2064c0d9f09..3ce172359e290 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_Mono.csproj @@ -2,6 +2,8 @@ true true + true + false From 5fad351f37a66df11565cdf3f5068e567e0ccb85 Mon Sep 17 00:00:00 2001 From: fanyang-mono Date: Thu, 15 Aug 2024 10:46:35 -0400 Subject: [PATCH 19/19] Add RequiresProcessIsolation for CoreCLR test --- .../ManagedSequential/LargeStructSize_CoreCLR.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj index 52f289a3b577a..a13bdc9995d53 100644 --- a/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj +++ b/src/tests/Loader/classloader/SequentialLayout/ManagedSequential/LargeStructSize_CoreCLR.csproj @@ -3,6 +3,7 @@ true true false + true