platform/upstream/dotnet/runtime.git
2 years agoDon't produce unnecessary default interface methods (#67409)
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.

2 years agoAdd RemoteExecutor check in TestWaitForExitValidation (#67397)
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.

2 years agoLoad R2R images on osx-arm64 according to Apple's guidelines (#67118)
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

2 years agoMakes GetChildKeys more efficient (#67186)
Maryam Ariyan [Thu, 31 Mar 2022 21:50:44 +0000 (17:50 -0400)]
Makes GetChildKeys more efficient (#67186)

2 years agoMark architecture-specific tests as requiring process isolation (#67394)
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

2 years agoFix missing side effect flags on HWI nodes (#67206)
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

2 years agoAccount for global stores in hoisting properly (#67213)
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

2 years agoMemory containment for `FIELD_LIST` operands on x86 (#65803)
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.

2 years agoFix Wrong exception for Open*Stream after connection is closed (#67342)
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>
2 years agoPort Access violation occurring in System.DirectoryServices.ActiveDirectory.ForestTru...
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

2 years agoFix ordering in default interface method lookup (#67379)
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

2 years ago[mono][llvm] Fix an assert with --aot=llvmonly and -O=gsharedvt. (#67357)
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 ().

2 years agoMinor refactoring in MarshallingAttributeInfoParser (#67325)
Elinor Fung [Thu, 31 Mar 2022 01:23:38 +0000 (18:23 -0700)]
Minor refactoring in MarshallingAttributeInfoParser (#67325)

2 years agoAlways commit X.509 chain before Finish
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.

2 years agoFix a PAL filemapping test for macOS arm64 (#67352)
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.

2 years agoDisable test45929 for win-arm64 (#67363)
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

2 years agoEnable all StructABI tests in pri-0 (#67362)
Bruce Forstall [Thu, 31 Mar 2022 00:27:06 +0000 (17:27 -0700)]
Enable all StructABI tests in pri-0 (#67362)

2 years agoRevert "Do not generate `TYP_STRUCT` `LCL_FLD` nodes (#66251)" (#67360)
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.

2 years agoTweak OSR debugging document (#67366)
Bruce Forstall [Wed, 30 Mar 2022 22:36:15 +0000 (15:36 -0700)]
Tweak OSR debugging document (#67366)

Grammar, consistency fixes

2 years agoShow the actual value of the X09VerifyStatusCode on error
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.

2 years agoperf: wasm: Collect helix logs, and artifacts when the build fails (#67248)
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

2 years agoFix SuperPMI implementation of `appendClassName` (#67280)
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.

2 years agoEnable QJFL and OSR by default for x64 and arm64 (#65675)
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.

2 years agoDisable coredumps for fuzzers (#67340)
Jakob Botsch Nielsen [Wed, 30 Mar 2022 19:54:29 +0000 (21:54 +0200)]
Disable coredumps for fuzzers (#67340)

2 years agoFix Referencing Unsafe Package in System.Diagnostics.DiagnosticSource (#67322)
Tarek Mahmoud Sayed [Wed, 30 Mar 2022 19:46:47 +0000 (12:46 -0700)]
Fix Referencing Unsafe Package in System.Diagnostics.DiagnosticSource (#67322)

2 years agoObsolete non-specific key blob support on ECDiffieHellmanPublicKey
Kevin Jones [Wed, 30 Mar 2022 19:39:24 +0000 (15:39 -0400)]
Obsolete non-specific key blob support on ECDiffieHellmanPublicKey

2 years agoFix failing CI after merging 63730 (#67348)
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.

2 years agoAdd missing SUCCEEDED() within conditional (#67321)
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

2 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/runtime-assets...
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>
2 years agoFix failing debug assertion in JsonTypeInfo initialization (#67334)
Eirik Tsarpalis [Wed, 30 Mar 2022 15:10:07 +0000 (16:10 +0100)]
Fix failing debug assertion in JsonTypeInfo initialization (#67334)

2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 168995...
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>
2 years agoImprove exception thrown when constructing SslCertificateTrust (#66763)
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

2 years agoEnable recently added analyzers (and fix some violations) (#67292)
Stephen Toub [Wed, 30 Mar 2022 10:55:28 +0000 (06:55 -0400)]
Enable recently added analyzers (and fix some violations) (#67292)

2 years agoUse shared SocketAddress code in QUIC (#66794)
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

2 years agoRun fuzzers on macOS arm64 (#67297)
Jakob Botsch Nielsen [Wed, 30 Mar 2022 07:10:16 +0000 (09:10 +0200)]
Run fuzzers on macOS arm64 (#67297)

2 years agoDo not generate `TYP_STRUCT` `LCL_FLD` nodes (#66251)
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

2 years ago[wasm][debugger] Debuger tests refactor 63667 (#63730)
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.

2 years agoQuote file path in rc file (#67307)
Jeremy Koritzinsky [Wed, 30 Mar 2022 01:01:49 +0000 (18:01 -0700)]
Quote file path in rc file (#67307)

2 years ago[main] Update dependencies from dotnet/linker (#67143)
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>
2 years agoSwitch crossgen2 to use SHA256 for PDB hash (#67305)
Jan Kotas [Wed, 30 Mar 2022 00:02:33 +0000 (17:02 -0700)]
Switch crossgen2 to use SHA256 for PDB hash (#67305)

2 years agoskip adding leaf certificate to ChainPolicy.ExtraStore (#67279)
Tomas Weinfurt [Tue, 29 Mar 2022 22:24:39 +0000 (15:24 -0700)]
skip adding leaf certificate to  ChainPolicy.ExtraStore (#67279)

2 years agoFix a couple of issues with StackTraceSymbols.TryGetReader (#67300)
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.

2 years ago[wasm] Unset PYTHONHOME (#67282)
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

2 years agoDo not call into MsQuic inside a lock (#67037)
Radek Zikmund [Tue, 29 Mar 2022 20:11:09 +0000 (22:11 +0200)]
Do not call into MsQuic inside a lock (#67037)

Fixes #59345

2 years agoJIT: Use small register types for some enregisterable locals (#67274)
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.

2 years ago[wasm] Dead code removal, minor fixes (#66418)
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

2 years ago[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/hotreloa...
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>
2 years agoFix a case of infinite retries while allocating at LOH boundary by constraining retri...
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

2 years agoIntroduce abstract PartitionedRateLimiter (#67241)
Brennan [Tue, 29 Mar 2022 17:08:27 +0000 (10:08 -0700)]
Introduce abstract PartitionedRateLimiter (#67241)

2 years agoIncrease timeout on regex count test (#67256)
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

2 years agoImprove `QuicImplementationProviders.MsQuic.IsSupported` for TLS1.3 On Windows (...
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

2 years agoPerform reachability analysis before codegen (#66967)
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

2 years agoAvoid allocating a delegate in OptionsMonitor.Get() when possible. (#66688)
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.

2 years agoOnly use first field maps for shared statics (#66558)
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

2 years ago[mono][workload] Add workloads for win-arm64 using emulation again
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

2 years agofeat: Add support for emscripten module exports (#66868)
Jérôme Laban [Tue, 29 Mar 2022 14:57:42 +0000 (10:57 -0400)]
feat: Add support for emscripten module exports (#66868)

2 years ago[wasm] provisioning: run sanitize.py with python3 (#67245)
Aleksey Kliger (λgeek) [Tue, 29 Mar 2022 14:52:17 +0000 (10:52 -0400)]
[wasm] provisioning: run sanitize.py with python3 (#67245)

2 years agoFixed dump path in HTTP stress test (#67230)
Marie Píchová [Tue, 29 Mar 2022 14:51:18 +0000 (16:51 +0200)]
Fixed dump path in HTTP stress test (#67230)

2 years agoFix error when provisioning with python 3.8. (#67287)
Ilona Tomkowicz [Tue, 29 Mar 2022 14:47:17 +0000 (16:47 +0200)]
Fix error when provisioning with python 3.8. (#67287)

2 years agoRemove `ToTimeoutSeconds`.`SendPingAsync` and fix `TimeSpan` behavior (#67253)
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

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Http` (#66891)
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

2 years agoPreserve parsed & raw header value ordering (#67227)
Miha Zupan [Tue, 29 Mar 2022 13:15:15 +0000 (06:15 -0700)]
Preserve parsed & raw header value ordering (#67227)

2 years ago[mono] Remove mono-perfcounters.c and most of mono-counters.c (#66986)
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.

2 years agoAccount for renamed Pri-0 tests (#67278)
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.

2 years agoAdd log to file option to createdump (#67181)
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.

2 years agoAdd support for creating delegates to static virtual methods (#66936)
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`

2 years agoJIT: refactor IsOSRLocal (#67247)
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.

2 years agoAdd \<para> tags to remarks comments (#67173)
Genevieve Warren [Tue, 29 Mar 2022 00:39:07 +0000 (17:39 -0700)]
Add \<para> tags to remarks comments (#67173)

2 years ago[wasm] Attempt to fix audit errors in sanitize (#67255)
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

2 years agoRemove `IsEmpty` workaround in `Span` and `ReadOnlySpan` (#66865)
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>
2 years agoAllow mismatched assembly name and file name (#67220)
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.

2 years agoPerform type/layout verification on some mono-config elements to avoid silent failure...
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

2 years agoFix SpecialTypeInfo.Byte (#67261)
Elinor Fung [Mon, 28 Mar 2022 23:39:33 +0000 (16:39 -0700)]
Fix SpecialTypeInfo.Byte (#67261)

2 years agoAdd some documentation on `GT_CAST`'s semantics (#67208)
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".

2 years agoIssue at most one connection attempt per request (#67114)
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

2 years agoAdd struct info to JitDump for INDEX and IND nodes (#67135)
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.

2 years ago[wasm] Improved error handling in debug proxy (#65828)
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

2 years ago[wasm] Bump emscripten to 3.1.7 (#67006)
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>
2 years ago[main] Update dependencies from dotnet/roslyn-analyzers (#67189)
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>
2 years ago[MAUI][PERF] Maui Perf add iOS Podcast SOD Tests (#67165)
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.

2 years agoAdd arm64 cross-arch msi installers (#67066)
Jeremy Koritzinsky [Mon, 28 Mar 2022 22:14:04 +0000 (15:14 -0700)]
Add arm64 cross-arch msi installers (#67066)

2 years agoRemove unnecessary remark from ObservableCollection.CollectionChanged (#67250)
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>
2 years agoObsolete ToXmlString and FromXmlString on ECC types
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>
2 years ago[wasm] MonoProxy.cs: Avoid some errors by pre-emptively checking (#67243)
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 .

2 years ago[wasm] EmccCompile: Improve AOT time by better utilizing the cores (#67195)
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.

2 years ago[PERF] Added --logbuildoutput to microbenchmark runs. (#67111)
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.

2 years agoFix a few issues with merged wrappers uncovered by local testing (#67211)
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

2 years agoLet CustomTypeMarshaller implementation use Span of unmanaged type for Value marshall...
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)

2 years agoadd gregsdennis to area-system-text-json (#67224)
Greg Dennis [Mon, 28 Mar 2022 14:23:52 +0000 (03:23 +1300)]
add gregsdennis to area-system-text-json (#67224)

2 years ago[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds...
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)

2 years agox ^ 0 opt
Sychev Vadim [Mon, 28 Mar 2022 10:41:36 +0000 (13:41 +0300)]
x ^ 0 opt

2 years agoPort SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)
Egor Bogatov [Mon, 28 Mar 2022 09:47:11 +0000 (12:47 +0300)]
Port SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)

2 years agoDo not reorder HTTP header values (#65249)
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>
2 years agoCI matrix change: Windows (#58989)
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>
2 years agoDon't apply IMAGE_REL_BASED_REL32 when address doesn't belong to current section...
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

2 years agoAdd reciprocal and SinCos methods to IFloatingPoint (#59521)
Bar Arnon [Sun, 27 Mar 2022 14:34:56 +0000 (17:34 +0300)]
Add reciprocal and SinCos methods to IFloatingPoint (#59521)

2 years ago[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)
Egor Bogatov [Sat, 26 Mar 2022 21:07:40 +0000 (00:07 +0300)]
[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)

2 years agoUse generic `Enum` methods in more places. (#67147)
Theodore Tsirpanis [Sat, 26 Mar 2022 19:34:21 +0000 (21:34 +0200)]
Use generic `Enum` methods in more places. (#67147)

2 years agoFix race condition in loading assemblies with composite native images (#67000)
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

2 years agoFix jit attach hang at Shutdown (#67166)
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.