platform/upstream/dotnet/runtime.git
3 years agomake MsQuicStatusCodes platform specific (#54031)
Tomas Weinfurt [Fri, 11 Jun 2021 18:02:54 +0000 (20:02 +0200)]
make MsQuicStatusCodes platform specific (#54031)

* make MsQuicStatusCodes platform specific

* add missing StreamLimit

3 years agoRe-enabled mock tests for H/3. (#53802)
Marie Píchová [Fri, 11 Jun 2021 17:57:51 +0000 (19:57 +0200)]
Re-enabled mock tests for H/3. (#53802)

* Re-enabled mock tests for H/3.

* Used IsMockQuicSupported to run the mock tests only on supported platforms.

* Disabling mock test completely.

* Hanging test fix experiment.

* Disabled some mock tests failing in CI.

3 years agoFix assertion on debugger-engine (#54041)
Thays Grazia [Fri, 11 Jun 2021 16:58:33 +0000 (13:58 -0300)]
Fix assertion on debugger-engine (#54041)

Sync to mono/mono #21100

3 years agoUpdate dotnet SDK to 6.0 Preview 4 (#53808)
Viktor Hofer [Fri, 11 Jun 2021 16:55:09 +0000 (18:55 +0200)]
Update dotnet SDK to 6.0 Preview 4 (#53808)

* Update dotnet SDK to 6.0 Preview 4

Update the minimum and target version of the SDK to 6.0 Preview 4.

Part of https://github.com/dotnet/runtime/issues/53411

* Switch to using eng/targetingpacks.targets for redirecting runtime pack location in src/mono/sample

* Fix binder tracing tests

* Set UseMonoRuntime property so the dotnet SDK can pull the mono runtime packs

This is necessary after the changes from https://github.com/dotnet/sdk/pull/16909.

* Move UseMonoRuntimeProperty and set it to false in coreclr

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
3 years agoVector.Sum(Vector<T>) API implementation for horizontal add. (#53527)
Ivan Zlatanov [Fri, 11 Jun 2021 16:50:09 +0000 (19:50 +0300)]
Vector.Sum(Vector<T>) API implementation for horizontal add. (#53527)

* Vector.Sum(Vector<T>) API implementation for horizontal add.

* Fixed inccorrect referece to Arm64 AddAccross intrinsic function.

* Added implementation for hardware accelerated Vector<T>.Sum for long, ulong, float, double on ARM64.

* Fixed formatting issue.

* Correctness.

* Fixed compiler error for ARM64.

* Formatting issue.

* More explicit switch statement. Fixed wrong simd size for NI_Vector64_ToScalar.

* Fixed auto formatting issue.

* Use AddPairwiseScalar for double, long and ulong on ARM64 for VectorT128_Sum.

* Forgot ToScalar call after AddPairwiseScalar.

* Fixed wrong return type.

3 years agoAllow UsingBrowserRuntimeWorkload to be disabled from the project file (#52728)
Pranav K [Fri, 11 Jun 2021 16:40:50 +0000 (09:40 -0700)]
Allow UsingBrowserRuntimeWorkload to be disabled from the project file (#52728)

3 years agoIncrease timeouts for PGO tests (#54030)
Andy Ayers [Fri, 11 Jun 2021 16:15:43 +0000 (09:15 -0700)]
Increase timeouts for PGO tests (#54030)

3 years agoRemoved extraneous closing parentheses causing compile errors. (#54064)
Peter Sollich [Fri, 11 Jun 2021 15:57:05 +0000 (17:57 +0200)]
Removed extraneous closing parentheses causing compile errors. (#54064)

3 years agoFollow up on HostFactoryResolver changes (#54052)
David Fowler [Fri, 11 Jun 2021 15:29:39 +0000 (08:29 -0700)]
Follow up on HostFactoryResolver changes (#54052)

- Cleaned up the comments to explain what ResolveHostFactory does.
- Added entry point completed callback to let callers know when the entry point code is done running.
- Added tests for the various callbacks.

3 years ago[HTTP/3] Fix #53632 by using original host when omitted (#53648)
TimTim [Fri, 11 Jun 2021 14:08:57 +0000 (22:08 +0800)]
[HTTP/3] Fix #53632 by using original host when omitted (#53648)

* Fix #53632

* Annotate non-nullable _originAuthority

* Test inheriting original host for HTTP/3 Alt-Svc

3 years agoMake some Brotli p/invokes blittable (#54029)
Elinor Fung [Fri, 11 Jun 2021 13:51:11 +0000 (06:51 -0700)]
Make some Brotli p/invokes blittable (#54029)

* Make some Brotli p/invokes blittable

* Use Interop.BOOL

3 years agoComActivator tests with built-in COM disabled (#53733)
Lakshan Fernando [Fri, 11 Jun 2021 11:03:14 +0000 (04:03 -0700)]
ComActivator tests with built-in COM disabled (#53733)

* ComActivator tests with built-in COM disabled

* Added negative scnearios with built-in com disabled

* FB

* FB

* FB

* Update src/tests/Interop/COM/Activator/Program.cs

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
3 years ago[interp] Fix loading of ThreadStatic value types (#53391)
Vlad Brezae [Fri, 11 Jun 2021 08:10:27 +0000 (11:10 +0300)]
[interp] Fix loading of ThreadStatic value types (#53391)

* [interp] Fix loading of ThreadStatic value types

* Add runtime test for ThreadStatic valuetype access

3 years ago[interp] Fix IL offset tracking of inlined bblocks (#53989)
Vlad Brezae [Fri, 11 Jun 2021 08:09:36 +0000 (11:09 +0300)]
[interp] Fix IL offset tracking of inlined bblocks  (#53989)

* [interp] Fix il offset tracking of inlined bblocks

During method compilation we maintain the `td->offset_to_bb` array that maps an IL offset to the bblock that contains generated code for those IL instructions. When a bblock is removed, we update this mapping so it no longer points to the removed bblock (even if those IL offsets are unreachable, we might still query them to get ranges for EH clauses). For bblocks that were added during inlining, their `bb->ip` didn't point to code inside the original transformed method, so we failed to remove them from `offset_to_bb` array. Once we finish inlining a method, we update the il_offsets of all newly added basic blocks.

* [interp] Correctly update il offset mapping for merged bblocks

If il_offset1 belongs to BB2 and BB2 is merged into BB1 (BB1->next_bb == BB2), then, once BB2 is removed, il_offset1 should belong to BB1 and not to BB2->next_bb. While it's unclear if this leads to bugs, the previous behavior was conceptually wrong.

3 years agoIn gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if...
Peter Sollich [Fri, 11 Jun 2021 07:58:10 +0000 (09:58 +0200)]
In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled. (#53995)

In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled - otherwise the lower SOH generations may be skipped.

3 years agoAdd trimmer annotations to System.Data.Common (#52046)
Krzysztof Wicher [Fri, 11 Jun 2021 06:47:48 +0000 (08:47 +0200)]
Add trimmer annotations to System.Data.Common (#52046)

Add trimmer annotations to System.Data.Common

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoConsider reloadWeight while evaluating spill cost (#53853)
Kunal Pathak [Fri, 11 Jun 2021 06:32:17 +0000 (23:32 -0700)]
Consider reloadWeight while evaluating spill cost (#53853)

* Consider reloadWeight while evaluating spill cost

* fix linux arm issue

* jit format

3 years ago[wasm][aot] Enable tests that are passing now (#53977)
Ankit Jain [Fri, 11 Jun 2021 03:31:35 +0000 (23:31 -0400)]
[wasm][aot] Enable tests that are passing now (#53977)

* [wasm][aot] Enable tests that are passing now

These don't reproduce on `main` anymore, after the exceptions fix.

`System.Transactions.Locals.Tests` Fixes https://github.com/dotnet/runtime/issues/50969
`System.Threading.Tasks.Parallel.Tests` Fixes https://github.com/dotnet/runtime/issues/51677

* [wasm][aot][tests] Enable `System.Xml.Xsl.XslCompiledTransformApi.Tests`

This hasn't been crashing for quite some time.
The individual test failures are already disabled with
https://github.com/dotnet/runtime/issues/51244, and
https://github.com/dotnet/runtime/issues/51911 .

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

3 years agoEnable devirtualization in more scenarios on crossgen2 (#53567)
David Wrighton [Fri, 11 Jun 2021 00:43:26 +0000 (17:43 -0700)]
Enable devirtualization in more scenarios on crossgen2 (#53567)

Address deficiencies in current devirtualization infrastructure

- Remove the responsibility of creating a CORINFO_RESOLVED_TOKEN structure from the JIT and make it a responsibility of the VM side of the jit interface.
  - This enables the component (crossgen2) which has deeper understanding of the requirements here to correctly handle scenarios that would otherwise require expressing crossgen2 specific details across the jit interface.
- Add a new set of fixups (`READYTORUN_FIXUP_Check_VirtualFunctionOverride` and `READYTORUN_FIXUP_Verify_VirtualFunctionOverride`) these are used to validate that the behavior of the runtime and crossgen2 compiler is equivalent for a virtual resolution event
  - `READYTORUN_FIXUP_Check_VirtualFunctionOverride` will ensure that the virtual resolution decision is the same at crossgen2 time and runtime, and if the decision differs, any generated code affected by the decision will not be used.
  - `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` will perform the same checks as `READYTORUN_FIXUP_Check_VirtualFunctionOverride`, but if it fails the check, the process will be terminated with a fail-fast. It is intended for use under the `--verify-type-and-field-layout` stress mode.
  - Currently only the `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` is actually generated, and it is only generated when using the `--verify-type-and-field-layout` switch to crossgen2. Future work will identify if there are scenarios where we need to generate the `READYTORUN_FIXUP_Check_VirtualFunctionOverride` flag. One area of possible concern is around covariant returns, another is around handling of type equivalence.
- In order to express the fixup signature for the VirtualFunctionOverride fixups, a new flag has been added to `ReadyToRunMethodSigFlags`. `READYTORUN_METHOD_SIG_UpdateContext` will allow the method signature to internally specify the assembly which is associated with the method token, instead of relying on the ambient context.
- R2RDump and the ReadyToRun format documentation have been updated with the details of the new fixups/flags.
- Update the rules for handling unboxing stubs
  - See #51918 for details. This adds a new test, as well as proper handling for unboxing stubs to match the JIT behavior
  - Also revert #52605, which avoided the problem by simply disabling devirtualization in the presence of structs
- Adjust the rules for when it is legal to devirtualize and maintain version resiliency
  - The VersionsWithCode and VersionsWithType rules are unnecessarily restrictive.
  - Instead Validate that the metadata is safely checkable, and rely on the canInline logic to ensure that no IL that can't be handled is inlined.
  - This also involved adding a check that the chain of types from the implementation type to the declaration method table type is within the version bubble.
  - And changing the `VersionsWithType` check on the implementation type, to a new `VersionsWithTypeReference` check which can be used to validate that the type can be referred to, in combination with using `VersionsWithType` on the type definition.
  - By adjusting the way that the declMethod is referred to, it becomes possible to use the declMethod without checking the full method is `VersionsWithCode`, and it just needs a relationship to version matching code.
- In `resolveVirtualMethod` generate the `CORINFO_RESOLVED_TOKEN` structures for the jit
  - In particular we are now able to resolve to methods where the decl method is the resolution result but is not within the version bubble itself. This can happen if we can prove that the decl method is the only method which can possibly implement a virtual.
- Add support for devirtualization reasons to crossgen2
- Port all devirtualization abort conditions to crossgen2 from runtime that were not already present
- Fix devirtualization from a canonical virtual method when the actual implementation is more exact
- Fix variant interface override scenario where there is an interface that requires implementation of the variant interface as well as the variant interface itself.

3 years agoUse custom mobile testing API (#53871)
Fan Yang [Thu, 10 Jun 2021 23:22:56 +0000 (19:22 -0400)]
Use custom mobile testing API (#53871)

* Use custom Android testing API

* Fix for non-mobile cases

* Use Collection Fixtures for mobile only

* Update src/tests/Common/Coreclr.TestWrapper/MobileAppHandler.cs

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Update src/tests/Common/Coreclr.TestWrapper/MobileAppHandler.cs

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Update src/tests/run.proj

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Fix the ios app extension

* Add back Path and remove redundant namespace string

* Add missing class name Path

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
3 years ago[main] Update dependencies from dnceng/internal/dotnet-optimization (#53864)
dotnet-maestro[bot] [Thu, 10 Jun 2021 23:15:07 +0000 (23:15 +0000)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#53864)

[main] Update dependencies from dnceng/internal/dotnet-optimization

3 years agosmall improvements to HTTP Cancellation Tests and rename (#54018)
Geoff Kizer [Thu, 10 Jun 2021 22:58:27 +0000 (15:58 -0700)]
small improvements to HTTP Cancellation Tests and rename (#54018)

* improve HttpClientHandler_Http11_Cancellation_Test and rename to SocketsHttpHandler_Http11_Cancellation_Test

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years ago[main] Update dependencies from dotnet/icu dotnet/llvm-project dotnet/runtime-assets...
dotnet-maestro[bot] [Thu, 10 Jun 2021 22:35:54 +0000 (00:35 +0200)]
[main] Update dependencies from dotnet/icu dotnet/llvm-project dotnet/runtime-assets dotnet/hotreload-utils (#53865)

* Update dependencies from https://github.com/dotnet/icu build 20210607.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-preview.6.21281.1 -> To Version 6.0.0-preview.6.21307.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-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
 From Version 9.0.1-alpha.1.21281.1 -> To Version 11.1.0-alpha.1.21307.2

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20210607.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21305.2 -> To Version 1.0.1-alpha.0.21307.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20210607.1

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.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21301.1 -> To Version 6.0.0-beta.21307.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-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
 From Version 9.0.1-alpha.1.21281.1 -> To Version 11.1.0-alpha.1.21308.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoDon't reference the netstandard shim inside the shared framework (#53023)
Viktor Hofer [Thu, 10 Jun 2021 22:32:53 +0000 (00:32 +0200)]
Don't reference the netstandard shim inside the shared framework (#53023)

* Don't reference ns.dll inside shared framework

The netstandard.dll shim shouldn't be referenced inside the shared
framework as it's a compat shim that shouldn't be required to compose
the shared framework.

This removes the necessity of a separate RefPath build and improves
incremental build times as only the few OOB projects that require the
shim would need to rebuild.

* Reference netstandard shim in OOBs that require it

There are a few OOB projects that require the netstandard.dll shim as
they intentionally reference projects that only expose a netstandard
configuration.

Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
3 years agoHandle Counter Polling Interval of 0 (#53836)
John Salem [Thu, 10 Jun 2021 22:21:30 +0000 (15:21 -0700)]
Handle Counter Polling Interval of 0 (#53836)

3 years ago[main] Update dependencies from mono/linker (#53866)
dotnet-maestro[bot] [Thu, 10 Jun 2021 22:04:42 +0000 (22:04 +0000)]
[main] Update dependencies from mono/linker (#53866)

[main] Update dependencies from mono/linker

3 years agoMake the ZLib P/Invokes all blittable (#53968)
Aaron Robinson [Thu, 10 Jun 2021 21:58:39 +0000 (14:58 -0700)]
Make the ZLib P/Invokes all blittable (#53968)

* Make the ZLib P/Invokes all blittable

3 years ago[mono] Reenable the empty finally optimization. (#53965)
Zoltan Varga [Thu, 10 Jun 2021 21:27:42 +0000 (17:27 -0400)]
[mono] Reenable the empty finally optimization. (#53965)

3 years agoUse InvariantCulture when parsing with NumberStyles.None (#54004)
Stephen Toub [Thu, 10 Jun 2021 20:59:25 +0000 (16:59 -0400)]
Use InvariantCulture when parsing with NumberStyles.None (#54004)

The only time {U}Int{32/64}.TryParse needs to consult a culture is if it needs to look up the negative symbol from it, and if NumberStyles.None or NumberStyles.HexNumber are passed, it won't ever do that.  All such call sites benefit from using CultureInfo.InvariantCulture explicitly, as it's just a static field read, whereas passing in null causes the implementation to access CultureInfo.CurrentCulture, which incurs a thread-static read.  Most of our usage already does this, but a few sites don't; this fixes those.

3 years agoFix value number of a partial definition via IND. (#53753)
Sergey Andreenko [Thu, 10 Jun 2021 20:35:48 +0000 (13:35 -0700)]
Fix value number of a partial definition via IND. (#53753)

* Add a repro.

* small ref of `VNApplySelectorsAssignTypeCoerce`.

* Fix the bug.

* fix comment

* Update src/coreclr/jit/valuenum.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
* Update src/coreclr/jit/valuenum.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoFix Sysctl() in buffer size autodetection mode (#52824)
Vadim Zhukov [Thu, 10 Jun 2021 19:45:37 +0000 (22:45 +0300)]
Fix Sysctl() in buffer size autodetection mode (#52824)

* Fix Sysctl() in buffer size autodetection mode

The code private static unsafe void Sysct() in the
Interop/BSD/System.Native/Interop.Sysctl.cs has two flaws in the case
value == null && len == 0.

First, in case of failure, this code doesn't call FreeHGlobal() on the memory it
allocated right before. I.e., we have pure memory leak.

Second, the "I don't know how much memory is needed, please allocated it by
yourself" idea standing behind value == null && len == 0 assumes the Sysctl()
itself being responsible to avoid ENOMEM condition. It could happen when, for
example, we ask to list all processes in the system: this list could be expanded
between first and second actual sysctl() calls, making the second call fail. So
instead of a single try, we should try to allocate a bit more memory and try
again; not force all our callers to do this themselves, by catching
InvalidOperationException and analyzing it.

Fixes #52823

* add missing IntPtr <-> int casts

3 years ago[wasm][testing] Avoid using crypto in WASM HTTP unit tests (#53925)
Pavel Savara [Thu, 10 Jun 2021 18:05:24 +0000 (20:05 +0200)]
[wasm][testing] Avoid using crypto in WASM HTTP unit tests (#53925)

avoid using crypto in WASM unit tests so that we could cover more scenarios

3 years agoSimplify how CheckGCMode gets the Marshal type (#54000)
Michal Strehovský [Thu, 10 Jun 2021 17:25:33 +0000 (19:25 +0200)]
Simplify how CheckGCMode gets the Marshal type (#54000)

Unless I'm missing something, this is equivalent. The previous version was incomprehensible to static analysis.

3 years agoUpdate SuppressGCTransition test to work in single file (#54001)
Michal Strehovský [Thu, 10 Jun 2021 17:25:22 +0000 (19:25 +0200)]
Update SuppressGCTransition test to work in single file (#54001)

Assembly.Location is an empty string when published as a single file.

3 years agomoving arm excludes to crossgen2 (#53976)
Manish Godse [Thu, 10 Jun 2021 17:22:14 +0000 (10:22 -0700)]
moving arm excludes to crossgen2 (#53976)

3 years agoAdd JsonPropertyDictionary and associated refactoring (#53206)
Steve Harter [Thu, 10 Jun 2021 16:23:17 +0000 (11:23 -0500)]
Add JsonPropertyDictionary and associated refactoring (#53206)

3 years agoFix mark overflow for regions (#53929)
Peter Sollich [Thu, 10 Jun 2021 16:07:32 +0000 (18:07 +0200)]
Fix mark overflow for regions (#53929)

Test GC\Scenarios\Boxing\variantlinklist\variantlinklist encountered a mark stack overflow that we didn't handle correctly in the regions case.

The problem was that this was a gen 2 GC, and we didn't iterate over the gen 0 and gen 1 regions, so the objects causing the mark stack overflow were in fact not revisited.

The fix is to iterate starting from gen 0 rather than the condemned generation.

I added an assert to make sure process_mark_overflow_internal has found at least one marked object to process - unfortunately, we can check this only for WKS GC.

3 years agoDisable STRESS_REGIONS (#53996)
Peter Sollich [Thu, 10 Jun 2021 16:06:12 +0000 (18:06 +0200)]
Disable STRESS_REGIONS (#53996)

There are several tests (most of them under GC\Scenarios\DoublinkList) that fail because STRESS_REGIONS pins arbitrary objects and thus keeps them alive, and thus these objects are not finalized.

Let's disable STRESS_REGIONS in the checked-in source code, but investigate whether there are any failures with STRESS_REGIONS that are real issues.

3 years agoAdd SupportedOSPlatform to Hosting.WindowsService HostBuilder extensions (#53941)
Hugo Woodiwiss [Thu, 10 Jun 2021 15:52:03 +0000 (16:52 +0100)]
Add SupportedOSPlatform to Hosting.WindowsService HostBuilder extensions (#53941)

* Set SupportedOSPlatforms at assembly level

Update build props to set SupportedOSPlatforms to windows assembly wide

3 years agokeep MsQuicConnection alive when streams are pending (#52800)
Tomas Weinfurt [Thu, 10 Jun 2021 15:49:47 +0000 (17:49 +0200)]
keep MsQuicConnection alive when streams are pending (#52800)

* keep MsQuicConnection alive when streams are pending

* remove extra file

* fix gchandle

* feedback from review

* feedback from review

* feedback from review

3 years agoDisable SynchronizationContextCurrent_NotUsedForAsyncOperations on Mono (#53997)
Alexander Köplinger [Thu, 10 Jun 2021 15:44:07 +0000 (17:44 +0200)]
Disable SynchronizationContextCurrent_NotUsedForAsyncOperations on Mono (#53997)

It seems to hang for some reason.

https://github.com/dotnet/runtime/issues/53987

3 years agoUpdate buildtools for linux arm64 lane (#53975)
Fan Yang [Thu, 10 Jun 2021 15:38:21 +0000 (11:38 -0400)]
Update buildtools for linux arm64 lane (#53975)

3 years agoAdd writeable holders for executable memory (#53934)
Jan Vorlicek [Thu, 10 Jun 2021 13:26:40 +0000 (15:26 +0200)]
Add writeable holders for executable memory (#53934)

* Add writeable holders for executable memory

This change adds holders for writeable mappings for executable memory.
It is the largest part of the W^X support. The ExecutableWriterHolder
implementation is dummy in this change, but it was fully tested with
coreclr / libraries tests on Windows arm, arm64, x64 and x86 with the
real double memory mapping.
There are few concepts / conventions used:
* When the writeable pointer isn't known at a place where it is needed
  and also not at the caller, the ExecutableWriterHolder instance is
  created.
* When a callee needs writeable pointer to executable memory and caller
  knows RW and RX, the argument is doubled with RX and RW suffixes. For
  constructors and member methods when "this" is the RW one, we pass just
  extra RX argument.
* Locals holding RW  pointer use RW suffix.
* Locals holding RX pointer usually have no suffix to minimize number of
  changes, but in some cases they have a RX suffix
  where I felt like it was better to make things clear.

3 years agoFixes race condition on captive scoped services (#53325)
Maryam Ariyan [Thu, 10 Jun 2021 12:59:09 +0000 (08:59 -0400)]
Fixes race condition on captive scoped services (#53325)

3 years agoReturn false for SocketsHttpHandler.IsSupported on Browser (#53926)
Alexander Köplinger [Thu, 10 Jun 2021 12:39:22 +0000 (14:39 +0200)]
Return false for SocketsHttpHandler.IsSupported on Browser (#53926)

We were returning true even though sockets don't work on Browser.

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
3 years agoAdd Mono diagnostics-tracing design document. (#53302)
Johan Lorensson [Thu, 10 Jun 2021 11:39:25 +0000 (13:39 +0200)]
Add Mono diagnostics-tracing design document. (#53302)

3 years ago[tests] Fix CRLF issues in M.E.Http (#52707)
Radek Doulik [Thu, 10 Jun 2021 11:35:27 +0000 (13:35 +0200)]
[tests] Fix CRLF issues in M.E.Http (#52707)

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

When running `Microsoft.Extensions.Http` tests on windows and
targeting `Browser`, the line ending differs between host and target
systems. Use helper `LineEndingsHelper.Normalize` method to update
expected strings.

The `Browser` Environment.NewLine is `\n`, while windows use `\r\n`.
https://github.com/dotnet/runtime/blob/5bd0edfe860e41bdfd690d3743e730594307292e/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs#L51

3 years agoposix_fallocate should work on WASM now (#53985)
Adam Sitnik [Thu, 10 Jun 2021 11:32:13 +0000 (13:32 +0200)]
posix_fallocate should work on WASM now (#53985)

3 years agoFix missing ClearStateUponCompletion call in AsyncTaskMethodBuilder (#53962)
Stephen Toub [Thu, 10 Jun 2021 11:11:20 +0000 (07:11 -0400)]
Fix missing ClearStateUponCompletion call in AsyncTaskMethodBuilder (#53962)

This was accidentally removed as part of a previous refactoring.  The lack of it means primarily that we're not always removing async method tasks from the s_currentActiveTasks dictionary when the debugger is attached (we didn't notice it because awaiting the resulting task also causes it to be removed).  It also means we're not clearing out some state we intended to in order to minimize extending lifetime of objects referenced by the state machine if the task is held onto for a prolonged period.

3 years agoFix2 for Trim HW (#53928)
Lakshan Fernando [Thu, 10 Jun 2021 10:55:23 +0000 (03:55 -0700)]
Fix2 for Trim HW (#53928)

* Fix for Trim HW

* FB

3 years agoRemove obsolete Versions.props extensibility point (#53986)
Viktor Hofer [Thu, 10 Jun 2021 10:22:35 +0000 (12:22 +0200)]
Remove obsolete Versions.props extensibility point (#53986)

See discussion here: https://github.com/dotnet/runtime/pull/53294#discussion_r648815525. That block isn't necessary anymore for source build.

3 years agoReplace Values with KeyValuePair enumerator in MemoryCache (#53762)
ezgambac [Thu, 10 Jun 2021 05:40:05 +0000 (22:40 -0700)]
Replace Values with KeyValuePair enumerator in MemoryCache (#53762)

fixes #53761

3 years agoAdd FileStreamOptions overloads (#52720)
Emmanuel André [Thu, 10 Jun 2021 04:57:09 +0000 (06:57 +0200)]
Add FileStreamOptions overloads (#52720)

3 years agoUse target OS strip tool, not host OS strip tool (#53961)
Jo Shields [Thu, 10 Jun 2021 03:56:19 +0000 (23:56 -0400)]
Use target OS strip tool, not host OS strip tool (#53961)

* Use target OS strip tool, not host OS strip tool. Fixes Android on Mac build.

* Try running objcopy when targeting Android, so we don't override it to "objcopy"

3 years agoRemove crossgen from superpmi tools (#53958)
Kunal Pathak [Thu, 10 Jun 2021 00:42:14 +0000 (17:42 -0700)]
Remove crossgen from superpmi tools (#53958)

* Remove crossgen SPMI collection

* Remove reference of crossgen from superpmi.py

* some misc crossgen references

* put back deleted things

3 years agoRemove AOT exclusion for full PGO runs (#53943)
Drew Scoggins [Thu, 10 Jun 2021 00:32:13 +0000 (17:32 -0700)]
Remove AOT exclusion for full PGO runs (#53943)

3 years agoApple Silicon reenable 49568 (#52202)
Steve MacLean [Thu, 10 Jun 2021 00:27:31 +0000 (20:27 -0400)]
Apple Silicon reenable 49568 (#52202)

3 years agoFix gcc armel/arm64 build (#53220)
Gleb Balykov [Wed, 9 Jun 2021 23:28:45 +0000 (02:28 +0300)]
Fix gcc armel/arm64 build (#53220)

* Fix gcc armel build

Mostly signed/unsigned comparisons, etc.

* Fix gcc arm64 build

3 years agoApple Silicon reenable 49110 failures (#52195)
Steve MacLean [Wed, 9 Jun 2021 23:28:21 +0000 (19:28 -0400)]
Apple Silicon reenable 49110 failures (#52195)

* Apple Silicon reenable 49110 failures

* Restore test disables

System.Numerics.Vectors & System.Runtime both failed
for both runs.  Restore disables of these tests.

3 years agoAvoid internal BitOperations in XxHash for .NET 6 build
Stephen Toub [Wed, 9 Jun 2021 23:19:53 +0000 (19:19 -0400)]
Avoid internal BitOperations in XxHash for .NET 6 build

3 years agofix spmi perfomance. (#53953)
Sergey Andreenko [Wed, 9 Jun 2021 22:53:19 +0000 (15:53 -0700)]
fix spmi perfomance. (#53953)

3 years agoHttpHeaders: remove StoreLocation and AddValue (#53918)
Geoff Kizer [Wed, 9 Jun 2021 22:53:03 +0000 (15:53 -0700)]
HttpHeaders: remove StoreLocation and AddValue (#53918)

* remove StoreLocation and AddValue

* make info.ParsedValue etc fields

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years ago[mono][wasm] Add additional icall signatures. (#53927)
Zoltan Varga [Wed, 9 Jun 2021 21:50:22 +0000 (17:50 -0400)]
[mono][wasm] Add additional icall signatures. (#53927)

3 years agoFix memory corruption after free in EventPipe streaming thread. (#53886)
Johan Lorensson [Wed, 9 Jun 2021 21:26:57 +0000 (23:26 +0200)]
Fix memory corruption after free in EventPipe streaming thread. (#53886)

If streaming thread was aborted with an error it will disable the session.
This is not the normal scenario, since most tools will explicit ask to
close session, but if there is a network connectivity causing failures
to write to stream, session will first be disabled and then it will write
NULL into freed memory, causing heap corruption.

Fix makes sure we reset streaming_thread before we eventually disable
session, making sure it won't write into freed memory.

3 years agoRevert "Do byref liveness updates for same register GPR moves (#53684)" (#53942)
Tanner Gooding [Wed, 9 Jun 2021 20:58:18 +0000 (13:58 -0700)]
Revert "Do byref liveness updates for same register GPR moves (#53684)" (#53942)

This reverts commit 7df92fd478aef22d4d98693e64d93730bc513e29.

3 years agoFix serializer check to permit fast-path serialization logic to run (#53916)
Layomi Akinrinade [Wed, 9 Jun 2021 20:57:39 +0000 (13:57 -0700)]
Fix serializer check to permit fast-path serialization logic to run (#53916)

* Fix serializer check to permit fast-path serialization logic to run

* Address feedback

* Add more tests

* Address feedback

3 years agoRun libraries package testing on build agent (#53905)
Viktor Hofer [Wed, 9 Jun 2021 20:55:07 +0000 (22:55 +0200)]
Run libraries package testing on build agent (#53905)

* Run libraries package testing on build agent

instead of on Helix as with recent changes the entire package testing
doesn't take more than 2 minutes. Helix created a work item per package
test even though it only took seconds and the average wait time for
a client was 10-15min.

Also cleaning up how the generated package test projects are restored
and incorporating a fix from Eric St John to not hard code the package
feeds.

* Expose useHelix argument

3 years agoProcessInfo2 Diagnostics IPC Command (#52258)
John Salem [Wed, 9 Jun 2021 19:52:29 +0000 (12:52 -0700)]
ProcessInfo2 Diagnostics IPC Command (#52258)

* Stash the entrypoint assembly path

* Add ep funcs for accessing entrypoint and version
 * TODO: get Mono's entrypoint asm

* Add ProcessInfo2 command
 * command includes everything the first one did + product ver
   and entrypoint asm path
* Add a test too

* Mono build fixes

* fix Mono build

* PR feedback
* fetch mono info from main assembly
* remove ref naming
* remove lazy method

* handle bundled host
* need to test still

* Use assembly name
* simplify access patterns
* change API to utf8
* updated test

* update comment

* PR feedback

* save before I commit this time...

* fix merge conflict

* Update ds-process-protocol.c

add missing break statement from merge conflict fix

* Update src/native/eventpipe/ds-process-protocol.h

* Update ds-process-protocol.c

add missing frees

* PR feedback

3 years agoRemove manual netfx targeting pack reference (#53936)
Viktor Hofer [Wed, 9 Jun 2021 19:46:48 +0000 (21:46 +0200)]
Remove manual netfx targeting pack reference (#53936)

The .NET Framework reference assemblies are referenced by default by the SDK these days so the PackageReference isn't necessary anymore.

3 years agoRemove unused usings (#53938)
David Fowler [Wed, 9 Jun 2021 19:46:34 +0000 (12:46 -0700)]
Remove unused usings (#53938)

3 years agocleanup cancellation handling in SocketAsyncContext (#53479)
Geoff Kizer [Wed, 9 Jun 2021 19:00:42 +0000 (12:00 -0700)]
cleanup cancellation handling in SocketAsyncContext (#53479)

* cleanup cancellation handling in SocketAsyncContext

* fix MacOS failback

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* address feedback

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoReenable resolved Apple Silicon intermittent test failures (#50889)
Steve MacLean [Wed, 9 Jun 2021 18:17:46 +0000 (14:17 -0400)]
Reenable resolved Apple Silicon intermittent test failures (#50889)

3 years agoImprove the rate of thread injection for blocking due to sync-over-async (#53471)
Koundinya Veluri [Wed, 9 Jun 2021 18:13:32 +0000 (11:13 -0700)]
Improve the rate of thread injection for blocking due to sync-over-async (#53471)

* Improve the rate of thread injection for blocking due to sync-over-async

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

3 years agoDon't try to strip .a files (#53915)
Jo Shields [Wed, 9 Jun 2021 17:00:29 +0000 (13:00 -0400)]
Don't try to strip .a files (#53915)

3 years agoAdd SupportedOSPlatform to X509Certificate2 members.
Kevin Jones [Wed, 9 Jun 2021 16:58:05 +0000 (12:58 -0400)]
Add SupportedOSPlatform to X509Certificate2 members.

Archived and FriendlyName's setters are only supported on Windows.

3 years agoexclude crossgen from build. (#53458)
Manish Godse [Wed, 9 Jun 2021 16:49:05 +0000 (09:49 -0700)]
exclude crossgen from build. (#53458)

* excluding crossgen from build.

* Fix cross-component build break

* Fix tests to not use crossgen

* more test fixes.

* switching R2R jobs to use cg2 by default

* switch helix runs to use crossgen2

3 years agoFix failing SetCookies_Success test (#53932)
Viktor Hofer [Wed, 9 Jun 2021 15:46:44 +0000 (17:46 +0200)]
Fix failing SetCookies_Success test (#53932)

* Fix failing SetCookies_Success test

3 years ago[wasm][testing] hosting echo server in xharness process (#52923)
Pavel Savara [Wed, 9 Jun 2021 15:32:58 +0000 (17:32 +0200)]
[wasm][testing] hosting echo server in xharness process (#52923)

- move tests to inner loop
- include echo middleware in xharness server
- improve doc
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53592 for lack of TRACE
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53591 for content on GET/HEAD
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53874 for HttpRequestMessage.Headers.Host
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53872 for NPE on System.Net.Http.BrowserHttpHandler
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53876
- include middleware in Helix correlation payload

3 years agomove the validaiton logic to FileStreamOptions (#53869)
Adam Sitnik [Wed, 9 Jun 2021 13:49:14 +0000 (15:49 +0200)]
move the validaiton logic to FileStreamOptions (#53869)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFixes Trim HelloWorld (#53912)
Lakshan Fernando [Wed, 9 Jun 2021 11:01:26 +0000 (04:01 -0700)]
Fixes Trim HelloWorld (#53912)

3 years agoRelease configuration resource. (#53857)
so [Wed, 9 Jun 2021 11:01:05 +0000 (19:01 +0800)]
Release configuration resource. (#53857)

Co-authored-by: shuxinqin <shuxinqin@outlook.com>
3 years agoFix process background segment end (#53879)
Peter Sollich [Wed, 9 Jun 2021 09:03:40 +0000 (11:03 +0200)]
Fix process background segment end (#53879)

Fix issue found in GetAllocatedBytesForCurrentThread with regions enabled.

The issue was traced to a region that had become empty in a background GC, but was still considered valid in the next ephemeral GC, so because there were cards set, we marked objects referenced from dead objects in the segment.

When a segment becomes completely empty in background GC, but is the start segment for the generation, we don't delete it, so we still need to reset heap_segment_allocated and decommit pages.

3 years agoInliner: new observations (don't impact inlining for now) (#53670)
Egor Bogatov [Wed, 9 Jun 2021 08:36:24 +0000 (11:36 +0300)]
Inliner: new observations (don't impact inlining for now) (#53670)

Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoDisable RegisterFromSTAThreadThatGoesAway_MessageStillDelivered test on Mono on Windo...
Alexander Köplinger [Wed, 9 Jun 2021 05:59:06 +0000 (07:59 +0200)]
Disable RegisterFromSTAThreadThatGoesAway_MessageStillDelivered test on Mono on Windows (#53893)

It started failing after https://github.com/dotnet/runtime/pull/53700 because the missing Dispose() caused the failure to not be reported.

3 years agoImprove clrjit.natvis (#53910)
Bruce Forstall [Wed, 9 Jun 2021 05:48:46 +0000 (22:48 -0700)]
Improve clrjit.natvis (#53910)

1. Add LclFld output: same as LclVar plus offset
2. Remove extra trailing GenTree brace

3 years agoAdd non-cryptographic hash algorithms library
Jeremy Barton [Wed, 9 Jun 2021 05:30:32 +0000 (22:30 -0700)]
Add non-cryptographic hash algorithms library

* Adds a new package, System.IO.Hashing (netstandard2.0, net461 to reduce netfx restore graph sizes, and net6.0)
* Provides implementations for four hash algorithms
  * CRC-32 (the variation used by IEEE 802.3 (Ethernet))
  * CRC-64 (the variation used by ECMA-182)
  * XxHash32, with optional seed
  * XxHash64, with optional seed
* The tests are structured so that algorithm tests just need to provide their test vectors and do some boilerplate overrides to get variation testing across the instance methods and static methods.

3 years agoJIT: fix OSR reporting for special stack slots (#53897)
Andy Ayers [Wed, 9 Jun 2021 00:59:13 +0000 (17:59 -0700)]
JIT: fix OSR reporting for special stack slots (#53897)

Revise the reporting of the special stack slots for OSR to be more uniform.
* Always record the original method FP-relative offset.
* Always apply the same adjustment for original method slosts i the OSR frame
* Handle caller-SP relative adjustment in `lvaToCallerSPRelativeOffset`

In particular, this fixes #43534 where we were reporting the wrong caller SP
for the profiler exit hook.

3 years agoMake sure EnsureInitialize() loads the GcInfo if it is there (#53896)
Andrew Au [Wed, 9 Jun 2021 00:50:18 +0000 (17:50 -0700)]
Make sure EnsureInitialize() loads the GcInfo if it is there (#53896)

3 years agoDisplay LSRA stats in method summary (#53901)
Kunal Pathak [Wed, 9 Jun 2021 00:42:24 +0000 (17:42 -0700)]
Display LSRA stats in method summary (#53901)

* Lsrstats

* jit format

* use blocks iterator

3 years agoDo byref liveness updates for same register GPR moves (#53684)
Tanner Gooding [Wed, 9 Jun 2021 00:37:36 +0000 (17:37 -0700)]
Do byref liveness updates for same register GPR moves (#53684)

* Do byref liveness updates for same register GPR moves on x86/x64

* Change where emitLastEmittedIns is tracked

* Ensure emitLastEmittedIns isn't tracked across instruction groups

3 years agoAdd unsigned variants for BitConverter float bit APIs (#53784)
MichalPetryka [Tue, 8 Jun 2021 23:46:57 +0000 (01:46 +0200)]
Add unsigned variants for BitConverter float bit APIs (#53784)

* Add unsigned variants for BitConverter bit APIs

Adds DoubleToUInt64Bits, UInt64BitsToDouble, SingleToUInt32Bits,
UInt32BitsToSingle, HalfToUInt16Bits and UInt16BitsToHalf.

Implementations were based on existing signed integer variants.

Convert usages of existing APIs to unsigned variants when appropriate.

Fix #36469

* Revert comment change

Reverted a comment change made in the existing code by mistake.

* Use existing code for implementations

Use the existing signed methods with a cast, less code with the same codegen.

* Cast correction

Corrected the type used in a cast.

3 years ago Fix InvariantGlobalization=false in a trimmed app (#53453)
Eric Erhardt [Tue, 8 Jun 2021 22:25:11 +0000 (17:25 -0500)]
 Fix InvariantGlobalization=false in a trimmed app (#53453)

* Fix InvariantGlobalization=false in a trimmed app.

Move the LoadICU logic into a static ctor, so it runs early in the process, but not as part of querying the GlobalizationMode.Invariant property. This allows for LoadICU to still be invoked, even when the app is trimmed and GlobalizationMode.Invariant is hard-coded by the linker.

While I was changing this code, I also removed the workaround in Browser builds for swallowing errors being returned from LoadICU.

Fix #49073
Fix #49391

* Add trimming tests for InvariantGlobalization

* Update the LoadICU message for mobile workloads.

* Respond to PR feedback.

- Split the substitutions of GlobalizationMode.Invariant between true and false
- Add a trimming test that ensures Invariant=true trims everything it is supposed to

* Add checks for all mobile platforms

3 years agoInclude NetCoreAppCurrent configs in packages (#53439)
Viktor Hofer [Tue, 8 Jun 2021 21:36:01 +0000 (23:36 +0200)]
Include NetCoreAppCurrent configs in packages (#53439)

* Include NetCoreAppCurrent configs in packages

The NetCoreAppCurrent configurations were omitted from packages to avoid
ever growing packages. Now that we adhere to the support policy for
packages we don't need to exclude them anymore as the policy defines a
baseline for .NETCoreApp configurations.

This will remove an artificial difference when source building the
repository and also make it so that partner repositories which don't
depend on a transport package like windowsdesktop (winforms) receive
the very latest assets that are included in the shared framework as
well.

* Fix package validation for non exposed inbox libs

3 years agoRemove an erroneous check (#53889)
Andrew Au [Tue, 8 Jun 2021 21:32:45 +0000 (14:32 -0700)]
Remove an erroneous check (#53889)

3 years agoImprove GC stress log instrumentation (#53547)
Andrew Au [Tue, 8 Jun 2021 21:32:14 +0000 (14:32 -0700)]
Improve GC stress log instrumentation (#53547)

3 years agoBuild support for s390x: clr.iltools and clr.paltests (#53289)
Ulrich Weigand [Tue, 8 Jun 2021 21:24:52 +0000 (23:24 +0200)]
Build support for s390x: clr.iltools and clr.paltests (#53289)

* Add dummy support for s390x in vm, jit, debug, and unwinder

* This suffices to make clr.iltools and clr.paltests buildable

3 years agoBuild support for s390x: libunwind (#53286)
Ulrich Weigand [Tue, 8 Jun 2021 21:23:31 +0000 (23:23 +0200)]
Build support for s390x: libunwind (#53286)

* Merge https://github.com/libunwind/libunwind/pull/245

* Add s390x support to local CMake files

3 years agoBuild support for s390x: PAL layer (#53287)
Ulrich Weigand [Tue, 8 Jun 2021 21:21:46 +0000 (23:21 +0200)]
Build support for s390x: PAL layer (#53287)

* Add PAL implementation for Linux on s390x

* Define BIGENDIAN on s390x when compiling coreclr

* Provide a default HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE
  value in eng/native/tryrun.cmake

3 years agoModernize DiagnosticsHandler tests (#53870)
Miha Zupan [Tue, 8 Jun 2021 20:47:09 +0000 (22:47 +0200)]
Modernize DiagnosticsHandler tests (#53870)

* Modernize DiagnosticsHandler tests

* Address PR feedback

SemaphoreSlim => TCS, Guid => nosuchhost.invalid, Http20 => Http2

3 years agoApple Silicon reenable 49365 (#52197)
Steve MacLean [Tue, 8 Jun 2021 20:05:25 +0000 (16:05 -0400)]
Apple Silicon reenable 49365 (#52197)