platform/upstream/dotnet/runtime.git
3 years agoAdd --inputbubbleref option to crossgen2 in order to put only part of references...
Gleb Balykov [Fri, 14 May 2021 23:36:23 +0000 (02:36 +0300)]
Add --inputbubbleref option to crossgen2 in order to put only part of references into version bubble (#51555)

3 years agoForce build failure if AOT compiler is missing, and avoid bad path (#52784)
Jo Shields [Fri, 14 May 2021 22:47:16 +0000 (18:47 -0400)]
Force build failure if AOT compiler is missing, and avoid bad path (#52784)

An error in paths was introduced last week. Work around that, and make it a fatal build failure if the AOT compiler is missing in future to catch this faster

3 years agoECMA spec addendum dealing with static interface methods (#49558)
Tomáš Rylek [Fri, 14 May 2021 22:14:06 +0000 (00:14 +0200)]
ECMA spec addendum dealing with static interface methods (#49558)

Co-authored-by: David Wrighton <davidwr@microsoft.com>
Co-authored-by: Aleksey Tsingauz <alekseyt@microsoft.com>
Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
3 years agoFix cmake warning (#52788)
Bruce Forstall [Fri, 14 May 2021 22:13:56 +0000 (15:13 -0700)]
Fix cmake warning (#52788)

Fix this:
```
 CMake Warning (dev) in crosscomponents.cmake:
    A logical block opening on the line

      C:/gh/runtime4/src/coreclr/crosscomponents.cmake:24 (if)

    closes on the line

      C:/gh/runtime4/src/coreclr/crosscomponents.cmake:36 (endif)

    with mis-matching arguments.
  Call Stack (most recent call first):
    CMakeLists.txt:254 (include)
  This warning is for project developers.  Use -Wno-dev to suppress it.
```

3 years agoAdd VirtualStaticsInInterfaces flag to RuntimeFeature (#52733)
David Wrighton [Fri, 14 May 2021 22:09:13 +0000 (15:09 -0700)]
Add VirtualStaticsInInterfaces flag to RuntimeFeature (#52733)

* Add RuntimeFeature indicating support for static virtual methods in the runtime
* Mark it with the preview flag

3 years agoRuntime support for static virtual interface methods (#52173)
Tomáš Rylek [Fri, 14 May 2021 22:05:16 +0000 (00:05 +0200)]
Runtime support for static virtual interface methods (#52173)

This change implements initial CoreCLR runtime support for static virtual interface methods and adds over 1700 test cases covering various aspects of this new runtime feature.

1) In the JIT, we are relaxing the assumption that ".constrained" must be always followed by a "callvirt" by allowing two more IL instructions to be constrained, "call" and "ldftn".

2) In the JIT interface, we're adding bits of code to CEEInfo::getCallInfo to properly handle the new static virtual methods. We're extending constrained method resolution to cater for the static virtual method case in a new method "ResolveStaticVirtualMethod".

3) In our work on the implementation we found a pre-existing JIT interface issue - the interplay between getCallInfo and embedGenericHandle doesn't work well in case of constrained calls as the existing API surface doesn't provide any means for communicating compile-time resolution of the constraint from getCallInfo to embedGenericHandle. In this change we're working around this by deferring to runtime resolution of the constraint in the presence of shared generics.

4) In the method table builder, we're newly tracking a flag saying whether we're implementing an interface declaring static virtual methods (fHasVirtualStaticMethods) that is used to speed up the runtime checks by skipping irrelevant interfaces.

5) For Crossgen / Crossgen2, this change only adds minimalistic support in the form of bailing out in getCallInfo whenever we hit a call to a static virtual method, cancelling AOT compilation of the caller and deferring it to runtime JIT.

3 years agoImprove flow graph DOT dumps (#52787)
Bruce Forstall [Fri, 14 May 2021 22:04:40 +0000 (15:04 -0700)]
Improve flow graph DOT dumps (#52787)

1. Introduce `COMPlus_JitFgDumpPrePhase`. This is analogous to the existing
`COMPlus_JitFgDumpPhase`, but to dump before a phase, not after. It takes a
set of short phase names, and dumps the flow graph before each of those phases.
E.g., to dump both before and after just loop cloning, you don't need to figure
out which phase comes before loop cloning, you can specify:

```
set COMPlus_JitDumpFgPhase=LP-CLONE
set COMPlus_JitDumpFgPrePhase=LP-CLONE
```

2. Interpret array length node type in BBJ_COND blocks, e.g., `V01.Length <= V03`.

3 years agoRemove unused Compiler::optFindLoopNumberFromBeginBlock() (#52786)
Bruce Forstall [Fri, 14 May 2021 22:03:21 +0000 (15:03 -0700)]
Remove unused Compiler::optFindLoopNumberFromBeginBlock() (#52786)

3 years agohide Obsolete FileStream ctors (#52587)
Adam Sitnik [Fri, 14 May 2021 21:52:10 +0000 (23:52 +0200)]
hide Obsolete FileStream ctors (#52587)

3 years ago[mono][aot] Fix an assertion. (#52762)
Zoltan Varga [Fri, 14 May 2021 20:19:57 +0000 (16:19 -0400)]
[mono][aot] Fix an assertion. (#52762)

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

3 years agoremove APM infrastructure code that's no longer needed (#52711)
Geoff Kizer [Fri, 14 May 2021 18:17:59 +0000 (11:17 -0700)]
remove APM infrastructure code that's no longer needed (#52711)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoMake superpmi.py work for python3.8 (#52778)
Kunal Pathak [Fri, 14 May 2021 18:08:09 +0000 (23:38 +0530)]
Make superpmi.py work for python3.8 (#52778)

3 years ago[interp] Squash multiple call args moves into single opcode (#52242)
Vlad Brezae [Fri, 14 May 2021 17:46:38 +0000 (20:46 +0300)]
[interp] Squash multiple call args moves into single opcode (#52242)

* [interp] Replace multiplication and division by 1 with simple mov

* [interp] Skip emitting redundant branch to next basic block

* [interp] Squash multiple call args moves into single opcode

Some vars cannot be used directly as an argument to another call. In this case, the var offset allocator generates new intermediary vars. For methods with a lot of parameters, we can end up with quite a lot of these stores.

As an example, for the following method:
```
public static void MethodPartial (int a, int b, object c, object d)
{
MethodFull (a, b, c, d, 12523);
}
```

Before:
```
IR_0000: ldc.i8         [72 <- nil], 12523
IR_0006: mov.4          [40 <- 0],
IR_0009: mov.4          [48 <- 8],
IR_000c: mov.8          [56 <- 16],
IR_000f: mov.8          [64 <- 24],
IR_0012: call           [32 <- 40], 0
IR_0016: ret.void       [nil <- nil],
```

After:
```
IR_0000: ldc.i8         [72 <- nil], 12523
IR_0006: mov.8.4        [nil <- nil], 40 <- 0, 48 <- 8, 56 <- 16, 64 <- 24
IR_000f: call           [32 <- 40], 0
IR_0013: ret.void       [nil <- nil]
```

3 years agoAdd Analyzer packaging support and packaging documentation (#52554)
Eric StJohn [Fri, 14 May 2021 17:06:41 +0000 (10:06 -0700)]
Add Analyzer packaging support and packaging documentation (#52554)

* Add Analyzer packaging support and packaging documentation

To package Microsoft.Extensions.Logging.Abstractions we needed support
for packing an Analyzer.  This adds that support.

I wanted to document this addition, so I created the start of a doc that's
meant to describe the packaging options for libraries in dotnet/runtime.

* Address code review feedback.

* More feedback

* Address more feedback

* Remove src.proj build of generators

* Update to use Microsoft.DotNet.PackageTesting

* Fix typos

* Fix package testing on net46*

3 years agoResolve ILLink warnings in Microsoft.Extensions.Logging.EventSource (#52656)
Jose Perez Rodriguez [Fri, 14 May 2021 16:10:50 +0000 (09:10 -0700)]
Resolve ILLink warnings in Microsoft.Extensions.Logging.EventSource (#52656)

* Resolve ILLink warnings in Microsoft.Extensions.Logging.EventSource

* Add nullable enable to attribute files

3 years ago[Android] Rename System.Security.Cryptography.Native.OpenSsl on Android (#52406)
Tammy Qiu [Fri, 14 May 2021 16:04:48 +0000 (12:04 -0400)]
[Android] Rename System.Security.Cryptography.Native.OpenSsl on Android (#52406)

* Rename System.Security.Cryptography.Native.OpenSsl to System.Security.Cryptography.Native.Android on Android and split remaining shared Interop files.

3 years agoAnnotate Type.GetInterfaceMap to guarantee trim compatibility. (#52697)
Vitek Karas [Fri, 14 May 2021 08:59:41 +0000 (10:59 +0200)]
Annotate Type.GetInterfaceMap to guarantee trim compatibility. (#52697)

3 years ago[mono] Fix https://github.com/dotnet/runtime/issues/52718. (#52724)
Zoltan Varga [Fri, 14 May 2021 08:28:59 +0000 (04:28 -0400)]
[mono] Fix https://github.com/dotnet/runtime/issues/52718. (#52724)

3 years agoPrepare the COM apartment and context at a safe time during thread start up. (#52745)
Aaron Robinson [Fri, 14 May 2021 07:47:11 +0000 (00:47 -0700)]
Prepare the COM apartment and context at a safe time during thread start up. (#52745)

3 years agoRespect Windows job object's CPU quota (#52690)
Anton Lapounov [Fri, 14 May 2021 03:23:33 +0000 (20:23 -0700)]
Respect Windows job object's CPU quota (#52690)

3 years agoFix single-file unhandled exception source/line info (#52725)
Mike McLaughlin [Fri, 14 May 2021 02:38:12 +0000 (19:38 -0700)]
Fix single-file unhandled exception source/line info (#52725)

Issues:
    https://github.com/dotnet/runtime/issues/51461
    https://github.com/dotnet/runtime/issues/11261
    https://github.com/dotnet/runtime/issues/18423

3 years agoAdd clrjit.natvis file (#52668)
Kunal Pathak [Fri, 14 May 2021 00:41:47 +0000 (06:11 +0530)]
Add clrjit.natvis file (#52668)

* Add clrjit.natvis file

* Review comments

* pass /NATVIS flag to linker

* Include clrjit.natvis only for windows

* Update src/coreclr/jit/CMakeLists.txt

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
* Add the missing review comment

* minor typo

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
3 years agoMove copy of Crossgen2 tasks/targets to runtime repo and build composite image for...
David Wrighton [Fri, 14 May 2021 00:39:04 +0000 (17:39 -0700)]
Move copy of Crossgen2 tasks/targets to runtime repo and build composite image for runtime repo in parallel path (#52579)

* Move all crossgen2 tasks/targets used in Runtime repo to be local to the repo

* Move ResolveReadyToRunCompilers task into the Crossgen2Tasks dll

* Create composite bundle and package
- Note that it doesn't build properly, but hopefully that's a crossgen2 task bug

* Composite image production

* Refactor how composite image creation works
- Move it to allow mixed composite and non-composite r2r in the same build, controlled by the PublishReadyToRunCompositeExclusions list
- Enhance the accuracy of how msbuild tracks which files are input vs reference for composite images
- Implement the R2R exclusion list for composite images
- Remove the always on usage of --inputbubble when compiling a composite image

* - Add a scheme to perform public signing with a PublicKeyToken to a composite of the composite image if required
  - Required adding a new parameter to crossgen2

3 years agoMulticorejit unification (#48326)
Gleb Balykov [Fri, 14 May 2021 00:16:08 +0000 (03:16 +0300)]
Multicorejit unification (#48326)

* Unify simple and generic methods in multicorejit

* Disable NDirect methods in MulticoreJit

Current multicorejit implementation in master has multiple flaws with NDirect methods:
- exception might be thrown inside GetStubForInteropMethod at some point for NDirect method, which will kill background thread, thus, reducing effectiveness of multicorejit (for example, occurs when multicorejit is used with crossgen2)
- some NDirect methods can lead to asserts during load inside GetStubForInteropMethod (for example, EvpMdCtxDestroy (0x6000044 token) from System.Security.Cryptography.Algorithms.dll)

* Add MultiCoreJitMinNumCpus env variable with default value =2 to configure minimum allowed number of cpus for MultiCoreJit.

On arm with cpu hotplug it should be set to 1.

* Do not save overall record length for methods

This change reduces mcj profile size

* Store non-generic methods using token instead of signatures

This change reduces mcj profile size

3 years agoAdd diagnostics IPC set environment variable command (#52567)
David Mason [Thu, 13 May 2021 23:59:30 +0000 (16:59 -0700)]
Add diagnostics IPC set environment variable command (#52567)

3 years agoAdd IServiceScopeFactory.CreateAsyncScope (#52719)
İlkay İlknur [Thu, 13 May 2021 23:57:00 +0000 (02:57 +0300)]
Add IServiceScopeFactory.CreateAsyncScope (#52719)

* CreateAsyncScope extension method added for IServiceScopeFactory

* add CreateAsyncScope extension method for IServiceScopeFactory

* test added for IServiceScopeFactory.CreateAsyncScope

3 years agoRefresh network tests server code to Kestrel (#52642)
Pavel Savara [Thu, 13 May 2021 22:45:53 +0000 (00:45 +0200)]
Refresh network tests server code to Kestrel (#52642)

* copy from https://github.com/davidsh/corefx-net-endpoint/commit/999f8356816be739ec65dae5a1a89782b3936a66
* license headers
* missing md5 test
* issue for missing functionality

3 years agoFix mcs merge error for missing pattern (#52715)
Bruce Forstall [Thu, 13 May 2021 22:11:30 +0000 (15:11 -0700)]
Fix mcs merge error for missing pattern (#52715)

1. Print the Unicode pattern properly
2. Return an error code

3 years agoResolve ILLink Warnings on Microsoft.Extensions.Http (#52658)
Jose Perez Rodriguez [Thu, 13 May 2021 21:51:35 +0000 (14:51 -0700)]
Resolve ILLink Warnings on Microsoft.Extensions.Http (#52658)

* Resolve ILLink Warnings on Microsoft.Extensions.Http

3 years agoImprove logging source generator error messages (#52684)
Maryam Ariyan [Thu, 13 May 2021 21:46:09 +0000 (17:46 -0400)]
Improve logging source generator error messages (#52684)

3 years agoUse same logic on iOS and macOS for dual-mode sockets in Ping (#52619)
Filip Navara [Thu, 13 May 2021 20:47:42 +0000 (22:47 +0200)]
Use same logic on iOS and macOS for dual-mode sockets in Ping (#52619)

* Use same logic on iOS and macOS for dual-mode sockets in Ping

* Address feedback

3 years ago[main] Update dependencies from 7 repositories (#52440)
dotnet-maestro[bot] [Thu, 13 May 2021 20:43:31 +0000 (13:43 -0700)]
[main] Update dependencies from 7 repositories (#52440)

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

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

* Update dependencies from https://github.com/dotnet/xharness build 20210507.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21255.1 -> To Version 1.0.0-prerelease.21257.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 9.0.1-alpha.1.21253.1 -> To Version 9.0.1-alpha.1.21256.1

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

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

* Update dependencies from https://github.com/dotnet/xharness build 20210507.2

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21255.1 -> To Version 1.0.0-prerelease.21257.2

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

System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21230.1 -> To Version 6.0.0-beta.21257.1

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

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-preview.5.21253.1 -> To Version 6.0.0-preview.5.21260.1

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

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

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-preview.5.21253.1 -> To Version 6.0.0-preview.5.21260.1

* Update dependencies from https://github.com/dotnet/xharness build 20210510.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21255.1 -> To Version 1.0.0-prerelease.21260.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 9.0.1-alpha.1.21253.1 -> To Version 9.0.1-alpha.1.21260.1

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

System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21230.1 -> To Version 6.0.0-beta.21260.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21257.1 -> To Version 1.0.1-alpha.0.21260.2

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

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

* Update dependencies from https://github.com/dotnet/xharness build 20210511.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21260.1 -> To Version 1.0.0-prerelease.21261.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21260.2 -> To Version 1.0.1-alpha.0.21261.2

* Update dependencies from https://github.com/dotnet/xharness build 20210510.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21255.1 -> To Version 1.0.0-prerelease.21260.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21257.1 -> To Version 1.0.1-alpha.0.21260.2

* Update dependencies from https://github.com/dotnet/xharness build 20210511.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21260.1 -> To Version 1.0.0-prerelease.21261.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21260.2 -> To Version 1.0.1-alpha.0.21261.2

* Fix attribute diffs

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

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

* Update dependencies from https://github.com/dotnet/xharness build 20210513.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21255.1 -> To Version 1.0.0-prerelease.21263.1

* Fix package testing on net46*

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
3 years agoBring Android arm64 tests back into PR builds (#52709)
Steve Pfister [Thu, 13 May 2021 20:30:21 +0000 (16:30 -0400)]
Bring Android arm64 tests back into PR builds (#52709)

3 years agoDetect presence of OpenSSL for AEAD algorithms on macOS
Kevin Jones [Thu, 13 May 2021 20:09:12 +0000 (16:09 -0400)]
Detect presence of OpenSSL for AEAD algorithms on macOS

This makes the IsSupported values for AesCcm and AesGcm return false on macOS when the
OpenSSL shim library can't find a suitable OpenSSL, and makes AesCcm/AesGcm throw an
informative exception in those cases.

Additionally it fixes the IsSupported on ChaCha/Poly to not tear down the process when
OpenSSL isn't found on macOS.

Co-authored-by: Filip Navara <filip.navara@gmail.com>
3 years agoMake the callsite cache more thread safe (#52691)
David Fowler [Thu, 13 May 2021 20:06:08 +0000 (13:06 -0700)]
Make the callsite cache more thread safe (#52691)

* Make the callsite cache more thread safe
- Previously we would create duplicate callsites and because they weren't used to for anything critical, now we're using them as a lock per type and slot and to store singleton values cheaply. This means we need to make sure they are unique. Duplicates were being created in situations where there were connected graphs and lots of concurrency because there was no lock to ensure that only a single type would be processed at a time. This change adds that lock and adds tests.

3 years agoFix trimming issue with extension data (#52673)
Steve Harter [Thu, 13 May 2021 20:02:48 +0000 (15:02 -0500)]
Fix trimming issue with extension data (#52673)

3 years agoAdd MacCatalyst functional test (#52552)
Jo Shields [Thu, 13 May 2021 19:39:25 +0000 (15:39 -0400)]
Add MacCatalyst functional test (#52552)

3 years ago[tests] Fix CRLF issues in SM.Syndication (#52705)
Radek Doulik [Thu, 13 May 2021 19:24:51 +0000 (21:24 +0200)]
[tests] Fix CRLF issues in SM.Syndication (#52705)

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

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

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

Also set `BrowserHost` property for the build as well. It is also used
in `src/libraries/tests.proj`.

3 years agoLow level API support for Objective-C interop. (#52146)
Aaron Robinson [Thu, 13 May 2021 19:04:46 +0000 (12:04 -0700)]
Low level API support for Objective-C interop. (#52146)

* Add Objective-C interop support.

* Include handling of HNDTYPE_REFCOUNTED when FEATURE_OBJCMARSHAL is defined (#47534)

* Allow overriding of Objective-C message send P/Invokes (#47721)

* Add new flag to MethodTable for types with ObjectiveCTrackedTypeAttribute.
Discover attribute during type load and set bit.
Update EagerFinalizer callout to query bit.

* Add testing for API

* Bridge API for propagating managed exception to native.

* Update GCEE interface to support GCServer scenario for Objective-C.
The new callbacks now fire when before the GC scans handles and is
non-concurrent.

* Comment added for ExceptionTracker non-NULL condition.

Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
3 years agoadd support for genReg1/genReg2->SIMD8 store on x86 windows. (#52581)
Sergey Andreenko [Thu, 13 May 2021 17:02:11 +0000 (10:02 -0700)]
add support for genReg1/genReg2->SIMD8 store on x86 windows. (#52581)

* add a standart header for inst_RV_RV

* add support for EAX/EDX->SIMD8 store on x86 windows.

* fix the header.

3 years agoBinaryFormatter deprecation for System.Configuration.ConfigurationManager (#50531)
Prashanth Govindarajan [Thu, 13 May 2021 17:01:41 +0000 (10:01 -0700)]
BinaryFormatter deprecation for System.Configuration.ConfigurationManager (#50531)

* First cut of deprecating BF usage

* Address comments

* sq

3 years agoMove s_defaultSerializerOptions to JsonHelpers. (#52557)
Eric Erhardt [Thu, 13 May 2021 16:34:06 +0000 (11:34 -0500)]
Move s_defaultSerializerOptions to JsonHelpers. (#52557)

This allows for JsonContent to be trimmed in a default Blazor WASM app.

3 years agoRemove Alt-Svc parser on browser-wasm. (#52681)
Eric Erhardt [Thu, 13 May 2021 15:24:40 +0000 (10:24 -0500)]
Remove Alt-Svc parser on browser-wasm. (#52681)

Contributes to #44534

3 years ago[tests] Fix CRLF vs LF issues (#52536)
Radek Doulik [Thu, 13 May 2021 15:11:48 +0000 (17:11 +0200)]
[tests] Fix CRLF vs LF issues (#52536)

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

When running `System.Numerics.Tensors` tests on windows and  targeting
`Browser`,the line ending differs between host and target systems.
Compensate for that by using
`Assert.Equal(..., ignoreLineEndingDifferences: true)`.

Also replace the compile time new line when creating `expectedNoSpace`
string.

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

* Use LineEndingsHelper, make CompiledNewline public

* Enable fixed tests

3 years agoAdd section to interop guidelines about tracking dependencies (#52302)
Matt Thalman [Thu, 13 May 2021 13:56:34 +0000 (08:56 -0500)]
Add section to interop guidelines about tracking dependencies (#52302)

* Add section to interop guidelines about tracking dependencies

* Set code owner

* Update wording

3 years agoFix typo (#52694)
Kia Panahi Rad [Thu, 13 May 2021 13:26:32 +0000 (17:56 +0430)]
Fix typo (#52694)

Under "What should be in a BotR chapter" heading.

3 years agoTest ios tvos simulator functional tests (#52655)
Mitchell Hwang [Thu, 13 May 2021 13:16:09 +0000 (09:16 -0400)]
Test ios tvos simulator functional tests (#52655)

* [iOS][tvOS][AOT] Run simulator AOT tests with TreatAsLocalProperty

* [tvOS] Include tvOS in MonoAOTCompiler arguments

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoUpdate dependencies from https://github.com/dotnet/emsdk build 20210512.1 (#52657)
dotnet-maestro[bot] [Thu, 13 May 2021 10:20:16 +0000 (10:20 +0000)]
Update dependencies from https://github.com/dotnet/emsdk build 20210512.1 (#52657)

[main] Update dependencies from dotnet/emsdk

3 years agoStresslog fixes (#52601)
Peter Sollich [Thu, 13 May 2021 08:43:11 +0000 (10:43 +0200)]
Stresslog fixes (#52601)

- Make regular (non-memory-mapped file based) stresslog work for clrgc.dll
- Fix interaction issue between GC and thread filters in StressLogAnalyzer
- Interpret small numbers for COMPlus_StressLogSize and COMPlus_TotalStressLogSize as GB rather than bytes
- Increment SOS_BREAKING_CHANGE_VERSION

3 years agoFix empty byte[] bug in EventSource (#52602)
Miha Zupan [Thu, 13 May 2021 07:01:21 +0000 (09:01 +0200)]
Fix empty byte[] bug in EventSource (#52602)

* Fix empty byte[] bug in EventSource

* Add some non-zero data to byte[] tests

* Remove leftover usings from testing

* Return Array.Empty for empty byte[]

* Pass correct pointer to Marshal copy

3 years agoReduce UriBuilder allocations (#51826)
Miha Zupan [Thu, 13 May 2021 06:59:20 +0000 (08:59 +0200)]
Reduce UriBuilder allocations (#51826)

* Reduce UriBuilder allocations

* Make _uri field nullable

* Add Debug.Assert(success)

3 years ago[mono] Fix generating invalid cpu description tables if two opcodes have the same...
Zoltan Varga [Thu, 13 May 2021 06:48:51 +0000 (02:48 -0400)]
[mono] Fix generating invalid cpu description tables if two opcodes have the same name. (#52670)

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

3 years agoBe explicit about platform support (#52686)
Larry Ewing [Thu, 13 May 2021 01:28:14 +0000 (20:28 -0500)]
Be explicit about platform support (#52686)

we're standing up the msi builds and finalizing details that are important for that tooling

3 years agoNew deps package for Fedora 34 (#52674)
Nikola Milosavljevic [Thu, 13 May 2021 01:11:06 +0000 (18:11 -0700)]
New deps package for Fedora 34 (#52674)

3 years agoremove tvos-x64 pack (#52663)
Larry Ewing [Thu, 13 May 2021 01:08:14 +0000 (20:08 -0500)]
remove tvos-x64 pack (#52663)

3 years agoReplacing `BOOL` with `bool` (#52585)
WhiteBlackGoose [Wed, 12 May 2021 23:32:36 +0000 (02:32 +0300)]
Replacing `BOOL` with `bool` (#52585)

* Replaces all BOOL to bool in RyuJIT

Replaced all Windows' BOOL to bool in RyuJIT except
for WIN API related cases.

Fix #48317

* Replaced `TRUE` and `FALSE` constants

Replaced `TRUE` with `true` and `FALSE`
with `false` constants in RyuJIT except
Windows-specific cases.

* A couple of BOOLs replaced to bool

* Format issue fixed

Formatting patch applied
according to the instruction.

3 years ago[debugger][interpreter] Generate seq_points even when doesn't have debug information...
Thays Grazia [Wed, 12 May 2021 22:58:33 +0000 (19:58 -0300)]
[debugger][interpreter] Generate seq_points even when doesn't have debug information (#52632)

* Trying to generate seq_points even without debug info as it's done in methor-to-ir.

3 years agoDon't reset stack level when it is already set to the required value. (#52594)
Sergey Andreenko [Wed, 12 May 2021 22:06:37 +0000 (15:06 -0700)]
Don't reset stack level when it is already set to the required value. (#52594)

3 years ago[tests] Fix CRLF issues in System.CodeDom tests (#52540)
Radek Doulik [Wed, 12 May 2021 21:58:03 +0000 (23:58 +0200)]
[tests] Fix CRLF issues in System.CodeDom tests (#52540)

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

When running `System.CodeDom` tests on windows and  targeting
`Browser`, the line ending differs between host and target systems.
Add helper `LineEndingsHelper.Normalize` method to update expected
strings.

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

3 years agoAdd obsoletions for System.Runtime (#52014)
John Tur [Wed, 12 May 2021 21:41:17 +0000 (17:41 -0400)]
Add obsoletions for System.Runtime (#52014)

* Add obsoletions for System.Runtime

* Fix tests

* Fix

* Update AppDomain obsoletion to SYSLIB0024 and augment message

* Add missing period to the SYSLIB0024 obsoletion message

* Update obsoletion message per feedback

Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
3 years agoAnnotate required APIs with DynamicallyAccessedMemberTypes.Interfaces (#52461)
Vitek Karas [Wed, 12 May 2021 21:20:27 +0000 (23:20 +0200)]
Annotate required APIs with DynamicallyAccessedMemberTypes.Interfaces (#52461)

After the basic annotation of `Type.GetInterface` and `Type.GetInterfaces` this propagates this annotation to all places which require it. It also resolves warnings in all the places where this shows up.

For the most part this is just blindly propagating the annotations.

Most of the suppressions rely on the fact that is `IFoo` is referenced (and thus the `Type` instance of it exists at runtime), trimmer guarantees that it will keep it on all types which implement that interface. And also on additional fact that if `IFoo<>` is preserved, then all instantiations of it are also preserved. This is true for linker, but not necessarily true for AOT - that is we can do better if we don't have to make that assumption. For now I rely on that assumption.

3 years agoModify JIT to support double mapped memory (#52600)
Jan Vorlicek [Wed, 12 May 2021 21:04:12 +0000 (14:04 -0700)]
Modify JIT to support double mapped memory (#52600)

* Modify JIT to support double mapped memory

This change modifies JIT so that it can generate code into
double mapped memory. The code is written into RW mapped memory,
but the relative offsets are computed using the related RX locations.

The change doesn't modify the runtime to provide double mapped memory
yet, the JIT2EE interface allocMem returns the same addresses as RW and
RX. The runtime changes will be part of follow-up PRs. However, it was
already tested with the double mapping enabled locally.

It also changes signature of allocMem to pass everything in a single structure

3 years agofix pinning in quic (#52368)
Tomas Weinfurt [Wed, 12 May 2021 20:06:27 +0000 (13:06 -0700)]
fix pinning in quic (#52368)

* fix pinning in quic

* remove SafeMsQuicBufferHandle

* Update src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs

Co-authored-by: Cory Nelson <phrosty@gmail.com>
* Apply suggestions from code review

* more feedback from review

Co-authored-by: Cory Nelson <phrosty@gmail.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoUse the existing workload-id for now (#52660)
Larry Ewing [Wed, 12 May 2021 19:03:26 +0000 (14:03 -0500)]
Use the existing workload-id for now (#52660)

3 years ago[iOS][tvOS][tests] Re add ios tvos simulator functional tests (#52606)
Mitchell Hwang [Wed, 12 May 2021 19:00:00 +0000 (15:00 -0400)]
[iOS][tvOS][tests] Re add ios tvos simulator functional tests (#52606)

* Revert "[iOS][tvOS] Remove AOT functional test projects (#52574)"

This reverts commit 16083f91a8c7b1cf246d8f8138950e1dcd7721d1.

* Cleanup iOS tvOS functional tests and test proj file

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years ago[Android][libraries] Active issue remaining android failing tests (#52654)
Mitchell Hwang [Wed, 12 May 2021 18:49:27 +0000 (14:49 -0400)]
[Android][libraries] Active issue remaining android failing tests (#52654)

* [Android][libraries] Add System.Net.Http.Json.Functional.Tests ActiveIssue

* [Android][libraries] Add System.Runtime.Caching.Tests ActiveIssue

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoPut failing WebSockets tests under ActiveIssue for Android (#52647)
Natalia Kondratyeva [Wed, 12 May 2021 18:24:41 +0000 (20:24 +0200)]
Put failing WebSockets tests under ActiveIssue for Android (#52647)

As per https://github.com/dotnet/runtime/pull/52052#issuecomment-838655841, putting the failing tests under ActiveIssue.

Tracking issue: https://github.com/dotnet/runtime/issues/52645

3 years agoReact to API Compat bug fix around attribute diffing in members (#52629)
Santiago Fernandez Madero [Wed, 12 May 2021 18:15:58 +0000 (11:15 -0700)]
React to API Compat bug fix around attribute diffing in members (#52629)

3 years agoIntroduce enum for BasicBlock and loop flags (#52410)
Bruce Forstall [Wed, 12 May 2021 16:36:19 +0000 (09:36 -0700)]
Introduce enum for BasicBlock and loop flags (#52410)

* Introduce enum for BasicBlock and loop flags

This gives a better debugging experience in Visual Studio. It
also improves type checking: there were a few places still using
`unsigned` instead of `unsigned __int64` when manipulating
BasicBlock flags.

* Make sure debugreturn and contracts are disabled for the JIT build

* Convert GenTree flags, debug flags, and call flags to enums

* Remove bad GT_HWINTRINSIC copy/paste code from GenTree::GetRegSpillFlagByIdx

3 years ago[iOS][libraries] Skip failing iOS tests with ActiveIssues and proj level skips (...
Mitchell Hwang [Wed, 12 May 2021 15:40:55 +0000 (11:40 -0400)]
[iOS][libraries] Skip failing iOS tests with ActiveIssues and proj level skips (#51491)

In effort to assess the state of the iOS library tests, a number of tests will be skipped

Test suites that crash, hang, or have a significant number of failures (mostly 20+ failing unique test methods) are skipped on at the `tests.proj` level. Otherwise, `[ActiveIssue]` attributes have been attached to either the individual test methods that fail or the entire class if the whole test class fails. Any pre-existing `ActiveIssue` attribute associated with iOS had been reassessed to either remain or be closed.

A few test suites have been skipped because they fail with some form of `PlatformNotSupportedException`. `[SkipOnPlatform]` attributes are attached to the failing test methods.

All of the Issues can be tracked at https://github.com/dotnet/runtime/projects/48#column-9236436

The ActiveIssues and `tests.proj` exclusions have been tested on https://github.com/dotnet/runtime/pull/49917 as well.

-----------
This PR makes the following changes in the following files:
`src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj` - Removed `$(NetCoreAppCurrent)-iOS` from target frameworks as it is stated to currently only supported on Windows.

`src/libraries/tests.proj` - Update the test suites that need to be skipped at the project level, reducing the number and categorizing as a skip due to PNSE, a skip due to numerous failures, and a skip due to the suite crashing.

The remaining files changed are either:
`[ActiveIssue("<issue-url>", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]`
`[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS or tvOS.")]`

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Tammy Qiu <tammy.qiu@yahoo.com>
3 years agoFixed a bug in websocket receive, when a compressed frame with no payload is received...
Ivan Zlatanov [Wed, 12 May 2021 15:36:34 +0000 (18:36 +0300)]
Fixed a bug in websocket receive, when a compressed frame with no payload is received. (#52621)

Fixed a bug where compressed frame of size 0, would have been prematurely marked as processed.
Compressed frames should always go through inflation in order to make sure
there is no leftover from previous receives.
Created a test that verifies the correct handling of empty compressed frame.

Fixes #52551

3 years ago[Android] Improve memory & pointer handling in Cryptography.Native.Android (#52638)
Marek Habersack [Wed, 12 May 2021 15:28:38 +0000 (17:28 +0200)]
[Android] Improve memory & pointer handling in Cryptography.Native.Android (#52638)

Context: https://github.com/dotnet/runtime/pull/52449
Context: https://github.com/dotnet/runtime/commit/5d213e6761c5393619e476b766b8778446155503

This commit makes sure that all memory allocation via the standard POSIX
APIs is checked and, should the allocation fail, the application is
aborted.  This strategy is chosen because whenever Unix allocation
fails, the memory resources are really exhausted and it is safer to
abort the application than risking thrashing memory and causing
unpredictable behavior of the application.

The same strategy is used with the string, byte and object array
allocation using Java JNI APIs.  Allocator functions for these objects
return `NULL` whenever allocation fails and, additionally, throw a Java
`OutOfMemory` exception.  The inline functions introduced to handle
allocation of the above objects check the return result, print
exceptions (if any) and abort the application.  The `NewObject` JNI
function doesn't get the same kind of treatment because there's no way
for us to detect whether the object creation failed because of an
out-of-memory error or because its constructor threw an exception - in
both cases JNI will return `NULL`.

Additionally, some internally used functions are decorated with the
`nonnul` attribute (if supported by the compiler) to indicate which
function pointer arguments mustn't be `NULL`.  This will not help
runtime invalid pointer detection, but it makes it harder to make
mistakes in code of passing a `NULL` value to a function that doesn't
expect it.

At the same time, the internal (static or hidden) functions not always
validate their pointer parameters.  They instead rely on the calling
code to do it for them.

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
--- Addendum ---

Commit 5d213e6761c5393619e476b766b8778446155503 was accidentally merged
without a commit message, so to not miss the information/context that
was included there, here's the commit message:

POSIX `assert(3)` is used frequently throughout the code to check
validity of certain parameters or assumptions but also to control the
flow of the program.  However, this approach works only in debug
builds (or, rather, when the `NDEBUG` macro is not defined during
compilation).  In release builds (or when the `NDEBUG` macro is
defined), `assert` calls turn into no-ops.  Therefore, they must not be
used to ensure that a certain code path is valid or a return value from
some function is correct etc.

Fix the above use of `assert` by replacing the calls with an inline
function that will check the assertion at all times and `abort()` the
application should the condition be `false`.  This is a desired
behavior, because assertions are used only in places which absolutely
must meet the condition and if not, it's a serious bug either in the
library or the application.

Additionally, add validation checks (using the same assertion mechanism)
for all the pointers passed from the managed/external code that are
dereferenced locally passed to Java functions which require the pointers
to not be `NULL`.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
3 years agoAnnotate FileStream.Lock/Unlock as unsupported on iOS/tvOS (#52433)
Maxim Lipnin [Wed, 12 May 2021 15:14:30 +0000 (18:14 +0300)]
Annotate FileStream.Lock/Unlock as unsupported on iOS/tvOS (#52433)

Part of #47910.

FileStream.Lock/Unlock methods throw PNSE with Locking/unlocking file regions is not supported on this platform. Use FileShare on the entire file instead.

3 years agoJIT: work around issues invoking the unboxed entry when prejitting (#52605)
Andy Ayers [Wed, 12 May 2021 15:13:20 +0000 (08:13 -0700)]
JIT: work around issues invoking the unboxed entry when prejitting (#52605)

If the jit devirtualizes a call to a value class method, it will try
and update the call to invoke the unboxed entry for the method. This
entry sometimes requires an explicit type context argument.

There are cases where the prejit host seemingly does not properly deduce
when the unboxed entry requires this extra argument. Until this is resolved,
defer this optimization when prejitting.

See #52483 for details.

3 years agoRemoving some linker warnings that are no longer needed (#52457)
Jose Perez Rodriguez [Wed, 12 May 2021 14:41:20 +0000 (07:41 -0700)]
Removing some linker warnings that are no longer needed (#52457)

* Removing all shared framework linker noWarns

* Addressing feedback and fixing Browser and windows legs

* Renaming ILLinkDescriptors file

3 years agoUse of WCHAR in `corinfo.h` leaves consumer with dependency on pal_mstypes/windows...
Anthony Shaw [Wed, 12 May 2021 13:38:31 +0000 (23:38 +1000)]
Use of WCHAR in `corinfo.h` leaves consumer with dependency on pal_mstypes/windows.h (#52630)

* WCHAR usage leaves dependency on <windows.h>/pal_mstypes

* Cast on return

3 years ago[wasm] Make windows wasm build run tests on helix (#51951)
Radek Doulik [Wed, 12 May 2021 12:26:45 +0000 (14:26 +0200)]
[wasm] Make windows wasm build run tests on helix (#51951)

Some of the tests were disabled for now: https://github.com/dotnet/runtime/issues/52138

* Make windows wasm build run tests on helix

* Update sendtohelixhelp.proj

* More changes for wasm/windows

* More changes to run on windows

* Fix xharness output paths

* Disable failing tests

* Use ProjectExclusions when adding wasm samples

* Restore platform matrix

* Disable the tests only on windows/helix

Also make the new property groups conditional to improve perf

3 years ago[Android] Improve assumption handling in Cryptography.Native.Android (#52449)
Marek Habersack [Wed, 12 May 2021 09:53:31 +0000 (11:53 +0200)]
[Android] Improve assumption handling in Cryptography.Native.Android (#52449)

3 years agoAdd streaming support for EventPipe env trace file. (#52443)
Johan Lorensson [Wed, 12 May 2021 09:21:01 +0000 (11:21 +0200)]
Add streaming support for EventPipe env trace file. (#52443)

* Add streaming support for EventPipe env trace file.

Using EventPipeOutputPath and EventPipeConfig it is possible to setup
an EventPipe file session running during complete runtime execution.
There was however no logic that would flush this session, so if number
of events included in file exceeded max buffer all subsequent events
would be lost. Depeding on use case (like startup profiling) that could
be acceptable, unless rundown events where needed, since they would
likely be lost unless buffer size was way biffer than default limit (1MB).

Adding ability to run a streaming thread (similar to IPC) together with
file sessions would greatly increase usage of the default file session
and could then be real useful in cases where regular diagnostic
tooling won't work or increase the complexity of the profilig task.

In order to preserve old behavior, a new EventPipeSessionType has been
introduced, EP_SESSION_TYPE_FILESTREAM and that will work similar to
existing EP_SESSION_TYPE_FILE, but also start a streaming thread,
making sure buffer content is periodically flushed into file, reduce
risk of getting a flooded buffer manager triggering lost events.

For the default trace file, old behavior is kept and there is a new env
variable, COMPlus_EventPipeOutputStreaming that can be used to enable
using EP_SESSION_TYPE_FILESTREAM instead of EP_SESSION_TYPE_FILE for the
default file session.

3 years agoEvent listener overhead reduction pt. 3 (#52455)
Miha Zupan [Wed, 12 May 2021 05:09:46 +0000 (07:09 +0200)]
Event listener overhead reduction pt. 3 (#52455)

* Remove unused field

* Reduce common-case EventWrittenEventArgs overheads

Store PayloadNames on EventMetadata instead of EventWrittenEventArgs

* Avoid duplication around TraceLoggingEventTypes

* Move GetParameterNames into property getter

* While => For

* Add EventMetadata.ParameterTypes

* Defer fetching ParameterTypes

* Add RequiresUnreferencedCode attribute to TraceLoggingEventTypes getter

* Revert init => get

* ActivityId => RelatedActivityId

* Remove eventId arg from DispatchToAllListeners

* Store the first caller's ActivityId in EventWrittenEventArgs

* Move ActivityId from MoreInfo to base object

3 years agoUpdate the exception thrown to be more useful when AsnEncodedData has a null Oid...
Daniel Hix [Wed, 12 May 2021 00:12:21 +0000 (19:12 -0500)]
Update the exception thrown to be more useful when AsnEncodedData has a null Oid value

3 years agoUse "OR_GREATER" conditional compilation instead of explicit legacy build conditionals
Kevin Jones [Wed, 12 May 2021 00:11:03 +0000 (20:11 -0400)]
Use "OR_GREATER" conditional compilation instead of explicit legacy build conditionals

3 years agoFix timeout for Pizza app and add min app (#52626)
Drew Scoggins [Tue, 11 May 2021 23:50:32 +0000 (16:50 -0700)]
Fix timeout for Pizza app and add min app (#52626)

3 years agoMulti-target RuntimeConfigParser task (#52618)
Steve Pfister [Tue, 11 May 2021 23:37:30 +0000 (19:37 -0400)]
Multi-target RuntimeConfigParser task (#52618)

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

3 years agoAllow overriding processor count via configuration setting (#52492)
Anton Lapounov [Tue, 11 May 2021 22:32:46 +0000 (15:32 -0700)]
Allow overriding processor count via configuration setting (#52492)

3 years agoSupport ChaCha20 Poly1305 on Unix
Kevin Jones [Tue, 11 May 2021 22:25:46 +0000 (18:25 -0400)]
Support ChaCha20 Poly1305 on Unix

Like AES-GCM and AES-CCM, the macOS build uses OpenSSL for the implementation.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
3 years agoFix Thread::SetProfilerFilterContext usage (#52607)
Mike McLaughlin [Tue, 11 May 2021 21:37:55 +0000 (14:37 -0700)]
Fix Thread::SetProfilerFilterContext usage (#52607)

Add holder to catch exceptions and clear context.

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

3 years agoMake sure the RuntimeConfigParser is in the Mono workload (#52609)
Steve Pfister [Tue, 11 May 2021 19:39:49 +0000 (15:39 -0400)]
Make sure the RuntimeConfigParser is in the Mono workload (#52609)

It was defined as a pack before, but not included in the workload def

3 years agoOptimize System.HexConverter.IsHexChar on 64 bits (#52470)
Sergio Pedri [Tue, 11 May 2021 19:10:40 +0000 (21:10 +0200)]
Optimize System.HexConverter.IsHexChar on 64 bits (#52470)

3 years agoGetLinuxNetworkInterfaces - avoid crash when /proc/net/route is inaccessible (#52376)
Karel Zikmund [Tue, 11 May 2021 18:57:33 +0000 (20:57 +0200)]
GetLinuxNetworkInterfaces - avoid crash when /proc/net/route is inaccessible (#52376)

Ignore UnauthorizedAccessException when reading route files.

Fixes #49946

3 years agoRemove unused InterceptStub (#52401)
Jan Vorlicek [Tue, 11 May 2021 18:26:30 +0000 (11:26 -0700)]
Remove unused InterceptStub (#52401)

This stub is not used anywhere in the current runtime.

3 years agoEnsure MacCatalyst default http handler is the same as iOS (#52229)
Steve Pfister [Tue, 11 May 2021 18:15:51 +0000 (14:15 -0400)]
Ensure MacCatalyst default http handler is the same as iOS (#52229)

3 years agoAdd list of prerequisites for Gentoo (#50317)
Andrii Kurdiumov [Tue, 11 May 2021 17:08:59 +0000 (23:08 +0600)]
Add list of prerequisites for Gentoo (#50317)

3 years agoUnnecessary cryptographic derived types obsoletions (#52303)
Annchous [Tue, 11 May 2021 17:04:54 +0000 (20:04 +0300)]
Unnecessary cryptographic derived types obsoletions (#52303)

* add new obsoletion ID

* nowarn for new obsoletion

* add obsoletions to csproj

* AesCryptoServiceProvider obsoletion

* DESCryptoServiceProvider obsoletion

* MD5CryptoServiceProvider obsoletion

* RC2CryptoServiceProvider obsoletion

* SHA1CryptoServiceProvider obsoletion

* SHA256CryptoServiceProvider obsoletion

* SHA384CryptoServiceProvider obsoletion

* SHA512CryptoServiceProvider obsoletion

* TripleDESCryptoServiceProvider obsoletion

* add obsoletions to csproj

* *Managed obsoletions

* add pragma suppress for types usages

* add nowarn in tests csproj

* add documentation

* add nowarn to new identified tests csproj

* add pragma suppress for types usages #2

* update documentation

* fix md5 usage

* Fix indentation

* fix obsoletions inclusion in csproj

* remove extra obsoletions inclusion in csproj

* De-dupe project items that were in both the browser and non-browser configs. Ensure Obsoletions.cs is included in all configs.

* Remove duplicate RandomNumberGeneratorImplementation.cs reference

* Update documentation

* Remove duplicate Obsoletions.cs from project file (introduced in merge)

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
3 years agoFix for failing WebSocket deflate test on ARM (#52052)
Ivan Zlatanov [Tue, 11 May 2021 15:53:22 +0000 (18:53 +0300)]
Fix for failing WebSocket deflate test on ARM (#52052)

Reducing the number of times Random.Next is called to improve runtime performance of test on ARM.
Fixes #52031

3 years agoStop harvesting S.IO.Pipes.AccessControl (#52294)
Viktor Hofer [Tue, 11 May 2021 15:40:30 +0000 (17:40 +0200)]
Stop harvesting S.IO.Pipes.AccessControl (#52294)

* Stop harvesting S.IO.Pipes.AccessControl

The removed configurations (netstandard1.3, netcoreapp2.1, net46) aren't
built anymore. Instead the already built matching binaries from the
latest available packages are redistributed when packaging these
libraries.

Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0 and are still in-support. As an example,
also dropping the netcoreapp2.1 asset which isn't supported anymore and
upgrading it to netcoreapp3.1.. For .NET Framework, there's still a
net461 configuration present to avoid binding redirect issues.

The ugly part of this change is that System.IO.Pipes.AccessControl
depends on an internal API of System.IO.Pipes for all .NETCoreApp
configurations. Because of that, for configurations that don't apply
to the current band (netcoreapp3.1, net5.0), the runtime packs need
to be downloaded so that runtime assembly can be referenced. Ideally
we will come up with a better solution to not require runtime packs
to be fetched as that adds 60MB of download size to the repo and breaks
source build.

Contributes to #47530

* Use non shipping refs for Pipes typeforwards

3 years agoMake RandomNumberGenerator.Create return a singleton
Levi Broderick [Tue, 11 May 2021 15:22:44 +0000 (08:22 -0700)]
Make RandomNumberGenerator.Create return a singleton

This makes the implementation of `RandomNumberGenerator.Create()` return a singleton instance.
So apps which need to call `RandomNumberGenerator.Create()` instead of using the static accelerator
APIs can still take advantage of a non-allocating factory.

Attempting to dispose of the returned singleton instance will no-op. The implementation of
`RandomNumberGenerator.Create(string)` is not changed. Using that API will continue to go through
the normal `CryptoConfig` activation code paths.

3 years agoDisable SocketsHttpHandlerTest_Http2.SocketSendQueueFull_RequestCanceled_ThrowsOperat...
Karel Zikmund [Tue, 11 May 2021 14:52:14 +0000 (16:52 +0200)]
Disable SocketsHttpHandlerTest_Http2.SocketSendQueueFull_RequestCanceled_ThrowsOperationCanceled on OSX (#52556)

Disable test SocketsHttpHandlerTest_Http2.SocketSendQueueFull_RequestCanceled_ThrowsOperationCanceled on OSX

Disabled test tracked by #44352

3 years ago[aot] Add JustInterp Mode to the MonoAOTCompiler task (#52560)
Aleksey Kliger (λgeek) [Tue, 11 May 2021 13:45:14 +0000 (09:45 -0400)]
[aot] Add JustInterp Mode to the MonoAOTCompiler task (#52560)

In this mode we pass `--aot=interp` to the AOT compiler.  This will _not_ AOT
the managed methods in the specified assemblies, but it will AOT the
trampolines and wrappers necessary for the interpreter to run the methods and
to interoperate with native P/Invokes and unmanaged callbacks.

3 years ago[iOS][tvOS] Remove AOT functional test projects (#52574)
Mitchell Hwang [Tue, 11 May 2021 13:11:42 +0000 (09:11 -0400)]
[iOS][tvOS] Remove AOT functional test projects (#52574)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>