platform/upstream/dotnet/runtime.git
2 years agofix ByteArrayConverter null handling inconsistencies. (#56390)
Eirik Tsarpalis [Tue, 27 Jul 2021 18:10:54 +0000 (21:10 +0300)]
fix ByteArrayConverter null handling inconsistencies. (#56390)

Fixes #49728.

2 years agoAdd tests for reads and writes beyond EOF (#56395)
Adam Sitnik [Tue, 27 Jul 2021 18:07:49 +0000 (20:07 +0200)]
Add tests for reads and writes beyond EOF (#56395)

* ensure that reads beyond EOF return 0

* ensure that writes beyond EOF extend the file and the content is zeroed

2 years agoJIT: more fixes for VN loop dependence tracking (#56184)
Andy Ayers [Tue, 27 Jul 2021 17:53:44 +0000 (10:53 -0700)]
JIT: more fixes for VN loop dependence tracking (#56184)

Specify `Overwrite` when setting loop dependence map entries, as we may
refine the initial result.

Fixes #56174.

Extract loop dependence of `VNF_PhiMemoryDef`.

Fixes new case noted in #55936, and 13/16 or so other cases Jakob sent
me privately. Also update a comment and fix tests to work better with
jitstress per other notes on that PR.

2 years agoFix thread pool hang (#56346)
Koundinya Veluri [Tue, 27 Jul 2021 16:59:14 +0000 (09:59 -0700)]
Fix thread pool hang (#56346)

* Fix thread pool hang

- In https://github.com/dotnet/runtime/pull/53471 the thread count goal was moved out of `ThreadCounts`, it turns out that are a few subtle races that it was avoiding. There are other ways to fix it, but I've added the goal back into `ThreadCounts` for now.
- Reverted PR https://github.com/dotnet/runtime/pull/55985, which worked around the issue in the CI

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

* Revert "mitigation for quic tests hangs (#55985)"

This reverts commit 0a5e93b09fe92cf866456552eef78a95bf6fdf27.

2 years agoUpdate CG2 ArgIterator to match the runtime one (#56059)
Jan Vorlicek [Tue, 27 Jul 2021 16:51:28 +0000 (18:51 +0200)]
Update CG2 ArgIterator to match the runtime one (#56059)

* Update CG2 ArgIterator to match the runtime one

The goal of the change is primarily to make it correct for the Apple
Silicon where the calling convention slightly differs from the
Unix ARM64 one, especially in passing arguments smaller than a pointer
size on stack.

2 years agoavoid ReadFile syscall if we know that there is nothing to read from file (#56387)
Adam Sitnik [Tue, 27 Jul 2021 16:13:38 +0000 (18:13 +0200)]
avoid ReadFile syscall if we know that there is nothing to read from file (#56387)

* avoid ReadFile syscall if we know that there is nothing to read from file

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoserialize the access to mutable shared state in System.IO.Packaging (#56367)
Adam Sitnik [Tue, 27 Jul 2021 16:10:34 +0000 (18:10 +0200)]
serialize the access to mutable shared state in System.IO.Packaging (#56367)

2 years agoSpecify RunContinuationsAsynchronously in DNS telemetry test (#56368)
Miha Zupan [Tue, 27 Jul 2021 13:31:34 +0000 (06:31 -0700)]
Specify RunContinuationsAsynchronously in DNS telemetry test (#56368)

2 years agoFix Invariant Test Configuration (#56340)
Tarek Mahmoud Sayed [Tue, 27 Jul 2021 13:07:43 +0000 (06:07 -0700)]
Fix Invariant Test Configuration (#56340)

2 years agopull in new version of msquic (#56344)
Tomas Weinfurt [Tue, 27 Jul 2021 13:07:25 +0000 (06:07 -0700)]
pull in new version of msquic (#56344)

2 years agofix CloseAsync_ByServer_AcceptThrows quic test (#56355)
Tomas Weinfurt [Tue, 27 Jul 2021 13:06:42 +0000 (06:06 -0700)]
fix CloseAsync_ByServer_AcceptThrows quic test (#56355)

2 years agoSkip finalizer test if precise GC is not supported (#56364)
Ulrich Weigand [Tue, 27 Jul 2021 13:05:21 +0000 (15:05 +0200)]
Skip finalizer test if precise GC is not supported (#56364)

* Finalizer_OperationNotCompleted_CompletesOperation assumes precise GC

2 years agoDisable tests requiring large contiguous memory allocation on 32-bit platforms (...
Jakob Botsch Nielsen [Tue, 27 Jul 2021 12:43:08 +0000 (14:43 +0200)]
Disable tests requiring large contiguous memory allocation on 32-bit platforms (#56366)

Fix #56197

2 years agoTighten up some ArrayPool.Return usage (#56229)
Stephen Toub [Tue, 27 Jul 2021 11:40:36 +0000 (07:40 -0400)]
Tighten up some ArrayPool.Return usage (#56229)

Avoid potential problems if Return were to throw an exception after having already put the array back into the pool.

2 years agoDisable test SendAsync_WithZeroLengthHeaderName_Throws (#56363)
Karel Zikmund [Tue, 27 Jul 2021 10:55:54 +0000 (12:55 +0200)]
Disable test SendAsync_WithZeroLengthHeaderName_Throws (#56363)

Test: System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_MsQuic.SendAsync_WithZeroLengthHeaderName_Throws

Disabled test tracked by #56292

2 years agoUpdate compiler version to enable CallerArgumentExpression (#56349)
Stephen Toub [Tue, 27 Jul 2021 10:40:25 +0000 (06:40 -0400)]
Update compiler version to enable CallerArgumentExpression (#56349)

2 years agoHonor ThrowOnEventWriteErrors for exceptions thrown by EventListeners (#56232)
Miha Zupan [Tue, 27 Jul 2021 09:28:10 +0000 (02:28 -0700)]
Honor ThrowOnEventWriteErrors for exceptions thrown by EventListeners (#56232)

2 years agoAdd timeouts to IPInterfaceProperties tests (#56319)
Miha Zupan [Tue, 27 Jul 2021 09:26:42 +0000 (02:26 -0700)]
Add timeouts to IPInterfaceProperties tests (#56319)

* Add timeouts to IPInterfaceProperties tests

* Use common Timeout value and Xunit output helper

* Add Threading.Tasks using

2 years agoDisplay class names and string literals in asm (#55970)
Egor Bogatov [Tue, 27 Jul 2021 09:02:22 +0000 (12:02 +0300)]
Display class names and string literals in asm (#55970)

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
2 years agoFix an assert in emitOffsetToLabel (#56278)
Egor Bogatov [Tue, 27 Jul 2021 09:01:26 +0000 (12:01 +0300)]
Fix an assert in emitOffsetToLabel (#56278)

2 years agoSkip environment variable access calls for non OSX apple platforms (#56320)
Mitchell Hwang [Tue, 27 Jul 2021 06:36:43 +0000 (02:36 -0400)]
Skip environment variable access calls for non OSX apple platforms (#56320)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
2 years agoGlobally disable implicit namespaces (#56348)
Santiago Fernandez Madero [Tue, 27 Jul 2021 06:22:08 +0000 (23:22 -0700)]
Globally disable implicit namespaces (#56348)

2 years agoFix ReliabilityFramework code formatting (#56342)
Andrew Au [Tue, 27 Jul 2021 06:17:54 +0000 (23:17 -0700)]
Fix ReliabilityFramework code formatting (#56342)

2 years agoFix an error printed out when install_location file is missing (#56327)
Vitek Karas [Tue, 27 Jul 2021 04:43:17 +0000 (06:43 +0200)]
Fix an error printed out when install_location file is missing (#56327)

The app will still run, but we must not print out anything in that case.

Fixes #56219

2 years agoUpdate SR.cs (#56332)
Chris Ross [Tue, 27 Jul 2021 02:56:13 +0000 (19:56 -0700)]
Update SR.cs (#56332)

2 years agoSplit mobile specific ILLink.Substitutions into its own file (#56306)
Steve Pfister [Tue, 27 Jul 2021 01:40:32 +0000 (21:40 -0400)]
Split mobile specific ILLink.Substitutions into its own file (#56306)

It was discovered in #56161 that mobile specific HttpClientHandler substitutions were sticking around even for non mobile builds. This change moves the substitution into ILLink.Substitutions.mobile.xml.

2 years agoquic test improvements (#56043)
Tomas Weinfurt [Tue, 27 Jul 2021 01:36:38 +0000 (18:36 -0700)]
quic test improvements (#56043)

* quic test improvements

* fix incorrect use of PassingTestTimeout

* feedback from review

2 years agoFix .vsconfig (#56339)
Dan Moseley [Tue, 27 Jul 2021 01:30:34 +0000 (19:30 -0600)]
Fix .vsconfig (#56339)

* Fix .vsconfig

* Remove vs2022 only item

2 years agoCreate manifest installers and VS manifests (#56308)
Jo Shields [Tue, 27 Jul 2021 00:48:34 +0000 (20:48 -0400)]
Create manifest installers and VS manifests (#56308)

2 years agoFix for issue 55241 (#56230)
Brian Sullivan [Mon, 26 Jul 2021 21:25:25 +0000 (14:25 -0700)]
Fix for issue 55241 (#56230)

Don't decrement our budget once we have reached 0

2 years agoUpgrade to msbuild version 16.10 (#56025)
Ulrich Weigand [Mon, 26 Jul 2021 21:23:41 +0000 (23:23 +0200)]
Upgrade to msbuild version 16.10 (#56025)

* Fixes https://github.com/dotnet/runtime/issues/54826

* Adjust net472 dependencies of Microsoft.NETCore.Platforms.Tests

2 years agoRemove crossgen comparison jobs (#56193)
David Wrighton [Mon, 26 Jul 2021 20:18:49 +0000 (13:18 -0700)]
Remove crossgen comparison jobs (#56193)

- We no longer have crossgen
- The jobs didn't detect that failure and have been wasting CPU time on every PR

2 years agoSeal JsonSourceGenerationOptionsAttribute (#56317)
Layomi Akinrinade [Mon, 26 Jul 2021 20:02:43 +0000 (13:02 -0700)]
Seal JsonSourceGenerationOptionsAttribute (#56317)

2 years agoReport that allocations may have side effects for all types outside of the version...
David Wrighton [Mon, 26 Jul 2021 19:59:58 +0000 (12:59 -0700)]
Report that allocations may have side effects for all types outside of the version bubble (#56177)

Fixes #45628

2 years agoInclude time taken on DNS queue in events (#56208)
Miha Zupan [Mon, 26 Jul 2021 19:03:15 +0000 (12:03 -0700)]
Include time taken on DNS queue in events (#56208)

* Include time taken on DNS queue in events

* Add test

* Add usings

* More usings

* Move Assert out of EventListener callback

2 years agoChange MonoProfiler provider GUID to be based on algorithm used by TraceEvent library...
Johan Lorensson [Mon, 26 Jul 2021 17:55:28 +0000 (19:55 +0200)]
Change MonoProfiler provider GUID to be based on algorithm used by TraceEvent library. (#56286)

TraceEvent uses an algorithm defined in http://www.ietf.org/rfc/rfc4122.txt
to get an EventSource GUID from its name. This is used for newer EventSource
providers, and doesn't need changes to TraceEvent code to be detected.

This commit adjust MonoProfiler EventSource provider GUID to the version
calculated by that algorithm.

2 years agoFix some DualMode connect test issues (#56226)
Anton Firszov [Mon, 26 Jul 2021 17:41:12 +0000 (19:41 +0200)]
Fix some DualMode connect test issues (#56226)

Fixes #55053, fixes #54677

2 years agoDisable BeginReceiveFrom_RemoteEpIsReturnedWhenCompletedSynchronously on catalyst...
Anton Firszov [Mon, 26 Jul 2021 17:39:31 +0000 (19:39 +0200)]
Disable BeginReceiveFrom_RemoteEpIsReturnedWhenCompletedSynchronously on catalyst (#56304)

2 years agoFix error message when publishing logs in Restore internal tools step (#56307)
Alexander Köplinger [Mon, 26 Jul 2021 17:33:45 +0000 (19:33 +0200)]
Fix error message when publishing logs in Restore internal tools step (#56307)

In https://dev.azure.com/dnceng/internal/_build/results?buildId=1250178&view=results we hit an issue where the 'Restore internal tools' step failed, but AzDO only highlights the failure in the 'Publish Logs' step because the directory didn't exist.
This happens because the restore step was not passing along the build configuration so it defaults to Debug instead of Release, leading to the log directory we try to publish not existing.

2 years agoHTTP/3 send FIN together with headers if no body (#56221)
Natalia Kondratyeva [Mon, 26 Jul 2021 15:52:58 +0000 (17:52 +0200)]
HTTP/3 send FIN together with headers if no body (#56221)

Fixes #55347

2 years agoUse more `ReadOnlySpan<byte>`s in `System.Reflection.MetadataLoadContext` (#56207)
Theodore Tsirpanis [Mon, 26 Jul 2021 15:41:50 +0000 (18:41 +0300)]
Use more `ReadOnlySpan<byte>`s in `System.Reflection.MetadataLoadContext` (#56207)

* Use spans instead of byte arrays in `MetadataLoadContext.Utf8Constants`.

* Optimize Helpers.ToUtf16(ReadOnlySpan<byte>).

It avoids a byte array allocation on all frameworks.
And remove an unused overload of it.

* Address PR feedback.

* Fix ArgumentNullExceptions.

2 years agoExplicit test for service provider IDisposable implementation (dotnet#56181) (#56227)
lord-executor [Mon, 26 Jul 2021 15:15:54 +0000 (17:15 +0200)]
Explicit test for service provider IDisposable implementation (dotnet#56181) (#56227)

2 years agoImplement new way of return address hijacking (#55946)
Jan Vorlicek [Mon, 26 Jul 2021 14:39:22 +0000 (16:39 +0200)]
Implement new way of return address hijacking (#55946)

* Implement new way of return address hijacking

This change implements a new way of return address hijacking for Intel
CET enabled Windows devices. It uses a mechanism created by the Windows
team for this purpose. The existing mechanism that just patches the
return address by an address of our helper routine would result in
process killing as it would seem like a ROP exploit.

2 years agoDisable DNS tests failing on Ubuntu 16.04 and Debian 9 (#56296)
Karel Zikmund [Mon, 26 Jul 2021 14:25:19 +0000 (16:25 +0200)]
Disable DNS tests failing on Ubuntu 16.04 and Debian 9 (#56296)

Disabled tests tracked by #56295

2 years agoDisable failing wasm test SendReceive_VaryingLengthBuffers_Success (#56293)
Pavel Savara [Mon, 26 Jul 2021 13:02:49 +0000 (15:02 +0200)]
Disable failing wasm test SendReceive_VaryingLengthBuffers_Success (#56293)

2 years agoAdd tvOS specific build of System.Net.Mail (#56185)
Filip Navara [Mon, 26 Jul 2021 11:59:26 +0000 (13:59 +0200)]
Add tvOS specific build of System.Net.Mail (#56185)

Ref: https://github.com/xamarin/xamarin-macios/pull/12011#issuecomment-885149485

2 years agoAdjust exception message for headers having non-ASCII chars (#55886)
Badre BSAILA [Mon, 26 Jul 2021 11:57:33 +0000 (13:57 +0200)]
Adjust exception message for headers having non-ASCII chars (#55886)

Reuse existing resource string.

Fixes #55310

2 years agoKeep X509 handle alive while in use when reading certificate data (#56277)
Kevin Jones [Mon, 26 Jul 2021 10:55:08 +0000 (06:55 -0400)]
Keep X509 handle alive while in use when reading certificate data (#56277)

* Add test for thread racing certificate usage and disposal

* Implement changes to keep the X509* alive while in use.

2 years agoDisable test ResponseCancellation_ServerReceivesCancellation (#56291)
Karel Zikmund [Mon, 26 Jul 2021 10:45:11 +0000 (12:45 +0200)]
Disable test ResponseCancellation_ServerReceivesCancellation (#56291)

Test: System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_Http3_MsQuic.ResponseCancellation_ServerReceivesCancellation

Disabled test tracked by #56194

2 years agoDisable test System.Net.Quic.Tests.MsQuicTests.ConnectWithCertificateCallback (#56264)
Karel Zikmund [Mon, 26 Jul 2021 10:26:32 +0000 (12:26 +0200)]
Disable test System.Net.Quic.Tests.MsQuicTests.ConnectWithCertificateCallback (#56264)

Disabled test tracked by #56263

2 years ago[mono] Disable test relying on precise GC (#56139)
Vlad Brezae [Mon, 26 Jul 2021 07:21:56 +0000 (10:21 +0300)]
[mono] Disable test relying on precise GC (#56139)

2 years agoFix Windows build of ds-ipc-pal-socket.c and make FD_CLOEXEC best effort. (#56141)
Johan Lorensson [Mon, 26 Jul 2021 06:35:28 +0000 (08:35 +0200)]
Fix Windows build of ds-ipc-pal-socket.c and make FD_CLOEXEC best effort. (#56141)

Up until https://github.com/dotnet/runtime/pull/55850 it was possible
to build using diagnostic server socket PAL on Windows for local testing.
NOTE, this is not a config we build on CI since it is not used by any
products (diagnostic server PAL on Windows uses NamedPipes), but useful
for local testing.

The same PR also included calls to fcntl using FD_CLOEXEC in case platform
doesn't define SOCK_CLOEXEC. Since this is a Linux specific flag, it might not
be defined on several targeted platforms. Failures calling fcntl using
FD_CLOEXEC was also triggering an EP_ASSERT but that is only on debug
builds. Most calls to fcntl using FD_CLOEXEC in runtime PAL layers
(both CoreCLR and MonoVM) doesn't check for errors in this case
and sees the operation as best effort, like done here
https://github.com/dotnet/runtime/blob/b937677e8f8601848d29bc072a93cc0c6e21576d/src/libraries/Native/Unix/System.Native/pal_networking.c#L2499.
We should do the same in ds-ipc-pal-socket.c making sure it won't break
any potential platform not fully supporting it or if we are really concerned
about this error, handle it as real error failing creation of socket, but
that needs to be tested on mobile platforms (not running TCP/IP PAL on CI).

2 years agoFix createdump crash on alpine 3.12 and above. (#56272)
Mike McLaughlin [Sun, 25 Jul 2021 19:13:32 +0000 (12:13 -0700)]
Fix createdump crash on alpine 3.12 and above. (#56272)

Finally hit an existing problem in createdump (since 2.1) where the std::set<MemoryRegions> in
ThreadInfo::GetThreadStack() where it is calling CrashInfo::SearchMemoryRegions with m_crashInfo.OtherMappings()
which returns a copy of the set of MemoryRegions instead of a reference. On alpine 3.12 musl, this set copy
is freed right away when it goes out of scope as soon as SearchMemoryRegions returns. On any other Linux distro
and MacOS the set doesn't get freed/invalidated as soon.

Return references to the threads and memory region sets in the CrashInfo functions.

2 years agoTweak code gen for Guid parsing (#56210)
Stephen Toub [Sun, 25 Jul 2021 15:27:40 +0000 (11:27 -0400)]
Tweak code gen for Guid parsing (#56210)

* Tweak code gen for Guid parsing

* Further tweak to use nuint/nint

2 years agoCleanup rotate patterns (#54099)
Huo Yaoyuan [Sun, 25 Jul 2021 05:33:52 +0000 (13:33 +0800)]
Cleanup rotate patterns (#54099)

* Clean RotateLeft

* Cleanup RotateRight

2 years agoDisable test ResponseCancellation_BothCancellationTokenAndDispose_Success (#56266)
Karel Zikmund [Sun, 25 Jul 2021 01:53:47 +0000 (03:53 +0200)]
Disable test ResponseCancellation_BothCancellationTokenAndDispose_Success (#56266)

2 years agoFix duplicated path.Contains check and other checks in Path.GetFullPath (#55373)
Steve Berdy [Sat, 24 Jul 2021 21:22:46 +0000 (17:22 -0400)]
Fix duplicated path.Contains check and other checks in Path.GetFullPath (#55373)

2 years agoEdit IOException docs in ZipFile.ExtractToDirectory (#55762)
Steve Berdy [Sat, 24 Jul 2021 21:21:53 +0000 (17:21 -0400)]
Edit IOException docs in ZipFile.ExtractToDirectory (#55762)

2 years agoHTTP3: Fix issue with GOAWAY handling and implement graceful shutdown logic in Http3L...
Geoff Kizer [Sat, 24 Jul 2021 21:06:10 +0000 (14:06 -0700)]
HTTP3: Fix issue with GOAWAY handling and implement graceful shutdown logic in Http3LoopbackServer (#56134)

* add IsMockProvider/IsMsQuicProvider on QuicTestBase

* add tests for AcceptStreamAsync and Open*Stream when/after the connection is closed/disposed, and related product fixes

* fix issue with GOAWAY handling and add graceful shutdown logic to Http3LoopbackConnection

* PR feedback

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
2 years agoPrevent divide-by-zero in ImageAnimator for images with 0 delay between frames (...
Jeff Handley [Sat, 24 Jul 2021 14:56:42 +0000 (10:56 -0400)]
Prevent divide-by-zero in ImageAnimator for images with 0 delay between frames (#56223)

2 years agoRevert Version.TryFormat changes (#56051)
Stephen Toub [Sat, 24 Jul 2021 13:40:29 +0000 (09:40 -0400)]
Revert Version.TryFormat changes (#56051)

* Revert Version.TryFormat changes to use interpolated strings

This was already optimized to use spans directly.  Using our new span-based interpolated string handler was simpler code, but a few more nanoseconds.  Reverting.

* Tweak original code

Make error handling a bit more clear, and use uint formatting rather than int formatting for small perf boost.

2 years agoDon't set onlyParseItemsDefinedInAssembly in Composite mode (#56050)
Egor Bogatov [Sat, 24 Jul 2021 08:28:33 +0000 (11:28 +0300)]
Don't set onlyParseItemsDefinedInAssembly in Composite mode (#56050)

2 years agodotnet-pgo: ignore native libs passed via -r *.dll (#56168)
Egor Bogatov [Sat, 24 Jul 2021 08:28:21 +0000 (11:28 +0300)]
dotnet-pgo: ignore native libs passed via -r *.dll (#56168)

2 years ago[WIP] Add new GC Standalone pipeline (#54024)
Manish Godse [Sat, 24 Jul 2021 05:20:26 +0000 (22:20 -0700)]
[WIP] Add new GC Standalone pipeline (#54024)

* Add new GC Regions pipeline

* removing osx legs from standalone.

2 years agoBuild support for s390x: installers and packages (#53950)
Ulrich Weigand [Sat, 24 Jul 2021 04:36:12 +0000 (06:36 +0200)]
Build support for s390x: installers and packages (#53950)

* Introduce "PrimaryRuntimeFlavor" concept, set to Mono for s390x

* Enable installers, packages, and archives when building the
  PrimaryRuntimeFlavor, even when this is Mono instead of CoreCLR

* Update default subsets in eng/Subsets.props to take
  PrimaryRuntimeFlavor into account

* Skip packaging singlefilehost when not available (due to building
  with the Mono runtime flavor)

* Only build the IL tools packages in coreclr-packages.proj
  when building with the Mono runtime flavor

2 years agoFix incorrect result right shifting specific negative BigInteger by 32 bits (#54115)
Wei Zheng [Sat, 24 Jul 2021 04:32:45 +0000 (12:32 +0800)]
Fix incorrect result right shifting specific negative BigInteger by 32 bits (#54115)

2 years agoMake callouts to interoplib in preemptive mode that can call back into runtime (...
Aaron Robinson [Fri, 23 Jul 2021 23:35:38 +0000 (16:35 -0700)]
Make callouts to interoplib in preemptive mode that can call back into runtime (#56199)

* Make sure all callouts to interoplib that can call back into runtime transition to PREEMPT mode.

2 years agoDisable tests blocking clean CI for Unix (#56242)
David Cantú [Fri, 23 Jul 2021 21:46:44 +0000 (14:46 -0700)]
Disable tests blocking clean CI for Unix (#56242)

2 years agoFix iOS/Android InvariantMode functional test (#56231)
Steve Pfister [Fri, 23 Jul 2021 21:29:07 +0000 (17:29 -0400)]
Fix iOS/Android InvariantMode functional test (#56231)

The android test was not handling CultureNotFoundException and was crashing.

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

2 years agoFix Microsoft.DotNet.Build.Tasks.Installers property name (#56218)
Matt Mitchell [Fri, 23 Jul 2021 20:59:43 +0000 (13:59 -0700)]
Fix Microsoft.DotNet.Build.Tasks.Installers property name (#56218)

2 years ago[QUIC] Certificate name validation (#56175)
Marie Píchová [Fri, 23 Jul 2021 19:32:00 +0000 (19:32 +0000)]
[QUIC] Certificate name validation (#56175)

* Shared CertificateValidation and used in S.N.Quic

* adressed feedback

* Post merge

* Added tests

2 years agoReenable poisoning test in non R2R jobs (#56149)
Jakob Botsch Nielsen [Fri, 23 Jul 2021 17:41:52 +0000 (19:41 +0200)]
Reenable poisoning test in non R2R jobs (#56149)

Fix #55062

2 years agoSupported contained bitcast under STORE_LCL_VAR/FLD on arm32/64. (#56122)
Sergey Andreenko [Fri, 23 Jul 2021 17:13:16 +0000 (10:13 -0700)]
Supported contained bitcast under STORE_LCL_VAR/FLD on arm32/64. (#56122)

* Return contained bitcast to arm lowering.

* Supported contained bitcast for arm64.

* support contained bitcast arm32.

* Fix arm32.

* fix

* fix assert

* improve comments

2 years ago[Mono] Cleans up test build when targeting iOS/tvOSSimulator on arm64. Enables arm64...
Steve Pfister [Fri, 23 Jul 2021 16:40:37 +0000 (12:40 -0400)]
[Mono] Cleans up test build when targeting iOS/tvOSSimulator on arm64.  Enables arm64 sim on CI (#55577)

2 years agoChange reading time zone display names (#56171)
Tarek Mahmoud Sayed [Fri, 23 Jul 2021 16:36:39 +0000 (09:36 -0700)]
Change reading time zone display names (#56171)

2 years agoEnsure MeterListener.RecordObservableInstruments invoking all instruments callbacks...
Tarek Mahmoud Sayed [Fri, 23 Jul 2021 16:33:04 +0000 (09:33 -0700)]
Ensure MeterListener.RecordObservableInstruments invoking all instruments callbacks (#56183)

2 years agoFix static Socket.ConnectAsync for DnsEndPoint containing IPv6-mapped address string...
Anton Firszov [Fri, 23 Jul 2021 15:37:13 +0000 (17:37 +0200)]
Fix static Socket.ConnectAsync for DnsEndPoint containing IPv6-mapped address string (#56102)

Fixes #56099

2 years agoAdd explicit dependency on System.Reflection.Metadata to the RuntimeConfigParser...
Jo Shields [Fri, 23 Jul 2021 14:20:49 +0000 (10:20 -0400)]
Add explicit dependency on System.Reflection.Metadata to the RuntimeConfigParser task. (#56152)

This change adds an explicit dependency on System.Reflection.Metadata to the RuntimeConfigParser task when targeting the full .net framework.

Closes: #55277

2 years agoReenable some Android Globalization tests (#56147)
Steve Pfister [Fri, 23 Jul 2021 14:04:06 +0000 (10:04 -0400)]
Reenable some Android Globalization tests (#56147)

Android ICU seems to have slight behavioral differences with Turkish and Slovak cultures. This change skips the data items that do have difficulty.

Additionally, there are a few other tests that were failing because the test data should have been the same as what we use on desktop. Adjusted accordingly.

Fixes #36672

2 years agoFix: XmlWriterSettings.Encoding must be registered in static Encoding (#56164)
Krzysztof Wicher [Fri, 23 Jul 2021 13:28:13 +0000 (15:28 +0200)]
Fix: XmlWriterSettings.Encoding must be registered in static Encoding (#56164)

* Fix: XmlWriterSettings.Encoding must be registered in static Encoding

* Update src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs

Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
2 years agoRe-enable System.Diagnostics.Tests.DiagnosticSourceEventSourceBridgeTests.NoException...
Maxim Lipnin [Fri, 23 Jul 2021 13:03:21 +0000 (16:03 +0300)]
Re-enable System.Diagnostics.Tests.DiagnosticSourceEventSourceBridgeTests.NoExceptionThrownWhenProcessingStaticActivityProperties (#56209)

2 years agoImport local nodes that may need normalization through common path (#56044)
Jakob Botsch Nielsen [Fri, 23 Jul 2021 12:17:58 +0000 (14:17 +0200)]
Import local nodes that may need normalization through common path (#56044)

Fix issues where we were creating TYP_INT locals that need normalization
in the importer. This could lead to us to read the wrong number of bytes
from such locals.

In particular this happened when passing a small-sized parameter as a
TYP_INT argument, and that call was inlined. We would end up with a
TYP_INT GT_LCL_VAR node referring to the small parameter that required
normalization.

This change seems to have some benefit too; in a few situations, it
seems the old behavior meant that we could not enregister the small
locals.

Fix #55143

2 years agofix SNI handling in quic (#55468)
Tomas Weinfurt [Fri, 23 Jul 2021 08:29:29 +0000 (01:29 -0700)]
fix SNI handling in quic (#55468)

* fix SNI handling in quic'

* cut ServerOptionsSelectionCallback

* feedback from review

* feedback from review

2 years agoDisable JIT xarch asserts on gcref/byref computation (#56192)
Bruce Forstall [Fri, 23 Jul 2021 05:36:51 +0000 (22:36 -0700)]
Disable JIT xarch asserts on gcref/byref computation (#56192)

The emitter has asserts that an xarch RMW inc/dec/add/sub of a byref
must have an incoming gcref/byref to be legal. This is (no longer)
true due to extensive use of Span and Unsafe constructs, where we
often see lclheap or other integer typed values cast to byref. Also,
the emitter only updates its GC info when an instruction is generated.
When one of these casts from integer to byref ends up getting the same
register allocated, and its instruction is thus omitted, the emitter
doesn't get the appropriate gcref update (this problem is being
attempted to be solved elsewhere).

For now, disable these asserts.

Re-enable the tests disabled in #54207

Fixes #51728, #54007

2 years agoMake Extensions.FileProviders supported in browser and only unsupport FSW usage ...
David Cantú [Fri, 23 Jul 2021 02:03:47 +0000 (19:03 -0700)]
Make Extensions.FileProviders supported in browser and only unsupport FSW usage (#56189)

* Make Extensions.FileProviders supported in browser and only unsupport FSW usage

* Disable CA1416 only for TryEnableFileSystemWatcher

2 years agoCall the jit shutdown logic on crossgen2 shutdown (#56187)
David Wrighton [Fri, 23 Jul 2021 00:28:07 +0000 (17:28 -0700)]
Call the jit shutdown logic on crossgen2 shutdown (#56187)

- Allows the jit shutdown logic to execute reliably on both Windows and Unix

2 years agoUse checked math with CryptoStream buffer calculations
Jeremy Barton [Fri, 23 Jul 2021 00:04:17 +0000 (17:04 -0700)]
Use checked math with CryptoStream buffer calculations

In .NET Framework, .NET 5, and .NET Core the block scaling logic was used for
`new byte[inputCount / inputBlockSize * outputBlockSize]` (or swap in/out).
That expression throws an OverflowException when the computed size
overflows.

Earlier in .NET 6 we changed to use ArrayPool.Rent.  When ArrayPool.Rent gets a
negative (overflowed) number it instead throws an ArgumentException.

This change restores the OverflowException, so that we're not leaking an
ArgumentException back to the caller.  (While the caller can control the
behavior with the arguments they pass to CryptoStream.Read/Write, the
description and paramName don't map in an obvious manner)

Making the scenario work has virtue, but requires a larger test investment than
we can make at this time.

2 years ago[mono] Mark jit icalls using ICALL_EXPORT so they get exported from libmonosgen.so...
Zoltan Varga [Thu, 22 Jul 2021 23:23:47 +0000 (19:23 -0400)]
[mono] Mark jit icalls using ICALL_EXPORT so they get exported from libmonosgen.so. (#56144)

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

2 years agoJIT: work around issue with GDV and Bboxing (#56126)
Andy Ayers [Thu, 22 Jul 2021 21:56:31 +0000 (14:56 -0700)]
JIT: work around issue with GDV and Bboxing (#56126)

If a call is a GDV candidate and returns a struct via hidden buffer, and that
return value is immediately boxed, the GDV expansion will produce IR in
incorrect order, leading to bad codegen.

This seems to be a rare enough sequence that disabling GDV is a reasonable
workaround for now.

Actually the box expansion is producing IR in the wrong order and GDV fails
to fix the order (unlike inlining, which does fix the order).

Longer term we should avoid producing out of order IR. But that seems a bit
more complicated and may have other CQ impact.

Added a test case.

Closes #53549.

2 years agoFix DAC issue with redefined standard new / delete operators (#55945)
Jan Vorlicek [Thu, 22 Jul 2021 21:39:42 +0000 (23:39 +0200)]
Fix DAC issue with redefined standard new / delete operators (#55945)

I have found that since .NET 6 preview 5, SOS on macOS arm64 crashes
when running basic commands like clrstack due to the fact that
its std::string allocations are done using standard new operator,
but the freeing at some places is done using our overriden delete
operator due to inlining of STL code.

This change removes our redefinitions of those operators for DAC
compilation, so this clash cannot happen.

2 years agoUpdate hosting shutdown doc (#56176)
Eric Erhardt [Thu, 22 Jul 2021 21:08:43 +0000 (16:08 -0500)]
Update hosting shutdown doc (#56176)

2 years agoFix build break (#56179)
Eric Erhardt [Thu, 22 Jul 2021 20:30:46 +0000 (15:30 -0500)]
Fix build break (#56179)

Disable the warning until a proper fix can be made.

See #56178

2 years agoFix DeserializeAsyncEnumerable streaming behavior (#56080)
Eirik Tsarpalis [Thu, 22 Jul 2021 20:29:22 +0000 (23:29 +0300)]
Fix DeserializeAsyncEnumerable streaming behavior (#56080)

Fixes regression introduced by #51702: the ContinueDeserialize method will return 'null' on partial reads so no elements will be yielded by the enumerator until the entire stream has been consumed.

This change reverts to the original implementation where the partially populated queue is being fetched from the ReadStack instead.

2 years agofix queue converter singleton initialization (#56081)
Eirik Tsarpalis [Thu, 22 Jul 2021 20:29:00 +0000 (23:29 +0300)]
fix queue converter singleton initialization (#56081)

2 years agoTranslate SocketError.MessageSize to IPStatus.PacketTooBig in Ping.SendPing[Async...
Filip Navara [Thu, 22 Jul 2021 20:22:49 +0000 (22:22 +0200)]
Translate SocketError.MessageSize to IPStatus.PacketTooBig in Ping.SendPing[Async] (#56092)

* Translate SocketError.MessageSize to IPStatus.PacketTooBig in Ping.SendPing[Async]

* Address feedback

* Remove extra whitespace

2 years ago[iOS/tvOS/MacCatalyst] Disable some of the library tests due to failures (#56074)
Maxim Lipnin [Thu, 22 Jul 2021 19:39:41 +0000 (22:39 +0300)]
[iOS/tvOS/MacCatalyst] Disable some of the library tests due to failures (#56074)

It's to clean up the respective CI staging lanes.

The related issues:

[iOS/tvOS/MacCatalyst] Test failures in System.Diagnostics.Tracing.Tests #56073

[libraries][iOSSimulator] ImageTests.FromFile_NullFileName_ThrowsArgumentNullException fails  #56048

JitInfoIsPopulated failed with after is not greater than before #55712

[MacCatalyst] Test failures in System.Tests.OperatingSystemTests #56084

[MacCatalyst] App crash in System.Text.Json.SourceGeneration.Tests #56085

2 years agoUpdate SDK to 6.0 Preview 5 (#55283)
Viktor Hofer [Thu, 22 Jul 2021 19:27:11 +0000 (21:27 +0200)]
Update SDK to 6.0 Preview 5 (#55283)

* Update SDK to 6.0 Preview 5

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

* Enable COM support to work around missing symbols in tests

* Update eng/testing/linker/project.csproj.template

* Disable the workload targets

* Disable workloads for wasm builds

For in-tree builds, and tests we don't want to use workloads from dotnet
being used to build these.

For the projects being built on the build machine, we can disable them
via `Directory.Build.props`, and wasm's InTree/LocalBuild props. But for
projects that get built on helix, eg. the runtime tests, we are setting
the property values as environment variables.

* Fix setting envvars for disabling workloads

* Another attempt to fix wasm tests

In preview5, the workload manifest overrides
`$(UsingBrowserRuntimeWorkload)` setting, so pass it on the command
line.

``xml
    <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
        <UsingBrowserRuntimeWorkload Condition="'$(RunAOTCompilation)' == 'true' or '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true'" >true</UsingBrowserRuntimeWorkload>
        <UsingBrowserRuntimeWorkload Condition="'$(UsingBrowserRuntimeWorkload)' == ''" >$(WasmNativeWorkload)</UsingBrowserRuntimeWorkload>
    </PropertyGroup>
```

* Fix host tests after upgrade to P5

In P5 we don't generate .runtimeconfig.dev.json anymore. Some tests started to fail because they relied on the .runtime.dev.json to include local nuget cache in the probing paths.

I changed one of those tests to force-generate .runtimeconfig.dev.json as for the tested scenario it seems to make sense. For the other test I modified it to copy the necessary dependency into the right location instead.

* Fix up reflection to private FileStatus field

* Disable workload resolver for wasm.build.tests, EMSDK run

* Disable workloads for wasm with MSBuildEnableWorkloadResolver=false everywhere

* remove linker workaround

* [wasm] Remove args unnecessary for disabling workloads

* Pass MSBuildEnableWorkloadResolver property to individual trimming projects

Co-authored-by: Juan Sebastian Hoyos Ayala <juhoyosa@microsoft.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Anirudh Agnihotry <anirudhagnihotry098@gmail.com>
2 years agoRemove diasymreader from source build (#56116)
David Wrighton [Thu, 22 Jul 2021 19:12:59 +0000 (12:12 -0700)]
Remove diasymreader from source build (#56116)

* Remove diasymreader from source build

* Remove Diasymreader from crossgen2 package in source build scenarios

2 years agoinstrumentation changes (#55888)
Maoni Stephens [Thu, 22 Jul 2021 19:08:27 +0000 (12:08 -0700)]
instrumentation changes (#55888)

We've never had ETW events that had fields about time - we rely on the the timestamps of the ETW events themselves to calculate time. This checkin introduces some new events/event fields that will include time info instead of firing individual events that otherwise don't carry much info, ie, they'd just be there so we could use their timestamps, which would be a nuisance when we have many heaps.

The rationale behind firing events with time already calculated is

1) it does reduce overhead since we don't fire as many events so we can fire these in fewer events for informational level
2) firing individual vents and having the tools interpret them isn't very useful unlike events such as GCStart/GCEnd which can be correlated with other events (eg, you get GCStart, and then get a bunch of other events so you know those happened after a GC started) wheras things like very GC internal things don't have this property, ie, we are not gonna care that "these other events happened during a GC and specifically during the relocaton phase".

---

Added MarkWithType events for marking due to dependent handles, newly promoted due to dead finalizable objects and mark_steal. Perfview needs to be updated to work with this otherwise you can't see the GCStats view (I'm submitting a PR for that).

Recorded time for marking roots (but sizedref is separate), short weak, ScanForFinalization, long weak, relocate, compact and sweep.

Added a new version that includes the size of the object that triggered the event. This is for a request from https://github.com/dotnet/runtime/issues/49424#issuecomment-810457867.

Provided a new rundown GCSettings event that has info on settings hard to get from traces.

Added a GCLOHCompact event which is fired for all heaps (heaps that didn't actually do LOH compact would have values of all 0s). I'm trying to add events that don't require a lot of correlation with other events to interpret. This is to help get an idea how long it takes to compact LOH and how reference rich it is.

Added a verbose level GCFitBucketInfo event which helps us with FL fitting investigation. I'm firing this for 2 things in a gen1 GC:

1) for plugs that allocated with allocate_in_condemned_generations the event will capture all of them with the same bucketing as we do for gen2 FL;

2) for gen2 FL we look at the largest free items that take up 25% of the FL space, or if there are too many of them we stop after walking a certain number of free items as we have to limit the amount of time we are spending here.

---

Fixed issues -

For BGC we were reporting the pinned object count the same as the last FGC..and that causes confusion so fixed that.

Fixed https://github.com/dotnet/runtime/issues/45375

While fixing https://github.com/dotnet/runtime/issues/45375, I noticed we have another bug related to alloc tick which is we are not firing the alloc tick events correctly for LOH and POH since the ETW alloc tracking didn't seperate them... fixed this too.

Added the POH type for GCSegmentTypeMap which was missing in the manifest.

---

Did some cleanup in eventtrace.h - we don't need the info that's not used which means we just ended up duplicating things like _GC_ROOT_KIND in more places than needed.

---

Note, I realize that I do have some inconsistency with the FEAETURE_EVENT_TRACE here, as in, some code should be under an #ifdef check but is not. I will look into a remedy for that with a separate PR.

2 years agoFix EH issues with SPMI and crossgen2 (#56054)
David Wrighton [Thu, 22 Jul 2021 18:43:18 +0000 (11:43 -0700)]
Fix EH issues with SPMI and crossgen2 (#56054)

* Remove last vestiges of the PAL exception handling from the JIT-EE interfaces

* Centralize the tweaks to allow finally behavior for crossgen2 exceptions in SPMI
- Centralize the exception filter to capture data with completely common code
- On unix, capture Crossgen2 triggered exceptions as exception code 1 (As was done for getCallInfo only before)
- Use a bunch of templates to reduce the code bloat in SPMI

With these changes catching exceptions should be more reliable. However, I was unable to reproduce the failure, so I need some jit team expertise to identify if these fixes are good.

Fixes #49563