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
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.
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>
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
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>
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>
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>
John Salem [Thu, 10 Jun 2021 22:21:30 +0000 (15:21 -0700)]
Handle Counter Polling Interval of 0 (#53836)
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
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
Zoltan Varga [Thu, 10 Jun 2021 21:27:42 +0000 (17:27 -0400)]
[mono] Reenable the empty finally optimization. (#53965)
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.
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>
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
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
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.
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.
Manish Godse [Thu, 10 Jun 2021 17:22:14 +0000 (10:22 -0700)]
moving arm excludes to crossgen2 (#53976)
Steve Harter [Thu, 10 Jun 2021 16:23:17 +0000 (11:23 -0500)]
Add JsonPropertyDictionary and associated refactoring (#53206)
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.
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.
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
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
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
Fan Yang [Thu, 10 Jun 2021 15:38:21 +0000 (11:38 -0400)]
Update buildtools for linux arm64 lane (#53975)
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.
Maryam Ariyan [Thu, 10 Jun 2021 12:59:09 +0000 (08:59 -0400)]
Fixes race condition on captive scoped services (#53325)
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>
Johan Lorensson [Thu, 10 Jun 2021 11:39:25 +0000 (13:39 +0200)]
Add Mono diagnostics-tracing design document. (#53302)
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
Adam Sitnik [Thu, 10 Jun 2021 11:32:13 +0000 (13:32 +0200)]
posix_fallocate should work on WASM now (#53985)
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.
Lakshan Fernando [Thu, 10 Jun 2021 10:55:23 +0000 (03:55 -0700)]
Fix2 for Trim HW (#53928)
* Fix for Trim HW
* FB
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.
ezgambac [Thu, 10 Jun 2021 05:40:05 +0000 (22:40 -0700)]
Replace Values with KeyValuePair enumerator in MemoryCache (#53762)
fixes #53761
Emmanuel André [Thu, 10 Jun 2021 04:57:09 +0000 (06:57 +0200)]
Add FileStreamOptions overloads (#52720)
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"
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
Drew Scoggins [Thu, 10 Jun 2021 00:32:13 +0000 (17:32 -0700)]
Remove AOT exclusion for full PGO runs (#53943)
Steve MacLean [Thu, 10 Jun 2021 00:27:31 +0000 (20:27 -0400)]
Apple Silicon reenable 49568 (#52202)
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
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.
Stephen Toub [Wed, 9 Jun 2021 23:19:53 +0000 (19:19 -0400)]
Avoid internal BitOperations in XxHash for .NET 6 build
Sergey Andreenko [Wed, 9 Jun 2021 22:53:19 +0000 (15:53 -0700)]
fix spmi perfomance. (#53953)
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>
Zoltan Varga [Wed, 9 Jun 2021 21:50:22 +0000 (17:50 -0400)]
[mono][wasm] Add additional icall signatures. (#53927)
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.
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.
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
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
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
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.
David Fowler [Wed, 9 Jun 2021 19:46:34 +0000 (12:46 -0700)]
Remove unused usings (#53938)
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>
Steve MacLean [Wed, 9 Jun 2021 18:17:46 +0000 (14:17 -0400)]
Reenable resolved Apple Silicon intermittent test failures (#50889)
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
Jo Shields [Wed, 9 Jun 2021 17:00:29 +0000 (13:00 -0400)]
Don't try to strip .a files (#53915)
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.
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
Viktor Hofer [Wed, 9 Jun 2021 15:46:44 +0000 (17:46 +0200)]
Fix failing SetCookies_Success test (#53932)
* Fix failing SetCookies_Success test
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
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>
Lakshan Fernando [Wed, 9 Jun 2021 11:01:26 +0000 (04:01 -0700)]
Fixes Trim HelloWorld (#53912)
so [Wed, 9 Jun 2021 11:01:05 +0000 (19:01 +0800)]
Release configuration resource. (#53857)
Co-authored-by: shuxinqin <shuxinqin@outlook.com>
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.
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>
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.
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
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.
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.
Andrew Au [Wed, 9 Jun 2021 00:50:18 +0000 (17:50 -0700)]
Make sure EnsureInitialize() loads the GcInfo if it is there (#53896)
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
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
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.
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
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
Andrew Au [Tue, 8 Jun 2021 21:32:45 +0000 (14:32 -0700)]
Remove an erroneous check (#53889)
Andrew Au [Tue, 8 Jun 2021 21:32:14 +0000 (14:32 -0700)]
Improve GC stress log instrumentation (#53547)
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
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
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
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
Steve MacLean [Tue, 8 Jun 2021 20:05:25 +0000 (16:05 -0400)]
Apple Silicon reenable 49365 (#52197)
Kunal Pathak [Tue, 8 Jun 2021 19:03:34 +0000 (12:03 -0700)]
Update instruction table to capture the correct state of EFlags (#53806)
* Update instruction table with accurate EFlags information
* Revert "Add issues.targets entry for the GitHub_13822 test to make CI green (#53789)"
This reverts commit
bd9ba598a0a3417510d318472d3c0f6641cdba93.
* minor fixup
* Fix some more instructions
* review comments
Steve MacLean [Tue, 8 Jun 2021 18:49:25 +0000 (14:49 -0400)]
Fix Apple Silicon shuffle thunks (#53250)
* Fix Apple Silicon shuffle thunks
Fixes 47294
* Set and use m_hfaFieldSize for stack arguments
m_hfaFieldSize is needed to calculate correct shuffle size.
Jo Shields [Tue, 8 Jun 2021 18:29:16 +0000 (14:29 -0400)]
Strip libmonosgen linked library (#53240)
It seems in the .symbols.nupkg package, instead of a stripped .dylib/so and companion .dwarf/.dbg, we've just been shipping unstripped libs. This commit largely duplicates the functions from eng/native/functions.cmake into an MSbuild proj, as our entire logic is already in MSbuild not CMake.
Andrii Kurdiumov [Tue, 8 Jun 2021 18:12:07 +0000 (00:12 +0600)]
Fix compilation errors if host does not support AVX2 (#50316)
* Fix compilation errors if host does not support AVX2
* Add comments to empty preprocessor branches
* Explicitly ask for architecture support
* Apply -march-native only on GCC
* Make sure if clang on x64 would be used
it actually pass -march=native, otherwise AVX2 would not be enabled.
* Ask test use AVX2 when run on Windows.
Aaron Robinson [Tue, 8 Jun 2021 17:44:02 +0000 (10:44 -0700)]
Check if the marshalling of a field is possible across all platforms. (#53194)
* Check if the marshalling of a field is possible across all platforms.
* Add test for the generic field generation for IClassX.
Zoltan Varga [Tue, 8 Jun 2021 17:22:12 +0000 (13:22 -0400)]
[mono][llvm] Access mono_polling_required directly instead of loading its value from a GOT slot in static mode. (#53776)
This will potentially avoid one load in the GC safe point code.
Bruce Forstall [Tue, 8 Jun 2021 17:05:29 +0000 (10:05 -0700)]
Distinguish Debug and Checked builds in version resource (#53847)
In the Win32 version resource, this changes the "Comment" field
from:
```
Flavor=Checked
```
to:
```
Flavor=Debug
```
It also properly sets `BUILDENV_DEBUG=1` for debug builds (only used in
exactly one place: gc.cpp).
David Fowler [Tue, 8 Jun 2021 15:47:49 +0000 (08:47 -0700)]
Fire diagnostic source events from IHostBuilder.Build (#53757)
* Fire diagnostic source events from IHostBuilder.Build
- We want to enable getting access to the IHostBuilder and IHost during the call to IHostBuilder.Build so that we can access the application's IServiceProvider from various tools. Usually, this is enabled by exposing a different entry point from the application but this technique allows us to let the application execute normally and hook important events via a diagnostic source.
- Add support for the new pattern in HostFactoryResolver
- Added support for resolving an IServiceProvider using the new diagnostics source pattern (which doesn't require a different entrypoint)
- Detect the version of Microsoft.Extensions.Hosting before waiting for events to fire
- We want to fail fast if we know this version of hosting will never fire events of if the hosting assembly fails to load. Added a version check.
- Allow the caller to specify a wait timeout.
- Added a flag to allow running the application to completion
Steve Pfister [Tue, 8 Jun 2021 14:48:52 +0000 (10:48 -0400)]
Multi-target RuntimeConfigParser Task (#53827)
Fixes https://github.com/dotnet/runtime/issues/53811
The props were not taking into account the right paths.
Tom Deseyn [Tue, 8 Jun 2021 14:47:16 +0000 (16:47 +0200)]
Sockets.tests: TcpReceiveSendGetsCanceledByDispose: remove Timeout. (#52599)
* Sockets.tests: TcpReceiveSendGetsCanceledByDispose: remove Timeout.
This timeout is not needed and masks a more useful exception thrown
by the test.
* Add WaitAsync to timeout on all async operations
* Add missing timeout
David Mason [Tue, 8 Jun 2021 09:55:52 +0000 (02:55 -0700)]
add support for unwinding function fragments in the dac (#53765)
Mitchell Hwang [Tue, 8 Jun 2021 07:23:54 +0000 (03:23 -0400)]
[libraries] Fix metadata name following arcade change to stop supporting multiple targets in helix sdk (#53828)
Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
dotnet-maestro[bot] [Tue, 8 Jun 2021 02:53:35 +0000 (02:53 +0000)]
[main] Update dependencies from dotnet/runtime dotnet/hotreload-utils dotnet/xharness (#53787)
[main] Update dependencies from dotnet/runtime dotnet/hotreload-utils dotnet/xharness
Bruce Forstall [Mon, 7 Jun 2021 23:16:51 +0000 (16:16 -0700)]
Add more iterators to JIT (#52515)
Add more iterators compatible with range-based `for` syntax for various data structures. These iterators all assume (and some check) that the underlying data structures determining the iteration are not changed during the iteration. For example, don't use these to iterate over the predecessor edges if you are changing the order or contents of the predecessor edge list.
- BasicBlock: iterate over all blocks in the function, a subset starting not at the first block, or a specified range of blocks. Removed uses of the `foreach_block` macro. E.g.:
```
for (BasicBlock* const block : Blocks()) // all blocks in function
for (BasicBlock* const block : BasicBlockSimpleList(fgFirstBB->bbNext)) // all blocks starting at fgFirstBB->bbNext
for (BasicBlock* const testBlock : BasicBlockRangeList(firstNonLoopBlock, lastNonLoopBlock)) // all blocks in range (inclusive)
```
- block predecessors: iterate over all predecessor edges, or all predecessor blocks, e.g.:
```
for (flowList* const edge : block->PredEdges())
for (BasicBlock* const predBlock : block->PredBlocks())
```
- block successors: iterate over all block successors using the `NumSucc()/GetSucc()`, or `NumSucc(Compiler*)/GetSucc(Compiler*)` pairs, e.g.:
```
for (BasicBlock* const succ : Succs())
for (BasicBlock* const succ : Succs(compiler))
```
Note that there already exists the "AllSuccessorsIter" which iterates over block successors including possible EH successors, e.g.:
```
for (BasicBlock* succ : block->GetAllSuccs(m_pCompiler))
```
- switch targets, (namely, the successors of `BBJ_SWITCH` blocks), e.g.:
```
for (BasicBlock* const bTarget : block->SwitchTargets())
```
- loops blocks: iterate over all the blocks in a loop, e.g.:
```
for (BasicBlock* const blk : optLoopTable[loopInd].LoopBlocks())
```
- Statements: added an iterator shortcut for the non-phi statements, e.g.:
```
for (Statement* const stmt : block->NonPhiStatements())
```
Note that there already exists an iterator over all statements, e.g.:
```
for (Statement* const stmt : block->Statements())
```
- EH clauses, e.g.:
```
for (EHblkDsc* const HBtab : EHClauses(this))
```
- GenTree in linear order (but not LIR, which already has an iterator), namely, using the `gtNext` links, e.g.:
```
for (GenTree* const call : stmt->TreeList())
```
This is a no-diff change.
Zoltan Varga [Mon, 7 Jun 2021 23:02:04 +0000 (19:02 -0400)]
[mono][wasm] Avoid AOTing methods with clauses, use the interpreter instead. (#52883)
Jose Perez Rodriguez [Mon, 7 Jun 2021 22:25:38 +0000 (15:25 -0700)]
Resolving ILLink warnings on Microsoft.Extensions.Options.ConfigurationManager (#53552)
* Resolving ILLink warnings on Microsoft.Extensions.Options.ConfigurationManager
* Fix message
* Addressing messages feedback
* Update src/libraries/Microsoft.Extensions.Logging.Configuration/ref/Microsoft.Extensions.Logging.Configuration.cs
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update remaining messages with suggestion.
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Bruce Forstall [Mon, 7 Jun 2021 22:00:52 +0000 (15:00 -0700)]
Fix superpmi.py/jitrollingbuild.py to handle large REST results (#53750)
The Azure Storage REST API returns a maximum of 5000 results in
a single query. We have more results in the JIT rolling build set,
so we weren't finding queried git_hash values.
Generalize the query to loop using the "marker" continuation functionality.
We currently have about 800 superpmi collections results, but update
the superpmi.py script similarly for future proofing.
I also changed the query used by jitrollingbuild.py to specify a prefix,
to avoid requiring so many results. Probably should do the same thing for
SuperPMI collections. The downside is the REST api doesn't have a facility
for the prefix to be case-insensitive. I think it's ok to be case-sensitive,
but we'd need to verify that.