From 80414e96ef5b5e110c52cd92265fb3a348e56a8b Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 23 May 2024 13:51:08 -0700 Subject: [PATCH 01/13] ILLink: Check for all expected warnings, then fail if any are unmatched (#102286) In Linker tests, we fail at the first ExpectedWarning that isn't matched, and print all the messages that haven't been matched yet, even though they may match another ExpectedWarning that just hasn't been processed yet. Instead, we should keep a list of all expected warnings that were missing report them at once along with all unmatched warnings. This makes it much easier to debug when a test is failing. --- .../TestCasesRunner/ResultChecker.cs | 76 ++++++++++++------- .../TestCasesRunner/TrimmingTestLogger.cs | 8 +- 2 files changed, 53 insertions(+), 31 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs index adee52bd4243d..aff0d6ba1e6b6 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; @@ -762,8 +763,11 @@ static IEnumerable GetAttributeProviders (AssemblyDefi void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logger, bool checkRemainingErrors) { - List loggedMessages = logger.GetLoggedMessages (); + ImmutableArray allMessages = logger.GetLoggedMessages (); + List unmatchedMessages = [..allMessages]; List<(ICustomAttributeProvider, CustomAttribute)> expectedNoWarningsAttributes = new (); + List missingMessageWarnings = []; + List unexpectedMessageWarnings = []; foreach (var attrProvider in GetAttributeProviders (original)) { foreach (var attr in attrProvider.CustomAttributes) { if (!IsProducedByLinker (attr)) @@ -776,27 +780,27 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge List matchedMessages; if ((bool) attr.ConstructorArguments[1].Value) - matchedMessages = loggedMessages.Where (m => Regex.IsMatch (m.ToString (), expectedMessage)).ToList (); + matchedMessages = unmatchedMessages.Where (m => Regex.IsMatch (m.ToString (), expectedMessage)).ToList (); else - matchedMessages = loggedMessages.Where (m => m.ToString ().Contains (expectedMessage)).ToList (); ; - Assert.IsTrue ( - matchedMessages.Count > 0, - $"Expected to find logged message matching `{expectedMessage}`, but no such message was found.{Environment.NewLine}Logged messages:{Environment.NewLine}{string.Join (Environment.NewLine, loggedMessages)}"); + matchedMessages = unmatchedMessages.Where (m => m.ToString ().Contains (expectedMessage)).ToList (); ; + if (matchedMessages.Count == 0) + missingMessageWarnings.Add ($"Expected to find logged message matching `{expectedMessage}`, but no such message was found.{Environment.NewLine}"); foreach (var matchedMessage in matchedMessages) - loggedMessages.Remove (matchedMessage); + unmatchedMessages.Remove (matchedMessage); } break; case nameof (LogDoesNotContainAttribute): { var unexpectedMessage = (string) attr.ConstructorArguments[0].Value; - foreach (var loggedMessage in loggedMessages) { - Assert.That (() => { - if ((bool) attr.ConstructorArguments[1].Value) - return !Regex.IsMatch (loggedMessage.ToString (), unexpectedMessage); - return !loggedMessage.ToString ().Contains (unexpectedMessage); - }, - $"Expected to not find logged message matching `{unexpectedMessage}`, but found:{Environment.NewLine}{loggedMessage.ToString ()}{Environment.NewLine}Logged messages:{Environment.NewLine}{string.Join (Environment.NewLine, loggedMessages)}"); + foreach (var loggedMessage in unmatchedMessages) { + bool isRegex = (bool) attr.ConstructorArguments[1].Value; + bool foundMatch = isRegex + ? Regex.IsMatch (loggedMessage.ToString (), unexpectedMessage) + : loggedMessage.ToString ().Contains (unexpectedMessage); + + if (foundMatch) + unexpectedMessageWarnings.Add ($"Expected to not find logged message matching `{unexpectedMessage}`, but found:{Environment.NewLine}{loggedMessage.ToString ()}"); } } break; @@ -833,7 +837,7 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge string expectedOrigin = null; bool expectedWarningFound = false; - foreach (var loggedMessage in loggedMessages) { + foreach (var loggedMessage in unmatchedMessages) { if (loggedMessage.Category != MessageCategory.Warning || loggedMessage.Code != expectedWarningCodeNumber) continue; @@ -892,7 +896,7 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge actualName.EndsWith ("get_" + expectedMember.Name) || actualName.EndsWith ("set_" + expectedMember.Name))) { expectedWarningFound = true; - loggedMessages.Remove (loggedMessage); + unmatchedMessages.Remove (loggedMessage); break; } if (memberDefinition is not MethodDefinition) @@ -901,13 +905,13 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge if (memberDefinition.Name == ".cctor" && (expectedMember is FieldDefinition || expectedMember is PropertyDefinition)) { expectedWarningFound = true; - loggedMessages.Remove (loggedMessage); + unmatchedMessages.Remove (loggedMessage); break; } if (memberDefinition.Name == ".ctor" && (expectedMember is FieldDefinition || expectedMember is PropertyDefinition || memberDefinition.DeclaringType.FullName == expectedMember.FullName)) { expectedWarningFound = true; - loggedMessages.Remove (loggedMessage); + unmatchedMessages.Remove (loggedMessage); break; } } @@ -917,7 +921,7 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge memberDefinition.DeclaringType.FullName == "Program" && memberDefinition.DeclaringType.Module.Assembly.Name.Name == expectedAssembly.Name.Name) { expectedWarningFound = true; - loggedMessages.Remove (loggedMessage); + unmatchedMessages.Remove (loggedMessage); break; } } @@ -925,14 +929,14 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge } else { if (LogMessageHasSameOriginMember (loggedMessage, attrProvider)) { expectedWarningFound = true; - loggedMessages.Remove (loggedMessage); + unmatchedMessages.Remove (loggedMessage); break; } continue; } expectedWarningFound = true; - loggedMessages.Remove (loggedMessage); + unmatchedMessages.Remove (loggedMessage); break; } @@ -945,11 +949,11 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge } + ": " : ""; - Assert.IsTrue (expectedWarningFound, - $"Expected to find warning: {(fileName != null ? fileName + (sourceLine != null ? $"({sourceLine},{sourceColumn})" : "") + ": " : "")}" + + if (!expectedWarningFound) + missingMessageWarnings.Add ($"Expected to find warning: {(fileName != null ? fileName + (sourceLine != null ? $"({sourceLine},{sourceColumn})" : "") + ": " : "")}" + $"warning {expectedWarningCode}: {expectedOriginString}" + $"and message containing {string.Join (" ", expectedMessageContains.Select (m => "'" + m + "'"))}, " + - $"but no such message was found.{Environment.NewLine}Logged messages:{Environment.NewLine}{string.Join (Environment.NewLine, loggedMessages)}"); + $"but no such message was found."); } break; @@ -972,7 +976,7 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge int? unexpectedWarningCodeNumber = unexpectedWarningCode == null ? null : int.Parse (unexpectedWarningCode.Substring (2)); MessageContainer? unexpectedWarningMessage = null; - foreach (var mc in logger.GetLoggedMessages ()) { + foreach (var mc in unmatchedMessages) { if (mc.Category != MessageCategory.Warning) continue; @@ -987,12 +991,28 @@ void VerifyLoggedMessages (AssemblyDefinition original, TrimmingTestLogger logge break; } - Assert.IsNull (unexpectedWarningMessage, - $"Unexpected warning found: {unexpectedWarningMessage}"); + if (unexpectedWarningMessage is not null) + { + unexpectedMessageWarnings.Add($"Unexpected warning found: {unexpectedWarningMessage}"); + } + } + + if (missingMessageWarnings.Any ()) + { + missingMessageWarnings.Add ("Unmatched Messages:" + Environment.NewLine); + missingMessageWarnings.AddRange (unmatchedMessages.Select (m => m.ToString ())); + missingMessageWarnings.Add (Environment.NewLine + "All Messages:" + Environment.NewLine); + missingMessageWarnings.AddRange (allMessages.Select (m => m.ToString ())); + Assert.Fail (string.Join (Environment.NewLine, missingMessageWarnings)); + } + + if (unexpectedMessageWarnings.Any()) + { + Assert.Fail (string.Join (Environment.NewLine, unexpectedMessageWarnings)); } if (checkRemainingErrors) { - var remainingErrors = loggedMessages.Where (m => Regex.IsMatch (m.ToString (), @".*(error | warning): \d{4}.*")); + var remainingErrors = unmatchedMessages.Where (m => Regex.IsMatch (m.ToString (), @".*(error | warning): \d{4}.*")); Assert.IsEmpty (remainingErrors, $"Found unexpected errors:{Environment.NewLine}{string.Join (Environment.NewLine, remainingErrors)}"); } diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingTestLogger.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingTestLogger.cs index f3b3213848e13..fabf6ac59dca7 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingTestLogger.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TrimmingTestLogger.cs @@ -1,7 +1,9 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; using System.Collections.Generic; +using System.Collections.Immutable; namespace Mono.Linker.Tests.TestCasesRunner { @@ -14,9 +16,9 @@ public TrimmingTestLogger () MessageContainers = new List (); } - public List GetLoggedMessages () + public ImmutableArray GetLoggedMessages () { - return MessageContainers; + return MessageContainers.ToImmutableArray(); } public void LogMessage (MessageContainer message) @@ -29,4 +31,4 @@ public void LogMessage (MessageContainer message) MessageContainers.Add (message); } } -} \ No newline at end of file +} From 59879adfdf26c3f13f48113f686a7204047d91bd Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 23 May 2024 13:54:21 -0700 Subject: [PATCH 02/13] Allow non-IMemberDefinition sources to be origin for event methods (#102613) There are some cases where an event may be marked by something that is not an IMemberDefinition, for example, an assembly level attribute. https://github.com/dotnet/runtime/pull/102528 made an assumption that this was not possible and threw in those cases. This reverts the change related to that assumption. Co-authored-by: Sven Boemer --- src/tools/illink/src/linker/Linker.Steps/MarkStep.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs index 7224e401c3e0c..d6cc0630a65d5 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs @@ -3508,9 +3508,7 @@ protected internal void MarkProperty (PropertyDefinition prop, in DependencyInfo protected internal virtual void MarkEvent (EventDefinition evt, in DependencyInfo reason, MessageOrigin origin) { - Debug.Assert (reason.Source is IMemberDefinition or null); - // Use reason as the origin for the event methods unless it's from a descriptor - origin = reason.Source is null ? origin : new MessageOrigin ((IMemberDefinition)reason.Source); + origin = reason.Source is IMemberDefinition member ? new MessageOrigin (member) : origin; DependencyKind dependencyKind = DependencyKind.EventMethod; MarkMethodIfNotNull (evt.AddMethod, new DependencyInfo (dependencyKind, evt), origin); From 097c8ab51ae9dea7a6217a4a9fbc34ce43ac33cf Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Thu, 23 May 2024 23:24:13 +0200 Subject: [PATCH 03/13] Disable W^X in Rosetta emulated x64 containers on macOS (#102509) * Disable W^X on x64 in rosetta based container The docker on macOS Arm64 uses Rosetta to run x64 containers. That has an effect on the double mapping. The Rosetta is unable to detect when an already executed code page is modified. So we cannot use double mapping on those containers. To detect that case, this change adds check that verifies that the double mapping works even when the code is modified. Close #102226 * Rework based on PR feedback * Check only for Rosetta * Enable the rosetta check for x86 too This will help WINE running 32 bit code under rosetta emulation on macOS. --- src/coreclr/minipal/CMakeLists.txt | 1 + src/coreclr/minipal/Unix/doublemapping.cpp | 33 ++++++----------- src/coreclr/minipal/Windows/doublemapping.cpp | 7 ++++ src/native/minipal/cpufeatures.c | 35 +++++++++++++++++++ src/native/minipal/cpufeatures.h | 1 + 5 files changed, 54 insertions(+), 23 deletions(-) diff --git a/src/coreclr/minipal/CMakeLists.txt b/src/coreclr/minipal/CMakeLists.txt index 3096237d2a2fe..78a1726af3e81 100644 --- a/src/coreclr/minipal/CMakeLists.txt +++ b/src/coreclr/minipal/CMakeLists.txt @@ -1,4 +1,5 @@ include_directories(.) +include_directories(${CLR_SRC_NATIVE_DIR}) if (CLR_CMAKE_HOST_UNIX) add_subdirectory(Unix) else (CLR_CMAKE_HOST_UNIX) diff --git a/src/coreclr/minipal/Unix/doublemapping.cpp b/src/coreclr/minipal/Unix/doublemapping.cpp index cb65e5e284e2b..67d516fb322a5 100644 --- a/src/coreclr/minipal/Unix/doublemapping.cpp +++ b/src/coreclr/minipal/Unix/doublemapping.cpp @@ -20,24 +20,13 @@ #define memfd_create(...) syscall(__NR_memfd_create, __VA_ARGS__) #endif // TARGET_LINUX && !MFD_CLOEXEC #include "minipal.h" +#include "minipal/cpufeatures.h" -#if defined(TARGET_OSX) && defined(TARGET_AMD64) -#include -#include +#ifdef TARGET_OSX -bool IsProcessTranslated() -{ - int ret = 0; - size_t size = sizeof(ret); - if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) == -1) - { - return false; - } - return ret == 1; -} -#endif // TARGET_OSX && TARGET_AMD64 +#include -#ifndef TARGET_OSX +#else // TARGET_OSX #ifdef TARGET_64BIT static const off_t MaxDoubleMappedSize = 2048ULL*1024*1024*1024; @@ -49,6 +38,12 @@ static const off_t MaxDoubleMappedSize = UINT_MAX; bool VMToOSInterface::CreateDoubleMemoryMapper(void** pHandle, size_t *pMaxExecutableCodeSize) { + if (minipal_detect_rosetta()) + { + // Rosetta doesn't support double mapping correctly + return false; + } + #ifndef TARGET_OSX #ifdef TARGET_FREEBSD @@ -78,14 +73,6 @@ bool VMToOSInterface::CreateDoubleMemoryMapper(void** pHandle, size_t *pMaxExecu *pHandle = (void*)(size_t)fd; #else // !TARGET_OSX -#ifdef TARGET_AMD64 - if (IsProcessTranslated()) - { - // Rosetta doesn't support double mapping correctly - return false; - } -#endif // TARGET_AMD64 - *pMaxExecutableCodeSize = SIZE_MAX; *pHandle = NULL; #endif // !TARGET_OSX diff --git a/src/coreclr/minipal/Windows/doublemapping.cpp b/src/coreclr/minipal/Windows/doublemapping.cpp index 0d7033b567056..9e8ddfed8e964 100644 --- a/src/coreclr/minipal/Windows/doublemapping.cpp +++ b/src/coreclr/minipal/Windows/doublemapping.cpp @@ -6,6 +6,7 @@ #include #include #include "minipal.h" +#include "minipal/cpufeatures.h" #define HIDWORD(_qw) ((ULONG)((_qw) >> 32)) #define LODWORD(_qw) ((ULONG)(_qw)) @@ -60,6 +61,12 @@ inline void *GetBotMemoryAddress(void) bool VMToOSInterface::CreateDoubleMemoryMapper(void **pHandle, size_t *pMaxExecutableCodeSize) { + if (minipal_detect_rosetta()) + { + // Rosetta doesn't support double mapping correctly. WINE on macOS ARM64 can be running under Rosetta. + return false; + } + *pMaxExecutableCodeSize = (size_t)MaxDoubleMappedSize; *pHandle = CreateFileMapping( INVALID_HANDLE_VALUE, // use paging file diff --git a/src/native/minipal/cpufeatures.c b/src/native/minipal/cpufeatures.c index a7c2ae737badc..a2ff83222140c 100644 --- a/src/native/minipal/cpufeatures.c +++ b/src/native/minipal/cpufeatures.c @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include "cpufeatures.h" #include "cpuid.h" @@ -473,3 +475,36 @@ int minipal_getcpufeatures(void) return result; } + +// Detect if the current process is running under the Apple Rosetta x64 emulator +bool minipal_detect_rosetta(void) +{ +#if defined(HOST_AMD64) || defined(HOST_X86) + // Check for CPU brand indicating emulation + int regs[4]; + char brand[49]; + + // Get the maximum value for extended function CPUID info + __cpuid(regs, (int)0x80000000); + if ((unsigned int)regs[0] < 0x80000004) + { + return false; // Extended CPUID not supported + } + + // Retrieve the CPU brand string + for (unsigned int i = 0x80000002; i <= 0x80000004; ++i) + { + __cpuid(regs, (int)i); + memcpy(brand + (i - 0x80000002) * sizeof(regs), regs, sizeof(regs)); + } + brand[sizeof(brand) - 1] = '\0'; + + // Check if CPU brand indicates emulation + if (strstr(brand, "VirtualApple") != NULL) + { + return true; + } +#endif // HOST_AMD64 || HOST_X86 + + return false; +} diff --git a/src/native/minipal/cpufeatures.h b/src/native/minipal/cpufeatures.h index a5a803e5d2888..472ce17833961 100644 --- a/src/native/minipal/cpufeatures.h +++ b/src/native/minipal/cpufeatures.h @@ -77,6 +77,7 @@ extern "C" #endif // __cplusplus int minipal_getcpufeatures(void); +bool minipal_detect_rosetta(void); #ifdef __cplusplus } From 4219e458f8a3151dab16224f22c99ed9d8481a6a Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Thu, 23 May 2024 14:31:51 -0700 Subject: [PATCH 04/13] [wasm] Optimize mmap and lock-free allocator * Use 64kb pages instead of 16kb pages in the lock-free allocator if custom mmap is active to reduce wasted memory * Request non-zeroed pages from custom mmap in lock free allocator, since all of its callers memset their allocations anyway --- src/mono/mono/sgen/sgen-internal.c | 1 + src/mono/mono/utils/lock-free-alloc.c | 2 +- src/mono/mono/utils/lock-free-alloc.h | 5 ++++- src/mono/mono/utils/mono-mmap-wasm.c | 2 +- src/mono/mono/utils/mono-mmap.h | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/sgen/sgen-internal.c b/src/mono/mono/sgen/sgen-internal.c index 6ff3e6fda9808..045e4c59bd803 100644 --- a/src/mono/mono/sgen/sgen-internal.c +++ b/src/mono/mono/sgen/sgen-internal.c @@ -15,6 +15,7 @@ #include "mono/sgen/sgen-gc.h" #include "mono/utils/lock-free-alloc.h" +#include "mono/utils/options.h" #include "mono/sgen/sgen-memory-governor.h" #include "mono/sgen/sgen-client.h" diff --git a/src/mono/mono/utils/lock-free-alloc.c b/src/mono/mono/utils/lock-free-alloc.c index 7826c27017848..dfbbd5ed6f7a9 100644 --- a/src/mono/mono/utils/lock-free-alloc.c +++ b/src/mono/mono/utils/lock-free-alloc.c @@ -125,7 +125,7 @@ static unsigned long prot_flags_for_activate (int activate) { unsigned long prot_flags = activate? MONO_MMAP_READ|MONO_MMAP_WRITE: MONO_MMAP_NONE; - return prot_flags | MONO_MMAP_PRIVATE | MONO_MMAP_ANON; + return prot_flags | MONO_MMAP_PRIVATE | MONO_MMAP_ANON | MONO_MMAP_NOZERO; } static gpointer diff --git a/src/mono/mono/utils/lock-free-alloc.h b/src/mono/mono/utils/lock-free-alloc.h index 5aa4e1ea90722..eefb9ed2701c5 100644 --- a/src/mono/mono/utils/lock-free-alloc.h +++ b/src/mono/mono/utils/lock-free-alloc.h @@ -45,8 +45,11 @@ typedef struct { MonoMemAccountType account_type; } MonoLockFreeAllocator; -// FIXME: On WASM the page size is 64KB, so this isn't enough. +#ifdef HOST_WASM +#define LOCK_FREE_ALLOC_SB_MAX_SIZE (mono_opt_wasm_mmap ? 65536 : 16384) +#else #define LOCK_FREE_ALLOC_SB_MAX_SIZE 16384 +#endif #define LOCK_FREE_ALLOC_SB_HEADER_SIZE (sizeof (gpointer)) #define LOCK_FREE_ALLOC_SB_USABLE_SIZE(block_size) ((block_size) - LOCK_FREE_ALLOC_SB_HEADER_SIZE) diff --git a/src/mono/mono/utils/mono-mmap-wasm.c b/src/mono/mono/utils/mono-mmap-wasm.c index aef7bfb9c3bed..b899068dfa417 100644 --- a/src/mono/mono/utils/mono-mmap-wasm.c +++ b/src/mono/mono/utils/mono-mmap-wasm.c @@ -119,7 +119,7 @@ valloc_impl (void *addr, size_t size, int flags, MonoMemAccountType type) if ((flags & MONO_MMAP_FIXED) && addr) return NULL; - ptr = mwpm_alloc_range (size, 1); + ptr = mwpm_alloc_range (size, (flags & MONO_MMAP_NOZERO) == 0); if (!ptr) return NULL; } else diff --git a/src/mono/mono/utils/mono-mmap.h b/src/mono/mono/utils/mono-mmap.h index fcf24bbea59c7..5a49853b0474f 100644 --- a/src/mono/mono/utils/mono-mmap.h +++ b/src/mono/mono/utils/mono-mmap.h @@ -23,6 +23,7 @@ enum { MONO_MMAP_FIXED = 1 << 7, MONO_MMAP_32BIT = 1 << 8, MONO_MMAP_JIT = 1 << 9, + /* do not zero the new pages */ MONO_MMAP_NOZERO = 1 << 10, }; From 8025156a0f3309bf181f00a3468d54a95bd5abf5 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Thu, 23 May 2024 14:32:13 -0700 Subject: [PATCH 05/13] [mono] Add unchecked version of stelem_ref interpreter opcode (#99829) * Introduce mint_stelem_ref_unchecked * Inline most of stelem_ref_unchecked in jiterpreter traces * Add more complete type check for stelem_ref_unchecked * Correctness fix and simplification for stelem_ref_unchecked --- .../runtime/jiterpreter-trace-generator.ts | 10 ++++++- src/mono/browser/runtime/jiterpreter.ts | 4 +-- src/mono/mono/mini/interp/interp.c | 9 +++++- src/mono/mono/mini/interp/mintops.def | 1 + src/mono/mono/mini/interp/transform.c | 29 +++++++++++++++++++ 5 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/mono/browser/runtime/jiterpreter-trace-generator.ts b/src/mono/browser/runtime/jiterpreter-trace-generator.ts index 3e9fba479e1b7..230c67733badf 100644 --- a/src/mono/browser/runtime/jiterpreter-trace-generator.ts +++ b/src/mono/browser/runtime/jiterpreter-trace-generator.ts @@ -3347,13 +3347,21 @@ function emit_arrayop (builder: WasmBuilder, frame: NativePointer, ip: MintOpcod append_ldloc(builder, getArgU16(ip, 2), WasmOpcode.i32_load); // value append_ldloc(builder, getArgU16(ip, 3), WasmOpcode.i32_load); - builder.callImport("stelem_ref"); + builder.callImport("stelemr_tc"); builder.appendU8(WasmOpcode.br_if); builder.appendULeb(0); append_bailout(builder, ip, BailoutReason.ArrayStoreFailed); builder.endBlock(); return true; } + case MintOpcode.MINT_STELEM_REF_UNCHECKED: { + // dest + append_getelema1(builder, ip, objectOffset, indexOffset, 4); + // &value (src) + append_ldloca(builder, valueOffset, 0); + builder.callImport("copy_ptr"); + return true; + } case MintOpcode.MINT_LDELEM_REF: elementSize = 4; elementGetter = WasmOpcode.i32_load; diff --git a/src/mono/browser/runtime/jiterpreter.ts b/src/mono/browser/runtime/jiterpreter.ts index bf77f28960384..9fc538c03f62d 100644 --- a/src/mono/browser/runtime/jiterpreter.ts +++ b/src/mono/browser/runtime/jiterpreter.ts @@ -285,7 +285,7 @@ function getTraceImports () { importDef("stfld_o", getRawCwrap("mono_jiterp_set_object_field")), importDef("cmpxchg_i32", getRawCwrap("mono_jiterp_cas_i32")), importDef("cmpxchg_i64", getRawCwrap("mono_jiterp_cas_i64")), - importDef("stelem_ref", getRawCwrap("mono_jiterp_stelem_ref")), + ["stelemr_tc", "stelemr", getRawCwrap("mono_jiterp_stelem_ref")], importDef("fma", getRawCwrap("fma")), importDef("fmaf", getRawCwrap("fmaf")), ]; @@ -649,7 +649,7 @@ function initialize_builder (builder: WasmBuilder) { WasmValtype.void, true ); builder.defineType( - "stelem_ref", + "stelemr", { "o": WasmValtype.i32, "aindex": WasmValtype.i32, diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 08023c81a4890..db76fa7c13732 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -6660,6 +6660,14 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_CASE(MINT_STELEM_I8) STELEM(gint64, gint64); MINT_IN_BREAK; MINT_IN_CASE(MINT_STELEM_R4) STELEM(float, float); MINT_IN_BREAK; MINT_IN_CASE(MINT_STELEM_R8) STELEM(double, double); MINT_IN_BREAK; + MINT_IN_CASE(MINT_STELEM_REF_UNCHECKED) { + MonoArray *o; + guint32 aindex; + STELEM_PROLOG(o, aindex); + mono_array_setref_fast ((MonoArray *) o, aindex, LOCAL_VAR (ip [3], MonoObject*)); + ip += 4; + MINT_IN_BREAK; + } MINT_IN_CASE(MINT_STELEM_REF) { MonoArray *o; guint32 aindex; @@ -6676,7 +6684,6 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += 4; MINT_IN_BREAK; } - MINT_IN_CASE(MINT_STELEM_VT) { MonoArray *o = LOCAL_VAR (ip [1], MonoArray*); NULL_CHECK (o); diff --git a/src/mono/mono/mini/interp/mintops.def b/src/mono/mono/mini/interp/mintops.def index d79d5cd30acac..7edb4f53e3fb7 100644 --- a/src/mono/mono/mini/interp/mintops.def +++ b/src/mono/mono/mini/interp/mintops.def @@ -413,6 +413,7 @@ OPDEF(MINT_STELEM_R8, "stelem.r8", 4, 0, 3, MintOpNoArgs) OPDEF(MINT_STELEM_REF, "stelem.ref", 4, 0, 3, MintOpNoArgs) OPDEF(MINT_STELEM_VT, "stelem.vt", 6, 0, 3, MintOpTwoShorts) OPDEF(MINT_STELEM_VT_NOREF, "stelem.vt.noref", 6, 0, 3, MintOpTwoShorts) +OPDEF(MINT_STELEM_REF_UNCHECKED, "stelem.ref.unchecked", 4, 0, 3, MintOpNoArgs) OPDEF(MINT_LDLEN, "ldlen", 3, 1, 1, MintOpNoArgs) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index c8d579bb9310c..a73656ad8f023 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -4945,6 +4945,35 @@ handle_stelem (TransformData *td, int op) interp_add_ins (td, op); td->sp -= 3; interp_ins_set_sregs3 (td->last_ins, td->sp [0].var, td->sp [1].var, td->sp [2].var); + + if (op == MINT_STELEM_REF) { + InterpVar *array_var = &td->vars [td->last_ins->sregs [0]], + *value_var = &td->vars [td->last_ins->sregs [2]]; + MonoClass *array_var_klass = mono_class_from_mono_type_internal (array_var->type), + *value_var_klass = mono_class_from_mono_type_internal (value_var->type); + + if (m_class_is_array (array_var_klass)) { + MonoClass *array_element_klass = m_class_get_element_class (array_var_klass); + // If lhs is T[] and rhs is T and T is sealed, we can skip the runtime typecheck + if ( + (array_element_klass == value_var_klass) && + m_class_is_sealed(value_var_klass) && + // HACK: Arrays are sealed, but it's possible to downcast string[][] to object[][], + // so we don't want to treat elements of array types as actually sealed. + // Our lhs of type object[][] might actually be of a different reference type. + !m_class_is_array(value_var_klass) + ){ + if (td->verbose_level > 2) + g_printf ( + "MINT_STELEM_REF_UNCHECKED for %s in %s::%s\n", + m_class_get_name (value_var_klass), + m_class_get_name (td->method->klass), td->method->name + ); + td->last_ins->opcode = MINT_STELEM_REF_UNCHECKED; + } + } + } + ++td->ip; } From a8bc8faa908d536ff8aceaa53ee38535fa63afd7 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 23 May 2024 17:21:46 -0700 Subject: [PATCH 06/13] Fix build break on osx/arm64 Debug (#102631) * fix build break on osx/arm64 Debug * remove constexpr * Revert "remove constexpr" This reverts commit e67ca1a4f46f1b00de48dd7a742b99418cd3f625. * Revert "fix build break on osx/arm64 Debug" This reverts commit dc5ad929fc17171a0635db37851530c901019012. * remove static constexpr --------- Co-authored-by: Kunal Pathak --- src/coreclr/jit/regset.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/coreclr/jit/regset.h b/src/coreclr/jit/regset.h index 20b55610594fc..99c7f8be6bc55 100644 --- a/src/coreclr/jit/regset.h +++ b/src/coreclr/jit/regset.h @@ -74,13 +74,8 @@ class RegSet bool rsModifiedRegsMaskInitialized; // Has rsModifiedRegsMask been initialized? Guards against illegal use. #endif // DEBUG -#ifdef SWIFT_SUPPORT - regMaskTP rsAllCalleeSavedMask; - regMaskTP rsIntCalleeSavedMask; -#else // !SWIFT_SUPPORT - static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // !SWIFT_SUPPORT + regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; public: regMaskTP rsGetModifiedRegsMask() const From ee3151531aa541ffadbd0b48dcc84b5b2d22812c Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Thu, 23 May 2024 22:54:36 -0700 Subject: [PATCH 07/13] Fix assembly name parsing in dotnet-pgo tool (#102634) Fixes #102630 --- .../tools/dotnet-pgo/TraceRuntimeDescToTypeSystemDesc.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/dotnet-pgo/TraceRuntimeDescToTypeSystemDesc.cs b/src/coreclr/tools/dotnet-pgo/TraceRuntimeDescToTypeSystemDesc.cs index 380aa017d9a7f..875eb67862a85 100644 --- a/src/coreclr/tools/dotnet-pgo/TraceRuntimeDescToTypeSystemDesc.cs +++ b/src/coreclr/tools/dotnet-pgo/TraceRuntimeDescToTypeSystemDesc.cs @@ -291,7 +291,7 @@ public ModuleDesc ResolveModuleID(long handle, bool throwIfNotFound = true) return null; } - minfo.Module = _context.ResolveAssembly(new AssemblyNameInfo(minfo.AssemblyName), throwIfNotFound); + minfo.Module = _context.ResolveAssembly(AssemblyNameInfo.Parse(minfo.AssemblyName), throwIfNotFound); return minfo.Module; } else From f4c9264fe8448fdf1f66eda04a582cbade40cd39 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan <96171496+mkhamoyan@users.noreply.github.com> Date: Fri, 24 May 2024 08:58:27 +0200 Subject: [PATCH 08/13] [wasm] Fix WebSocket failures on wasm test runs (#102366) Update test cases to skip on wasm from outerloop attribute. --- .../System/IO/StreamConformanceTests.cs | 6 ++++-- .../Cryptography/AlgorithmImplementations/DSA/DSAXml.cs | 2 +- .../System.Console/tests/WindowAndCursorProps.cs | 2 +- .../tests/DegreeOfParallelismTests.cs | 9 ++++++--- .../tests/QueryOperators/ZipTests.cs | 3 ++- .../System.Net.WebSockets/tests/WebSocketCreateTest.cs | 6 +++--- .../tests/System.IO.FileSystem.Tests/Directory/Delete.cs | 2 +- .../System.IO.FileSystem.Tests/File/EncryptDecrypt.cs | 2 +- .../tests/X509Certificates/CertTests.cs | 6 +++--- .../tests/X509Certificates/ChainTests.cs | 4 ++-- .../tests/X509Certificates/ExportTests.cs | 2 +- .../RevocationTests/DynamicRevocationTests.cs | 2 +- .../X509Certificates/RevocationTests/TimeoutTests.cs | 2 +- .../tests/FunctionalTests/RegexIgnoreCaseTests.cs | 2 +- 14 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 242a2099f0cab..c36ce7c6feb0a 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -1742,7 +1742,8 @@ from writeSize in new[] { 10 * 1024 * 1024 } from startWithFlush in new[] { false, true } select new object[] { mode, writeSize, startWithFlush }; - [OuterLoop] + [OuterLoop("May take several seconds", ~TestPlatforms.Browser)] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on browser")] [Theory] [MemberData(nameof(ReadWrite_Success_Large_MemberData))] public virtual async Task ReadWrite_Success_Large(ReadWriteMode mode, int writeSize, bool startWithFlush) => @@ -2438,7 +2439,8 @@ public static IEnumerable CopyToAsync_AllDataCopied_MemberData() => from useAsync in new bool[] { true, false } select new object[] { byteCount, useAsync }; - [OuterLoop] + [OuterLoop("May take several seconds", ~TestPlatforms.Browser)] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on browser")] [Theory] [InlineData(false)] [InlineData(true)] diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAXml.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAXml.cs index 9a959df1ada4f..69de7580f62e6 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAXml.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAXml.cs @@ -415,7 +415,7 @@ public static void TestWriteDeficientXParameters(bool includePrivateParameters) } [ConditionalFact(typeof(DSAFactory), nameof(DSAFactory.SupportsKeyGeneration))] - [OuterLoop("DSA key generation is very slow")] + [OuterLoop("DSA key generation is very slow", ~TestPlatforms.Browser)] public static void FromToXml() { using (DSA dsa = DSAFactory.Create()) diff --git a/src/libraries/System.Console/tests/WindowAndCursorProps.cs b/src/libraries/System.Console/tests/WindowAndCursorProps.cs index c54fa87f0e361..3f70f02019d6c 100644 --- a/src/libraries/System.Console/tests/WindowAndCursorProps.cs +++ b/src/libraries/System.Console/tests/WindowAndCursorProps.cs @@ -277,7 +277,7 @@ public static void Beep_Invoke_Success() } [Fact] - [OuterLoop] // makes noise, not very inner-loop friendly + [OuterLoop("makes noise, not very inner-loop friendly", ~TestPlatforms.Browser)] [PlatformSpecific(TestPlatforms.Windows)] public static void BeepWithFrequency_Invoke_Success() { diff --git a/src/libraries/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs b/src/libraries/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs index 69c4bb6933ee4..95404c7a3199f 100644 --- a/src/libraries/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/DegreeOfParallelismTests.cs @@ -40,7 +40,8 @@ public static IEnumerable NotLoadBalancedDegreeData(int[] counts, int[ [Theory] [MemberData(nameof(DegreeData), new[] { 1024 }, new[] { 1, 4, 512 })] - [OuterLoop] + [OuterLoop("Resource-intensive due to parallel processing", ~TestPlatforms.Browser)] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on browser")] public static void DegreeOfParallelism(Labeled> labeled, int count, int degree) { Assert.Equal(Functions.SumRange(0, count), labeled.Item.WithDegreeOfParallelism(degree).Sum()); @@ -93,7 +94,8 @@ public static void DegreeOfParallelism_Throttled_Pipelining(Labeled> labeled, int count, int degree) { ParallelQuery query = labeled.Item; @@ -111,7 +113,8 @@ public static void DegreeOfParallelism_Aggregate_Accumulator(Labeled> labeled, int count, int degree) { ParallelQuery query = labeled.Item; diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs index c952169b8c37f..6531bdaffbedc 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/ZipTests.cs @@ -179,7 +179,8 @@ public static void Zip_NotPipelined_Longrunning(Labeled> left // Zip with ordering on showed issues, but it was due to the ordering component. // This is included as a regression test for that particular repro. [Theory] - [OuterLoop] + [OuterLoop("Resource-intensive due to parallel processing", ~TestPlatforms.Browser)] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on browser")] [MemberData(nameof(ZipThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] public static void Zip_AsOrdered_ThreadedDeadlock(Labeled> left, int leftCount, Labeled> right, int rightCount, int degree) { diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs index 988f8e4eaaa92..e13d46fc708db 100644 --- a/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs +++ b/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs @@ -37,7 +37,7 @@ public void CreateFromStream_ValidBufferSizes_CreatesWebSocket() Assert.NotNull(CreateFromStream(new MemoryStream(), true, null, Timeout.InfiniteTimeSpan)); } - [OuterLoop("Uses external servers")] + [OuterLoop("Uses external servers", ~TestPlatforms.Browser)] [Theory] [MemberData(nameof(EchoServers))] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform.")] @@ -230,7 +230,7 @@ public async Task ReceiveAsync_ServerSplitHeader_ValidDataReceived() } } - [OuterLoop("Uses external servers")] + [OuterLoop("Uses external servers", ~TestPlatforms.Browser)] [Theory] [MemberData(nameof(EchoServersAndBoolean))] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform.")] @@ -272,7 +272,7 @@ public async Task WebSocketProtocol_CreateFromConnectedStream_CloseAsyncClosesSt } [ActiveIssue("https://github.com/dotnet/runtime/issues/28957")] - [OuterLoop("Uses external servers")] + [OuterLoop("Uses external servers", ~TestPlatforms.Browser)] [Theory] [MemberData(nameof(EchoServersAndBoolean))] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform.")] diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Directory/Delete.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Directory/Delete.cs index 5595984f7a1f7..afe8dc39fed3a 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Directory/Delete.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Directory/Delete.cs @@ -267,7 +267,7 @@ public void RecursiveDeleteWithTrailingSlash() [Fact] [PlatformSpecific(TestPlatforms.Windows)] - [OuterLoop("This test is very slow.")] + [OuterLoop("This test is very slow.", ~TestPlatforms.Browser)] public void RecursiveDelete_DeepNesting() { // Create a 2000 level deep directory and recursively delete from the root. diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/EncryptDecrypt.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/EncryptDecrypt.cs index 23faf099319b6..a98234894890f 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/EncryptDecrypt.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/EncryptDecrypt.cs @@ -29,7 +29,7 @@ public void NullArg_ThrowsException() // because EFS (Encrypted File System), its underlying technology, is not available on these operating systems. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer), nameof(PlatformDetection.IsNotWindowsHomeEdition))] [PlatformSpecific(TestPlatforms.Windows)] - [OuterLoop] // Occasional failures: https://github.com/dotnet/runtime/issues/12339 + [OuterLoop("Occasional failures", ~TestPlatforms.Browser)] // Occasional failures: https://github.com/dotnet/runtime/issues/12339 public void EncryptDecrypt_Read() { string tmpFileName = Path.GetTempFileName(); diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertTests.cs index a2479d92b7187..6f8a0b6c0bf87 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertTests.cs @@ -425,7 +425,7 @@ public static void X509Cert2Test() [ActiveIssue("https://github.com/dotnet/runtime/issues/26213")] [ConditionalFact] - [OuterLoop("May require using the network, to download CRLs and intermediates")] + [OuterLoop("May require using the network, to download CRLs and intermediates", ~TestPlatforms.Browser)] public void TestVerify() { bool success; @@ -861,7 +861,7 @@ public static void CertificateSha3Signed() } [ConditionalFact(typeof(PlatformSupport), nameof(PlatformSupport.PlatformCryptoProviderFunctionalP256))] - [OuterLoop("Hardware backed key generation takes several seconds.")] + [OuterLoop("Hardware backed key generation takes several seconds.", ~TestPlatforms.Browser)] public static void CreateCertificate_MicrosoftPlatformCryptoProvider_EcdsaKey() { using (CngPlatformProviderKey platformKey = new CngPlatformProviderKey(CngAlgorithm.ECDsaP256)) @@ -882,7 +882,7 @@ public static void CreateCertificate_MicrosoftPlatformCryptoProvider_EcdsaKey() } [ConditionalFact(typeof(PlatformSupport), nameof(PlatformSupport.PlatformCryptoProviderFunctionalRsa))] - [OuterLoop("Hardware backed key generation takes several seconds.")] + [OuterLoop("Hardware backed key generation takes several seconds.", ~TestPlatforms.Browser)] public static void CreateCertificate_MicrosoftPlatformCryptoProvider_RsaKey() { using (CngPlatformProviderKey platformKey = new CngPlatformProviderKey(CngAlgorithm.Rsa)) diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/ChainTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/ChainTests.cs index 210f36dcf6d57..c0e06c6a5a385 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/ChainTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/ChainTests.cs @@ -216,7 +216,7 @@ public static void TestResetMethod() /// and trusted root. It will fail to build any chain if those are not valid. /// [Fact] - [OuterLoop] + [OuterLoop("May take a long time on some platforms", ~TestPlatforms.Browser)] [SkipOnPlatform(TestPlatforms.Android, "Not supported on Android.")] public static void BuildChainExtraStoreUntrustedRoot() { @@ -656,7 +656,7 @@ public static void BuildChain_FailOnlyApplicationPolicy() } [ConditionalFact(nameof(TrustsMicrosoftDotComRoot))] - [OuterLoop(/* Modifies user certificate store */)] + [OuterLoop("Modifies user certificate store", ~TestPlatforms.Browser)] [SkipOnPlatform(PlatformSupport.MobileAppleCrypto, "Root certificate store is not accessible")] public static void BuildChain_MicrosoftDotCom_WithRootCertInUserAndSystemRootCertStores() { diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/ExportTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/ExportTests.cs index 37526125041e9..1ddfb8418774b 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/ExportTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/ExportTests.cs @@ -173,7 +173,7 @@ public static void ExportAsPfxWithPrivateKey() [Fact] [PlatformSpecific(TestPlatforms.Windows)] - [OuterLoop("Modifies user-persisted state")] + [OuterLoop("Modifies user-persisted state", ~TestPlatforms.Browser)] public static void ExportDoesNotCorruptPrivateKeyMethods() { string keyName = $"clrtest.{Guid.NewGuid():D}"; diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/DynamicRevocationTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/DynamicRevocationTests.cs index 56440ded4ed6c..015166f8f776c 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/DynamicRevocationTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/DynamicRevocationTests.cs @@ -10,7 +10,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests.RevocationTests { - [OuterLoop("These tests run serially at about 1 second each, and the code shouldn't change that often.")] + [OuterLoop("These tests run serially at about 1 second each, and the code shouldn't change that often.", ~TestPlatforms.Browser)] [ConditionalClass(typeof(DynamicRevocationTests), nameof(SupportsDynamicRevocation))] [SkipOnPlatform(TestPlatforms.Browser, "Browser doesn't support X.509 certificates")] public static partial class DynamicRevocationTests diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/TimeoutTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/TimeoutTests.cs index a0386f4e5c785..1e38859998d31 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/TimeoutTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/RevocationTests/TimeoutTests.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests.RevocationTests { - [OuterLoop("These tests exercise timeout properties which take a lot of time.")] + [OuterLoop("These tests exercise timeout properties which take a lot of time.", ~TestPlatforms.Browser)] [SkipOnPlatform(TestPlatforms.Browser, "Browser doesn't support X.509 certificates")] public static class TimeoutTests { diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexIgnoreCaseTests.cs b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexIgnoreCaseTests.cs index 1d8ff187bb722..df515f5d66958 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexIgnoreCaseTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexIgnoreCaseTests.cs @@ -149,7 +149,7 @@ public async Task SourceGenerator_Supports_All_Cultures() // This test takes a long time to run since it needs to compute all possible lowercase mappings across // 3 different cultures and then creates Regex matches for all of our engines for each mapping. - [OuterLoop] + [OuterLoop("Takes long time to run", ~TestPlatforms.Browser)] [ActiveIssue("https://github.com/dotnet/runtime/issues/67793")] [Theory] [MemberData(nameof(Unicode_IgnoreCase_TestData))] From 8ec2649b6a9042972853e69e208bb132da034c1f Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 24 May 2024 09:43:44 -0500 Subject: [PATCH 09/13] Use Sdk not installer flow for wasm build tests (#102624) * Use Sdk not installer flow for wasm build tests * Update Version.Details.xml Remove installer reference from Version.Details.xml * Update Versions.props * Update versions --- eng/Version.Details.xml | 12 ++++-------- eng/Versions.props | 9 ++++----- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3cea14dde4829..2eb61d37db729 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -386,14 +386,14 @@ 40e6b96cad11400acb5b8999057ac8ba748df940 - + https://github.com/dotnet/sdk - 190723c80d85721cdc58fd906e645c4029b947bb + a134a94cfb1209e4181072719d554eb232b51317 - + https://github.com/dotnet/sdk - 190723c80d85721cdc58fd906e645c4029b947bb + a134a94cfb1209e4181072719d554eb232b51317 @@ -410,10 +410,6 @@ https://github.com/NuGet/NuGet.Client 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 - - https://github.com/dotnet/installer - fa261b952d702c6bd604728fcbdb58ac071a22b1 - https://github.com/dotnet/node 308c7d0f1fa19bd1e7b768ad13646f5206133cdb diff --git a/eng/Versions.props b/eng/Versions.props index 4b3f455604c8c..6f7441b0be875 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,8 +80,8 @@ 0.2.0 - - 9.0.100-preview.5.24263.1 + + 9.0.100-preview.5.24272.19 9.0.0-beta.24272.5 9.0.0-beta.24272.5 @@ -253,9 +253,8 @@ 3.1.7 1.0.406601 - - 9.0.100-preview.5.24253.16 - $(MicrosoftDotnetSdkInternalVersion) + + $(MicrosoftDotNetApiCompatTaskVersion) 9.0.0-alpha.1.24175.1 $(MicrosoftNETRuntimeEmscriptenVersion) $(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion) From 62664f2e25194b404fe527d72a64b118936d853c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 10:01:32 -0500 Subject: [PATCH 10/13] [main] Update dependencies from dotnet/roslyn (#102606) * Update dependencies from https://github.com/dotnet/roslyn build 20240522.10 Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.11.0-2.24271.11 -> To Version 4.11.0-2.24272.10 * Update dependencies from https://github.com/dotnet/roslyn build 20240523.9 Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.11.0-2.24271.11 -> To Version 4.11.0-2.24273.9 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2eb61d37db729..a244af592a9a5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -360,17 +360,17 @@ https://github.com/dotnet/runtime-assets c185f58a7f75bd824a3cd820634cddf27e791d91 - + https://github.com/dotnet/roslyn - 40e6b96cad11400acb5b8999057ac8ba748df940 + ec93266ae18214bc9b67c5d9d8e6c001b9179789 - + https://github.com/dotnet/roslyn - 40e6b96cad11400acb5b8999057ac8ba748df940 + ec93266ae18214bc9b67c5d9d8e6c001b9179789 - + https://github.com/dotnet/roslyn - 40e6b96cad11400acb5b8999057ac8ba748df940 + ec93266ae18214bc9b67c5d9d8e6c001b9179789 https://github.com/dotnet/roslyn-analyzers @@ -381,9 +381,9 @@ 8dccccec1ce3bd2fb532ec77d7e092ab9d684db7 - + https://github.com/dotnet/roslyn - 40e6b96cad11400acb5b8999057ac8ba748df940 + ec93266ae18214bc9b67c5d9d8e6c001b9179789 diff --git a/eng/Versions.props b/eng/Versions.props index 6f7441b0be875..d09aea62fdbe9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,9 +42,9 @@ Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure they do not break the local dev experience. --> - 4.11.0-2.24271.11 - 4.11.0-2.24271.11 - 4.11.0-2.24271.11 + 4.11.0-2.24273.9 + 4.11.0-2.24273.9 + 4.11.0-2.24273.9