diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index 1b38cbd3efa37..8e8bde2b45092 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -23,7 +23,7 @@ The .NET Foundation licenses this file to you under the MIT license. lld lld bfd - 1572864 + 1572864 diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets index dfd432a77805c..49a0d7cf9e165 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets @@ -33,6 +33,7 @@ The .NET Foundation licenses this file to you under the MIT license. CONSOLE eventpipe-disabled eventpipe-enabled + 1572864 @@ -94,6 +95,7 @@ The .NET Foundation licenses this file to you under the MIT license. + diff --git a/src/coreclr/pal/src/init/pal.cpp b/src/coreclr/pal/src/init/pal.cpp index c88febfc26162..606bd5311522c 100644 --- a/src/coreclr/pal/src/init/pal.cpp +++ b/src/coreclr/pal/src/init/pal.cpp @@ -288,6 +288,14 @@ InitializeDefaultStackSize() } } +#ifdef HOST_APPLE + // Match Windows stack size + if (g_defaultStackSize == 0) + { + g_defaultStackSize = 1536 * 1024; + } +#endif + #ifdef ENSURE_PRIMARY_STACK_SIZE if (g_defaultStackSize == 0) { diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index 8a7acf0800596..bbf437b40207e 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -4475,7 +4475,6 @@ public static void DCS_TypeWithPrimitiveKnownTypes() Assert.NotNull(actual); } - [ActiveIssue("https://github.com/dotnet/runtime/issues/1417", TestPlatforms.OSX)] [SkipOnPlatform(TestPlatforms.Browser, "Causes a stack overflow")] [Fact] public static void DCS_DeeplyLinkedData() diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs index b426a576d982b..2800a5e9e24c4 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs @@ -1223,7 +1223,7 @@ public static void RunLazyCancellationTests_Negative() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/2084", TestRuntimes.Mono)] + [SkipOnPlatform(TestPlatforms.Browser, "Causes a stack overflow")] public static void LongContinuationChain_ContinueWith_DoesNotStackOverflow() { const int DiveDepth = 12_000; diff --git a/src/native/libs/System.Native/pal_threading.c b/src/native/libs/System.Native/pal_threading.c index c96c7e8abd558..975e94acc476d 100644 --- a/src/native/libs/System.Native/pal_threading.c +++ b/src/native/libs/System.Native/pal_threading.c @@ -233,6 +233,14 @@ int32_t SystemNative_CreateThread(uintptr_t stackSize, void *(*startAddress)(voi error = pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED); assert(error == 0); +#ifdef HOST_APPLE + // Match Windows stack size + if (stackSize == 0) + { + stackSize = 1536 * 1024; + } +#endif + if (stackSize > 0) { if (stackSize < (uintptr_t)PTHREAD_STACK_MIN) diff --git a/src/tests/JIT/jit64/opt/cse/HugeArray1.csproj b/src/tests/JIT/jit64/opt/cse/HugeArray1.csproj index da12a89427f99..e6438b89c251b 100644 --- a/src/tests/JIT/jit64/opt/cse/HugeArray1.csproj +++ b/src/tests/JIT/jit64/opt/cse/HugeArray1.csproj @@ -3,10 +3,6 @@ true true - - - true Full diff --git a/src/tests/JIT/jit64/opt/cse/hugeSimpleExpr1.csproj b/src/tests/JIT/jit64/opt/cse/hugeSimpleExpr1.csproj index 7ae624af5725c..b32d6d0b3059b 100644 --- a/src/tests/JIT/jit64/opt/cse/hugeSimpleExpr1.csproj +++ b/src/tests/JIT/jit64/opt/cse/hugeSimpleExpr1.csproj @@ -4,10 +4,6 @@ true true - - - true Full diff --git a/src/tests/JIT/jit64/opt/rngchk/RngchkStress2_o.csproj b/src/tests/JIT/jit64/opt/rngchk/RngchkStress2_o.csproj index 88a3a33728468..24e01e4305a86 100644 --- a/src/tests/JIT/jit64/opt/rngchk/RngchkStress2_o.csproj +++ b/src/tests/JIT/jit64/opt/rngchk/RngchkStress2_o.csproj @@ -2,10 +2,6 @@ PdbOnly True - - - true diff --git a/src/tests/Regressions/coreclr/GitHub_87879/test87879.cs b/src/tests/Regressions/coreclr/GitHub_87879/test87879.cs new file mode 100644 index 0000000000000..7eb42eb899124 --- /dev/null +++ b/src/tests/Regressions/coreclr/GitHub_87879/test87879.cs @@ -0,0 +1,39 @@ +// 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.Threading; +using System.Runtime.CompilerServices; +using Xunit; + +namespace test87879; + +public class test87879 +{ + [Fact, SkipLocalsInit] + public static void TestEntryPoint() + { + //determine the expected available stack size 1.5MB, minus a little bit (384kB) for overhead. + var expectedSize = 0x180000 - 0x60000; + + //allocate on the stack as specified above + Span bytes = stackalloc byte[expectedSize]; + Consume(bytes); + Console.WriteLine("Main thread succeeded."); + + //repeat on a secondary thread + Thread t = new Thread([SkipLocalsInit] () => + { + Span bytes = stackalloc byte[expectedSize]; + Consume(bytes); + }); + t.Start(); + t.Join(); + Console.WriteLine("Secondary thread succeeded."); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void Consume(Span bytes) + { + } +} diff --git a/src/tests/Regressions/coreclr/GitHub_87879/test87879.csproj b/src/tests/Regressions/coreclr/GitHub_87879/test87879.csproj new file mode 100644 index 0000000000000..fdd2160133b6b --- /dev/null +++ b/src/tests/Regressions/coreclr/GitHub_87879/test87879.csproj @@ -0,0 +1,11 @@ + + + true + true + true + false + + + + +