platform/upstream/dotnet/runtime.git
4 years agoFix Path.GetPathRoot wrong check in Unix (#35734)
Carlos Sanchez Lopez [Wed, 13 May 2020 19:24:01 +0000 (12:24 -0700)]
Fix Path.GetPathRoot wrong check in Unix (#35734)

* Fix Path.GetPathRoot wrong check in Unix

* Return .Empty instead of null

* Update src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Address unit test comments

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years ago[CBOR] Implement a proof of concept for ECDsa COSE key serialization (#36002)
Eirik Tsarpalis [Wed, 13 May 2020 19:16:03 +0000 (20:16 +0100)]
[CBOR] Implement a proof of concept for ECDsa COSE key serialization (#36002)

* Implement a proof of concept for ECDSA cose key serialization

* roundtrip COSE all the way to the ECDsa instance

* remove comment out code

* fix tests failing on Linux

* address feedback

* fix tests for linux

* address feedback

* add missing using statement

* refactor CoseKey deserializer implementation so that optional fields are supported.

4 years agoThrottle allocations in BinaryReader (#36348)
Levi Broderick [Wed, 13 May 2020 18:02:13 +0000 (11:02 -0700)]
Throttle allocations in BinaryReader (#36348)

4 years agoAdd a WasmAppBuilder task and a sample. (#36338)
Zoltan Varga [Wed, 13 May 2020 17:10:57 +0000 (13:10 -0400)]
Add a WasmAppBuilder task and a sample. (#36338)

4 years agoUpdate -vs removal switch documentation (#36353)
Viktor Hofer [Wed, 13 May 2020 16:57:17 +0000 (18:57 +0200)]
Update -vs removal switch documentation (#36353)

4 years agoSet TargetsMobile=true on Browser TargetOS and build the wasm runtimes earlier during...
Alexander Köplinger [Wed, 13 May 2020 16:39:17 +0000 (18:39 +0200)]
Set TargetsMobile=true on Browser TargetOS and build the wasm runtimes earlier during the libs build (#36337)

* Set TargetsMobile=true on Browser TargetOS

* Build the wasm runtimes earlier during the libs build so they end up in lib-runtime-packs.

* Add emsdk_env.sh into .gitignore

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
4 years agoMerge pull request #36268 from kouvel/NamedMutexFix
Koundinya Veluri [Wed, 13 May 2020 16:37:16 +0000 (12:37 -0400)]
Merge pull request #36268 from kouvel/NamedMutexFix

Fix Unix named mutex crash during some race conditions

Below when I refer to "mutex" I'm referring to the underlying mutex object, not an instance of the `Mutex` class.
- When the last reference to a mutex is closed while the lock is held by some thread and a pthread mutex is used, the mutex was attempted to be destroyed but that has undefined behavior
- There doesn't seem to be a way to behave exactly like on Windows for this corner case, where the mutex is destroyed when the last reference to it is released, regardless of which process has the mutex locked and which process releases the last reference to it (they could be two different processes), including in cases of abrupt shutdown
- For this corner case I settled on what seems like a decent solution and compatible with older runtimes:
  - When a process releases its last reference to the mutex
    - If that mutex is locked by the same thread, the lock is abandoned and the process no longer references the mutex
    - If that mutex is locked by a different thread, the lifetime of the mutex is extended with an implicit ref. The implicit ref prevents this or other processes from attempting to destroy the mutex while it is locked. The implicit ref is removed in either of these cases:
      - The mutex gets another reference from within the same process
      - The thread that owns the lock exits and abandons the mutex, at which point that would be the last reference to the mutex and the process would not reference the mutex anymore
  - The implementation based on file locks is less restricted, but for consistency that implementation also follows the same behavior
- There was also a race between an exiting thread abandoning one of its locked named mutexes and another thread releasing the last reference to it, fixed by using the creation/deletion process lock to synchronize

Fix for https://github.com/dotnet/runtime/issues/34271 in master
Closes https://github.com/dotnet/runtime/issues/28449 - probably doesn't fix the issue, but trying to enable it to see if it continues to fail

4 years agoReturn exit code 1 in android test runner if a test failed (#36319)
Santiago Fernandez Madero [Wed, 13 May 2020 16:00:23 +0000 (09:00 -0700)]
Return exit code 1 in android test runner if a test failed (#36319)

* Return exit code 1 in android test runner if a test failed

* Exit instrumentation with runner exit code

4 years agoRemove some `= null!`s from corelib (#36175)
Stephen Toub [Wed, 13 May 2020 13:13:14 +0000 (09:13 -0400)]
Remove some `= null!`s from corelib (#36175)

* Remove some `= null!`s from corelib

In some cases, this was achieved by:
- Using [MemberNotNull] when it could be used to enable the compiler to appropriately follow the initialization
- Making the field nullable and using `!`s at usage sites in cases where the `= null!` wasn't appropriate because the field could actually be null
- Making the field nullable and adding null checks sparingly
- Suppressing warnings in cases where fields weren't accessed in managed code
- Removing stale cases where it wasn't necessary anymore anyway
- Removing unnecessary empty internal/private ctors

* Address PR feedback

* Disable test on mono

4 years agoEmit DWARF debug_abbrev offset for compile units as a label instead of 0 (#36320)
monojenkins [Wed, 13 May 2020 12:23:28 +0000 (08:23 -0400)]
Emit DWARF debug_abbrev offset for compile units as a label instead of 0 (#36320)

When outputting DWARF code to start a compilation unit in .debug_info, the standard expect a 4-byte offset from the .debug_abbrev code. Mono has always output an offset of 0.

However, this doesn't work in every cases. When we have linux+fullaot, we link two object files (one from Mono, one from LLVM). Both have their .debug_abbrev section. If we use 0 as an offset, it seems possible that the linker will keep thinking that our offset is 0, no matter the circumstances. Since the offset is always 0, it can be using the wrong abbreviation table (i.e. the one from the LLVM assembly instead of the one from the Mono assembly). The consequence of this is that the linked file is not valid DWARF (dwarfdump and objdump will complain about invalid offsets). At best, some tools will be able to work with a part of what we have, but any program requiring entirely valid DWARF will fail.

To fix this, we generate a label for the start of our debug_abbrev section and we instead generate it by generating a long with that label. This matches existing behavior seen in the LLVM generated code, and makes dwarfdump and objdump react properly to the linked product.

Fixes mono/mono#8806

Co-authored-by: mathieubourgeois <mathieubourgeois@users.noreply.github.com>
4 years ago[runtime] Move delegate_bound_static_invoke_cache to MonoWrapperCaches. (#36309)
monojenkins [Wed, 13 May 2020 12:01:30 +0000 (08:01 -0400)]
[runtime] Move delegate_bound_static_invoke_cache to MonoWrapperCaches. (#36309)

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoAdd MonoAOTCompiler msbuild task (#35961)
Alexander Köplinger [Wed, 13 May 2020 10:50:39 +0000 (12:50 +0200)]
Add MonoAOTCompiler msbuild task (#35961)

4 years agoRemove several unnecessary arrays used with Split (#36304)
Stephen Toub [Wed, 13 May 2020 03:35:53 +0000 (23:35 -0400)]
Remove several unnecessary arrays used with Split (#36304)

Now that we have a Split overload that takes a single char, the previous optimization to cache an array and reuse that array with the array-based overload isn't needed.

4 years agoAdd POH size counter (#36150)
Sung Yoon Whang [Wed, 13 May 2020 03:16:00 +0000 (20:16 -0700)]
Add POH size counter (#36150)

* Add POH size counter

* Add 'Pinned Object Heap' to DisplayName

4 years agoFlow exit code from RunTests.sh in iOS (#36315)
Santiago Fernandez Madero [Wed, 13 May 2020 02:55:48 +0000 (19:55 -0700)]
Flow exit code from RunTests.sh in iOS (#36315)

4 years agoRemove unsed variable in MsQuicApi (#36302)
Eric Erhardt [Wed, 13 May 2020 02:39:49 +0000 (21:39 -0500)]
Remove unsed variable in MsQuicApi (#36302)

4 years agoPrevent build scripts from letting random values through (#35642)
Ivan Diaz Sanchez [Wed, 13 May 2020 01:58:51 +0000 (18:58 -0700)]
Prevent build scripts from letting random values through (#35642)

* Arch, OS, and Config no longer let random values through when building the repo. Also, removed the casing restrictions on the bash version.

* Fixed the bash build script! Also, casing restrictions are gone!

* Added safeguards for bogus values on -rc and -lc on the sh build script.

* Fixed the merge conflict on build.sh

* Used awk instead of declare for increased compatibility on build.sh

* Restored execute permissions to build.sh

4 years agoFix Microsoft.Extensions.DependencyModel AssemblyVersionInPackageVersion (#36301)
Eric Erhardt [Wed, 13 May 2020 01:07:59 +0000 (20:07 -0500)]
Fix Microsoft.Extensions.DependencyModel AssemblyVersionInPackageVersion (#36301)

4 years agoSet ExactSpelling=true on P/Invokes in System.Private.CoreLib that already specify...
Elinor Fung [Wed, 13 May 2020 01:04:14 +0000 (18:04 -0700)]
Set ExactSpelling=true on P/Invokes in System.Private.CoreLib that already specify the unicode W suffix (#36257)

* Set ExactSpelling=true on P/Invokes in System.Private.CoreLib that
already specify the unicode W suffix

* PR feedback: refactor NDirectMethodDesc::FindEntryPoint

4 years agoFix HttpClient SSL3.0 test on newer Windows OS (#36308)
David Shulman [Wed, 13 May 2020 00:36:08 +0000 (17:36 -0700)]
Fix HttpClient SSL3.0 test on newer Windows OS (#36308)

When I upgraded my dev machine to Windows 10 Version 2004 Preview, I noticed that the
HttpClient GetAsync_SupportedSSLVersion_Succeeds test was failing when using SSL 3.0.

This new version of Windows changes the default setting of SSL 3.0. So, by default,
SSL 3.0 is no longer enabled.

The problem was that this specific test wasn't using our PlatformDetection.SupportsSsl30
logic. Fixed the test so that it will properly detect whether SSL 3.0 is enabled on
the machine.

4 years agoAdd ctor to JsonSerializerOptions that takes serializer defaults (#36073)
Nikiforov Alexey [Wed, 13 May 2020 00:13:16 +0000 (03:13 +0300)]
Add ctor to JsonSerializerOptions that takes serializer defaults (#36073)

* add ctor to JsonSerializerOptions that takes serializer defaults

* add out of range handling; enhance xml documentation

* test serializer option construction via serializer defaults

* adjust PredefinedSerializerOptions tests

4 years agoAdd QCALL_CONTRACT_NO_GC_TRANSITION (#36294)
Aaron Robinson [Tue, 12 May 2020 23:10:36 +0000 (16:10 -0700)]
Add QCALL_CONTRACT_NO_GC_TRANSITION (#36294)

New QCall macro for APIs that use SuppressGCTransitionAttribute.

4 years agoFix nullable annotations on DangerousAcceptAnyServerCertificateValidator (#36305)
Stephen Toub [Tue, 12 May 2020 22:48:53 +0000 (18:48 -0400)]
Fix nullable annotations on DangerousAcceptAnyServerCertificateValidator (#36305)

It should match ServerCertificateCustomValidationCallback.

4 years agoComment typos (#36296)
Aaron Hudon [Tue, 12 May 2020 21:29:36 +0000 (14:29 -0700)]
Comment typos (#36296)

4 years agoUse Publish target for self contained test apps (#36290)
Santiago Fernandez Madero [Tue, 12 May 2020 20:43:24 +0000 (13:43 -0700)]
Use Publish target for self contained test apps (#36290)

4 years agoAddress feedback, disable a test on Mono, slightly simplify same test (avoid two...
Koundinya Veluri [Tue, 12 May 2020 20:14:37 +0000 (13:14 -0700)]
Address feedback, disable a test on Mono, slightly simplify same test (avoid two guids in name)

4 years agoRemove PlatformAbstractions from runtime tests. (#36243)
Eric Erhardt [Tue, 12 May 2020 20:09:17 +0000 (15:09 -0500)]
Remove PlatformAbstractions from runtime tests. (#36243)

* Remove PlatformAbstractions from runtime tests.

Contributes to #3470

4 years agoIgnore the private key handle cert property for persisted keys
Jeremy Barton [Tue, 12 May 2020 19:54:18 +0000 (12:54 -0700)]
Ignore the private key handle cert property for persisted keys

When a CERT_CONTEXT value has both property 2 (prov info) and property 78
(ncrypt key handle), prefer to load based on the property 2 state.
This avoids a scenario where calling Get[Algorithm]PrivateKey sets the
'CLR IsEphemeral' property on a persisted key, preventing future loads of that key.

An alternative approach of preferring the loaded key over the cold-load was
not selected to avoid value contamination of ephemeral properties set on the
CngKey object directly after the caller calls Get[Algorithm]PrivateKey.

4 years agoFix build break by bumping DependencyModel package version (#36285)
Eric Erhardt [Tue, 12 May 2020 18:04:48 +0000 (13:04 -0500)]
Fix build break by bumping DependencyModel package version (#36285)

4 years agoMinor MethodTable building optimization (#36283)
Jan Vorlicek [Tue, 12 May 2020 17:52:35 +0000 (19:52 +0200)]
Minor MethodTable building optimization (#36283)

When learning on how virtual method overriding is implemented in the
runtime, I've bumped into two places where we were calling
MapToImplSlotNumber twice in a row without any reason. Since this method
isn't trivial, it seems worth fixing.

4 years agoApply CA1835 - Prefer memory overloads for Stream.ReadAsync/WriteAsync (#35941)
Carlos Sanchez Lopez [Tue, 12 May 2020 17:43:28 +0000 (10:43 -0700)]
Apply CA1835 - Prefer memory overloads for Stream.ReadAsync/WriteAsync (#35941)

* Apply CA1835 Roslyn fixes on .NET Libraries
- Prefer the Stream.ReadAsync and Stream.WriteAsync memory overloads.
- Unit test fix suggested by buyaa-n to adjust the usage of these overloads.

* Additional missing unit test overload for ReadOnlyMemory

4 years ago[mono] Don't throw inheritance error on interfaces in IsDefined (#35516)
Ryan Lucia [Tue, 12 May 2020 17:16:16 +0000 (13:16 -0400)]
[mono] Don't throw inheritance error on interfaces in IsDefined (#35516)

Issue is very similar to the one fixed in https://github.com/dotnet/runtime/commit/3df21ae60ec7de12abc77f4cc329903abe9ea542. When adding the error messages, we were too strict on when to throw. This should hopefully avoid all that by being significantly more lax.

Test moved to be in a location better suited to both examples.

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

4 years agoUse CopyTo(arr) instead of creating List<T> first (#36228)
Youssef Victor [Tue, 12 May 2020 16:50:06 +0000 (18:50 +0200)]
Use CopyTo(arr) instead of creating List<T> first (#36228)

* Use LINQ ToArray

* Update RoType.cs

* Update RoType.cs

* Update src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoType.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix whitespace causing analyzer warnings

Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoUpdate testing.md (#36286)
Santiago Fernandez Madero [Tue, 12 May 2020 16:49:05 +0000 (09:49 -0700)]
Update testing.md (#36286)

4 years ago[master] Update dependencies from 4 repositories (#36279)
dotnet-maestro[bot] [Tue, 12 May 2020 16:48:50 +0000 (12:48 -0400)]
[master] Update dependencies from 4 repositories (#36279)

* Update dependencies from https://github.com/dotnet/arcade build 20200508.8

- Microsoft.DotNet.XUnitExtensions: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.VersionTools.Tasks: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.ApiCompat: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.Arcade.Sdk: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.Build.Tasks.Feed: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.Build.Tasks.Packaging: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.CodeAnalysis: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.XUnitConsoleRunner: 2.5.1-beta.20256.5 -> 2.5.1-beta.20258.8
- Microsoft.DotNet.Helix.Sdk: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.RemoteExecutor: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8
- Microsoft.DotNet.GenFacades: 5.0.0-beta.20256.5 -> 5.0.0-beta.20258.8

* Update dependencies from https://github.com/mono/linker build 20200511.2

- Microsoft.NET.ILLink.Tasks: 5.0.0-preview.3.20257.4 -> 5.0.0-preview.3.20261.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20200511.3

- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20261.1 -> 6.0.1-alpha.1.20261.3
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20261.1 -> 6.0.1-alpha.1.20261.3
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20261.1 -> 6.0.1-alpha.1.20261.3
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20261.1 -> 6.0.1-alpha.1.20261.3
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20261.1 -> 6.0.1-alpha.1.20261.3
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20261.1 -> 6.0.1-alpha.1.20261.3

* Update dependencies from https://github.com/dotnet/xharness build 20200511.4

- Microsoft.DotNet.XHarness.Tests.Runners: 1.0.0-prerelease.20257.4 -> 1.0.0-prerelease.20261.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoEnsure Process.ProcessName doesn't change when setting Thread.Name on Linux (#34064)
Tom Deseyn [Tue, 12 May 2020 14:08:50 +0000 (16:08 +0200)]
Ensure Process.ProcessName doesn't change when setting Thread.Name on Linux (#34064)

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

This issue is a side-effect of adding support for setting thread names on Linux in https://github.com/dotnet/coreclr/pull/27182.

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
4 years agoAdd configurations for SunOS CoreCLR managed build (#36266)
Adeel Mujahid [Tue, 12 May 2020 13:45:02 +0000 (16:45 +0300)]
Add configurations for SunOS CoreCLR managed build (#36266)

4 years agoBuild tests as self contained apps for mobile targets (#36262)
Santiago Fernandez Madero [Tue, 12 May 2020 11:47:59 +0000 (04:47 -0700)]
Build tests as self contained apps for mobile targets (#36262)

This uses the SDK to publish tests as self contained apps before building the app bundle using the built runtime pack.

I moved the `RunTests.sh` output path to `BundleDir` as whenever we start sending to helix, there is no need to .zip up the whole `OutDir` as we can just send the bundle + `RunTests.sh` script.

4 years agoMerge pull request #35683 from krwq/nullable-xml-2
Krzysztof Wicher [Tue, 12 May 2020 08:29:47 +0000 (01:29 -0700)]
Merge pull request #35683 from krwq/nullable-xml-2

Nullable: System.Xml, part 2

4 years agoBuild WASM runtimes (#35566)
Zoltan Varga [Tue, 12 May 2020 07:29:02 +0000 (03:29 -0400)]
Build WASM runtimes (#35566)

4 years agoFix vs testing link (#36261)
Sean Hall [Tue, 12 May 2020 06:24:02 +0000 (16:24 +1000)]
Fix vs testing link (#36261)

4 years agoFix Unix named mutex crash during some race conditions
Koundinya Veluri [Mon, 27 Apr 2020 23:30:06 +0000 (16:30 -0700)]
Fix Unix named mutex crash during some race conditions

Below when I refer to "mutex" I'm referring to the underlying mutex object, not an instance of the `Mutex` class.
- When the last reference to a mutex is closed while the lock is held by some thread and a pthread mutex is used, the mutex was attempted to be destroyed but that has undefined behavior
- There doesn't seem to be a way to behave exactly like on Windows for this corner case, where the mutex is destroyed when the last reference to it is released, regardless of which process has the mutex locked and which process releases the last reference to it (they could be two different processes), including in cases of abrupt shutdown
- For this corner case I settled on what seems like a decent solution and compatible with older runtimes:
  - When a process releases its last reference to the mutex
    - If that mutex is locked by the same thread, the lock is abandoned and the process no longer references the mutex
    - If that mutex is locked by a different thread, the lifetime of the mutex is extended with an implicit ref. The implicit ref prevents this or other processes from attempting to destroy the mutex while it is locked. The implicit ref is removed in either of these cases:
      - The mutex gets another reference from within the same process
      - The thread that owns the lock exits and abandons the mutex, at which point that would be the last reference to the mutex and the process would not reference the mutex anymore
  - The implementation based on file locks is less restricted, but for consistency that implementation also follows the same behavior
- There was also a race between an exiting thread abandoning one of its locked named mutexes and another thread releasing the last reference to it, fixed by using the creation/deletion process lock to synchronize

Fix for https://github.com/dotnet/runtime/issues/34271 in master
Closes https://github.com/dotnet/runtime/issues/28449 - probably doesn't fix the issue, but trying to enable it to see if it continues to fail

4 years agoHandle struct marshal stubs in ILStubManager::TraceManager. (#36249)
Jeremy Koritzinsky [Tue, 12 May 2020 05:18:17 +0000 (22:18 -0700)]
Handle struct marshal stubs in ILStubManager::TraceManager. (#36249)

Fixes #36248

4 years agodisable ServerAsyncAuthenticate_MismatchProtocols_Fails again (#36250)
Tomas Weinfurt [Tue, 12 May 2020 01:48:54 +0000 (18:48 -0700)]
disable ServerAsyncAuthenticate_MismatchProtocols_Fails again (#36250)

4 years ago[ARM64] Implement Duplicate and DuplicateSelectedScalar (#36144)
Tanner Gooding [Tue, 12 May 2020 01:32:04 +0000 (18:32 -0700)]
[ARM64] Implement Duplicate and DuplicateSelectedScalar (#36144)

* Adding support for DuplicateToVector64 and DuplicateToVector128 to Arm.AdvSimd and Arm.AdvSimd.Arm64

* Adding tests for DuplicateToVector64 and DuplicateToVector128

* Adding support for DuplicateSelectedScalarToVector64 and DuplicateSelectedScalarToVector128 to Arm.AdvSimd and Arm.AdvSimd.Arm64

* Adding tests for DuplicateSelectedScalarToVector64 and DuplicateSelectedScalarToVector128

* Regenerating tests for the newly added HWIntrinsics

* Ensure parentheses exist

* Removing the AdvSimd.Arm64 hwintrinsiclist entry for DuplicateToVector64

* Removing the rest of the NI_AdvSimd_arm64_DuplicateToVector64 usages and clarifying a comment

* Moving break outside the braces for consistency

* Removing another Arm64.DuplicateToVector64

* Removing the AdvSimd.Arm64.DuplicateToVector64 tests

* Adding tests covering DuplicateToVector64/DuplicateToVector128 immediate inputs

* Regenerating the ARM64 HWIntrinsic tests

* Fixing the DuplicateToVector immediate tests

* Regenerating the DuplicateToVector immediate tests

4 years agoDelete outdated todo comment (#36224)
Youssef Victor [Tue, 12 May 2020 01:12:22 +0000 (03:12 +0200)]
Delete outdated todo comment (#36224)

4 years agoupdate branding to preview6 (#36247)
Anirudh Agnihotry [Tue, 12 May 2020 00:56:45 +0000 (17:56 -0700)]
update branding to preview6 (#36247)

4 years agoReduce DebugInfoTable size (#36174)
Simon Nattress [Mon, 11 May 2020 23:35:06 +0000 (16:35 -0700)]
Reduce DebugInfoTable size (#36174)

The DebugInfoTableNode contains an array of native format vertices that currently are not unified. Many methods have identical debug info blobs so they can be collapsed to save output binary size. For identical debug info blobs, pass the same byte array reference to the native format writer which will unify on the object reference.

In the framework composite image for example, 70% of the debug infos are duplicates. Removing the duplicates reduces the composite image size by 5%.

4 years agoFix empty ParamName in ArgumentException (#36208)
Youssef Victor [Mon, 11 May 2020 23:34:17 +0000 (01:34 +0200)]
Fix empty ParamName in ArgumentException (#36208)

* Update reflectioninvocation.cpp

* Update TypeInfoTests.cs

* Update EnumConverterTest.cs

4 years agoFix up nint code after latest changes to use compiler nint. (#36220)
Eric Erhardt [Mon, 11 May 2020 22:02:42 +0000 (17:02 -0500)]
Fix up nint code after latest changes to use compiler nint. (#36220)

4 years ago[testing] Rename Prop AppleTestBuilderDir to AppleAppBuilderDir (#36227)
Mitchell Hwang [Mon, 11 May 2020 21:57:51 +0000 (17:57 -0400)]
[testing] Rename Prop AppleTestBuilderDir to AppleAppBuilderDir (#36227)

Co-authored-by: Mitchell Hwang <mihw@microsoft.com>
4 years agoRemove EmbeddedResourceUseDependentUponConvention (#36140)
Viktor Hofer [Mon, 11 May 2020 21:37:25 +0000 (23:37 +0200)]
Remove EmbeddedResourceUseDependentUponConvention (#36140)

Underlying issue is fixed: https://github.com/microsoft/msbuild/issues/4740

4 years agoUse already defined generateAssemblyReferenceSource rather defining a new target...
Anirudh Agnihotry [Mon, 11 May 2020 20:59:11 +0000 (13:59 -0700)]
Use already defined generateAssemblyReferenceSource rather defining a new target (#35818)

* use arcade target

* extra space

* fixes generation of reference src from runtime projects

* run target to get genapi

* use referencePath to get references

* adding  GenerateReferenceSource target

* added the target name

4 years agoSetup pr and batch runs for dev/infrsatructure (#36218)
Jarret Shook [Mon, 11 May 2020 20:01:19 +0000 (13:01 -0700)]
Setup pr and batch runs for dev/infrsatructure (#36218)

4 years agoEnsure we mark op2 as delayFree if it is rmw and the parent node returns a non-SIMD...
Tanner Gooding [Mon, 11 May 2020 19:43:07 +0000 (12:43 -0700)]
Ensure we mark op2 as delayFree if it is rmw and the parent node returns a non-SIMD type (#36226)

4 years agoUpdate the mscorlib.md document. (#36225)
Aaron Robinson [Mon, 11 May 2020 19:29:42 +0000 (12:29 -0700)]
Update the mscorlib.md document. (#36225)

Rename mscorlib.md to corelib.md.
Remove no longer relevant details.

4 years agoFix iOS and Android samples (#36223)
Egor Bogatov [Mon, 11 May 2020 18:47:13 +0000 (21:47 +0300)]
Fix iOS and Android samples (#36223)

4 years agoMake global ComWrappers for marshalling respect requested IID (#36054)
Elinor Fung [Mon, 11 May 2020 18:06:12 +0000 (11:06 -0700)]
Make global ComWrappers for marshalling respect requested IID (#36054)

4 years agoInclude Content-Type in exception in ReadFromJsonAsync (#36186)
Youssef Victor [Mon, 11 May 2020 18:05:14 +0000 (20:05 +0200)]
Include Content-Type in exception in ReadFromJsonAsync (#36186)

* Update Strings.resx

* Update HttpContentJsonExtensions.cs

4 years agoExpose the parsed signature in structured format (#36190)
Andrew Au [Mon, 11 May 2020 18:00:41 +0000 (11:00 -0700)]
Expose the parsed signature in structured format (#36190)

4 years agoUse TargetFramework conditions consistently in libraries (#35956)
Viktor Hofer [Mon, 11 May 2020 18:00:11 +0000 (20:00 +0200)]
Use TargetFramework conditions consistently in libraries (#35956)

* Use TargetFramework condition consistently in libs

* Add docs section to describe the guideline

* Update Microsoft.Extensions.DependencyInjection.csproj

* Outline TargetFramework DesingTimeBuild issue

* Update Microsoft.Extensions.DependencyInjection.csproj

4 years agoUpdate dependencies from https://github.com/dotnet/llvm-project build 20200511.1...
dotnet-maestro[bot] [Mon, 11 May 2020 17:34:48 +0000 (17:34 +0000)]
Update dependencies from https://github.com/dotnet/llvm-project build 20200511.1 (#36210)

- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20254.1 -> 6.0.1-alpha.1.20261.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20254.1 -> 6.0.1-alpha.1.20261.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20254.1 -> 6.0.1-alpha.1.20261.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20254.1 -> 6.0.1-alpha.1.20261.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20254.1 -> 6.0.1-alpha.1.20261.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20254.1 -> 6.0.1-alpha.1.20261.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoAdd invalidation to DTFI's SetAllDateTimePatterns (#34438)
ts2do [Mon, 11 May 2020 17:32:59 +0000 (12:32 -0500)]
Add invalidation to DTFI's SetAllDateTimePatterns (#34438)

Invalidate derived patterns to match the behavior of invoking the corresponding property setters

4 years agoRevert "Revert "Remove superflous CheckReleased call which will slow down Event Log...
Tarek Mahmoud Sayed [Mon, 11 May 2020 17:29:17 +0000 (10:29 -0700)]
Revert "Revert "Remove superflous CheckReleased call which will slow down Event Log Reading up to 20x times. (#35911)" (#36143)" (#36188)

This reverts commit ca8c9dea8e30a9701160e4cd61b5b26f209499ff.

4 years agoPreempt Watson exception handling (#36179)
Manish Godse [Mon, 11 May 2020 17:24:37 +0000 (10:24 -0700)]
Preempt Watson exception handling (#36179)

* switch to preemp GC before DW version lookup

* move preempt to PopulateBucketParameters

* Adding GC_TRIGGERS to callchain of CaptureUnhandledInfoForWatson

* explictly adding PREEMPTIVE to all DwGetFileVersionInfo codepaths.

4 years agoAdd some upcoming distro RIDs
Omair Majid [Mon, 11 May 2020 15:58:20 +0000 (11:58 -0400)]
Add some upcoming distro RIDs

This adds some RIDs that we know are current/upcoming:

- Fedora 33 is in development, and the version after this is most likely
  going to be Fedora 34. Adding this RID now, so we can get this RID in
  all current releases when it comes time to build on Fedora 34

- RHEL has generally committed to doing a major release every 3 years.
  With RHEL 8 released in 2019, RHEL 9 is under development. There's
  even a plan on how to create that from Fedora here:
  https://fedoraproject.org/wiki/Changes/ELN_Buildroot_and_Compose

- If there's a RHEL 9, there will most likely be an equivalent CentOS 9.
  Lets add that too.

- CentOS 7 has an aarch64 port. As does CentOS 8.

4 years agoImprove deserialization perf for case-insensitive and missing-property cases (#35848)
Steve Harter [Mon, 11 May 2020 15:54:41 +0000 (10:54 -0500)]
Improve deserialization perf for case-insensitive and missing-property cases (#35848)

4 years agoReturn the correct OSVersion on OSX like systems. (#36029)
Eric Erhardt [Mon, 11 May 2020 14:47:01 +0000 (09:47 -0500)]
Return the correct OSVersion on OSX like systems. (#36029)

* Return the correct OSVersion on OSX like systems.

Fix #34977

* Rename files to not have Linux when they aren't Linux specific.

* Assert OSVersion Build number is valid.

* PR feedback

Move interop code to Common\src\Interop.
Specify the full path to libobjc.dylib.
Fix objc_msgSend_stret for ARM64.

* Specify full path to libproc.dylib.

Fix #24095

4 years agoPort GC changes from dotnet/corert (#36197)
Jan Kotas [Mon, 11 May 2020 10:57:07 +0000 (03:57 -0700)]
Port GC changes from dotnet/corert (#36197)

4 years ago[mono] Fix musl PowerPC build (#36162)
monojenkins [Mon, 11 May 2020 08:35:19 +0000 (04:35 -0400)]
[mono] Fix musl PowerPC build (#36162)

PT_NIP and friends are in this kernel header, but glibc includes it
somewhere in the chain implicitly. musl doesn't. Fix that.

4 years agoUpdate ryujit-tutorial.md (#36191)
Jan Kotas [Mon, 11 May 2020 05:29:50 +0000 (22:29 -0700)]
Update ryujit-tutorial.md (#36191)

4 years agoAdding unit test to provoke exception using Sch_WhiteSpaceRestriction… (#35013)
mrj001 [Mon, 11 May 2020 02:41:54 +0000 (20:41 -0600)]
Adding unit test to provoke exception using Sch_WhiteSpaceRestriction… (#35013)

* Adding unit test to provoke exception using Sch_WhiteSpaceRestriction1 as its message.

4 years ago[tests] Adjustments to interp disabled tests (#36178)
monojenkins [Sun, 10 May 2020 21:12:15 +0000 (17:12 -0400)]
[tests] Adjustments to interp disabled tests (#36178)

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoFix sync call in XContainer.ReadContentFromAsync (#35789)
Emmanuel André [Sun, 10 May 2020 20:37:54 +0000 (22:37 +0200)]
Fix sync call in XContainer.ReadContentFromAsync (#35789)

* Fix sync call in XContainer.ReadContentFromAsync

4 years agoAdd tests for changes in #34438 (#36166)
ts2do [Sun, 10 May 2020 19:17:15 +0000 (14:17 -0500)]
Add tests for changes in #34438 (#36166)

4 years agoRemove CompareOrdinalEx (#36184)
Egor Bogatov [Sun, 10 May 2020 15:59:43 +0000 (18:59 +0300)]
Remove CompareOrdinalEx (#36184)

4 years agoUpdate dependencies from https://github.com/dotnet/runtime-assets build 20200508...
dotnet-maestro[bot] [Sun, 10 May 2020 11:13:17 +0000 (07:13 -0400)]
Update dependencies from https://github.com/dotnet/runtime-assets build 20200508.1 (#36161)

- System.ComponentModel.TypeConverter.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.Drawing.Common.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.IO.Compression.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.IO.Packaging.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.Net.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.Private.Runtime.UnicodeData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.Security.Cryptography.X509Certificates.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1
- System.Windows.Extensions.TestData: 5.0.0-beta.20257.1 -> 5.0.0-beta.20258.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoFix mobile testing and do some extra cleanup in variables (#36157)
Santiago Fernandez Madero [Sun, 10 May 2020 10:44:54 +0000 (03:44 -0700)]
Fix mobile testing and do some extra cleanup in variables (#36157)

4 years agoRemove unnecessary static array from FrameworkName (#36176)
Stephen Toub [Sun, 10 May 2020 10:18:20 +0000 (06:18 -0400)]
Remove unnecessary static array from FrameworkName (#36176)

Now that there's a char overload of Split, we don't need the cached array.

4 years agoReenable iOS_arm builds (#34942)
Alexander Köplinger [Sun, 10 May 2020 08:38:48 +0000 (10:38 +0200)]
Reenable iOS_arm builds (#34942)

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

4 years agoFix buffer overrun in JIT for Vector256<T> types on ARM64. (#35864)
Anton Lapounov [Sun, 10 May 2020 01:41:20 +0000 (18:41 -0700)]
Fix buffer overrun in JIT for Vector256<T> types on ARM64. (#35864)

Stop recognizing Vector256<T> types as intrinsic for ARM64 in Crossgen2.

4 years agoEnable Common Runtime Tests for Mono on Linux-Arm64 in CI (#35366)
Nathan Ricci [Sat, 9 May 2020 23:31:27 +0000 (19:31 -0400)]
Enable Common Runtime Tests for Mono on Linux-Arm64 in CI (#35366)

Enable runtime tests on Linux-amd64 running Mono. Also add issues to issues.targets for the same.

4 years agoMake Uri Thread-Safe (#33042)
Miha Zupan [Sat, 9 May 2020 19:26:16 +0000 (21:26 +0200)]
Make Uri Thread-Safe (#33042)

* Do not lock on string in Uri

* Make Uri thread-safe without locks

*A lock may still be used for custom parsers

* Update comments

* Use existing style for enum values

* Add a comment about locking for custom parsers

* Add a comment about DebugSetLeftCtor usage

* Add trailing dot in exception message

* Fix typos

* Fix typo

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoUse C# compiler provided nint/nuint (#36159)
Jan Kotas [Sat, 9 May 2020 14:41:33 +0000 (07:41 -0700)]
Use C# compiler provided nint/nuint (#36159)

4 years agoincrease FailingTestTimeoutMiliseconds for Ssl server tests. (#36101)
Tomas Weinfurt [Sat, 9 May 2020 12:57:20 +0000 (05:57 -0700)]
increase FailingTestTimeoutMiliseconds for Ssl server tests. (#36101)

* increase FailingTestTimeoutMiliseconds

* use standard ITestOutputHelper helper

* set timeout to to 500ms

* rework protocol mismatch

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoadd platform to two tests to avoid test skip on Unix (#36082)
Tomas Weinfurt [Sat, 9 May 2020 12:55:15 +0000 (05:55 -0700)]
add platform to two tests to avoid test skip on Unix (#36082)

4 years agoApply Regex starting loop optimization to non-atomic loops as well (#35936)
Stephen Toub [Sat, 9 May 2020 10:12:15 +0000 (06:12 -0400)]
Apply Regex starting loop optimization to non-atomic loops as well (#35936)

* Apply Regex starting loop optimization to non-atomic loops as well

* Remove min iteration restriction

The node.N > 0 restriction isn't necessary, and prevents this optimization from being used with * loops.    Worst case, the loop doesn't match anything, and we pay to overwrite the starting position with itself.  Best case, we eliminate a ton of cost.

4 years ago[interp] Fix sdks build (#36121)
monojenkins [Sat, 9 May 2020 08:26:43 +0000 (04:26 -0400)]
[interp] Fix sdks build (#36121)

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoFixing test failing on arm64 (#36145)
Jose Perez Rodriguez [Sat, 9 May 2020 05:20:34 +0000 (22:20 -0700)]
Fixing test failing on arm64 (#36145)

4 years agoFinish the other part of the GCTotalPhysicalMemory config implementation (#36152)
Jan Kotas [Sat, 9 May 2020 04:39:46 +0000 (21:39 -0700)]
Finish the other part of the GCTotalPhysicalMemory config implementation (#36152)

* Finish the other part of the GCTotalPhysicalMemory config implementation

The total physical memory specified by the GCTotalPhysicalMemory config
needs to communicated over to the VM side for memory load calculation.
Otherwise inside GC we are using the correct physical memory specified,
but when we ask for the memory load it's still based on the total available
memory.

* Delete unnecessary delay-loading of kernel32.dll

* Avoid mutable restricted memory limit inside OS PAL

Co-authored-by: Maoni0 <maonis@microsoft.com>
4 years agoReact to latest Roslyn nullability changes (#36104)
Levi Broderick [Sat, 9 May 2020 03:12:52 +0000 (20:12 -0700)]
React to latest Roslyn nullability changes (#36104)

Also updates the compiler toolset to the latest version

4 years agoNaricc/test mono is mono (#36079)
Nathan Ricci [Fri, 8 May 2020 21:58:24 +0000 (17:58 -0400)]
Naricc/test mono is mono (#36079)

Add test to test if we are running mono.

4 years agoRevert "Remove superflous CheckReleased call which will slow down Event Log Reading...
Tarek Mahmoud Sayed [Fri, 8 May 2020 21:30:35 +0000 (14:30 -0700)]
Revert "Remove superflous CheckReleased call which will slow down Event Log Reading up to 20x times. (#35911)" (#36143)

This reverts commit 4602a61526631a5b29d451b40be3e3e321b86c00.

4 years agoEnable VS Test Explorer without the -vs switch (#36126)
Viktor Hofer [Fri, 8 May 2020 20:12:25 +0000 (22:12 +0200)]
Enable VS Test Explorer without the -vs switch (#36126)

* Enable VS Test Explorer without the -vs switch

4 years agoAdd windows 8 and windows 7 testing for PRs in a reduced way (#36096)
Santiago Fernandez Madero [Fri, 8 May 2020 19:07:15 +0000 (12:07 -0700)]
Add windows 8 and windows 7 testing for PRs in a reduced way (#36096)

4 years agoDocument F5 and Test Explorer prerequisites (#36117)
Viktor Hofer [Fri, 8 May 2020 19:03:17 +0000 (21:03 +0200)]
Document F5 and Test Explorer prerequisites (#36117)

* Document F5 and Test Explorer prerequisites

* Update docs/workflow/testing/visualstudio.md

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoFix reverse marshalling of refs to blittable types (#8140) (#36119)
Jan Kotas [Fri, 8 May 2020 18:34:07 +0000 (11:34 -0700)]
Fix reverse marshalling of refs to blittable types (#8140) (#36119)

Hit in selfhosted ilc.exe. In JitInterface we have a couple cases where we do reverse p/invoke with a delegate that has a ref parameter. Sometimes the `ref` is null (and we don't touch it).

The marshaller was trying to make a copy of the pointed to value, NullRefing in the process because the pointer was null. We don't actually need to make a copy because the value is blittable.

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
4 years agoMerge pull request #35826 from layomia/converter_handle_null
Layomi Akinrinade [Fri, 8 May 2020 17:56:28 +0000 (13:56 -0400)]
Merge pull request #35826 from layomia/converter_handle_null

Add opt-in for converters to handle null

4 years agoMerge pull request #32107 from YohDeadfall/fix-hidden-props
Layomi Akinrinade [Fri, 8 May 2020 17:55:20 +0000 (13:55 -0400)]
Merge pull request #32107 from YohDeadfall/fix-hidden-props

Fixed serialization of hidden base class members

4 years agoAdd mono performance runs (#34825)
Drew Scoggins [Fri, 8 May 2020 17:50:13 +0000 (10:50 -0700)]
Add mono performance runs (#34825)

* Add mono perf job

* Move runtimeFlavor to the right level

* chnage variable access

* Change condition

* Add steps to download mono and build the patched dotnet

* Change variable access

* Pass variables directly

* Plumb through mono path to runner

* Fix parameter reference

* Fix variables access?

* Fix typo

* Fix pathing issue

* Add log saving for publish to helix step

* Fix variable in shell script

* Fix up mv command and publish logs step

* Change runkind and add Windows runs

* Add Windows mono build

* Fixup parsing

* Remove Windows runs for now

* Switch to using build command to generate mono testhost

* Fixup parens

* Forgot to add a slash

* Add Windows runs and fix pathing issue

* Add backslash for Windows and -r for cp on Linux

* Switch to using corerun argument

* Switch to monopath

* Use CoreRun

* Remove mono property and use corerun instead

* Fixing closing tags

* Change xcopy to copy

* Add llvm config flag

* Add AOT and Interpreter config flags

* Change order to ensure config gets added

* Change order

* Add exlusion filter for Perf_Image_Load tests

* Add more to exclusion list

* Remove Windows legs for now