platform/upstream/dotnet/runtime.git
2 years agoMove test with expected crash to outerloop (#65114)
Elinor Fung [Fri, 11 Feb 2022 18:22:24 +0000 (10:22 -0800)]
Move test with expected crash to outerloop (#65114)

2 years agoAvoid using object_gennum for objects that could come from frozen segments (#65174)
Andrew Au [Fri, 11 Feb 2022 17:21:58 +0000 (09:21 -0800)]
Avoid using object_gennum for objects that could come from frozen segments (#65174)

2 years ago[Group 2] Enable nullable annotations for `Microsoft.Extensions.Options` (#63767)
Maksym Koshovyi [Fri, 11 Feb 2022 16:34:13 +0000 (18:34 +0200)]
[Group 2] Enable nullable annotations for `Microsoft.Extensions.Options` (#63767)

* Everithing but ref

* Update ValidateOptions.cs

* Update ref

* ConfigureNamedOptions TDep is notnull

* PostConfigureOptions Tdep is notnull

* OptionsMonitor.OnChange name is notnull

* Revert non-nullable changes

* Fix invalid ref

* Failures notnull only when Failed

* FailureMessage is notnull

* Validation is nonnull

* Update OptionsValidationTests.cs

* OptionsFactory.Create name is nonnull

2 years agoIntroduce `GenTreeDebugOperKind` (#64498)
SingleAccretion [Fri, 11 Feb 2022 16:08:54 +0000 (19:08 +0300)]
Introduce `GenTreeDebugOperKind` (#64498)

* Introducing GenTreeDebugOperKind

To track invariants related to opers in asserts
without increasing the size of the primary oper
kind table.

Some shuffling of the oper table to make it look better.

* More "gtlist.h" cleanup

Put all OperIsIdir opers together, fix up formatting,
move opers around to more logical places.

* Remove redundant asserts

* GTK_NOTLIR -> DBK_NOTLIR

There is not a lot of point in this being a "release"
oper kind, as it is really only useful for debug checks.

* GTK_NOCONTAIN -> DBK_NOCONTAIN

* Fix formatting...

2 years agoJIT: fgMorphModToSubMulDiv should not reorder operands (#65118)
Andy Ayers [Fri, 11 Feb 2022 16:06:35 +0000 (08:06 -0800)]
JIT: fgMorphModToSubMulDiv should not reorder operands (#65118)

There was existing logic to spill but it was there to avoid duplicating costly trees and was
not considering possible interference. Unfortunately, this method is invoked in morph
preorder and child node flags can't be trusted for interference checks.

Fix is to update `fgMakeMultiUse` so it will spill any exposed local.

2 years agoAdd suppressions (#65030)
Dan Moseley [Fri, 11 Feb 2022 15:56:28 +0000 (08:56 -0700)]
Add suppressions (#65030)

2 years agoUpdate StyleCopAnalyzers to 1.2.0-beta.406 (#65142)
Stephen Toub [Fri, 11 Feb 2022 15:03:06 +0000 (10:03 -0500)]
Update StyleCopAnalyzers to 1.2.0-beta.406 (#65142)

* Update to StyleCopAnalyzers 1.2.0-beta.406

* Add missing newlines at end of files to satisfy changes to SA1518

2 years agoFix policheck warnings (#65179)
Andy Gocke [Fri, 11 Feb 2022 11:13:09 +0000 (03:13 -0800)]
Fix policheck warnings (#65179)

2 years agoAvoid InitialTarget in libs tree for CoreLib (#65146)
Viktor Hofer [Fri, 11 Feb 2022 10:33:28 +0000 (11:33 +0100)]
Avoid InitialTarget in libs tree for CoreLib (#65146)

* Avoid InitialTarget in libs tree for CoreLib

InitialTargets are quite expensive as they run for every project invocation, even if the target invoked doesn't require the InitialTarget to run. Libraries projects only have one InitialTarget for correctly referencing CoreLib which can be changed so that it runs before RAR.

2 years agoSubtract instead of building the cartesian product in targets (#65123)
Viktor Hofer [Fri, 11 Feb 2022 07:10:13 +0000 (08:10 +0100)]
Subtract instead of building the cartesian product in targets (#65123)

* Subtract instead of cartesian product in targets

See https://github.com/dotnet/runtime/pull/64000#issuecomment-1030460532. These targets were quite expensive and noticeable in no-op builds. Instead of building the cartesian product via item batching, using subtraction which avoids unnecessary items to be computed.

* Update resolveContract.targets

* Update targetingpacks.targets

* Update resolveContract.targets

* Update resolveContract.targets

2 years agoRemove GeneratedDllImportAttribute.PreserveSig (#65164)
Elinor Fung [Fri, 11 Feb 2022 03:03:11 +0000 (19:03 -0800)]
Remove GeneratedDllImportAttribute.PreserveSig (#65164)

2 years agoSecond round of changing null checks to !! (#65108)
Stephen Toub [Fri, 11 Feb 2022 01:40:07 +0000 (20:40 -0500)]
Second round of changing null checks to !! (#65108)

2 years agoAdd a few more regex generator malformed input tests (#65159)
Stephen Toub [Fri, 11 Feb 2022 00:34:36 +0000 (19:34 -0500)]
Add a few more regex generator malformed input tests (#65159)

2 years agoFix DacEnumerableHashTable enumerator (#65157)
Jan Kotas [Fri, 11 Feb 2022 00:27:14 +0000 (16:27 -0800)]
Fix DacEnumerableHashTable enumerator (#65157)

The enumerator was missing the last 2 buckets

Fixes #65013

2 years agoUpdate RateLimiter queues on cancellation (#64825)
Brennan [Thu, 10 Feb 2022 23:27:24 +0000 (15:27 -0800)]
Update RateLimiter queues on cancellation (#64825)

2 years agoUpdate linux-instructions.md for .NET 6/7 (#65160)
Andrew Wang [Thu, 10 Feb 2022 22:56:09 +0000 (14:56 -0800)]
Update linux-instructions.md for .NET 6/7 (#65160)

* Update linux build instructions for .NET 6/7
* Add linux musl arm to the list

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
2 years ago[wasm] Disable System.Threading.Channels.Tests (#65083)
Ankit Jain [Thu, 10 Feb 2022 22:02:40 +0000 (17:02 -0500)]
[wasm] Disable System.Threading.Channels.Tests (#65083)

Issue: https://github.com/dotnet/runtime/issues/65012

2 years agoRemoving Unity and StructureMap from DependencyInjection.ExternalContainers.Tests...
Eric Erhardt [Thu, 10 Feb 2022 21:38:10 +0000 (15:38 -0600)]
Removing Unity and StructureMap from DependencyInjection.ExternalContainers.Tests (#65091)

These are no longer being developed/maintained. Thus there is no reason for us to keep running our tests against them.

Also, updating the rest of the DI containers to their latest stable versions.

Fix #64988

2 years agoCopy propagation tweaking (#64378)
SingleAccretion [Thu, 10 Feb 2022 20:53:44 +0000 (23:53 +0300)]
Copy propagation tweaking (#64378)

* Relax the type check

The type check is too conservative: it prevents partial
definitions from being used in propagation:
```
LCL_FLD V00/1 [X] = { ... }; // Pushed on the stack as a def.

USE LCL_VAR V01 // Has the same VN as V00/1, but the type
                // check prevented it from being replaced.
```
This new version is conservative too, but will do for now
as we don't propagate on (most) partial uses.

Another reason for this change is that in my upcoming refactoring
of copy propagation (that will bring another 0.5% in TP gains), we
will no longer have the "defNode" available.

* Do not propagate shadowed "this"

Ordinarily, shadowed parameters would not be used for
propagation anyway, because of the liveness check, but
"this" bypasses that checks, and so was used, which is
presumably not what we want.

Regardless of that, it is also not profitable to propagate
"this" in such a situation as it extends its live range
and makes the RA unhappy.

* NO_SHADOW_COPY -> BAD_VAR_NUM

2 years ago[tests][mobile] Enable diagnostic_tracing for mobile runtime tests (#60879)
Mitchell Hwang [Thu, 10 Feb 2022 20:36:45 +0000 (15:36 -0500)]
[tests][mobile] Enable diagnostic_tracing for mobile runtime tests (#60879)

* [mobile] Add diagnostics tracing to Android iOS mobile runtime components

* [tests] Reenable eventactivityidcontrol test on Android

Reenables eventactivityidcontrol now that diagnostics_tracing runtime component is included

* [tests] Enable non-eventpipe Android tracing tests to emulate desktop mono

* Revert "[tests] Enable non-eventpipe Android tracing tests to emulate desktop mono"

This reverts commit 3b8ef2356a739ee66962bb65f81db9d8ae64f3f3.

* [tests] Skip JitOptimizationSensitive script on mono

* Update Android GetStandardTransport TcpClient initialization

* [tests] Skip diagnostics tests on browser and Android

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
2 years agoImplement LoadPairVector64 and LoadPairVector128 (#64864)
Egor Chesakov [Thu, 10 Feb 2022 19:51:16 +0000 (11:51 -0800)]
Implement LoadPairVector64 and LoadPairVector128 (#64864)

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
2 years agoMove DllImportGenerator to use DisableRuntimeMarshalling for its blittable classifica...
Jeremy Koritzinsky [Thu, 10 Feb 2022 19:26:14 +0000 (11:26 -0800)]
Move DllImportGenerator to use DisableRuntimeMarshalling for its blittable classification (#64279)

2 years ago[wasm] Add exports to workaround emscripten bug (#64807)
Radek Doulik [Thu, 10 Feb 2022 19:02:09 +0000 (20:02 +0100)]
[wasm] Add exports to workaround emscripten bug (#64807)

* [wasm] Workaround emscripten bug

Fix https://github.com/dotnet/runtime/issues/64724 and
https://github.com/dotnet/runtime/issues/64725

* Re-enable failing tests

* Revert "Re-enable failing tests"

This reverts commit 52b270d2eef3f48b9b51ed47ea406dbccfe3652b.

2 years agoMark cctor tests with RequiresProcessIsolation property (#65036)
Tomáš Rylek [Thu, 10 Feb 2022 18:59:02 +0000 (19:59 +0100)]
Mark cctor tests with RequiresProcessIsolation property (#65036)

This change marks several JIT/Methodical tests as requiring out-of-process
execution because they exercise managed runtime initialization. It also
includes various small fixes I had to apply to make the change fully
functional end to end.

Thanks

Tomas

2 years agoFix bool.TryParse/Format on big-endian systems (#65078)
Ulrich Weigand [Thu, 10 Feb 2022 18:34:14 +0000 (19:34 +0100)]
Fix bool.TryParse/Format on big-endian systems (#65078)

* Fix regression after https://github.com/dotnet/runtime/pull/64782

2 years ago[mono] Fix support for calls to static virtual methods from gshared code. (#65126)
Zoltan Varga [Thu, 10 Feb 2022 17:32:58 +0000 (12:32 -0500)]
[mono] Fix support for calls to static virtual methods from gshared code. (#65126)

Fixes https://github.com/dotnet/runtime/issues/65002.

When called from gshared code, these methods cannot be resolved at compile time,
since they depend on the constrained class which is only known at runtime.

* For calls from normal gshared code, load the method address from the rgctx.
* For calls from gsharedvt code, extend the existing mono_gsharedvt_constrained_call ()
JIT icall to be able to handle static virtual methods.

2 years agoFix too wide memory accesses for nullchecks (#64683)
Egor Bogatov [Thu, 10 Feb 2022 17:04:31 +0000 (20:04 +0300)]
Fix too wide memory accesses for nullchecks (#64683)

2 years agoFixing a runtime check and test to match the EnableISA flag behavior (#65096)
Tanner Gooding [Thu, 10 Feb 2022 16:57:24 +0000 (08:57 -0800)]
Fixing a runtime check and test to match the EnableISA flag behavior (#65096)

* Fixing a runtime check and test to match the EnableISA flag behavior

* Ensure the Runtime_34587 takes RuntimeInformation.ProcessArchitecture into account

2 years agoFix RegionInfo creation when using LOCALE_CUSTOM_UNSPECIFIED LCID (#64927)
Tarek Mahmoud Sayed [Thu, 10 Feb 2022 16:36:08 +0000 (08:36 -0800)]
Fix RegionInfo creation when using LOCALE_CUSTOM_UNSPECIFIED LCID (#64927)

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
2 years agoFix nullable annotations for MemoryCacheExtensions Set and GetOrCreate (#65133)
Maksym Koshovyi [Thu, 10 Feb 2022 16:30:23 +0000 (18:30 +0200)]
Fix nullable annotations for MemoryCacheExtensions Set and GetOrCreate (#65133)

Fixes: #65107

2 years agodisable TotalMemory2 test from gcstress runs (#65110)
Manish Godse [Thu, 10 Feb 2022 16:29:08 +0000 (08:29 -0800)]
disable TotalMemory2 test from gcstress runs (#65110)

* disable TotalMemory2 test from gcstress

* Disable TM2 as well

2 years agoOptimize `StringBuilder.Insert`. (#64922)
Theodore Tsirpanis [Thu, 10 Feb 2022 16:07:00 +0000 (18:07 +0200)]
Optimize `StringBuilder.Insert`. (#64922)

* Optimize StringBuilder.Insert.

The character array overload calls the ReadOnlySpan overload, and the overloads of primitives call a private helper function that takes advantage of ISpanFormattable.

* Throw OOM when StringBuilder.Insert exceeds capacity, like before.

2 years agoissue-22928 Add ImmutableArray Span-based APIs (#61196)
LateApexEarlySpeed [Thu, 10 Feb 2022 15:39:42 +0000 (23:39 +0800)]
issue-22928 Add ImmutableArray Span-based APIs (#61196)

* issue-22928 Initial commit: AddRange, InsertRange, ToImmutableArray, Create.

* issue-22928 CopyTo, RemoveRange, Slice. Skip old tests.

* Eliminate range based method compilation for .netstandard2.0 and net461.

* issue-22928 Refine to use common code.

* Try to use <framework>_OR_GREATER pre-compilation symbol.

* issue-22928 Test cases of ImmutableArray.Create() overloads.

* issue-22928 Add test cases for ImmutableArray.ToImmutableArray(), ImmutableArray.AddRange().

* Test cases for AsSpan(start, length).

* Test cases of AsSpan(Range).

* Test cases of ImmutableArray.CopyTo().

* Test cases of InsertRange().

* Test cases of RemoveRange().

* Add test cases of .Slice().

* Add test cases of Builder.CopyTo() and Builder.AddRange().

* Add xml doc for AsSpan(Range) method.

* Fix comment: refine test cases; adjust method list order; add Debug.Assert().

* Fix comment: move tfm specific code into separate tfm files.

* Fix ValidateDefaultThisBehavior() logic issue.

* Fix comment: use compile condition: $(TargetFrameworkIdentifier)' == '.NETCoreApp'.

* Fix comment: specify actual data length when construct span.

* Change RemoveRange(ReadOnlySpan) to be O(M+N) implementation.

* Fix comment: refine xml doc.

* Fix comment: Use new CollectionsMarshal methods to get and update value in Dictionary; split netcoreapp RemoveRange and non-netcoreapp RemoveRange().

* Fix comment: refine RemoveRange() to use 'continue'.

* Fix comment: merge 2 tfm version RemoveRange() back to ImmutableArray_1.cs.

* Add some demo-used test cases to indicate (null & custom equalityComparer) case issue for new RemoveRange().

* Revert "Change RemoveRange(ReadOnlySpan) to be O(M+N) implementation."

This reverts commit 50e278d7158e64b75e045ae098fac5f730c87091.

* Fix comment: use explicit type name; enhance RemoveRange test cases to cover 'null' case.

* Use explicit type names.

2 years ago[Mono] Add arm64 SIMD intrinsic for Vector64/128 Abs (#65086)
Meri Khamoyan [Thu, 10 Feb 2022 14:33:01 +0000 (18:33 +0400)]
[Mono] Add arm64 SIMD intrinsic for Vector64/128 Abs (#65086)

* [Mono] Add arm64 SIMD intrinsic for Vector64/128 Abs

2 years ago[wasm][debugger] Fixed debugger attachment to a project with special characters in...
Ilona Tomkowicz [Thu, 10 Feb 2022 14:20:02 +0000 (15:20 +0100)]
[wasm][debugger] Fixed debugger attachment to a project with special characters in the path. (#64527)

* Fixed special path.

* Prevent tests from failing.

* Fix for related but not loaded assemblies with special characters.

* Refactor - changing slash direction is not necessary.

* Undo unnecessary refactoring.

* Added test for setting breakpoint in a source with path with special characters.

* dummy commit

* Adressed @radical's suggestions.

* Add more logged info for failing tests.

* Direct string comparison is not a good idea - locally they are coded and on CI they are not.

* avoid calling pdb2pdb.

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: DESKTOP-GEPIA6N\Thays <thaystg@gmail.com>
2 years agoClean-up DllImportGenerator packaging infra (#64810)
Viktor Hofer [Thu, 10 Feb 2022 13:15:18 +0000 (14:15 +0100)]
Clean-up DllImportGenerator packaging infra (#64810)

* Clean-up DllImportGenerator packaging infra

Most of what DllImportGenerator was trying to achieve via targets or by setting common packaging properties is already handled by libraries common packaging infrastructure (packaging.props) which is imported when a project sets `IsPackable=true`.

2 years ago[main] Update dependencies from dotnet/linker (#64983)
dotnet-maestro[bot] [Thu, 10 Feb 2022 12:54:14 +0000 (13:54 +0100)]
[main] Update dependencies from dotnet/linker (#64983)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix System.Net.NetworkInformation.Tests.PingTest.SendPingToExternalHostWithLowTtlTest...
Radek Zikmund [Thu, 10 Feb 2022 11:26:55 +0000 (12:26 +0100)]
Fix System.Net.NetworkInformation.Tests.PingTest.SendPingToExternalHostWithLowTtlTest (#65075)

2 years agoEnable set of nullability checks in NativeAOT CoreLib (#64730)
Andrii Kurdiumov [Thu, 10 Feb 2022 07:28:14 +0000 (13:28 +0600)]
Enable set of nullability checks in NativeAOT CoreLib (#64730)

Contributes to https://github.com/dotnet/runtimelab/issues/106

2 years agoUpdate Parallel.ForEachAsync.cs (#65009)
Theodor Zoulias [Thu, 10 Feb 2022 04:16:55 +0000 (06:16 +0200)]
Update Parallel.ForEachAsync.cs (#65009)

2 years agoOverwrite existing inc file in h2inc (#65113)
Adeel Mujahid [Thu, 10 Feb 2022 04:12:56 +0000 (06:12 +0200)]
Overwrite existing inc file in h2inc (#65113)

2 years agoJIT: verify containment safety before forming address modes (#65048)
Andy Ayers [Thu, 10 Feb 2022 02:31:23 +0000 (18:31 -0800)]
JIT: verify containment safety before forming address modes (#65048)

At least on arm64, where LEAs must be contained.

Fixes #64936.

2 years agoDon't throw from RemoteExecutor on SkipTestExceptions (#65105)
Miha Zupan [Thu, 10 Feb 2022 01:45:52 +0000 (17:45 -0800)]
Don't throw from RemoteExecutor on SkipTestExceptions (#65105)

2 years agoDeduplicate several special classes of JIT/Methodical tests (#64842)
Tomáš Rylek [Wed, 9 Feb 2022 23:27:32 +0000 (00:27 +0100)]
Deduplicate several special classes of JIT/Methodical tests (#64842)

* Deduplicate a few special tests
* Deduplicate helper module main.cs in unsafecsharp tests

2 years agoClean up several special tests under JIT/Methodical (#64837)
Tomáš Rylek [Wed, 9 Feb 2022 23:26:20 +0000 (00:26 +0100)]
Clean up several special tests under JIT/Methodical (#64837)

* Clean up a bunch of weird one-off test source code constructs

Several IL tests listed their classes twice - presumably once as a
'declaration' and ther second time as the 'definition'. Apart from
the fact that this causes trouble in my semi-automatic IL rewriter,
I don't see any reason for keeping this moving forward as it just
clutters the files and complicates their maintenance. I also found
one remaining test with main accepting command-line arguments
(previously overlooked due to lowercase m).

Thanks

Tomas

2 years agoFor LclHeap touch a page at [originalSp] not at [originalSp+amount] in src/coreclr...
Egor Chesakov [Wed, 9 Feb 2022 23:18:57 +0000 (15:18 -0800)]
For LclHeap touch a page at [originalSp] not at [originalSp+amount] in src/coreclr/jit/codegenarm64.cpp (#65088)

2 years agoFix Arm64 CFG dispatcher being always disabled (#65095)
Austin Wise [Wed, 9 Feb 2022 23:12:36 +0000 (15:12 -0800)]
Fix Arm64 CFG dispatcher being always disabled (#65095)

Fix of a typo in #63763

2 years agoAccount for HWI stores in LIR side effects code (#65079)
SingleAccretion [Wed, 9 Feb 2022 21:07:43 +0000 (00:07 +0300)]
Account for HWI stores in LIR side effects code (#65079)

* Add a test

* Account for HWI stores in LIR side effect code

Otherwise we risk missing stores to addressable locations.

* Add MEMORYBARRIER to fix the assert

Won't ever matter as memory barriers split statements.

2 years agoLimit the number of JIT/HardwareIntrinsics/* tests when running under GCStress (...
Egor Chesakov [Wed, 9 Feb 2022 19:51:42 +0000 (11:51 -0800)]
Limit the number of JIT/HardwareIntrinsics/* tests when running under GCStress (#65049)

2 years agostabilize quic tests on server 2022 (#65057)
Tomas Weinfurt [Wed, 9 Feb 2022 19:25:34 +0000 (19:25 +0000)]
stabilize quic tests on server 2022 (#65057)

2 years agofix ping tests on unsupported unix platforms (#65060)
Tomas Weinfurt [Wed, 9 Feb 2022 18:48:18 +0000 (18:48 +0000)]
fix ping tests on unsupported unix platforms (#65060)

2 years agoAdd default method support to virtual statics (#64717)
David Wrighton [Wed, 9 Feb 2022 18:44:15 +0000 (10:44 -0800)]
Add default method support to virtual statics (#64717)

- The preview feature version of virtual statics implemented for .NET 6 does not allow for the interface methods to have a default implementation.
- With this change, we add support for the interface method having an actual implementation to CoreCLR. From what I can tell the Mono runtime already had such support
- There are some small ECMA spec updates to allow this change that are also included

In addition, I've taken the liberty to enable running the coreclr test suite on Mono on Windows. It needed a small amount of fixup.

2 years agoFileSystemWatcher.Unix: use CLOEXEC when initializing an inotify instance. (#64971)
Tom Deseyn [Wed, 9 Feb 2022 18:39:17 +0000 (19:39 +0100)]
FileSystemWatcher.Unix: use CLOEXEC when initializing an inotify instance. (#64971)

This stops inotify instances from leaking into child processes,
and helps reduce .NET applications hitting the system inotify limit.

2 years agoChange `OSX.1015.Arm64.Open` to `OSX.1100.Arm64.Open` (former does not exist) (#65093)
Přemek Vysoký [Wed, 9 Feb 2022 18:19:55 +0000 (19:19 +0100)]
Change `OSX.1015.Arm64.Open` to `OSX.1100.Arm64.Open` (former does not exist) (#65093)

2 years ago[Android] Workaround for invalid return value from clock_nanosleep (#64679)
Simon Rozsival [Wed, 9 Feb 2022 17:41:06 +0000 (18:41 +0100)]
[Android] Workaround for invalid return value from clock_nanosleep (#64679)

There used to be a bug in Android libc implementation of `clock_nanosleep`. The return value should be `errno` on errors  but instead in it returns `-1` and sets `errno`. The libc (Bionic) bug [has been fixed](https://android-review.googlesource.com/c/platform/bionic/+/110652/) since Android 6 and newer but it causes problems to [customers who are unable to update Android on their devices](https://github.com/xamarin/xamarin-android/issues/6600#issuecomment-1026023654).

Fixes https://github.com/xamarin/xamarin-android/issues/6600

* Account for incorrect implementation of clock_nanosleep in older Android libc

* Shorten comments

* Add g_clock_nanosleep function

* Add remap definition

* Fix build

* Make sure the extra check runs only on Android

* Make Windows builds happy

* Try making wasm builds happy

2 years agoImplement TLS1.3 delayed client cert requests on Linux
Radek Zikmund [Wed, 9 Feb 2022 17:14:18 +0000 (18:14 +0100)]
Implement TLS1.3 delayed client cert requests on Linux

2 years agoMove iOS/tvOS simulator runs back to the OSX.1015.Amd64.Open queue (#65070)
Alexander Köplinger [Wed, 9 Feb 2022 15:36:32 +0000 (16:36 +0100)]
Move iOS/tvOS simulator runs back to the OSX.1015.Amd64.Open queue (#65070)

There's a problem with exit code detection on the 12.00 queue.

2 years agoPull msquic from official microsoft linux package repository (#65063)
Marie Píchová [Wed, 9 Feb 2022 15:03:43 +0000 (16:03 +0100)]
Pull msquic from official microsoft linux package repository (#65063)

2 years ago[Mono] Add SIMD intrinsics for Vector64/128 ConditionalSelect on Arm64 (#65062)
Simon Rozsival [Wed, 9 Feb 2022 14:41:11 +0000 (15:41 +0100)]
[Mono] Add SIMD intrinsics for Vector64/128 ConditionalSelect on Arm64  (#65062)

* Add conditional select vector intrinsic

* Remove unrelated code change

2 years agoIntroduce DOTNET_AltJitOS (#64979)
Egor Bogatov [Wed, 9 Feb 2022 14:11:52 +0000 (17:11 +0300)]
Introduce DOTNET_AltJitOS (#64979)

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years ago[main] Update dependencies from dotnet/icu dotnet/xharness dotnet/runtime-assets...
dotnet-maestro[bot] [Wed, 9 Feb 2022 10:57:35 +0000 (10:57 +0000)]
[main] Update dependencies from dotnet/icu dotnet/xharness dotnet/runtime-assets dotnet/roslyn-analyzers dotnet/hotreload-utils dotnet/llvm-project (#64982)

[main] Update dependencies from dotnet/icu dotnet/xharness dotnet/runtime-assets dotnet/roslyn-analyzers dotnet/hotreload-utils dotnet/llvm-project

 - Merge branch 'main' into darc-main-51defe84-5fd5-4263-9073-7190ffd6b499

2 years agoConsolidate _handshakeBuffer and _internalBuffer in SslStream (#64747)
Radek Zikmund [Wed, 9 Feb 2022 10:36:31 +0000 (11:36 +0100)]
Consolidate _handshakeBuffer and _internalBuffer in SslStream (#64747)

The two buffers have been merged together since they are never used in parallel (i.e. receciving appdata is not allowed during renegotiation etc.).

2 years ago[Mono] Add arm64 SIMD intrinsic for Vector64/128 Ceiling and Floor (#64994)
Simon Rozsival [Wed, 9 Feb 2022 10:01:39 +0000 (11:01 +0100)]
[Mono] Add arm64 SIMD intrinsic for Vector64/128 Ceiling and Floor (#64994)

* Add intrinsic for Vector64/128 Ceiling

* Add intrinsic for Vector64/128 Floor

Co-authored-by: Simon Rozsival <srozsival@xam-emag-01.redmond.corp.microsoft.com>
2 years ago[wasm] Fix WebSocket tests on NodeJS (#64330)
Marek Fišera [Wed, 9 Feb 2022 09:27:24 +0000 (10:27 +0100)]
[wasm] Fix WebSocket tests on NodeJS (#64330)

- Move all SetScriptCommands to a target, so they are placed after scenario in the generated script.
- Add WasmXHarnessArgsCli as an alternative variable that can be used from cli.
- Fix NodeJS symbolic links on Helix.
- Copy TestEchoMiddleware and RemoteLoopMiddleware even for Scenario=NodeJS.
- Enable System.Net.WebSockets.Client.Tests on NodeJS.

2 years agoDisable SendPingWithHostAndTimeoutAndBuffer tests on OSX (#65055)
Elinor Fung [Wed, 9 Feb 2022 08:02:27 +0000 (00:02 -0800)]
Disable SendPingWithHostAndTimeoutAndBuffer tests on OSX (#65055)

2 years agoRun System.Collections instead of System.Runtime tests (#65044)
Michal Strehovský [Wed, 9 Feb 2022 06:24:10 +0000 (15:24 +0900)]
Run System.Collections instead of System.Runtime tests (#65044)

The newly added NativeAOT libraries testing is very unstable. System.Collections are probably a less intense test, so run that one instead.

This will of course be revisited since we want to run more libraries tests but I want to stop turning people's PR's red.

If this is not sufficient, we'll have to pull the entire leg until it's root caused.

2 years agoFix mono native warnings from wasm targets (#64650)
Adeel Mujahid [Wed, 9 Feb 2022 06:23:56 +0000 (08:23 +0200)]
Fix mono native warnings from wasm targets (#64650)

* Fix mono native warnings from wasm targets

* Add back Werror option

* Use tabs for indent

2 years agoimprove SslStream tests on server 2022 (#64968)
Tomas Weinfurt [Wed, 9 Feb 2022 06:02:22 +0000 (06:02 +0000)]
improve SslStream tests on server 2022 (#64968)

* improve SslStream tests on server 2022

* Update src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs

Co-authored-by: Anton Firszov <antonfir@gmail.com>
Co-authored-by: Anton Firszov <antonfir@gmail.com>
2 years agoAdd a new wrapper `runtime-wasm.yml` to be used from azdo (#65032)
Ankit Jain [Wed, 9 Feb 2022 05:23:45 +0000 (00:23 -0500)]
Add a new wrapper `runtime-wasm.yml` to be used from azdo (#65032)

* Add a new wrapper `runtime-wasm.yml` to be used from azdo

Currently, we have `runtime-wasm` in azdo pointing to
`runtime-extra-platforms.yml`, which has some scheduled triggers
defined. azdo seems to use these for running `runtime-wasm` too.

Instead, in azdo use a new `runtime-wasm.yml` for `runtime-wasm` pipeline, so
we can explicitly avoid the scheduled triggers. This yml just uses the
existing `runtime-extra-platforms-wasm.yml`.

* Add missing variables template. thanks to @safern

2 years agoDisable ILVerify for source build (#64833)
Jan Kotas [Wed, 9 Feb 2022 05:01:02 +0000 (21:01 -0800)]
Disable ILVerify for source build (#64833)

2 years agoOverride DictionaryEntry.ToString to match KeyValuePair.ToString (#64959)
Jeff Handley [Wed, 9 Feb 2022 02:14:27 +0000 (18:14 -0800)]
Override DictionaryEntry.ToString to match KeyValuePair.ToString (#64959)

* Override DictionaryEntry.ToString to match KeyValuePair.ToString

* Add a couple more test cases and test case comments

* Update src/libraries/Common/tests/System/Collections/DictionaryEntry.Tests.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoupdate expected exception for cases when all requested TLS versions are disabled...
Tomas Weinfurt [Wed, 9 Feb 2022 02:09:47 +0000 (02:09 +0000)]
update expected exception for cases when all requested TLS versions are disabled (#65020)

2 years agoimprove SslStream tests on misconfigured systems (#64966)
Tomas Weinfurt [Wed, 9 Feb 2022 02:06:54 +0000 (02:06 +0000)]
improve SslStream tests on misconfigured systems (#64966)

* improve SslStream tests on misconfigured systems

* feedback from review

2 years agoFix error during unwrap existing instance (#64996)
Andrii Kurdiumov [Wed, 9 Feb 2022 01:48:39 +0000 (07:48 +0600)]
Fix error during unwrap existing instance (#64996)

2 years agoFix System.Runtime reference versions and several test project names under JIT/Method...
Tomáš Rylek [Tue, 8 Feb 2022 23:58:21 +0000 (00:58 +0100)]
Fix System.Runtime reference versions and several test project names under JIT/Methodical (#64839)

* Fix System.Runtime reference public key token in delegatetail.il

* Three more IL sources needing explicit System.Runtime PKT

* Clean up several project file names

* Typo

* Fix assembly name for sin_cs_il* tests

2 years agoEnable merging of platform-variant tests
Tomáš Rylek [Tue, 8 Feb 2022 23:49:11 +0000 (00:49 +0100)]
Enable merging of platform-variant tests

This particular change doesn't yet attempt to merge platform-variant tests into
fewer source files mostly because the affected tests are mostly ILPROJ tests and
it's not yet clear to me how to apply platform variations to them without substantial
changes in the source code. For now I have just aligned the assembly vs. project
naming so that the tests work in the merged scenario.

Thanks

Tomas

2 years agoFix outerloop build break (#65027)
Jakob Botsch Nielsen [Tue, 8 Feb 2022 23:04:51 +0000 (00:04 +0100)]
Fix outerloop build break (#65027)

2 years agoUse generic collections in System.ComponentModel.TypeConverter implementation (#63315)
Matt Kotsenas [Tue, 8 Feb 2022 23:00:14 +0000 (15:00 -0800)]
Use generic collections in System.ComponentModel.TypeConverter implementation (#63315)

* Convert ContextStack to use generics

* Convert AttributeCollection to generics

Also replaced a double dictionary lookup with the `TryGet` variant to
increase performance.

* Convert ComponentResourceManager to generics

* Convert LicInfoHelperLicenseContext to generics

* Convert PropertyDescriptor to generics

2 years agoFix size estimates (#64826)
SingleAccretion [Tue, 8 Feb 2022 22:59:12 +0000 (01:59 +0300)]
Fix size estimates (#64826)

2 years agoChange the way we build CoreCLR tests for NativeAOT (#64738)
Michal Strehovský [Tue, 8 Feb 2022 22:23:13 +0000 (07:23 +0900)]
Change the way we build CoreCLR tests for NativeAOT (#64738)

* Remove NativeAOT testing added in dotnet/runtime#62704 to make room for the different strategy.
* Build NativeAOT as part of test build, not test run

2 years agoAdd `runtime-wasm` pipeline (#64830)
Ankit Jain [Tue, 8 Feb 2022 21:56:13 +0000 (16:56 -0500)]
Add `runtime-wasm` pipeline (#64830)

* Add `runtime-wasm` pipeline

This adds support for a `runtime-wasm` pipeline, which uses
`runtime-extra-platforms.yml`.

The wasm jobs have been moved to `runtime-extra-platforms-wasm.yml`, and
the rest to `runtime-extra-platforms-other.yml`. And the two files are
included conditionally.

Effectively, this still runs all these jobs when
`runtime-extra-platforms` is run (same as before). But it allows running
just the wasm jobs, triggered manually with:

    `/azp run runtime-wasm`

When `runtime-wasm` is manually run:

- LibraryTests will run all the tests on linux+windows
- LibraryTests_EAT will run all the tests on linux
- LibraryTests_AOT will run all the tests on linux+windows
- Wasm.Build.Tests, and Wasm debugger tests will run on linux+windows
- Runtime tests will run on linux

When `runtime-extra-platforms` is manually run:

- LibraryTests will run all the tests, if paths changed
- LibraryTests_EAT will run all the tests on linux, if paths changed
- LibraryTests_AOT will run all the tests on linux+windows, if paths changed
- Wasm.Build.Tests, and Wasm debugger tests will never run
- Runtime tests will never run

On rolling builds, `runtime-extra-platforms` runs by default:

- LibraryTests will run all the tests
- LibraryTests_EAT will run all the tests on linux
- LibraryTests_AOT will run all the tests on linux+windows
- Wasm.Build.Tests, and Wasm debugger tests will never run
- Runtime tests will never run

With feedback from @steveisok, and @safern.

* Flow `isExtraPlatformsBuild` to the new *-wasm, and *-other templates

```
/mnt/vss/_work/1/s/.packages/microsoft.dotnet.helix.sdk/7.0.0-beta.22080.1/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(18,5): error : You must specify at least one target queue to send a job to helix. Use the HelixTargetQueues property or HelixTargetQueue items. [/mnt/vss/_work/1/s/src/libraries/sendtohelixhelp.proj]
```

Fix suggested by @safern

* Update condition, based on feedback

* Fix typo

* Rename the var `RunSmokeTestsOnly` to *not* the match msbuild property

.. used to control smoke tests. The variables in yml seem to get
converted to environment variables which can affect the build. Like
causing unrelated builds to get `RUNSMOKETESTSONLY=true`, and breaking
the build.

2 years agoInitial roll out of !! (#64720)
Stephen Toub [Tue, 8 Feb 2022 21:06:59 +0000 (16:06 -0500)]
Initial roll out of !! (#64720)

* Bump version of C# compiler

This should be reverted when arcade brings in a new enough compiler.

* Fix a few new warnings from updating compiler

* Enable IDE0190 to employ parameter null checking

* Initial roll out of !!

* Fix more compiler warnings from upgrade, plus some test fixes / reverts

* Fix a few more tests

* Disable profiling test

2 years agoUpdate Android to r23b image (#64567)
Jo Shields [Tue, 8 Feb 2022 21:06:48 +0000 (16:06 -0500)]
Update Android to r23b image (#64567)

* Update Android to r23b image

* Don't use flag unavailable in r23b

2 years agoTemporarily disable core dumps when running libraries tests on macOS (#65001)
Elinor Fung [Tue, 8 Feb 2022 19:57:53 +0000 (11:57 -0800)]
Temporarily disable core dumps when running libraries tests on macOS (#65001)

2 years agoIncluding FastFloat in parsing process (#62301)
Carl Verret [Tue, 8 Feb 2022 19:33:46 +0000 (14:33 -0500)]
Including FastFloat in parsing process (#62301)

* Including FastFloat in parsing process

* PR step 1 - adjusting code in regards to received comments.

* DigitsToUInt64 : Parsing batches of 8 digits with SWAR

* Update src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
* Update src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
* MaxMantissaFastPath fix

* merge problem...

* Revert "merge problem..."

This reverts commit 1b5fd5136a5396c6439ffd47ef46d0c8b3134693.

* removing an extra comparison for fast path.

* According to PR review, all requested changes are in this commit.

* According to new serie of comments on this PR.

* Fixing formatting.

* fixing sentence ending in comments

* Update THIRD-PARTY-NOTICES.TXT

Adding license notice for FastFloat algorithm

* Update src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Identation of power of 5 table

* some adjustements according to reviewer's requests.

* Unnecessary assignment of a value to 'exponent'

* removing excedent path for total digits < 7

* removing path for totaldigits <7

* getting rid of unused power of 10 table

* Renaming FastFloat specific values
Specifying infinitePower param as hexa

* renaming some variables and adjusting comments.

* Handle endianness swapping for BigEndian systems.

Co-authored-by: Günther Foidl <gue@korporal.at>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2 years agoTest and comment one-shot CFB8 with extra padding
Kevin Jones [Tue, 8 Feb 2022 19:11:34 +0000 (14:11 -0500)]
Test and comment one-shot CFB8 with extra padding

The CFB one shot decryption handled up to block-size padding intentionally. This adds a test and a comment to explain why.

2 years agoJIT: more stringent interference checks in forward sub (#64933)
Andy Ayers [Tue, 8 Feb 2022 19:05:09 +0000 (11:05 -0800)]
JIT: more stringent interference checks in forward sub (#64933)

Forward sub analysis was missing some cases of call arg interference and so
inviting/allowing morph to do unsafe arg reorderings.

Fix by considering all kinds of local nodes, not just GT_LCL_VAR, as sources
of interference.

Closes #64904.

2 years agoAdd JIT support for control-flow guard on x64 and arm64 (#63763)
Jakob Botsch Nielsen [Tue, 8 Feb 2022 17:20:12 +0000 (18:20 +0100)]
Add JIT support for control-flow guard on x64 and arm64 (#63763)

Add support for generating control-flow guard checks. The support is enabled by a JIT flag or by setting COMPlus_JitForceControlFlowGuard=1.

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
2 years agoJIT: fix containment safety check in LowerHWIntrinsicGetElement (#64960)
Andy Ayers [Tue, 8 Feb 2022 15:59:59 +0000 (07:59 -0800)]
JIT: fix containment safety check in LowerHWIntrinsicGetElement (#64960)

Missing call to IsSafeToContainMem was causing us to mistakenly think
an operand was going to be contained when it wasn't.

Fixes #64918

2 years agoJIT: fix morph's tree rethreading/recosting logic (#64954)
Andy Ayers [Tue, 8 Feb 2022 15:57:30 +0000 (07:57 -0800)]
JIT: fix morph's tree rethreading/recosting logic (#64954)

Morph might sometimes not rethread/recost changed trees, leading to asserts
downstream as ordered traversals ran across deleted operands.

Fixes #64892

2 years agoTake into account zero-offset field sequences when propagating locals (#64701)
SingleAccretion [Tue, 8 Feb 2022 15:30:28 +0000 (18:30 +0300)]
Take into account zero-offset field sequences when propagating locals (#64701)

* Add a test

* Fix the problem

LCL_VAR use VN != VN of its SSA def.

Using one for replacement can run afoul of substituting
into a LCL_VAR that has a zero-offset field sequence on
top and thus duplicate the sequence (as the replacement
def will already have this sequence incorporated into its
VN).

* Fix the same problem in local propagation

Just one diff, missing null check elimination: we propagated a field
sequence for an array address (PtrToArrElem) that later wasn't recognized
as implying non-nullness of another PtrToArrElem to the same array.

2 years agoDelete StructLayoutAttribute.Pack adjustment (#64965)
Jan Kotas [Tue, 8 Feb 2022 15:28:17 +0000 (07:28 -0800)]
Delete StructLayoutAttribute.Pack adjustment (#64965)

This adjustment was trying to minic adjustment performed by type loader, but the logic has been out-of-sync with the type loader evolution for years.
It does not make sense for custom attribute reading via reflection to perform this adjustment.

Fixes #12480

2 years ago[mono] Fix is_byreflike_set on big-endian platforms (#64903)
Ulrich Weigand [Tue, 8 Feb 2022 15:16:32 +0000 (16:16 +0100)]
[mono] Fix is_byreflike_set on big-endian platforms (#64903)

* Use int / gint32 types to avoid C# vs. native type mismatches

* Fixes s390x regression after https://github.com/dotnet/runtime/pull/63985

2 years agoReduce the cost of creating a MemoryMappedFile (#63790)
Adam Sitnik [Tue, 8 Feb 2022 09:17:51 +0000 (10:17 +0100)]
Reduce the cost of creating a MemoryMappedFile (#63790)

* don't fetch the file size more than once when creating a MemoryMappedFile

* use SafeFileHandle instead FileStream

* ensure the handle is disposed when fetching the file size fails

2 years agoImprove Directory.Move and DirectoryInfo.MoveTo (#63675)
Adam Sitnik [Tue, 8 Feb 2022 09:10:40 +0000 (10:10 +0100)]
Improve Directory.Move and DirectoryInfo.MoveTo (#63675)

* fix the tests: call the virtual Move method, which is overridden in DirectoryInfo_MoveTo class and allows for testing DirectoryInfo.MoveTo as well

* unify the Directory.Move and DirectoryInfo.MoveTo logic, move the common part to FileSystem.MoveDirectory

* remove duplicated check

* there is no need to perform the extra checks on Windows

* check for source file existence only once

* on WASM rename does not fail with ENOTDIR for files that end with /
so we need to handle it before rename is called

2 years agoFix card marking issue (#64748)
Peter Sollich [Tue, 8 Feb 2022 09:07:51 +0000 (10:07 +0100)]
Fix card marking issue (#64748)

Fix issue where we didn't clear cards at the ends of regions.

The problem is that when we reach the end of a region during card marking, we clear the cards between card and card_of (end). If card_of (end) is equal to card, we end up clearing nothing at all.

A similar problem occurs when cards happen to be set between end and the end of the reserved memory of the region - these cards would never be cleared.

Both issues don't affect correctness, but they do affect performance for regions with very few cross generation pointers.

Note this change affects only regions - for segments, we stay with code that is equivalent to what we had before.

2 years ago[Mono] Fix potential crash when handling image load event. (#64908)
Johan Lorensson [Tue, 8 Feb 2022 08:42:59 +0000 (09:42 +0100)]
[Mono] Fix potential crash when handling image load event. (#64908)

2 years agoAdd user-facing docs and samples for NativeAOT (#64894)
Michal Strehovský [Tue, 8 Feb 2022 07:39:55 +0000 (16:39 +0900)]
Add user-facing docs and samples for NativeAOT (#64894)

As of https://github.com/dotnet/runtimelab/commit/04b092003db5ba207d4fa3f3becb7f01828bf16c.

2 years agoFix runtime tests on Android (#64950)
Alexander Köplinger [Tue, 8 Feb 2022 05:50:06 +0000 (06:50 +0100)]
Fix runtime tests on Android (#64950)

In https://github.com/dotnet/runtime/pull/64744 I changed the name of the env variable used to store the test results directoy but I didn't notice that the runtime tests don't use the same runner.

Fixes https://github.com/dotnet/runtime/issues/64920

2 years agoImprove SSL platform detection (#64923)
Tomas Weinfurt [Tue, 8 Feb 2022 04:49:55 +0000 (20:49 -0800)]
Improve SSL platform detection (#64923)

* CI matrix change: add Windows Server 2022

* Add registry check for ssl3 - tls1.2 tests

* Disable TLS1.3 on framework code

* Fix typo

* revert queue change

Co-authored-by: Jan Jahoda <jajahoda@microsoft.com>