David Fowler [Fri, 11 Jun 2021 22:11:50 +0000 (15:11 -0700)]
Add support for IServiceProviderIsService (#54047)
* Add support for IServiceProviderIsService
- This optional service lets consumers query to see if a service is resolvable without side effects (not having to explicitly resolve the service).
- Added new spec tests to verify the baseline behavior based on IServiceCollection features.
- Handle built in services as part of IsServce
- Special case built in services as part of the IsService check
- Make the tests part of the core DI tests and enable skipping via a property
Co-authored-by: Travis Illig <tillig@paraesthesia.com>
Ankit Jain [Fri, 11 Jun 2021 22:10:55 +0000 (18:10 -0400)]
[wasm][aot][tests] Disable tests causing crash - System.Text.Encoding… (#53971)
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Steve MacLean [Fri, 11 Jun 2021 21:49:49 +0000 (17:49 -0400)]
Fix 54025 (#54070)
Stephen Toub [Fri, 11 Jun 2021 21:31:15 +0000 (17:31 -0400)]
Fix Deflate/Brotli/CryptoStream handling of partial and zero-byte reads (#53644)
Stream.Read{Async} is supposed to return once at least a byte of data is available, and in particular, if there's any data already available, it shouldn't block. But Read{Async} on DeflateStream (and thus also GZipStream and ZLibStream), BrotliStream, and CryptoStream won't return until either it hits the end of the stream or the caller's buffer is filled. This makes it behave very unexpectedly when used in a context where the app is using a large read buffer but expects to be able to process data as it's available, e.g. in networked streaming scenarios where messages are being sent as part of bidirectional communication.
This fixes that by stopping looping once any data is consumed. Just doing that, though, caused problems for zero-byte reads. Zero-byte reads are typically used by code that's trying to delay-allocate a buffer for the read data until data will be available to read. At present, however, zero-byte reads return immediately regardless of whether data is available to be consumed. I've changed the flow to make it so that zero-byte reads don't return until there's at least some data available as input to the inflater/transform (this, though, doesn't 100% guarantee the inflater/transform will be able to produce output data).
Note that both of these changes have the potential to introduce breaks into an app that erroneously depended on these implementation details:
- If an app passing in a buffer of size N to Read{Async} depended on that call always producing the requested number of bytes (rather than what the Stream contract defines), they might experience behavioral changes.
- If an app passing in a zero-byte buffer expected it to return immediately, it might instead end up waiting until data was actually available.
Huo Yaoyuan [Fri, 11 Jun 2021 21:17:50 +0000 (05:17 +0800)]
Expose RoundUpToPowerOf2 (#53992)
* 32bit
* 64bit
* Expose in public api
* Unit test
* Add more tests
* Use in test
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Jakob Botsch Nielsen [Fri, 11 Jun 2021 21:00:20 +0000 (23:00 +0200)]
Improve dotnet-pgo output and fix null type handles (#53494)
* Improve dotnet-pgo output and fix null type handles
* When comparing .mibc files, find a unique name to print for both files
by repeatedly appending another parent directory on it.
* When comparing .mibc files, print a comparison of type handle
histogram data
* Fix a potential division by zero
* Print some info when producing .mibc that are based on samples/LBR
data
* Fix .mibc read type handles with value 0 to actually return IsNull
* Use different devirt threshold for interfaces and classes
* Add ClassProfileFlags to PgoFormat.cs
Zoltan Varga [Fri, 11 Jun 2021 20:33:32 +0000 (16:33 -0400)]
[mono][llvm] Remove some dead code. (#53920)
Bruce Forstall [Fri, 11 Jun 2021 18:42:33 +0000 (11:42 -0700)]
Fix mismatch between morph and lower (#53911)
For x86 delegate invoke tailcall via helper calls,
Lower expects the `this` pointer in a LCL_VAR. Morph
(`fgMorphTailCallViaJitHelper`) was letting a LCL_FLD go through
instead of inserting a copy of the field to a temp local.
Simply change the condition in morph to match the condition in Lower.
Fixes #53568
Steve MacLean [Fri, 11 Jun 2021 18:11:28 +0000 (14:11 -0400)]
Reenable 48786 (#54028)
Reenable tests disabled for issue 48786
This should be fixed now that we have moved to crossgen2
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
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.
Thays Grazia [Fri, 11 Jun 2021 16:58:33 +0000 (13:58 -0300)]
Fix assertion on debugger-engine (#54041)
Sync to mono/mono #21100
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>
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.
Pranav K [Fri, 11 Jun 2021 16:40:50 +0000 (09:40 -0700)]
Allow UsingBrowserRuntimeWorkload to be disabled from the project file (#52728)
Andy Ayers [Fri, 11 Jun 2021 16:15:43 +0000 (09:15 -0700)]
Increase timeouts for PGO tests (#54030)
Peter Sollich [Fri, 11 Jun 2021 15:57:05 +0000 (17:57 +0200)]
Removed extraneous closing parentheses causing compile errors. (#54064)
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.
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
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
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>
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
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.
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.
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>
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
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.