Michal Strehovský [Fri, 1 Apr 2022 05:33:57 +0000 (14:33 +0900)]
Don't produce unnecessary default interface methods (#67409)
Found this because it was asserting in one of the Pri-0 tests. We were trying to generate a special instantiating stub for an interface type that was not a dynamic interface castable implementation. I'm adding a regression test too because it has a visible outside behavior besides the assert.
Steve Pfister [Thu, 31 Mar 2022 23:11:09 +0000 (19:11 -0400)]
Add RemoteExecutor check in TestWaitForExitValidation (#67397)
https://github.com/dotnet/runtime/pull/64860 added a TestWaitForExitValidation test that would fail when run on platforms that did not support RemoteExecutor.
This change adds a `ConditionalTheory` to make sure that doesn't happen.
Jonathan Giannuzzi [Thu, 31 Mar 2022 22:54:58 +0000 (00:54 +0200)]
Load R2R images on osx-arm64 according to Apple's guidelines (#67118)
* Load R2R images on osx-arm64 according to Apple's guidelines
* Address review comments
* use MAP_PRIVATE for the mapped file
* correct the condition
* Use PAL_JitWriteProtect once per relocation
* Flush instruction cache during relocation on Apple Silicon
* Fix typo in comment
* Use PAL_JitWriteProtect in the same spots where protection is toggled
This allows to keep the instruction cache flush logic identical between platforms.
* Revert the change for Intel to avoid any regression
* Always unmap the file to avoid leaks + log errors
Maryam Ariyan [Thu, 31 Mar 2022 21:50:44 +0000 (17:50 -0400)]
Makes GetChildKeys more efficient (#67186)
Tomáš Rylek [Thu, 31 Mar 2022 21:11:14 +0000 (23:11 +0200)]
Mark architecture-specific tests as requiring process isolation (#67394)
As discussed offline, according to the current merged wrapper
architecture, for architecture-variant tests all versions
are compiled and the "wrong" variants get skipped at runtime
using the ConditionalFact attribute. Sadly for some of the ILPROJ
tests JITting the "wrong" variant ends up crashing the JIT during
Crossgen2 compilation. We can follow up by figuring out whether
the crash is intentional but for now a simple way to work around
this problem (hitting just a small number of tests) is to mark
them as out-of-process tests so that the wrong variants get
filtered out early and R2R compilation is not triggered for them.
Thanks
Tomas
SingleAccretion [Thu, 31 Mar 2022 20:57:44 +0000 (23:57 +0300)]
Fix missing side effect flags on HWI nodes (#67206)
* Set side-effect flags in constructor for HWIs
* Add test
* Experiment: NULL_CHECK LDOBJs
SingleAccretion [Thu, 31 Mar 2022 20:39:31 +0000 (23:39 +0300)]
Account for global stores in hoisting properly (#67213)
* Take HWI stores into account in hoisting
* Also fix ordinary stores while we're at it
The contract for whether the LHS of a global ASG(IND, ...)
should be marked with GLOB_REF is not clearly specified.
* Add tests
SingleAccretion [Thu, 31 Mar 2022 20:25:42 +0000 (23:25 +0300)]
Memory containment for `FIELD_LIST` operands on x86 (#65803)
* Remove "inst_RV_TT" usages from non-XARCH code
a) It is clearer and cheaper to directly use the emitter anyway.
b) "inst_RV_TT" will be made XARCH-only in an upcoming change.
* Refactor "inst_TT" and "inst_RV_TT"
a) Make them XARCH-only.
b) Rewrite them using "OperandDesc".
* Memory containment for FIELD_LIST operands on x86
Enable broader containment for FIELD_LIST operands on x86.
The primary benefits come from containing loads that long
decomposition has left (e. g. LCL_FLDs):
```diff
- mov ecx, dword ptr [ebp+08H]
- mov edx, dword ptr [ebp+0CH]
- push edx
- push ecx
+ push dword ptr [ebp+0CH]
+ push dword ptr [ebp+08H]
```
* emitIns_A: add function header
* Remove the "UNDONE: ..." printing
Insert an assert instead about what we expect and handle GCInfo-wise.
Radek Zikmund [Thu, 31 Mar 2022 19:26:58 +0000 (21:26 +0200)]
Fix Wrong exception for Open*Stream after connection is closed (#67342)
* Fix Wrong exception for Open*Stream after connection is closed
* Don't handle InvalidState
* Update src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
Ravi Kumar [Thu, 31 Mar 2022 17:34:47 +0000 (10:34 -0700)]
Port Access violation occurring in System.DirectoryServices.ActiveDirectory.ForestTrustRelationshipInformation fix from .netfx to .net-core (#66726)
* foresttrust port from dotnetfx
* fixed nullable reference error
Michal Strehovský [Thu, 31 Mar 2022 13:45:25 +0000 (22:45 +0900)]
Fix ordering in default interface method lookup (#67379)
* Fix ordering in default interface method lookup
The previous implementation would find a default implementation in the current type before looking for non-default implementation in the base. Default implementations should be looked at last.
In fact the default implementation in the current type is unreachable if there's a non-default implementation in the base type - the compiler shouldn't even have bothered to emit it into the dispatch map. That can be a separate fix - this fix is still logically correct and necessary to get variant dispatch corner cases correctly.
* Regression test
Zoltan Varga [Thu, 31 Mar 2022 09:26:55 +0000 (11:26 +0200)]
[mono][llvm] Fix an assert with --aot=llvmonly and -O=gsharedvt. (#67357)
Deopt is currently disabled for gsharedvt methods, so disable AOTing
gsharedvt methods with clauses to avoid hitting an assert in
emit_llvmonly_landing_pad ().
Elinor Fung [Thu, 31 Mar 2022 01:23:38 +0000 (18:23 -0700)]
Minor refactoring in MarshallingAttributeInfoParser (#67325)
Kevin Jones [Thu, 31 Mar 2022 01:22:11 +0000 (21:22 -0400)]
Always commit X.509 chain before Finish
For OpenSSL 3, we need to always commit the chain to clear out the untrusted intermediates. Otherwise, we started getting details about the partial chain that we don't map to codes.
This fixes the behavior so that an AKI/SKI mismatch reports as a partial chain.
Jan Vorlicek [Thu, 31 Mar 2022 00:33:17 +0000 (02:33 +0200)]
Fix a PAL filemapping test for macOS arm64 (#67352)
This test was disabled for macOS arm64, adding MEM_RESERVE_EXECUTABLE fixes the issue.
Bruce Forstall [Thu, 31 Mar 2022 00:28:28 +0000 (17:28 -0700)]
Disable test45929 for win-arm64 (#67363)
Tracking: https://github.com/dotnet/runtime/issues/60152
Bruce Forstall [Thu, 31 Mar 2022 00:27:06 +0000 (17:27 -0700)]
Enable all StructABI tests in pri-0 (#67362)
SingleAccretion [Wed, 30 Mar 2022 23:13:07 +0000 (02:13 +0300)]
Revert "Do not generate `TYP_STRUCT` `LCL_FLD` nodes (#66251)" (#67360)
This reverts commit
2453f16807b85b279efc26d17d6f20de87801c09.
Bruce Forstall [Wed, 30 Mar 2022 22:36:15 +0000 (15:36 -0700)]
Tweak OSR debugging document (#67366)
Grammar, consistency fixes
Omair Majid [Wed, 30 Mar 2022 21:42:41 +0000 (17:42 -0400)]
Show the actual value of the X09VerifyStatusCode on error
Right now, the Debug.Fail just shows the literal text `Unrecognized
X509VerifyStatusCode:Interop+Crypto+X509VerifyStatusCode`, which isn't
very helpful.
Ankit Jain [Wed, 30 Mar 2022 21:16:00 +0000 (17:16 -0400)]
perf: wasm: Collect helix logs, and artifacts when the build fails (#67248)
* perf: wasm: Collect helix logs, and artifacts when the build fails
This will be helpful in debugging build issues, and random crashes that
we have been seeing on helix.
* Fix misplaced double quote
* perf: Use '--run-isolated' with wasm projects
Bruce Forstall [Wed, 30 Mar 2022 20:47:49 +0000 (13:47 -0700)]
Fix SuperPMI implementation of `appendClassName` (#67280)
* Fix SuperPMI implementation of `appendClassName`
Change #67135 added more and different calls to `appendClassName`, exposing
that it was not correctly implemented in SuperPMI. Fix this, especially, to
handle the case of passing a zero length to determine the correct size output buffer.
Also, add `eeTryGetClassSize` to wrap `getClassSize` and use it in two cases in the
importer that only use the output in JitDump, but was preventing a clean JitDump
replay of some collections.
Change the JIT-EE GUID because the SuperPMI collection data structures were changed.
* Update semantics of `appendClassName` API
Document the semantics more clearly.
Update EE and crossgen2 to conform to the same semantics.
Notable changes:
1. ppBuf argument is allowed to be nullptr, if `*pnBufLen` is zero.
2. If `*pnBufLen` is greater than zero, `*ppBuf` and `*pnBufLen` are
advanced by the number of characters actually written rather than the
number in the full class name string. This will differ in the case of
truncation due to a small output buffer. The advance does not include
the null terminator. Thus, `*ppBuf` will point at the null terminator
on return, and `*pnBufLen` will be at least `1`.
3. The EE will copy as much as possible (i.e., will truncate if necessary),
rather than crashing on a too-small output buffer.
4. Crossgen2 now advances `*ppBuf` and `*pnBufLen` as noted above.
5. SuperPMI implements these new semantics.
* Fix non-Windows build
Set `JIT_BUILD` when building SuperPMI. This disables contracts and some PAL debugging,
including the debugreturn.h debugging that was causing a build break.
Also, adjust a couple loops based on code review feedback.
Andy Ayers [Wed, 30 Mar 2022 20:03:41 +0000 (13:03 -0700)]
Enable QJFL and OSR by default for x64 and arm64 (#65675)
Change these default values when the jit targets x64 or arm64:
* COMPlus_TC_QuickJitForLoops=1
* COMPlus_TC_OnStackReplacement=1
The upshot is that on x64/arm64 more methods will be jitted at Tier0,
and we will rely on OSR to get out of long-running Tier0 methods.
Other architectures continue to use the old behavior for now, as
OSR is not yet supported for x86 or arm.
Jakob Botsch Nielsen [Wed, 30 Mar 2022 19:54:29 +0000 (21:54 +0200)]
Disable coredumps for fuzzers (#67340)
Tarek Mahmoud Sayed [Wed, 30 Mar 2022 19:46:47 +0000 (12:46 -0700)]
Fix Referencing Unsafe Package in System.Diagnostics.DiagnosticSource (#67322)
Kevin Jones [Wed, 30 Mar 2022 19:39:24 +0000 (15:39 -0400)]
Obsolete non-specific key blob support on ECDiffieHellmanPublicKey
Ilona Tomkowicz [Wed, 30 Mar 2022 18:37:35 +0000 (20:37 +0200)]
Fix failing CI after merging 63730 (#67348)
Add sorting by access level in ValueType + check if index exists before accessing element.
Levi Broderick [Wed, 30 Mar 2022 16:49:57 +0000 (09:49 -0700)]
Add missing SUCCEEDED() within conditional (#67321)
Addresses CodeQL rule cpp/hresult-boolean-conversion
dotnet-maestro[bot] [Wed, 30 Mar 2022 15:40:17 +0000 (17:40 +0200)]
[main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/runtime-assets (#67328)
* Update dependencies from https://github.com/dotnet/xharness build
20220330.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.22178.1 -> To Version 1.0.0-prerelease.22180.1
* Update dependencies from https://github.com/dotnet/arcade build
20220329.1
Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
From Version 2.5.1-beta.22171.2 -> To Version 2.5.1-beta.22179.1
* Update dependencies from https://github.com/dotnet/runtime-assets build
20220329.2
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
From Version 7.0.0-beta.22177.1 -> To Version 7.0.0-beta.22179.2
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Eirik Tsarpalis [Wed, 30 Mar 2022 15:10:07 +0000 (16:10 +0100)]
Fix failing debug assertion in JsonTypeInfo initialization (#67334)
dotnet bot [Wed, 30 Mar 2022 12:01:24 +0000 (05:01 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1689955 (#67177)
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1683074
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1683308
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1683442
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1683560
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1683893
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1683991
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1684448
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1684571
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1684919
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1685160
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1685380
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1685824
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1686332
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1686932
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1687139
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1687242
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1687551
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1687851
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1688205
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1688723
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1689101
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1689361
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1689678
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1689955
* Commit updated .xlf files
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Radek Zikmund [Wed, 30 Mar 2022 11:01:04 +0000 (13:01 +0200)]
Improve exception thrown when constructing SslCertificateTrust (#66763)
* Improve exception thrown when constructing SslCertificateTrust
* Remove UnsupportedOSPlatform annotation
* fixup! Remove UnsupportedOSPlatform annotation
* Update ApiCompatBaseline
Stephen Toub [Wed, 30 Mar 2022 10:55:28 +0000 (06:55 -0400)]
Enable recently added analyzers (and fix some violations) (#67292)
Radek Zikmund [Wed, 30 Mar 2022 10:40:32 +0000 (12:40 +0200)]
Use shared SocketAddress code in QUIC (#66794)
* Use shared SocketAddress code in QUIC
* Code review feedback
* Disable broken tests
* Rename file
Jakob Botsch Nielsen [Wed, 30 Mar 2022 07:10:16 +0000 (09:10 +0200)]
Run fuzzers on macOS arm64 (#67297)
SingleAccretion [Wed, 30 Mar 2022 04:48:39 +0000 (07:48 +0300)]
Do not generate `TYP_STRUCT` `LCL_FLD` nodes (#66251)
* Do not create TYP_STRUCT LCL_FLD
* Fix regressions
This is also a correctness fix. Missing adding zero-offset field sequences is fatal.
* More fixes for regressions
Types of location nodes do not matter, the underlying locations do.
* Add a comment
Ilona Tomkowicz [Wed, 30 Mar 2022 01:37:00 +0000 (03:37 +0200)]
[wasm][debugger] Debuger tests refactor 63667 (#63730)
* Removed a dedicated StructGetter class.
* Used DerivedClass in protection level tests + fixed InvokeMethod + reverted StructureGetters removal.
* Exchange ElementType in DotnetObjectId for bool.
* Applied @radical's suggestion to log whole call stack instead of message.
* Applied @lewing's suggestions.
* Merge errors fixed.
Jeremy Koritzinsky [Wed, 30 Mar 2022 01:01:49 +0000 (18:01 -0700)]
Quote file path in rc file (#67307)
dotnet-maestro[bot] [Wed, 30 Mar 2022 00:44:44 +0000 (19:44 -0500)]
[main] Update dependencies from dotnet/linker (#67143)
* Update dependencies from https://github.com/dotnet/linker build
20220324.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22173.2 -> To Version 7.0.100-1.22174.1
* Update dependencies from https://github.com/dotnet/linker build
20220328.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22173.2 -> To Version 7.0.100-1.22178.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Jan Kotas [Wed, 30 Mar 2022 00:02:33 +0000 (17:02 -0700)]
Switch crossgen2 to use SHA256 for PDB hash (#67305)
Tomas Weinfurt [Tue, 29 Mar 2022 22:24:39 +0000 (15:24 -0700)]
skip adding leaf certificate to ChainPolicy.ExtraStore (#67279)
Stephen Toub [Tue, 29 Mar 2022 21:39:36 +0000 (17:39 -0400)]
Fix a couple of issues with StackTraceSymbols.TryGetReader (#67300)
The implementation has a comment about how ConditionalWeakTable prevents multiple threads from racing to create readers, but CWT doesn't invole the delegate under its lock. So multiple threads can actually race to create a reader, and if one loses, it won't Dispose the reader it created. On top of this, every call to TryGetReader is allocating a closure, even if one of the fast paths is hit, because the cache callback captures all the parameters.
Radek Doulik [Tue, 29 Mar 2022 20:48:39 +0000 (22:48 +0200)]
[wasm] Unset PYTHONHOME (#67282)
Unset PYTHONHOME environment variable. We don't use emsdk.bat, which
unsets PYTHONHOME and PYTHONPATH variables to not clash with emscripten
python. So we should make sure the PYTHONHOME and PYTHONPATH are not
pointing to other python locations.
Together with previous PYTHONPATH
[change](https://github.com/dotnet/runtime/pull/63894/commits/
d9b8aefcbf0efc4692c9ca46b323efcf86bda961)
it should fix https://github.com/dotnet/runtime/issues/65859
Radek Zikmund [Tue, 29 Mar 2022 20:11:09 +0000 (22:11 +0200)]
Do not call into MsQuic inside a lock (#67037)
Fixes #59345
Andy Ayers [Tue, 29 Mar 2022 20:10:33 +0000 (13:10 -0700)]
JIT: Use small register types for some enregisterable locals (#67274)
Fix two cases where small enregisterable locals can't be saved to the stack
using actual (widened) types:
* small memory args for OSX ARM64
* promoted fields of OSR locals
Closes #67152.
Closes #67188.
Pavel Savara [Tue, 29 Mar 2022 19:29:57 +0000 (21:29 +0200)]
[wasm] Dead code removal, minor fixes (#66418)
* - treat jsHandle and gcHandle as IntPtr on C# icall definition
- removed IJSObject, HostObject, CoreObject empty private classes
- removed Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, Uint16Array, Uint32Array, Uint8ClampedArray, SharedArrayBuffer, Map unused private classes and their tests
- moved Length property to Array and TypedArray types
- removed unused eventListener helpers and it's tests
- added Module.stackSave, Module.stackRestore, Module.stackAlloc imports
- fixed promise reject signature
- fixed cwrap of mono_wasm_invoke_method and mono_wasm_try_unbox_primitive_and_get_type
- fixed string interning on StringDecoder path
- improved assert helper
* feedeback from @kg
dotnet-maestro[bot] [Tue, 29 Mar 2022 17:31:54 +0000 (12:31 -0500)]
[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/hotreload-utils dotnet/llvm-project (#67289)
* Update dependencies from https://github.com/dotnet/xharness build
20220328.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.22173.1 -> To Version 1.0.0-prerelease.22178.1
* Update dependencies from https://github.com/dotnet/runtime-assets build
20220327.1
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
From Version 7.0.0-beta.22171.1 -> To Version 7.0.0-beta.22177.1
* Update dependencies from https://github.com/dotnet/hotreload-utils build
20220328.2
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 1.0.2-alpha.0.22171.1 -> To Version 1.0.2-alpha.0.22178.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20220328.2
runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22171.2 -> To Version 11.1.0-alpha.1.22178.2
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Mukund Raghav Sharma [Tue, 29 Mar 2022 17:29:09 +0000 (10:29 -0700)]
Fix a case of infinite retries while allocating at LOH boundary by constraining retries (#67128)
* Fix a case of infinite retries while allocating at LOH boundary that is now an OOM
* Addressed feedback.
* Updated name of allocation variable and parenthesized the retry check
Brennan [Tue, 29 Mar 2022 17:08:27 +0000 (10:08 -0700)]
Introduce abstract PartitionedRateLimiter (#67241)
Dan Moseley [Tue, 29 Mar 2022 16:27:14 +0000 (10:27 -0600)]
Increase timeout on regex count test (#67256)
* Increase timeout on regex count test
* make it 30
Hugo Woodiwiss [Tue, 29 Mar 2022 16:19:44 +0000 (17:19 +0100)]
Improve `QuicImplementationProviders.MsQuic.IsSupported` for TLS1.3 On Windows (#66019)
* Scaffold TLS Support Helper
Scaffolds an interoperable TLS support helper.
Needs to be multi-file so that the Microsoft.Win32 dependency can be safely used in `MsQuicTlsSupportHelper.Windows.cs`
* Invert `IsTls1_3Enabled` to `IsTls1_3Disabled`
Disabling TLS1.3 is an explicit action in supported versions of windows, and we should check for the explicit configuration
* Add check for whether TLS1.3 Is DDisabled
* Add reference to Microsoft.Win32.Registry for windows builds
Need access to Registry API to check whether TLS 1.3 has been disabled
* Remove Platform agnostic MsQuicTlsSupportHelper
* Implement IsTls1_3Disabled
- Checks if key exists
- If not returns false
- Gets Value from Key "Enabled"
- If Enabled == 0 returns true
- Any other case returns false
* Revert some spacing and line changes in csproj
* Remove added spaces from .csproj
* Move to conditional compilation for TLS Check
* Move to TARGET_WINDOWS defined constant
Update to check correct registry keys/values
* Simplify IsTls13Disabled implementation
* Remove IsTls13Disabled from Windows version check
* Add TLS13MayBeDisabled flag
* Add `QuicTlsVersionException`
Throw `QuicTlsVersionException` on specific failures of ConfigurationLoadCredential
Throw this exception if status is 0x80090331 (Algorithm Mismatch), and the registry indicated that Tls13 could be disabled
* Fix IDE resource file whitespace changes
* Update net_quic_tls_version_notsupported message
* Change error code comparison to use Interop.SECURITY_STATUS
Make AlgorithmMismatch check TARGET_WINDOWS only
Interop.SECURITY_STATUS contains status values from SChannel, which is the source of this error in the first place.
* Remove QuicTlsVersionException and update usages
* Remove unused using
Kunal Pathak [Tue, 29 Mar 2022 16:19:28 +0000 (09:19 -0700)]
Perform reachability analysis before codegen (#66967)
* Add size
* Remove unreachable blocks
* Ensure epoch
* Add a condition in asserT
* Add test case
* Another shorter implementation
* Add DeadBlock elimination
* fgDomsComputed adjusted
* Review comment
madelson [Tue, 29 Mar 2022 15:32:55 +0000 (11:32 -0400)]
Avoid allocating a delegate in OptionsMonitor.Get() when possible. (#66688)
* Avoid allocating a delegate in OptionsMonitor.Get() when possible.
Fix #61086
* Address feedback from https://github.com/dotnet/runtime/pull/66688#discussion_r827519222
* Use locals to avoid unnecessary closure allocations.
* Remove another closure allocation in OptionsMonitor and add test for #61086.
SingleAccretion [Tue, 29 Mar 2022 15:04:55 +0000 (18:04 +0300)]
Only use first field maps for shared statics (#66558)
* Use a handle for field sequences in VN
The field sequences are already canonical in the store,
so there is no need to have the somewhat involved code
in VN which essentially re-canonicalized them, we can
just use the pointer value (as a handle) to encode them.
Makes the future change of encoding some information in
the handle a little easier.
* Encode the statics
* Use shared-ness info in IsFieldAddr
Larry Ewing [Tue, 29 Mar 2022 15:00:32 +0000 (10:00 -0500)]
[mono][workload] Add workloads for win-arm64 using emulation again
This reverts commit
67f26ca4fbc27d215c9ba766c7d93966b69b5a99 and adds back the emulated win-arm64 workloads
Jérôme Laban [Tue, 29 Mar 2022 14:57:42 +0000 (10:57 -0400)]
feat: Add support for emscripten module exports (#66868)
Aleksey Kliger (λgeek) [Tue, 29 Mar 2022 14:52:17 +0000 (10:52 -0400)]
[wasm] provisioning: run sanitize.py with python3 (#67245)
Marie Píchová [Tue, 29 Mar 2022 14:51:18 +0000 (16:51 +0200)]
Fixed dump path in HTTP stress test (#67230)
Ilona Tomkowicz [Tue, 29 Mar 2022 14:47:17 +0000 (16:47 +0200)]
Fix error when provisioning with python 3.8. (#67287)
Robin Lindner [Tue, 29 Mar 2022 14:46:54 +0000 (16:46 +0200)]
Remove `ToTimeoutSeconds`.`SendPingAsync` and fix `TimeSpan` behavior (#67253)
* Move CancellationToken throwing logic to the end of `Task.Wait`
To match the default behavior
* Fix timeout behavior in `NetworkStream.Close`
Use milliseconds instead of seconds
* Remove `SendPingAsync` overloads
Maksym Koshovyi [Tue, 29 Mar 2022 13:33:49 +0000 (16:33 +0300)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Http` (#66891)
* Annotate things
* InnerHandler not null
* Fix build
Miha Zupan [Tue, 29 Mar 2022 13:15:15 +0000 (06:15 -0700)]
Preserve parsed & raw header value ordering (#67227)
Alexander Köplinger [Tue, 29 Mar 2022 11:37:04 +0000 (13:37 +0200)]
[mono] Remove mono-perfcounters.c and most of mono-counters.c (#66986)
They were disabled already so were behaving as no-ops.
The recommended replacement is using EventCounters.
Michal Strehovský [Tue, 29 Mar 2022 11:07:04 +0000 (20:07 +0900)]
Account for renamed Pri-0 tests (#67278)
Fixes NativeAOT Pri-0 test baselines.
Mike McLaughlin [Tue, 29 Mar 2022 04:00:43 +0000 (21:00 -0700)]
Add log to file option to createdump (#67181)
Add log to file option to createdump
Add DOTNET_CreateDumpVerboseDiagnostics env var
Make the timestamp ms and 8 hex digits
Add printf_status and printf_error that all stdout goes through.
Prefix "[createdump" to all printf_status/error output.
Michal Strehovský [Tue, 29 Mar 2022 03:44:03 +0000 (12:44 +0900)]
Add support for creating delegates to static virtual methods (#66936)
Requires a JitInterface change because we need to be able to pass information about constraints to `getReadyToRunDelegateCtorHelper`
Andy Ayers [Tue, 29 Mar 2022 01:27:55 +0000 (18:27 -0700)]
JIT: refactor IsOSRLocal (#67247)
Make this a property of the local, in anticipation of needing to check this in
cases where we won't have access to the compiler object.
Unify marking of OSR exposed locals.
Genevieve Warren [Tue, 29 Mar 2022 00:39:07 +0000 (17:39 -0700)]
Add \<para> tags to remarks comments (#67173)
Larry Ewing [Tue, 29 Mar 2022 00:36:36 +0000 (19:36 -0500)]
[wasm] Attempt to fix audit errors in sanitize (#67255)
* Run audit fix by default
* Run update before audit
* review suggestions
xtqqczze [Tue, 29 Mar 2022 00:16:33 +0000 (01:16 +0100)]
Remove `IsEmpty` workaround in `Span` and `ReadOnlySpan` (#66865)
* Revert "Workaround to remove unnecessary bounds checks when using {ReadOnly}Span.IsEmpty (dotnet/coreclr#19640)"
This reverts commit
82bd67f763bd1b3fc8752eae22b31012455e95b5.
* Update doc comments
* Apply suggestions from code review
Co-authored-by: Robin Lindner <robin.lindner1@t-online.de>
* Apply suggestions from code review
Co-authored-by: Robin Lindner <robin@deeprobin.de>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Robin Lindner <robin.lindner1@t-online.de>
Co-authored-by: Robin Lindner <robin@deeprobin.de>
Michal Strehovský [Tue, 29 Mar 2022 00:12:36 +0000 (09:12 +0900)]
Allow mismatched assembly name and file name (#67220)
`GetModuleForSimpleName` checks that the assembly name matches the file name we just opened and throws if it doesn't. Avoid this API for the `--root` command line argument.
This is needed because we have 400+ Pri-0 tests in IL where the assembly name doesn't match the file name of the test.
Katelyn Gadd [Mon, 28 Mar 2022 23:53:02 +0000 (16:53 -0700)]
Perform type/layout verification on some mono-config elements to avoid silent failures or crashes later (#65449)
Perform type/layout verification on some mono-config elements to avoid silent failures or crashes later
Elinor Fung [Mon, 28 Mar 2022 23:39:33 +0000 (16:39 -0700)]
Fix SpecialTypeInfo.Byte (#67261)
SingleAccretion [Mon, 28 Mar 2022 23:24:06 +0000 (02:24 +0300)]
Add some documentation on `GT_CAST`'s semantics (#67208)
* Add documentation on GT_CAST's semantics
The semantics of cast nodes are notoriously complicated.
It was requested documentation be added clarifying some
of the less obvious bits, this change does just that.
* Fix a typo, add the "integer -> FP" case
"Integer -> FP" (always) unchecked casts also use "IsUnsigned".
Miha Zupan [Mon, 28 Mar 2022 23:21:59 +0000 (16:21 -0700)]
Issue at most one connection attempt per request (#67114)
* Issue at most one connection attempt per request
* Drop the Try- from PeekNextRequestForConnectionAttempt
* Add test
* PR feedback
* Entry => QueueItem
Bruce Forstall [Mon, 28 Mar 2022 23:20:05 +0000 (16:20 -0700)]
Add struct info to JitDump for INDEX and IND nodes (#67135)
Also, shorten struct type name display. Use the `appendClassName`
API to construct a smaller class name, without the full assembly info.
Ankit Jain [Mon, 28 Mar 2022 22:49:05 +0000 (18:49 -0400)]
[wasm] Improved error handling in debug proxy (#65828)
* [wasm] Mark result as Error if it has 'exceptionDetails' field
* [wasm] Don't swallow errors from methods that enumerate properties
.. like for getting locals. Instead, surface the original errors which
have details of the actual failure, to the point before we send a
response.
This helps debugging a lot, so instead of `Unable to evaluate dotnet:scope:1`,
we get more detailed errors.
* [wasm] Throw an exception when a debugger agent command fails
We are checking `HasError` property on the binary reader in very few
places. Other places just try to use the reader which then fails with
errors in reading, or base64 conversion etc, and we don't get any info
about what command failed.
Instead, throw an exception on error by default. But the existing
locations that do check `HasError`, don't throw for them.
* [wasm] Fix evaluating expression calling a non-existant method
Issue: https://github.com/dotnet/runtime/issues/65744
The test doesn't fail because it is expecting an error, and it gets
that.
But the log shows an assertion:
`console.error: * Assertion at /workspaces/runtime/src/mono/mono/metadata/class-accessors.c:71, condition `<disabled>' not met`
1. This is because the debugger-agent does not check that the `klass`
argument is NULL, which is fixed by adding that check.
2. But the reason why this got called with `klass==NULL`, is because
`MemberReferenceResolver.Resolve` tries first to find the non-existant
method on the type itself. Then it tries to find the method on
`System.Linq.Enumerable`, but fails to find a typeid for that.
- but continues to send a command to get the methods on that
`linqTypeId==0`.
* [wasm] Add some missing exception logging in the proxy
* cleaup
* [wasm] GetMethodIdByName: throw on invalid type ids
* [wasm] Improve error handling in expression evaluation
* Cleanup
* Disable failing test - https://github.com/dotnet/runtime/issues/65881
* Add missed files
* Address @ilonatommy's feedback
Radek Doulik [Mon, 28 Mar 2022 22:45:08 +0000 (00:45 +0200)]
[wasm] Bump emscripten to 3.1.7 (#67006)
* Bump emscripten to 3.1.7
* Use new docker images with emscripten 3.1.7
* Update exported functions list for 3.1.7:
* Use 3.1.7 emsdk and icu packages
Co-authored-by: Ankit Jain <radical@gmail.com>
dotnet-maestro[bot] [Mon, 28 Mar 2022 22:41:45 +0000 (16:41 -0600)]
[main] Update dependencies from dotnet/roslyn-analyzers (#67189)
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20220324.1
Microsoft.CodeAnalysis.NetAnalyzers
From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22174.1
* React to DisableRuntimeMarshalling attribute analyzer by switching a few extraneous places to source-generated marshalling and removing some unused attributes.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Parker Bibus [Mon, 28 Mar 2022 22:21:55 +0000 (17:21 -0500)]
[MAUI][PERF] Maui Perf add iOS Podcast SOD Tests (#67165)
* Publish the maui iOS Podcast app in the build yml
* Pipe the built Podcast IPA file through and test it.
Jeremy Koritzinsky [Mon, 28 Mar 2022 22:14:04 +0000 (15:14 -0700)]
Add arm64 cross-arch msi installers (#67066)
Carlos Sanchez [Mon, 28 Mar 2022 21:52:05 +0000 (14:52 -0700)]
Remove unnecessary remark from ObservableCollection.CollectionChanged (#67250)
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Kevin Jones [Mon, 28 Mar 2022 21:07:19 +0000 (17:07 -0400)]
Obsolete ToXmlString and FromXmlString on ECC types
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Ankit Jain [Mon, 28 Mar 2022 19:51:01 +0000 (15:51 -0400)]
[wasm] MonoProxy.cs: Avoid some errors by pre-emptively checking (#67243)
.. inspired by https://github.com/dotnet/runtime/issues/66149 .
Ankit Jain [Mon, 28 Mar 2022 19:48:00 +0000 (15:48 -0400)]
[wasm] EmccCompile: Improve AOT time by better utilizing the cores (#67195)
* [wasm] EmccCompile: Improve AOT time by better utilizing the cores
Problem:
`EmccCompile` tasks compiles `.bc` files to `.o` files, and uses
`Parallel.ForEach` to run `emcc` for these in parallel.
The problem manifests when `EmccCompile` is compiling lot of files.
- To start with, the intended number of cores are being used
- but at some point (in my case after ~150 out of 180 files), the number
of cores being utilized goes down to 1.
- And the reason is that `Parallel.ForEach` partitions the list of
files(jobs), and they execute only the assigned jobs
From: https://github.com/dotnet/runtime/issues/46146#issuecomment-
754021690
Stephen Toub:
"As such, by default ForEach works on a scheme whereby each
thread takes one item each time it goes back to the enumerator,
and then after a few times of this upgrades to taking two items
each time it goes back to the enumerator, and then four, and
then eight, and so on. This ammortizes the cost of taking and
releasing the lock across multiple items, while still enabling
parallelization for enumerables containing just a few items. It
does, however, mean that if you've got a case where the body
takes a really long time and the work for every item is
heterogeneous, you can end up with an imbalance."
The above means that with wildy different times taken by each job, we
can end up in this imbalance, leading to some cores being idle, which
others get reduced to running jobs sequentially.
Instead, we want to use work-stealing so jobs can be run by any partition.
In my highly unscientific testing, with AOT for `System.Buffers.Tests`,
the total time to run `EmccCompile` for 181 assemblies goes from 5.7mins
to 4.0mins .
* MonoAOTCompiler.cs: Ensure that the parallel jobs get scheduled with
.. work-stealing, instead of being partitioned.
Nathan Ricci [Mon, 28 Mar 2022 17:35:18 +0000 (13:35 -0400)]
[PERF] Added --logbuildoutput to microbenchmark runs. (#67111)
Added --logbuildoutput to microbenchmark runs.
Tomáš Rylek [Mon, 28 Mar 2022 16:02:58 +0000 (18:02 +0200)]
Fix a few issues with merged wrappers uncovered by local testing (#67211)
After merging in the last preparatory change (deduplication of
tests with the same assembly names) I'm now testing the "final"
JIT/Methodical switchover change; this testing uncovered a few
previously unseen issues related to the merged wrappers and I'm
sending them for a separate PR to decouple them from the big
mechanical switchover change.
1) For out-of-process tests, "Method" contains the relative test
execution script path; we need to prefix the string with "@"
to avoid complaining about backslashes on Windows.
2) Jeremy recently added a consistency check to catch multiple
projects producing assemblies with the same simple name; turns
out there was a subtle bug where the check blew up on projects
with DisableProjectBuild set to true.
3) A similar problem exists for projects with the property
CLRTestTargetUnsupported but I haven't added it to the fix;
I believe it is healthy to receive this type of error in the build
as with the merged wrappers the CLRTestTargetUnsupported clauses
need to be removed and replaced with ConditionalFactAttribute
annotations, otherwise we could lose part of the conditional
code coverage as in the lab the managed tests are build only
once on an arbitrary platform so their individual platform-specific
exclusions must be postponed to execution time.
Thanks
Tomas
Elinor Fung [Mon, 28 Mar 2022 15:52:43 +0000 (08:52 -0700)]
Let CustomTypeMarshaller implementation use Span of unmanaged type for Value marshalling (#67172)
Greg Dennis [Mon, 28 Mar 2022 14:23:52 +0000 (03:23 +1300)]
add gregsdennis to area-system-text-json (#67224)
Robin Lindner [Mon, 28 Mar 2022 14:14:09 +0000 (16:14 +0200)]
[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds, and timeouts (Group 1/3) (#64860)
Sychev Vadim [Mon, 28 Mar 2022 10:41:36 +0000 (13:41 +0300)]
x ^ 0 opt
Egor Bogatov [Mon, 28 Mar 2022 09:47:11 +0000 (12:47 +0300)]
Port SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)
feiyun0112 [Mon, 28 Mar 2022 08:51:11 +0000 (16:51 +0800)]
Do not reorder HTTP header values (#65249)
* Do not reorder HTTP header values
* fix complie error
* make the changes @ danmoseley recommended
* make the changes @MihaZupan recommended
* make the changes @MihaZupan recommended
* make the changes @MihaZupan recommended
* make the changes @MihaZupan recommended
* make the changes @MihaZupan recommended
* check array length
* fix unit test
* Update src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* make the changes @MihaZupan recommended
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* chang unit test
* GetParsedValueLength
* fix build error
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* unit test
* make changes @geoffkizer recommended
* CloneAndAddValue for InvalidValues
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Final nits
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Jan Jahoda [Mon, 28 Mar 2022 07:37:41 +0000 (09:37 +0200)]
CI matrix change: Windows (#58989)
* CI matrix change: Windows
* Remove Windows Server RS5
* Revert .net Framework change
* Add 19H1 to rolling
* Add Windows.Server.Core.20H2 to CI matrix
* Remove Windows 8.1
* Remove 20H2 as thhere is a PR for it #60054
* Typo
Co-authored-by: Jan Jahoda <jajahoda@microsoft.com>
Co-authored-by: Andy Gocke <andy@commentout.net>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Egor Chesakov [Sun, 27 Mar 2022 17:07:05 +0000 (10:07 -0700)]
Don't apply IMAGE_REL_BASED_REL32 when address doesn't belong to current section (#66855)
* Don't attempt to apply IMAGE_REL_BASED_REL32 when address doesn't belong to current block in src/coreclr/ToolBox/superpmi/superpmi-shared/compileresult.cpp
* Update "Exit Codes" section in the superpmi help command output
Bar Arnon [Sun, 27 Mar 2022 14:34:56 +0000 (17:34 +0300)]
Add reciprocal and SinCos methods to IFloatingPoint (#59521)
Egor Bogatov [Sat, 26 Mar 2022 21:07:40 +0000 (00:07 +0300)]
[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)
Theodore Tsirpanis [Sat, 26 Mar 2022 19:34:21 +0000 (21:34 +0200)]
Use generic `Enum` methods in more places. (#67147)
Tomáš Rylek [Sat, 26 Mar 2022 09:32:59 +0000 (10:32 +0100)]
Fix race condition in loading assemblies with composite native images (#67000)
I originally hit this bug when testing my Crossgen2 perf optimization
change involving only registering composite code range once but I
managed to disprove the bug was caused by this change. Indeed, it
was caused by my earlier change improving component assembly caching.
In my overzealous attempt to make sure the assembly gets always
registered I added a new method NativeImage::AddComponentAssemblyToCache
that registered the assembly which had triggered the native image load
in the first place. This was incorrect, by that point the assembly
wasn't yet fully initialized and putting it in the cache made it
visible to other threads that subsequently crashed trying to access
the assembly before it was fully loaded.
Furthermore it was unnecessary, once the assembly gets loaded, it
gets stored in the cache via the call to
SetNativeMetadataAssemblyRefInCache from ZapSig::DecodeModuleFromIndex.
Before the fix I was able to repro the bug locally typically after
about 500 iterations of the thread14 unit test, with the fix I was
unable to repro after 4500 iterations.
Thanks
Tomas
Fixes: https://github.com/dotnet/runtime/issues/66954
Probably also fixes: https://github.com/dotnet/runtime/issues/66210
Noah Falk [Sat, 26 Mar 2022 04:52:22 +0000 (21:52 -0700)]
Fix jit attach hang at Shutdown (#67166)
Fixes #66715
We are seeing exceptions thrown at shutdown turn into hangs because the debugger
lock suspends threads at that point. We are mitigating that problem by disabling the
jit attach setup work and allowing WatsonLastChance to continue.