platform/upstream/dotnet/runtime.git
2 years ago[release/6.0-rc1] Migrate LoggerMessageGenerator to IIncrementalGenerator (#58271)
github-actions[bot] [Sat, 28 Aug 2021 00:30:23 +0000 (17:30 -0700)]
[release/6.0-rc1] Migrate LoggerMessageGenerator to IIncrementalGenerator (#58271)

* Migrate LoggerMessageGenerator to IIncrementalGenerator

This reduces the time spent in the background in VS running the source generator, since we only need to respond to methods that have the LoggerMessageAttribute on them.

Contributes to #56702

* PR feedback

* PR feedback

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoMake JsonGenerator be an incremental generator (#57088) (#58278)
Eric Erhardt [Fri, 27 Aug 2021 22:47:52 +0000 (16:47 -0600)]
Make JsonGenerator be an incremental generator (#57088) (#58278)

* Make JsonGenerator be an incremental generator

* Improve incrementalism by doing less work when not applicable

* Change SourceGeneration.UnitTests to SourceGeneration.Unit.Tests so it is built and executed in CI

* Get unit tests running after IIncrementalGenerator migration

* Fix duplicate file name tests by working around https://github.com/dotnet/roslyn/issues/54185.

* Fix unit tests now that they are running in CI against non-English languages.

* Fix System.Text.Json.SourceGeneration.Unit.Tests on WASM

* Disable STJ.SourceGeneration.Unit.Tests on Browser

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
2 years ago[mono] Replace -disable-fp-elim with -frame-pointer=all (#58195)
github-actions[bot] [Fri, 27 Aug 2021 18:20:38 +0000 (11:20 -0700)]
[mono] Replace -disable-fp-elim with -frame-pointer=all (#58195)

`-disable-fp-elim` was removed in LLVM 8 in commit b7cef81fd36c85e52b115b9ed6d1fb92d63781d6.
Also see https://reviews.llvm.org/D56351.

The replacement option, `-frame-pointer`, is still present in LLVM 11.

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

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
2 years agoGive tvOS a special value for Personal/MyDocuments (#58056)
Jo Shields [Fri, 27 Aug 2021 18:20:01 +0000 (14:20 -0400)]
Give tvOS a special value for Personal/MyDocuments (#58056)

2 years ago[release/6.0-rc1] [MacCatalyst] Make AppleCryptoNative_SslSetEnabledCipherSuites...
github-actions[bot] [Fri, 27 Aug 2021 18:18:59 +0000 (11:18 -0700)]
[release/6.0-rc1] [MacCatalyst] Make AppleCryptoNative_SslSetEnabledCipherSuites check for 32 bit & 16 bit SSLCipherSuite (#58182)

* [MacCatalyst] Make AppleCryptoNative_SslSetEnabledCipherSuites check for 32 bit & 16 bit SSLCipherSuite

According to CipherSuites.h, SSLCipherSuite is a 16 bit value on iOS/tvOS x64 & arm64, but on MacCatalyst that is only true on arm64.  x64 is defined as 32 bit.

```
/* 16-bit value on iOS */
typedef uint16_t SSLCipherSuite;
/* 32-bit value elsewhere */
typedef uint32_t SSLCipherSuite;
```

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

* Feedback

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years ago[mono] Avoid a JIT assert. (#58127)
github-actions[bot] [Fri, 27 Aug 2021 18:17:38 +0000 (11:17 -0700)]
[mono] Avoid a JIT assert. (#58127)

Workaround for https://github.com/dotnet/runtime/issues/57560.

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
2 years ago[release/6.0-rc1] Add Crossgen2 symbol files to package (#58193)
github-actions[bot] [Fri, 27 Aug 2021 18:15:20 +0000 (11:15 -0700)]
[release/6.0-rc1] Add Crossgen2 symbol files to package (#58193)

* Add Crossgen2 symbol files to package

* Slight improvement

Co-authored-by: Anton Lapounov <antonl@microsoft.com>
2 years agoPhysicalFileProvider: Use active polling instead of FileSystemWatcher on iOS/tvOS...
github-actions[bot] [Thu, 26 Aug 2021 19:52:43 +0000 (21:52 +0200)]
PhysicalFileProvider: Use active polling instead of FileSystemWatcher on iOS/tvOS (#58165)

In https://github.com/dotnet/runtime/issues/57931 we found out that the FSEventStream APIs which are used to implement System.IO.FileSystemWatcher aren't allowed on the App Store.
According to [Apple's docs](https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate) these APIs are only supported on macOS and Mac Catalyst.

Mark System.IO.FileSystemWatcher as unsupported on iOS/tvOS and throw PNSE.
Switch PhysicalFileProvider to use active polling instead, like we do for Browser.

Addresses https://github.com/dotnet/runtime/issues/57931

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoX86 Debug Stack offsets are encoded divided by 4 - Fix the encoding (#58094)
github-actions[bot] [Thu, 26 Aug 2021 17:34:56 +0000 (10:34 -0700)]
X86 Debug Stack offsets are encoded divided by 4 - Fix the encoding (#58094)

Fixes #57951

Co-authored-by: David Wrighton <davidwr@microsoft.com>
2 years ago[release/6.0-rc1] [wasm] spread WS based timers over next 6 minutes to prevent heavy...
github-actions[bot] [Thu, 26 Aug 2021 17:34:43 +0000 (10:34 -0700)]
[release/6.0-rc1] [wasm] spread WS based timers over next 6 minutes to prevent heavy throttling (#58160)

* spread WS based timers over next 6 minutes to prevent heavy throttling

* wip

* wip

* fix

* better assert description

* exclude test from CI, because helix is headless

* feedback

* more

Co-authored-by: Pavel Savara <pavelsavara@microsoft.com>
2 years ago[release/6.0-rc1] Update dependencies from mono/linker (#58043)
dotnet-maestro[bot] [Thu, 26 Aug 2021 16:31:16 +0000 (09:31 -0700)]
[release/6.0-rc1] Update dependencies from mono/linker (#58043)

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21424.2

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21424.3

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21424.3 -> To Version 6.0.100-preview.6.21424.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix trigger paths for perf_slow.yml (#58079)
Drew Scoggins [Thu, 26 Aug 2021 16:20:03 +0000 (09:20 -0700)]
Fix trigger paths for perf_slow.yml (#58079)

2 years agoSupport reference type custom converters (#57954)
github-actions[bot] [Wed, 25 Aug 2021 17:38:03 +0000 (10:38 -0700)]
Support reference type custom converters (#57954)

Co-authored-by: Steve Harter <steveharter@users.noreply.github.com>
2 years agoFixing DebuggerDisplayAttribute when using utf16 characters. Fixes #58046 (#58087)
github-actions[bot] [Wed, 25 Aug 2021 17:37:52 +0000 (10:37 -0700)]
Fixing DebuggerDisplayAttribute when using utf16 characters. Fixes #58046 (#58087)

Co-authored-by: Thays <thaystg@gmail.com>
2 years ago[release/6.0-rc1] Support special characters in [JsonPropertyName] (#58075)
github-actions[bot] [Wed, 25 Aug 2021 15:46:30 +0000 (08:46 -0700)]
[release/6.0-rc1] Support special characters in [JsonPropertyName] (#58075)

* Support special characters in [JsonPropertyName]

* Make gen'd property name readonly; other misc

Co-authored-by: Steve Harter <steveharter@users.noreply.github.com>
2 years ago[release/6.0-rc1] Add event to RuntimeEventSource for AppContext switches (#57847)
github-actions[bot] [Wed, 25 Aug 2021 15:45:46 +0000 (08:45 -0700)]
[release/6.0-rc1] Add event to RuntimeEventSource for AppContext switches (#57847)

* Add event to RuntimeEventSource for AppContext switches

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

* Respond to PR comments

* Add preliminary tests

* Respond to PR comments

* Add keyword

* Fix tests

* Remove AppContext EventSource support on browser

* forgot using

* Fix error reporting, add comments

* Respond to PR comments

* Refactor tests

* Fix case where s_switches is null

* Fix bug

* Print more info for test failure

* Typo

* Fix lab failure

* Respond to PR comments

* Respond to PR comments

* Typo

* Respond to PR comments

* Skip RuntimeEventSource tests on wasm and android (#57890)

* Skip RuntimeEventSource tests on wasm and android

* Skip tests without using issues.targets

* Disable test for mono

(cherry picked from commit 454ac571fe489ab818c7727f11eee71d521c4366)

Co-authored-by: Andy Gocke <angocke@microsoft.com>
2 years ago[release/6.0-rc1] [wasm][debugger] Fixing assert while debugging. (#58032)
github-actions[bot] [Tue, 24 Aug 2021 20:37:20 +0000 (16:37 -0400)]
[release/6.0-rc1] [wasm][debugger] Fixing assert while debugging. (#58032)

When trying to evaluate DebuggerProxyAttribute of a generic type <T, K>, it was working only for one parameter .

Fixes #58021

Co-authored-by: Thays <thaystg@gmail.com>
2 years ago[interp] Use existing InterpMethod if allocation and lookup race (#57985)
github-actions[bot] [Tue, 24 Aug 2021 19:27:13 +0000 (15:27 -0400)]
[interp] Use existing InterpMethod if allocation and lookup race (#57985)

If two threads both want to get an InterpMethod for the same MonoMethod, and
they both see null from the first hash table lookup, make sure that whichever
one comes into the jit_mm lock second re-uses the previously inserted
InterpMethod, instead of its own version.

Without this change, racing threads will overwrite
MonoJitInfo:seq_points (in mono_interp_transform_method) which sometimes leads
to deallocating the same sequence points multiple times.

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

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
2 years ago[wasm][debugger] Proxy but don't process events from worker sessions (#57990)
github-actions[bot] [Tue, 24 Aug 2021 19:25:36 +0000 (15:25 -0400)]
[wasm][debugger] Proxy but don't process events from worker sessions (#57990)

Backport of #57974

Should Fix #57949

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years ago[release/6.0-rc1] MonoAOTCompiler: Check for proxy file's target only when the cache...
Ankit Jain [Tue, 24 Aug 2021 19:23:45 +0000 (19:23 +0000)]
[release/6.0-rc1] MonoAOTCompiler: Check for proxy file's target only when the cache is being used. (#57867)

Backport of #57865

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

2 years agoFix loading app local ICU (#57992)
github-actions[bot] [Tue, 24 Aug 2021 17:46:44 +0000 (19:46 +0200)]
Fix loading app local ICU (#57992)

Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
2 years ago[release/6.0-rc1] [HTTP/3] Abort response stream on dispose if content not finished...
github-actions[bot] [Tue, 24 Aug 2021 17:02:08 +0000 (11:02 -0600)]
[release/6.0-rc1] [HTTP/3] Abort response stream on dispose if content not finished (#57999)

* Sends abort read/write if H/3 stream is disposed before respective contents are finsihed

* Minor tweaks in abort conditions

* Prevent reverting SendState from Aborted/ConnectionClosed back to sending state within Send* methods.

Co-authored-by: ManickaP <mapichov@microsoft.com>
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
2 years ago[release/6.0-rc1] Improve tracing of HTTP/2 PINGs (#57998)
github-actions[bot] [Tue, 24 Aug 2021 16:58:49 +0000 (10:58 -0600)]
[release/6.0-rc1] Improve tracing of HTTP/2 PINGs (#57998)

* more HTTP/2 PING logging

* test unexpected PING response

Co-authored-by: Anton Firszov <antonfir@gmail.com>
2 years ago[release/6.0-rc1] Fixed StreamPipeReader.CopyToAsync (#57966)
github-actions[bot] [Tue, 24 Aug 2021 16:17:36 +0000 (10:17 -0600)]
[release/6.0-rc1] Fixed StreamPipeReader.CopyToAsync (#57966)

* Fixed StreamPipeReader.CopyToAsync - Take the segment index into account when copying buffered data. This handles the case where ReadAsync has consumed a partial segment and then the same PipeReader instance is used to copy to a Stream and PipeWriter. - Added tests

* Always slice

Co-authored-by: David Fowler <davidfowl@gmail.com>
2 years ago[release/6.0-rc1] Align DCJS with 4.8 implementation. (#57883)
github-actions[bot] [Tue, 24 Aug 2021 06:35:54 +0000 (08:35 +0200)]
[release/6.0-rc1] Align DCJS with 4.8 implementation. (#57883)

* Align DCJS with 4.8 version. This work addresses #55270.

* Close() nits.

* Remove some extraneous trimmer attributes.

* Another trimmer nit.

Co-authored-by: Steve Molloy <smolloy@microsoft.com>
2 years ago[release/6.0-rc1] Enable SocketHttpHandler to decompress zlib or deflate (#57940)
github-actions[bot] [Mon, 23 Aug 2021 19:57:39 +0000 (15:57 -0400)]
[release/6.0-rc1] Enable SocketHttpHandler to decompress zlib or deflate (#57940)

* Enable SocketHttpHandler to decompress zlib or deflate

Some servers incorrectly implement the deflate content-coding with the raw deflate algorithm rather than with deflate wrapped with a zlib header/footer.  Auto-detect whether to use ZLibStream or DeflateStream in order to accomodate both kinds of responses.

* Fix test build for WinHttpHandler on .NET Framework

* Apply suggestions from code review

* Add decompression test for empty response body

* Add decompression tests for multiple source content lengths

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoDisable TaskDropsExecutionContextUponCompletion test (#57864)
github-actions[bot] [Sat, 21 Aug 2021 12:04:29 +0000 (08:04 -0400)]
Disable TaskDropsExecutionContextUponCompletion test (#57864)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoRemove run trigger (#57850)
Drew Scoggins [Fri, 20 Aug 2021 23:11:46 +0000 (16:11 -0700)]
Remove run trigger (#57850)

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[release/6.0-rc1] [mono][debugger] Fix watch of local variable values (#57787)
github-actions[bot] [Fri, 20 Aug 2021 20:22:03 +0000 (13:22 -0700)]
[release/6.0-rc1] [mono][debugger] Fix watch of local variable values (#57787)

* Fix xamarin-android 6161

* Fixing leak.

* Adding wasm debugger test. Fixing using protocol version.

* only get locals in older protocol versions.

Co-authored-by: Thays <thaystg@gmail.com>
2 years ago[release/6.0-rc1] [hot_reload] Don't look at delta method table rows (#57799)
github-actions[bot] [Fri, 20 Aug 2021 20:21:55 +0000 (13:21 -0700)]
[release/6.0-rc1] [hot_reload] Don't look at delta method table rows (#57799)

* Add test case

Call a method for the first time after an update has been applied to it.

This will check that the interpreter or JIT does not have to rely on cached
information from the baseline (about the method signature, for example) and
that it can compute it from the delta.

* [hot_reload] Don't look at delta method table rows

The issue is that the ParamList column in EnC deltas is a "suppressed column"
that has the value 0.  So when a method is updated if we use the value
directly, we will break, for example - `mono_metadata_get_param_attrs` which
expects a non-zero index in that column.

CoreCLR solves this by having a set of suppressed columns that are never
updated by deltas.  (CoreCLR's model is to directly mutate the tables of the
baseline image).  In Mono we can eventually do the same thing by writing the
value from the previous generation into the current delta's row.  But right now
since we don't allow parameter modifications, and the only column on a Method
table that we allow to be modified is the RVA - which we look up specially - we
can just always return the baseline image row for the method table.

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

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
2 years agoUpdate toolset MicrosoftNETCoreApp version This package no longer exists. Replace...
github-actions[bot] [Fri, 20 Aug 2021 17:53:29 +0000 (10:53 -0700)]
Update toolset MicrosoftNETCoreApp version This package no longer exists. Replace with runtime package version and appropriate property. (#57828)

Co-authored-by: Matt Mitchell <mmitche@microsoft.com>
2 years agoUpdate dependencies from https://github.com/dotnet/icu build 20210819.1 (#57763)
dotnet-maestro[bot] [Fri, 20 Aug 2021 08:21:26 +0000 (10:21 +0200)]
Update dependencies from https://github.com/dotnet/icu build 20210819.1 (#57763)

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-rc.1.21416.1 -> To Version 6.0.0-rc.1.21419.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUpdate dependencies from https://github.com/mono/linker build 20210819.1 (#57777)
dotnet-maestro[bot] [Fri, 20 Aug 2021 08:17:35 +0000 (10:17 +0200)]
Update dependencies from https://github.com/mono/linker build 20210819.1 (#57777)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21416.1 -> To Version 6.0.100-preview.6.21419.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoPack windows implementation assemblies in windowsdesktop transport package (#57796)
github-actions[bot] [Fri, 20 Aug 2021 07:08:46 +0000 (09:08 +0200)]
Pack windows implementation assemblies in windowsdesktop transport package (#57796)

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
2 years agoRe-disable AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion test (...
github-actions[bot] [Thu, 19 Aug 2021 23:26:51 +0000 (19:26 -0400)]
Re-disable AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion test (#57762)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoUpdate dependencies from https://github.com/dotnet/emsdk build 20210819.1 (#57759)
dotnet-maestro[bot] [Thu, 19 Aug 2021 22:52:04 +0000 (00:52 +0200)]
Update dependencies from https://github.com/dotnet/emsdk build 20210819.1 (#57759)

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.1.21416.1 -> To Version 6.0.0-rc.1.21419.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix Microsoft.NETCore.Platforms builds on Unix (#57757)
github-actions[bot] [Thu, 19 Aug 2021 22:50:46 +0000 (00:50 +0200)]
Fix Microsoft.NETCore.Platforms builds on Unix (#57757)

The casing of the SDK imported via the Sdk attribute was wrong which lead to:

Microsoft.NETCore.Platforms.csproj : error MSB4236: The SDK 'Microsoft.NET.SDK' specified could not be found.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years ago[release/6.0-rc1] Update dependencies from dotnet/arcade (#57628)
dotnet-maestro[bot] [Thu, 19 Aug 2021 22:37:56 +0000 (00:37 +0200)]
[release/6.0-rc1] Update dependencies from dotnet/arcade (#57628)

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

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21413.4 -> To Version 6.0.0-beta.21417.1

* Unpin compiler version

* Update source-index-stage1.yml

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

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21413.4 -> To Version 6.0.0-beta.21418.12

* Partial cherry pick from a169ca9da716a710a576667206b4d8cdf40a7f79

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years ago[mono] Fix crash in common_call_trampoline due to inconsistent rgctx mode (#57677)
github-actions[bot] [Thu, 19 Aug 2021 18:51:37 +0000 (11:51 -0700)]
[mono] Fix crash in common_call_trampoline due to inconsistent rgctx mode (#57677)

* Assume MRGCTX mode if mini_method_is_default_method is true

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

Co-authored-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2 years ago[release/6.0-rc1] Update pinned compiler version (#57730)
github-actions[bot] [Thu, 19 Aug 2021 16:06:29 +0000 (18:06 +0200)]
[release/6.0-rc1] Update pinned compiler version (#57730)

* Update pinned compiler version

The version that flows in automatically appears to still be old.  We need to fix that, but in the meantime, we're a month out of date on the compiler.

* Suppress CS8969 warnings

* Change several dynamic tests to use typeof(object[])

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years ago[release/6.0-rc1] JIT: don't clone loops where init or limit is a cast local (#57690)
github-actions[bot] [Thu, 19 Aug 2021 14:20:47 +0000 (07:20 -0700)]
[release/6.0-rc1] JIT: don't clone loops where init or limit is a cast local (#57690)

* JIT: don't clone loops where init or limit is a cast local

The loop cloner assumes all computations it introduces are compatible
with TYP_INT, so don't allow cloning when the initial or final value
are variables with incompatible types.

Fixes #57535.

* Apply suggestions from code review

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
2 years agoBump timeout for workloads build job (#57721)
github-actions[bot] [Thu, 19 Aug 2021 14:13:11 +0000 (16:13 +0200)]
Bump timeout for workloads build job (#57721)

We're seeing it sometimes timing out on official builds.

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoThrow on invalid payload length in WebSockets (#57635)
github-actions[bot] [Wed, 18 Aug 2021 19:43:58 +0000 (12:43 -0700)]
Throw on invalid payload length in WebSockets (#57635)

Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
2 years agoFix Debug.Assert use of string interpolation (#57668)
github-actions[bot] [Wed, 18 Aug 2021 19:36:43 +0000 (15:36 -0400)]
Fix Debug.Assert use of string interpolation (#57668)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years ago[wasm] Enable tests blocked by IL2105 (#57457)
Larry Ewing [Tue, 17 Aug 2021 21:28:09 +0000 (16:28 -0500)]
[wasm] Enable tests blocked by IL2105 (#57457)

* Disable ReflectionCachesUpdateHandler_CachesCleared with aggressive trimming

* Enable more tests stopped by 2105

* Create tests.mobile.targets

Suppress IL2025

* Remove comment enabling trim warnings

* Mark more active issues

2 years agodon't try to test module path if we can't load the module (#57590)
Adam Sitnik [Tue, 17 Aug 2021 20:48:02 +0000 (22:48 +0200)]
don't try to test module path if we can't load the module (#57590)

2 years agoFix the string search behavior when using ICU (#57078)
Tarek Mahmoud Sayed [Tue, 17 Aug 2021 20:41:34 +0000 (13:41 -0700)]
Fix the string search behavior when using ICU (#57078)

2 years agoFix crashreport for stack overflow (#57428)
Mike McLaughlin [Tue, 17 Aug 2021 20:02:14 +0000 (13:02 -0700)]
Fix crashreport for stack overflow (#57428)

* Fix crashreport for stack overflow

Issue: https://github.com/dotnet/runtime/issues/57032

The stack overflow managed exception wasn't been set/written out.

Changed the "unmanaged_frames" value to "stack_frames" because it includes both native and managed frames.

Aggregated the repeated stack frames adding a "repeated"/repeated_frames value/array for the time of times the sequence was repeated.

Looks like this:

    {
      "repeated" : "0x1542",
      "repeated_frames" : [
       {
        "is_managed" : "true",
        "module_address" : "0x10e402000",
        "stack_pointer" : "0x7000045ce020",
        "native_address" : "0x11b9ee8c9",
        "native_offset" : "0x29",
        "token" : "0x600006f",
        "il_offset" : "0x0",
        "method_name" : "Macson.Client.Diagnostics.CrashyClass.Foo2()",
        "timestamp" : "0xa8561820",
        "sizeofimage" : "0xe000",
        "filename" : "Macson.Client.dll",
        "guid" : "49cd869a682942bc95c0c34ca206c61d"
       },
       {
        "is_managed" : "true",
        "module_address" : "0x10e402000",
        "stack_pointer" : "0x7000045ce040",
        "native_address" : "0x11b9ee879",
        "native_offset" : "0x29",
        "token" : "0x6000070",
        "il_offset" : "0x0",
        "method_name" : "Macson.Client.Diagnostics.CrashyClass.Foo1()",
        ...
       },
      ]
    }

* Update createdump doc

* Fix Windows triage dump flags

* Code review feedback

2 years agoAdd --make-repro-path option to crossgen2 (#57543)
David Wrighton [Tue, 17 Aug 2021 19:42:07 +0000 (12:42 -0700)]
Add --make-repro-path option to crossgen2 (#57543)

- This is used to create repro packages for customer discovered issues with CrossGen2
- Customers will use this by setting the PublishCrossGen2ExtraArgs property to something like `--make-repro-path:c:\repro\crossgen2repro`
- Then the build will run, and produce zip files in the specified directory, one for each crossgen2 run that occurs during that build.
- Hopefully, then it is straightforward to package the failure up and send it in.

In addition, this tech can be used to transfer a full set of repro details from a Unix to Windows machine for easier debugging.

2 years agoUpdate dependencies from https://github.com/dotnet/msquic build 20210817.1 (#57581)
dotnet-maestro[bot] [Tue, 17 Aug 2021 19:37:43 +0000 (12:37 -0700)]
Update dependencies from https://github.com/dotnet/msquic build 20210817.1 (#57581)

System.Net.MsQuic.Transport
 From Version 6.0.0-preview.7.21416.1 -> To Version 6.0.0-preview.7.21417.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoThe FilterLoggingBuilderExtensions public API's (#57485)
Feng Gao [Tue, 17 Aug 2021 19:35:04 +0000 (03:35 +0800)]
The FilterLoggingBuilderExtensions public API's (#57485)

document doesn't reflect the acutal type.  Change
it from the ILoggingBuilder to LoggerFilterOptions.

Fix #57482

2 years agodon't dispose client control stream before closing connection (#57223)
Geoff Kizer [Tue, 17 Aug 2021 19:31:26 +0000 (12:31 -0700)]
don't dispose client control stream before closing connection (#57223)

* don't dispose client control stream before closing connection

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
2 years agoRemove codesign before bundling (#57532)
Andy Gocke [Tue, 17 Aug 2021 18:52:10 +0000 (11:52 -0700)]
Remove codesign before bundling (#57532)

* Remove codesign before bundling

* Change tests to sign by default and check for signing

* Use standard .NET style

Fixes #57242

2 years agoRemove validation to stat call for symlinks since is a breaking change (#57551)
David Cantú [Tue, 17 Aug 2021 18:51:46 +0000 (11:51 -0700)]
Remove validation to stat call for symlinks since is a breaking change (#57551)

* Remove validation to stat call for symlinks since is a breaking change, subsequently remove the symlink cache logic as is no longer needed

* Undo try-catch workaround in PhysicalFileProvider

* Fix tests that were failing due to changes

2 years agoDon't fgMorphCommutative when the optimization can violate VN invariants or remove...
Egor Chesakov [Tue, 17 Aug 2021 18:41:32 +0000 (11:41 -0700)]
Don't fgMorphCommutative when the optimization can violate VN invariants or remove an active CSE candidate (#57160)

2 years agoFix ARM64 unsigned div by const perf regression (#57400)
Pent Ploompuu [Tue, 17 Aug 2021 18:38:19 +0000 (21:38 +0300)]
Fix ARM64 unsigned div by const perf regression (#57400)

2 years agoNumber handling with converters (#57525)
Steve Harter [Tue, 17 Aug 2021 18:35:10 +0000 (13:35 -0500)]
Number handling with converters (#57525)

Co-authored-by: Layomi Akinrinade <laakinri@microsoft.com>
2 years agoAdd tests for notification profilers (#57429)
David Mason [Tue, 17 Aug 2021 18:32:20 +0000 (11:32 -0700)]
Add tests for notification profilers (#57429)

Add CI tests for notification profilers, and fix a couple things to make life with multiple profilers easier
  * Reduced default timeout for profiler detach - we used to try at 300ms, 600ms, 5s, 10s, and then 10 minutes. The check is just a read of an int, so there's no reason to wait 10 minutes
  * Got rid of a couple asserts that were wrong since switching from the dedicated profiler attach thread to the diagnostics server implementation
  * ProfControlBlock::GetProfilerInfo would only work for active profilers, not attaching profilers, which could cause subtle bugs

2 years agoMake all interpolated string handlers pass by ref (#57536)
Stephen Toub [Tue, 17 Aug 2021 18:17:14 +0000 (14:17 -0400)]
Make all interpolated string handlers pass by ref (#57536)

We currently pass all of our interpolated string handlers to their destination methods by ref, with the exception of those for Debug.  I think it makes sense to centralize on the pattern of always passing by ref: it doesn’t negatively impact the user experience, these are typically larger structs and so by ref helps (though it doesn’t matter for Debug), making it a ref makes it even less attractive to try to call directly / makes it look even more special, and most importantly, it gives us the opportunity to more safely clean up at the end of the operation.  This changes the Debug.Assert/Write{Line}If overloads we added in Preview 7 to pass the handler’s by ref.

This also then updates the Debug.Write{Line}If methods to create the StringBuilder used via StringBuilderCache, just in case these are used in a scenario where true is frequently passed.

2 years agoFix hanging HTTP cancelation test. (#57573)
Pavel Savara [Tue, 17 Aug 2021 18:17:05 +0000 (20:17 +0200)]
Fix hanging HTTP cancelation test. (#57573)

* fix hanging http cancelation test. On wasm, the loopback could never get to read the headers

* feedback

2 years agoRevert "Change IOptionsSnapshot to reuse options instances across scopes (#56271...
Eric Erhardt [Tue, 17 Aug 2021 18:13:13 +0000 (13:13 -0500)]
Revert "Change IOptionsSnapshot to reuse options instances across scopes (#56271)" (#57570)

* Revert "Change IOptionsSnapshot to reuse options instances across scopes (#56271)"

This reverts commit 8f5f9d049a6a98b138f88fa1d9d6a96c40c03aa7.

* Add a test to ensure ASP.NET's scenario isn't broken again

2 years ago[mono][debugger] Fix deadlock when debugging AOTed class (#57574)
Thays Grazia [Tue, 17 Aug 2021 18:11:49 +0000 (15:11 -0300)]
[mono][debugger] Fix deadlock when debugging AOTed class (#57574)

* Fix deadlock when debugging AOTed class

* fix comment.

2 years agoUse Type.GetTypeCode() instead of private extension (#57540)
Steve Molloy [Tue, 17 Aug 2021 18:11:38 +0000 (11:11 -0700)]
Use Type.GetTypeCode() instead of private extension (#57540)

* Use official Type.GetTypeCode() instead of the extension that was added to fill the gap in the earlier days of .Net Core.
* Bring reflection-based serializer in line with RefEmit behavior for 'object' serialization.

2 years agoSgen: Update GetTempAssemblyName according to #46499 (#57026)
Tal Aloni [Tue, 17 Aug 2021 18:11:00 +0000 (21:11 +0300)]
Sgen: Update GetTempAssemblyName according to #46499 (#57026)

* Update GetTempAssemblyName according to #46499

In #46499 we corrected Compilation.GetTempAssemblyName in order for it to be not deterministic under .NET Core.
In this PR we update the generated filename to match the new logic.

* Update Microsoft.XmlSerializer.Generator.csproj

* Update SGen.cs

Avoid using external dependency

* Update Microsoft.XmlSerializer.Generator.csproj

Avoid using external dependency

* Update Sgen.cs

Fixed compilation

2 years agoFix source indexer failing official builds (#57336) (#57593)
Alexander Köplinger [Tue, 17 Aug 2021 18:10:45 +0000 (20:10 +0200)]
Fix source indexer failing official builds (#57336) (#57593)

Works around https://github.com/dotnet/arcade/issues/7747 to unblock official builds.
This change will revert itself with the next Arcade update.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years agoPublish VS workloads assets in requested folder layout to BAR (#57559)
Alexander Köplinger [Tue, 17 Aug 2021 18:08:38 +0000 (20:08 +0200)]
Publish VS workloads assets in requested folder layout to BAR (#57559)

See discussion in https://github.com/dotnet/runtime/issues/57154

2 years ago[Android][libraries] Throw PNSE for PersistKeySet flags (#57494)
Mitchell Hwang [Tue, 17 Aug 2021 18:06:02 +0000 (14:06 -0400)]
[Android][libraries] Throw PNSE for PersistKeySet flags (#57494)

* [Android][libraries] Throw PNSE for Exportable and PersistKeySet flags

* Ignore exportable flag

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
2 years agoAdd checks for missing SSA numbers (#57274)
Jakob Botsch Nielsen [Tue, 17 Aug 2021 17:48:38 +0000 (19:48 +0200)]
Add checks for missing SSA numbers (#57274)

In several places there were cases where we were checking lvaInSsa for
the lcl num of a local tree node, but then proceeded to use the ssa
number directly after. It is possible for a local to be in SSA without
tree nodes themselves having SSA form built for them, for example if
unreachable code makes it to SSA building. This adds some additional
check for missing SSA numbers.

2 years agocommenting out an assert that could be triggered on Win7 (#57524)
Vladimir Sadov [Tue, 17 Aug 2021 17:21:27 +0000 (10:21 -0700)]
commenting out an assert that could be triggered on Win7 (#57524)

2 years ago[wasm] Add incremental build support (#57113)
Ankit Jain [Tue, 17 Aug 2021 16:58:50 +0000 (12:58 -0400)]
[wasm] Add incremental build support (#57113)

* Update tasks to support incremental build

MonoAOTCompiler:
- Compiles assemblies to .bc files.
- Hashes for the .bc files are stored in a json cache file.
- And uses .depfile generated by mono-aot-cross, to figure out the
  if any of the dependencies have changed
- Writes out the actual .bc file only if the assembly, or it's
  dependencies changed

EmccCompile.cs: Support a `%(Dependencies)` metadata on the source
files, to compile the files only when needed.

* Update wasm targets

* don't pass unncessary args to RunTests

* Add tests for incremental builds

* Disable non-wasm builds, for testing

* Add miggins LogAsErrorException.cs

* Bump sdk for workload testing to 6.0.100-rc.1.21410.3

* fix build

* MonoAOTCompiler: use the full path to copy the final .bc file

* Make the method used with `MemberData`, static

otherwise xunit just shows a cryptic:
```
    Wasm.Build.Tests.RebuildTests.NoOpRebuild [STARTING]
    Wasm.Build.Tests.RebuildTests.NoOpRebuild [FAIL]
      System.NotSupportedException : Specified method is not supported.
```

* add back builds

* Split Wasm.Build.Tests into multiple helix jobs

* Revert "add back builds"

This reverts commit 1d031c04e13780ec73180ba6f06a37ee42c24203.

* Split up native rebuild tests

* remove non-test classes

* add back builds

This reverts commit b008130a7886c2e2b9f16c83641c1b8c936082f6.

* MonoAOTCompiler: make cache optional

* MonoAOTCompiler: handle the case where we have a cache entry, but the file on disk doesn't exist

* Fix aot compiler task output

* MonoAOTCompiler: Use hashes of .bc files instead of assemblies

`--depfile` isn't supported on aot config used by android, and fails
with:

```
* Assertion at /__w/1/s/src/mono/mono/mini/aot-compiler.c:14216, condition `acfg->aot_opts.llvm_only && acfg->aot_opts.asm_only && acfg->aot_opts.llvm_outfile' not met
```

Instead, use hashes of the .bc.tmp files generated, with the existing
.bc files.

* MonoAOTCompiler: Support more than one output file

The earlier implementation assumed that there would be only one output
file. But in some cases (eg. android), there are more than one, like
`.s`, `.dll-llvm.o`.

* -bump sdk for workload testing

* MonoAOTCompiler: don't use tmp files at all, when cache isn't being

.. used.

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years ago[main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/arcade...
dotnet-maestro[bot] [Tue, 17 Aug 2021 16:42:43 +0000 (18:42 +0200)]
[main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/arcade dotnet/icu dotnet/llvm-project dotnet/runtime-assets dotnet/msquic (#57563)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210816.5

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.21411.3 -> To Version 1.0.0-prerelease.21416.5

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

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21412.1 -> To Version 6.0.0-beta.21413.4

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-rc.1.21410.2 -> To Version 6.0.0-rc.1.21416.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20210816.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 11.1.0-alpha.1.21409.1 -> To Version 11.1.0-alpha.1.21416.1

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

Microsoft.DotNet.CilStrip.Sources , 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.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21411.3 -> To Version 6.0.0-beta.21416.1

* Update dependencies from https://github.com/dotnet/msquic build 20210816.1

System.Net.MsQuic.Transport
 From Version 6.0.0-preview.7.21413.1 -> To Version 6.0.0-preview.7.21416.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUpdate dependencies from https://github.com/mono/linker build 20210816.1 (#57565)
dotnet-maestro[bot] [Tue, 17 Aug 2021 16:41:14 +0000 (18:41 +0200)]
Update dependencies from https://github.com/mono/linker build 20210816.1 (#57565)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21413.1 -> To Version 6.0.100-preview.6.21416.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoAdd dedicated wasm implementation for Parallel.Invoke and Parallel.For (#57283)
Katelyn Gadd [Tue, 17 Aug 2021 16:40:02 +0000 (09:40 -0700)]
Add dedicated wasm implementation for Parallel.Invoke and Parallel.For (#57283)

Introduces a simple single-threaded implementation for Parallel.Invoke, .For, and .ForEach that bypasses Task and wait primitives so that in browser environments parallel loop operations complete synchronously on the current thread

2 years agoupdate msquic to 1.7 (#57541)
Tomas Weinfurt [Tue, 17 Aug 2021 16:37:59 +0000 (09:37 -0700)]
update msquic to 1.7 (#57541)

2 years agoAdd UnmanagedCallersOnly attribute to SafeDeleteSslContext.ReadFromConnection/WriteTo...
Maxim Lipnin [Tue, 17 Aug 2021 16:33:06 +0000 (19:33 +0300)]
Add UnmanagedCallersOnly attribute to SafeDeleteSslContext.ReadFromConnection/WriteToConnection methods (#55947)

* Add UnmanagedCallersOnly attribute to  SafeDeleteSslContext.ReadFromConnection/WriteToConnection methods

* Fix the build

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix the build

* Add SslSetConnection interop method to make sure the right SafeDeleteSslContext instance is associated to an ssl session

* Update entrypoints.c with new DllImport

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoUse OID constructor for certificate SignatureAlgorithm.
Kevin Jones [Tue, 17 Aug 2021 15:58:13 +0000 (11:58 -0400)]
Use OID constructor for certificate SignatureAlgorithm.

This fixes an issue where it was not possible to get the SignatureAlgorithm
on Windows if the signature algorithm does not have a FriendlyName, like
a GOST certificate. This changes the SignatureAlgorithm property to use the
OID constructor so that the value can always be accessed, and the FriendlyName
is lazily resolve when the property is accessed.

2 years agoJIT: Don't fold NEG(NEG(X)) to X when NEG(x) is a CSE candidate (#57478)
Egor Bogatov [Tue, 17 Aug 2021 15:27:11 +0000 (18:27 +0300)]
JIT: Don't fold NEG(NEG(X)) to X when NEG(x) is a CSE candidate (#57478)

2 years ago[wasm] [debugger] Cache debugger information on Proxy side to avoid going to debugger...
Thays Grazia [Tue, 17 Aug 2021 15:22:09 +0000 (12:22 -0300)]
[wasm] [debugger] Cache debugger information on Proxy side to avoid going to debugger-agent everytime. (#57404)

* Caching some debugger information to avoid going to debugger-agent everytime.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.

* Adding cache for generic type.

* Fix merge.

* Fixing test behavior.

* Fixing debuggerproxy.

* Fixing merge
Fixing tests.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoAvoid most of the (small) regressions for seeded and derived Random instances (#57530)
Stephen Toub [Tue, 17 Aug 2021 15:07:31 +0000 (11:07 -0400)]
Avoid most of the (small) regressions for seeded and derived Random instances (#57530)

* Split Random compat implementation to address most regressions

When we introduced the new Random algorithm, we did so by factoring the old algorithm out into an implementation strategy class that is instantiated for all use other than `new Random()`.  This ends up penalizing other uses (providing a seed and/or deriving from Random) by adding more virtual dispatch than is strictly necessary, in particular for `new Random(seed)`.  This PR negates most of that (expected) regression by splitting the compat implementation in two, one class for `new Random(seed)` and one for `new DerivedRandom()`/`new DerivedRandom(seed)`; the former no longer needs to make virtual calls back out to the parent type.  The former is also one that a consumer can't really do anything to improve, whereas in the derived case, the derivation may override to provide a more optimal implementation.

* Change NextUInt64 implementation to reduce number of calls

We haven't shipped this yet, so we can change its implementation to make 3 calls instead of 8 and to delegate to a different overload of Next.

* Consolidate NextBytes to use span

2 years agoSkip CSE for non-hoistable floats (#57438)
Egor Bogatov [Tue, 17 Aug 2021 15:06:04 +0000 (18:06 +0300)]
Skip CSE for non-hoistable floats (#57438)

2 years agoAdd `zip` tool to the install list for Android tests (#57569)
Vitek Karas [Tue, 17 Aug 2021 15:00:48 +0000 (17:00 +0200)]
Add `zip` tool to the install list for Android tests (#57569)

On default WSL Ubuntu `zip` is not installed, and trying to build Android tests fails with rather cryptic errors.

2 years ago[iOS] [Android] Remove PNSE from some HttpClientHandler methods (#57555)
Steve Pfister [Tue, 17 Aug 2021 14:52:51 +0000 (10:52 -0400)]
[iOS] [Android] Remove PNSE from some HttpClientHandler methods (#57555)

Since HttpClientHandler on mobile can support both the underlying native handler and SocketsHttpHandler, it doesn't make sense to always throw PNSE on some methods due to only the native handler not supporting them.

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

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years ago[mono] Check for additional implemented variant interfaces (#57086)
Aleksey Kliger (λgeek) [Tue, 17 Aug 2021 14:23:31 +0000 (10:23 -0400)]
[mono] Check for additional implemented variant interfaces (#57086)

* [class-setup-vtable] Use flags bitmask in check_interface_method_override

No funcitonal change yet.

* [class-setup-vtable] Check additional slots when explicitly implementing variant interfaces

If a class implements a variant interface, consider whether it is explicitly
implementing (as opposed to obtaining by being a subclass of some base class)
some variant interfaces.

Two examples:
public interface IFactory<out T> { T Get(); }
public class Foo {}
public class Bar : Foo {}
public class FooFactory : IFactory<Foo> { public Foo Get() => new Foo(); }
public class BarFactory : FooFactory, IFactory<Bar> { public new Bar Get() => new Bar(); }

In this case, BarFactory explicitly implements IFactory<Bar> and also
IFactory<Foo>.

Conversely for contravariant gparams:
interface ITaker<in T> { string Consume (T x); }
class Foo {}
class Bar : Foo {}
class BarTaker : ITaker<Bar> { public string Consume (Bar x) => "consumed Bar"; }
class FooTaker : BarTaker, ITaker<Foo> { public string Consume (Foo x) =>
"consumed Foo"; }

In this case FooTaker implements ITaker<Foo> but also ITaker<Bar>.

When this happens, the signature of the implementing method 'Bar
BarFactory:Get()' doesn't match the signature of the implemented interface
method 'Foo IFactory<Foo>:Get()'.

We should check the signature parameters of the candidate method and the
implemented method, but I think the interface setup code already checks this
for us.

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

* oops, disable vtable tracing

* Use explicit variant interface to implement base type interfaces

2 years agoFix DacHeapWalker for USE_REGIONS (#56796)
Andrew Au [Tue, 17 Aug 2021 14:18:47 +0000 (07:18 -0700)]
Fix DacHeapWalker for USE_REGIONS (#56796)

2 years ago[QUIC] QuicStream add ReadsCompleted (#57492)
Natalia Kondratyeva [Tue, 17 Aug 2021 12:22:06 +0000 (14:22 +0200)]
[QUIC] QuicStream add ReadsCompleted (#57492)

Add ReadsCompleted API that exposes ReadState=ReadsCompleted, set ReadState to ReadsCompleted if FIN flag arrives in RECEIVE event, fix ReadState changing to final stauses, expand ReadState transition description

Fixes #55707

2 years ago[main] Update dependencies from dotnet/runtime dotnet/emsdk (#57491)
dotnet-maestro[bot] [Tue, 17 Aug 2021 10:58:38 +0000 (12:58 +0200)]
[main] Update dependencies from dotnet/runtime dotnet/emsdk (#57491)

* Update dependencies from https://github.com/dotnet/runtime build 20210815.6

Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.DotNetHost , runtime.native.System.IO.Ports , Microsoft.NET.Sdk.IL , System.Runtime.CompilerServices.Unsafe , System.Text.Json
 From Version 6.0.0-rc.1.21411.3 -> To Version 6.0.0-rc.1.21415.6

* Update dependencies from https://github.com/dotnet/emsdk build 20210816.1

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.1.21415.1 -> To Version 6.0.0-rc.1.21416.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoSystem.Net.NetworkInformation UnsupportedOSPlatform attributes (#57281)
Marie Píchová [Tue, 17 Aug 2021 10:44:11 +0000 (12:44 +0200)]
System.Net.NetworkInformation UnsupportedOSPlatform attributes (#57281)

* Added UnsupportedOSPlatform attributes to PNSE thowing methods

* Replaced unix with the list of OSes

2 years agoFix System.Text.Json IAsyncEnumerator disposal on cancellation (#57505)
Eirik Tsarpalis [Tue, 17 Aug 2021 10:16:27 +0000 (11:16 +0100)]
Fix System.Text.Json IAsyncEnumerator disposal on cancellation (#57505)

* Ensure WriteStack.Pending task is awaited on exception. Ensure IAsyncDisposable instances are disposed exactly once.

Fixes #57360.

* Update src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs

2 years agoMove Select_AcceptNonBlocking_Success to non-parallel collection (#57503)
Anton Firszov [Tue, 17 Aug 2021 09:13:40 +0000 (11:13 +0200)]
Move Select_AcceptNonBlocking_Success to non-parallel collection (#57503)

2 years agoRe-enable NameResolution tests on SLES, Debian 9 and Ubuntu 16.04 (#57509)
Karel Zikmund [Tue, 17 Aug 2021 08:40:14 +0000 (10:40 +0200)]
Re-enable NameResolution tests on SLES, Debian 9 and Ubuntu 16.04 (#57509)

The underlying infrastructure issue was addressed in https://github.com/dotnet/core-eng/issues/13889

Fixes #55271
Fixes #56295

2 years agodon't fail LongModuleFileNamesAreSupported test if we can't load assembly on x86...
Adam Sitnik [Tue, 17 Aug 2021 07:49:41 +0000 (09:49 +0200)]
don't fail LongModuleFileNamesAreSupported test if we can't load assembly on x86  (#57471)

2 years ago[wasm] Redesign of JS objects marshaling and lifecycle (#57098)
Pavel Savara [Tue, 17 Aug 2021 04:48:45 +0000 (06:48 +0200)]
[wasm] Redesign of JS objects marshaling and lifecycle (#57098)

* thenable and datetime cleanup

* removed ownsHandle for readability, removed AnyRef from hierarchy, removed old refcount debug code

* rename _csOwnedObjects

* rename _csOwnedObjects

* redirect to Inflight counter

* renames

* rename and move

* rename

* New+BindCoreObject -> CreateCsOwnedObject single call

* remove refcount frames

* differentiate gcHandles

* get rid of weak GCHandle

* feedback

* added MappedType enum

* naming consistency

* feedback

* rename _cs_owned_objects_by_js_handle

* split and rename files

* shouldAddInflight to more methods

* improved in-flight references

* assert for JSObject not disposed

* introduce in-flight assert

* move should_add_in_flight arg to fisrt position, so that we could bind it in convert

* doc

* cleanup

* doc

* implement fallback for missing support of FInalizationRegistry/WeakRef in onlder browsers

* feedback

* no polyfill feedback

* feedback

* name consistency feedback

* use symbols for helper fields

* feedback

2 years agoInitialize gtUseNum before use (#57256)
Kunal Pathak [Tue, 17 Aug 2021 04:35:39 +0000 (21:35 -0700)]
Initialize gtUseNum before use (#57256)

* Initialize gtUseNum

* Add test case

* catch the exceptions in test case

* kind of disable test

* try to exclude the test one more time

2 years agoAdd more Metrics API overloads taking tags (#56940)
Tarek Mahmoud Sayed [Tue, 17 Aug 2021 04:08:12 +0000 (21:08 -0700)]
Add more Metrics API overloads taking tags (#56940)

* Add more Metrics API overloads taking tags

2 years agoFix handling of new connection in MsQuicListener (#57319)
Tomas Weinfurt [Tue, 17 Aug 2021 01:35:26 +0000 (18:35 -0700)]
Fix handling of new connection in MsQuicListener (#57319)

* update

* feedback from review

2 years agoSet CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS (#57507)
Alexander Köplinger [Tue, 17 Aug 2021 01:28:31 +0000 (03:28 +0200)]
Set CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS (#57507)

* Set CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS

Not just if we're targetting iOS/tvOS/macOS since the AOT compiler for WASM or Android can run on macOS too.

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

* Use RealTargetOS if it's available

2 years agoAdd linux mariner to rolling builds for libraries tests (#57322)
Santiago Fernandez Madero [Tue, 17 Aug 2021 01:01:52 +0000 (18:01 -0700)]
Add linux mariner to rolling builds for libraries tests (#57322)

* Add linux mariner to rolling builds for libraries tests

* Adjust ChasChaPoly crypto test for mariner

* Disable tests failing on mono

2 years ago[mono][llvm] Access mono_thread_interruption_request_flag directly from llvm generate...
Zoltan Varga [Tue, 17 Aug 2021 00:18:51 +0000 (20:18 -0400)]
[mono][llvm] Access mono_thread_interruption_request_flag directly from llvm generated code, similarly to mono_polling_required. (#57263)

2 years agoCheck for OpenSSL availability for OpenSsl asymmetric primitives
Kevin Jones [Mon, 16 Aug 2021 23:52:08 +0000 (19:52 -0400)]
Check for OpenSSL availability for OpenSsl asymmetric primitives

If you attempt to use any of the *OpenSsl primitives on macOS, this will currently abort the whole process.
This changes them to check for OpenSSL's presence and throw an appropriate exception instead of aborting.

When used as an internal implementation, the aborting behavior remains.

2 years agoRevert "[mono] Fix a few corner case overflow operations (#57407)" (#57501)
Sam Patel [Mon, 16 Aug 2021 23:18:10 +0000 (19:18 -0400)]
Revert "[mono] Fix a few corner case overflow operations (#57407)" (#57501)

This reverts commit e81efc832ae56978ae26ff0dbf17cb5622cee735.