platform/upstream/dotnet/runtime.git
2 years agoMove the fabricbot config files to the eng folder to avoid changes triggering CI...
Jeff Handley [Thu, 24 Feb 2022 20:48:52 +0000 (12:48 -0800)]
Move the fabricbot config files to the eng folder to avoid changes triggering CI (#65856)

2 years agoNetworkAddressChange.Unix: fix error checking. (#65849)
Tom Deseyn [Thu, 24 Feb 2022 19:05:14 +0000 (20:05 +0100)]
NetworkAddressChange.Unix: fix error checking. (#65849)

2 years ago[wasm] Refactor script to load NPM modules for NodeJS on Helix (#65774)
Marek Fišera [Thu, 24 Feb 2022 18:54:31 +0000 (19:54 +0100)]
[wasm] Refactor script to load NPM modules for NodeJS on Helix (#65774)

- Refactor script to load NPM modules for NodeJS on Helix to tests.wasm.targets.
- Move NODE_TLS_REJECT_UNAUTHORIZED=0 to LocalEchoServer.props.

2 years agoFix Queryable-to-Enumerable overload mapping logic (#65569)
Eirik Tsarpalis [Thu, 24 Feb 2022 18:48:07 +0000 (18:48 +0000)]
Fix Queryable-to-Enumerable overload mapping logic (#65569)

* Fix Queryable-to-Enumerable overload mapping logic

* fix linker warnings

* address feedback

* use strict order when calculating maximal elements

2 years ago Handle direct addresses for statics in `IsFieldAddr` (#64846)
SingleAccretion [Thu, 24 Feb 2022 15:58:18 +0000 (18:58 +0300)]
 Handle direct addresses for statics in `IsFieldAddr` (#64846)

* DEBUG-ONLY: FieldInfo

Allows this change to be tested via SPMI.

* Handle direct addresses in IsFieldAddr

* Always use NotAField in IsFieldAddr

No diffs.

* Revert "DEBUG-ONLY: FieldInfo"

This reverts commit b17817e0354a63319256a0fa0d21b74c2cfbf781.

2 years agoAdd support for sending CA names in handshake on Linux and OSX (#65195)
Radek Zikmund [Thu, 24 Feb 2022 12:54:34 +0000 (13:54 +0100)]
Add support for sending CA names in handshake on Linux and OSX (#65195)

2 years ago[main] Update dependencies from 10 repositories (#65504)
dotnet-maestro[bot] [Thu, 24 Feb 2022 12:49:02 +0000 (13:49 +0100)]
[main] Update dependencies from 10 repositories (#65504)

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22115.2 -> To Version 7.0.0-preview.3.22116.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220216.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.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22115.1 -> To Version 7.0.0-beta.22116.1

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

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22111.1 -> To Version 7.0.0-preview.3.22116.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220216.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22115.3 -> To Version 7.0.0-preview1.22116.1

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

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , 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.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22114.7 -> To Version 2.5.1-beta.22117.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220219.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22115.3 -> To Version 7.0.0-preview1.22119.1

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

runtime.native.System.IO.Ports , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json , Microsoft.NET.Sdk.IL
 From Version 7.0.0-preview.2.22113.2 -> To Version 7.0.0-preview.3.22120.1

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

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.22078.3 -> To Version 1.0.0-prerelease.22121.2

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.2.22081.1 -> To Version 7.0.0-preview.3.22121.1

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22114.1 -> To Version 1.0.0-prerelease.22121.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220221.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.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22115.1 -> To Version 7.0.0-beta.22121.1

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

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22077.1 -> To Version 7.0.0-preview.3.22121.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-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 , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.22114.2 -> To Version 11.1.0-alpha.1.22121.2

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

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , 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.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22114.7 -> To Version 2.5.1-beta.22122.3

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.2.22081.1 -> To Version 7.0.0-preview.3.22122.1

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

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22077.1 -> To Version 7.0.0-preview.3.22122.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.2-alpha.0.22114.2 -> To Version 1.0.2-alpha.0.22122.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoFix nullability mismatch between `ref` and `src` in `Microsoft.Extensions.Caching...
Maksym Koshovyi [Thu, 24 Feb 2022 12:45:45 +0000 (14:45 +0200)]
Fix nullability mismatch between `ref` and `src` in `Microsoft.Extensions.Caching.Abstractions` (#65804)

* Update PostEvictionDelegate.cs

* Fix GetOrCreateAsync

2 years agoAdd [NotNullWhen(true)] to Enum.TryParse overloads (#65827)
Stephen Toub [Thu, 24 Feb 2022 12:44:26 +0000 (07:44 -0500)]
Add [NotNullWhen(true)] to Enum.TryParse overloads (#65827)

2 years agoAdd RegexGenerator to System.ComponentModel.TypeConverter. (#62325)
Stephen A. Imhoff [Thu, 24 Feb 2022 12:43:27 +0000 (04:43 -0800)]
Add RegexGenerator to System.ComponentModel.TypeConverter. (#62325)

* Add RegGen to System.ComponentModel.TypeConverter.

Added to src, not to test (no test found)

* Change to targets generator enablement

* Correct RegGen for System.ComponentModel.TypeConverter

* Remove extra space

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
* Remove .NetF inclusion definition

* Remove implicit regex generator entrypoint

* Remove regex generator enabled variable target.

* Update eng/generators.targets

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
2 years agoUnify reading from procfs to get network related information (#63696)
Radek Zikmund [Thu, 24 Feb 2022 12:33:34 +0000 (13:33 +0100)]
Unify reading from procfs to get network related information (#63696)

Throw NetworkInformationException instead of PNSE

2 years agoUse SECPKG_ATTR_REMOTE_CERT_CHAIN to retrieve server cert during handshake (#65134)
Radek Zikmund [Thu, 24 Feb 2022 12:29:33 +0000 (13:29 +0100)]
Use SECPKG_ATTR_REMOTE_CERT_CHAIN to retrieve server cert during handshake (#65134)

This allows us to query peer cert even before Tls Handshake completes.

2 years ago[wasm][debugger] Optional param fix 56251 (#64970)
Ilona Tomkowicz [Thu, 24 Feb 2022 12:19:59 +0000 (13:19 +0100)]
[wasm][debugger] Optional param fix 56251 (#64970)

* Optional parameter fix.

* Working version of optional parameter support, requires refactoring.

* Refactored.

* Fixed failing tests.

* Simplified tests.

* @radical's parenthesis refactor.

Co-authored-by: Ankit Jain <radical@gmail.com>
* Add nullable tests, rename mixed params function.

* Applied @radical suggestions + fixed tests failing because of double separator.

* Capitalised params first letter, removed explicit getters.

* Applied @radical's and @lewing's comments where it was possible.

* Applied @radical's suggestions.

* Handle Linq with ParamsCnt = methodParamsCnt. OptionalParamsCnt not used anymore.

* Fix: previos commit worked only in tests, not in browser.

* Applied @radical's approach.

* Fixed ParamsInfo so that it will be loaded on demand only.

* Update src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoUse TargetFramework singular for tests
Viktor Hofer [Sat, 12 Feb 2022 14:47:35 +0000 (15:47 +0100)]
Use TargetFramework singular for tests

Use TargetFramework instead of TargetFrameworks property whenever a
test project targets a single target framework only.
This avoid unnecessary outer builds and evaluations and makes the build
faster.

2 years agosfx+oob split, shim project refactoring, P2Ps
Viktor Hofer [Tue, 18 Jan 2022 15:07:01 +0000 (16:07 +0100)]
sfx+oob split, shim project refactoring, P2Ps

Split the build of shared framework and out-of-band projects so that
it's possible to just build the shard framework projects, which was
requested by the CLR teams. In the next infrastructure rollout, the
current "libs.ref+libs.src" subsets should be removed. Generate the
targeting pack with an incomplete (without shims) frameworklist as part
of the "libs.sfx" subset.

Build the shim projects after the shared framework and oob projects and
re-generate the targeting pack's frameworklist to include the shims.

Refactor the shims so that they aren't grouped anymore by generated &
manual. Instead group them by "ref" and "src" same as other libraries
in the tree which allows to reference the source project shims and read
from the ReferenceAssembly metadata.

Use ProjectReferences in traversal projects and shim projects instead
of named references that point to binplace directories (see graph below)
This allows to build parts of the product dynamically, i.e. the shim
projects, apicompat.proj, sfx.proj and oob.proj.

2 years agoMove ApiCompat files into own directory
Viktor Hofer [Tue, 18 Jan 2022 15:03:50 +0000 (16:03 +0100)]
Move ApiCompat files into own directory

2 years agoEqualize promoted (#64206)
Peter Sollich [Thu, 24 Feb 2022 11:16:22 +0000 (12:16 +0100)]
Equalize promoted (#64206)

I have observed that in server GC scenarios, the amount of promoted memory is often very uneven between heaps, which leads to suboptimal work distribution between server GC threads.

The PR introduces a new method equalize_promoted_bytes that attemps to even out the promoted memory between heaps by moving regions from heaps with lots of promotion of heaps with less promotion.

The algorithm used removes regions from heaps that have more than average promotion. These surplus regions are arranged into size classes by the amount of promoted memory in them. The heaps are also arranged into size classes by how much their promoted memory is short of the average promoted memory per heap.

Then we repeatedly move the surplus region with the most promoted memory to the heap with the biggest deficit. If the heap still has a deficit, it is reconsidered under its new deficit size class. Otherwise, it now has average or more promoted memory and is removed from further consideration.

Because regions may now move between heaps, it is no longer true that the finalization queue entry for an object is always on the same heap as the object itself. This necessitated moving the call to finalize_queue->UpdatePromotedGenerations to a later point in time when all threads have finished updating the final generation for a region.

2 years agoChanges to reduce committed memory: (#65367)
Peter Sollich [Thu, 24 Feb 2022 10:17:16 +0000 (11:17 +0100)]
Changes to reduce committed memory: (#65367)

* Changes to reduce committed memory:
- Be more careful about estimating what is needed in the future
- Decommit regions that haven't been used in 20 GCs
- Keep regions sorted by decreasing commit size and increasing age
- Insturmentation enhancements

* Address code review feedback:
- optimize add_region_in_descending_order to search backwards if the region to be added is not fully committed
- adjust dprintf levels
- fix formatting issues
- made merge_sort_by_committed_and_age more efficient
- fix comment to use symbolic constant instead of number
- added new helper generation_start_segment_rw

2 years agoUpdate area-owners and fabricbot to reflect libraries area pod changes (#65830)
Jeff Handley [Thu, 24 Feb 2022 09:41:08 +0000 (01:41 -0800)]
Update area-owners and fabricbot to reflect libraries area pod changes (#65830)

* Update area-owners to use area team names for the libraries area pods

* Update fabricbot for libraries pod changes; remove configs for old project boards

* Remove intra-team consultants from libraries areas

2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220222.1 (#65772)
dotnet-maestro[bot] [Thu, 24 Feb 2022 09:01:40 +0000 (10:01 +0100)]
Update dependencies from https://github.com/dotnet/linker build 20220222.1 (#65772)

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22121.2 -> To Version 7.0.100-1.22122.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[mono] Throw a MarshalDirectiveException when marshalling generic instances as return...
monojenkins [Thu, 24 Feb 2022 08:53:59 +0000 (03:53 -0500)]
[mono] Throw a MarshalDirectiveException when marshalling generic instances as return types from pinvoke callbacks. (#65743)

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

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
2 years agoProcess.GetProcessById bugfix (#64723)
Evgeny Peshkov [Thu, 24 Feb 2022 07:52:15 +0000 (10:52 +0300)]
Process.GetProcessById bugfix (#64723)

* Bugfix: Process.GetProcessById claims killed process is still alive in .NET Core #63937

* Added test for GetProcessById with killed process

Co-authored-by: epeshk <>
2 years ago[wasm] Use `--emit-symbol-map` to generate a `dotnet.js.symbols` (#65162)
Ankit Jain [Thu, 24 Feb 2022 07:31:56 +0000 (02:31 -0500)]
[wasm] Use `--emit-symbol-map` to generate a `dotnet.js.symbols` (#65162)

* [wasm] Use --emit-symbol-map to generate a dotnet.js.symbols

.. and package it in the runtime pack. This can be disabled with
`$(WasmEmitSymbolMap)`.

* wasm.proj: cleanup

* [wasm] honor XunitShowProgress property

* [wasm] avoid extra build when publishing

* [wasm] WasmAppBuilder: Fix handling of ExtraFilesToDeploy

It incorrectly treated `TargetPath` metadata as a directory.

* [wasm] Disable generation of symbol maps by default

- this is needed because the sdk needs to handle this file specifically,
  and would break tests.
- Once, the sdk gets the fix, then we can turn this on by default.

- For tests, turn it on by default

* [wasm] Deploy dotnet.js.symbols with the tests

* cleanup

* [wasm] dotnet-install.sh logs errors from curl, while trying older urls,

.. don't let that fail the build.

* [wasm] Temporarily disable WasmEmitSymbolMap by default

.. because sdk needs a fix for blazor projects to handle
`dotnet.js.symbols`.

But explicitly enable this for tests.

* Address review feedback

2 years agofix few Filesystem tests on FreeBSD (#65059)
Tomas Weinfurt [Thu, 24 Feb 2022 07:19:21 +0000 (23:19 -0800)]
fix few Filesystem tests on FreeBSD (#65059)

* fix few FileSystem tests on FreeBSD

* fix MoveDirectory_FailToMoveLowerCaseDirectoryWhenUpperCaseDirectoryExists

* feedback from review

2 years agoReduce alignment of dispatch maps (#65823)
Michal Strehovský [Thu, 24 Feb 2022 05:49:00 +0000 (14:49 +0900)]
Reduce alignment of dispatch maps (#65823)

We've been aligning these at 16 bytes [since dispatch maps were added](https://github.com/dotnet/corert/pull/626) in 2016. Not clear where the 16 came from. Rhbind seems to be aligning these at pointer boundaries, but we only place `ushort`s in here.

This likely results in some size savings.

2 years ago[MonoAPI] Split type and function headers, add MONO_API_FUNCTION macro (#65446)
Aleksey Kliger (λgeek) [Thu, 24 Feb 2022 03:52:46 +0000 (22:52 -0500)]
[MonoAPI] Split type and function headers, add MONO_API_FUNCTION macro (#65446)

* [monoapi] Split type and function headers, add MONO_API_FUNCTION macro

The idea is that the function header can be included multiple times with different definitions of MONO_API_FUNCTION in order to make it easier to re-used the definitions for embedding the runtime in late-binding scenarios

* rename public mono/mini subdirectory to mono/jit

  To match how embedders see the tree.

  Update the runtime to include <mono/jit/jit.h> instead of <mono/mini/jit.h>.

  No change in public API

* Add needed includes to mobile testing host templates

* add unstable API comment to the details headers, too

* use install(FILES) to copy the headers

  not other stray files to the include dir

* update CODEOWNERS

* Remove duplicate definitions of mono_event_get_remove_method

  This was already duplicated before the header reorganization, e.g. here https://github.com/dotnet/runtime/blob/b9a55b4f52243325359ced26e3d4b31ccacdc381/src/native/public/mono/metadata/class.h#L279-L282

2 years agoRemove checks and settings for Internal.Runtime.CompilerServices.Unsafe since that...
Jeremy Koritzinsky [Thu, 24 Feb 2022 03:17:58 +0000 (19:17 -0800)]
Remove checks and settings for Internal.Runtime.CompilerServices.Unsafe since that type is gone (#65809)

2 years agoUpdate GeneratedDllImportAttribute CharSet -> StringMarshalling (#65544)
Elinor Fung [Thu, 24 Feb 2022 02:36:10 +0000 (18:36 -0800)]
Update GeneratedDllImportAttribute CharSet -> StringMarshalling (#65544)

2 years ago[wasm] Misc Debugger improvements (including tests) (#65752)
Ankit Jain [Thu, 24 Feb 2022 01:08:23 +0000 (20:08 -0500)]
[wasm] Misc Debugger improvements (including tests) (#65752)

* [wasm][debugger] Fail test if an assertion is detected

* [wasm][debugger] Make DevToolsProxy's `pending_ops` thread-safe

Currently, `pending_ops` can get written by different threads at the
same time, and also read in parallel. This causes tests to randomly fail
with:

```
DevToolsProxy::Run: Exception System.ArgumentException: The tasks argument included a null value. (Parameter 'tasks')
    at System.Threading.Tasks.Task.WhenAny(Task[] tasks)
    at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.Run(Uri browserUri, WebSocket ideSocket) in /_/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsProxy.cs:line 269
```

Instead, we use `Channel<T>` to add the ops, and then read those in
the main loop, and add to the *local* `pending_ops` list.

* [wasm] Install chrome for debugger tests

- controlled by `$(InstallChromeForDebuggerTests)` which defaults to
`true` for non-CI docker containers
- Useful for using the correct chrome version when testing locally, or
on codespaces

- Also, add support for detecting, and defaulting to such an
installation

* [wasm][debugger] Disable tests failing with runtime assertions

`DebuggerTests.EvaluateOnCallFrameTests.EvaluateSimpleMethodCallsError`: https://github.com/dotnet/runtime/issues/65744
`DebuggerTests.ArrayTests.InvalidArrayId`: https://github.com/dotnet/runtime/issues/65742

* [wasm][debugger] Fix NRE with `"null"` condition for a breakpoint

`ConditionalBreakpoint` test fails.
The test with condition=`"null"` failed with a NRE, instead of correctly
handling it as a condition that returns null.

```
Unable evaluate conditional breakpoint: System.Exception: Internal Error: Unable to run (null ),
    error: Object reference not set to an instance of an object..
    ---> System.NullReferenceException: Object reference not set to an instance of an object.
            at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 399
            --- End of inner exception stack trace ---
            at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 407
            at Microsoft.WebAssembly.Diagnostics.MonoProxy.EvaluateCondition(SessionId sessionId, ExecutionContext context, Frame mono_frame, Breakpoint bp, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 801 condition:null
```

* [wasm] Improve default message for ReturnAsErrorException,

.. since we seem to be not catching them as intended in many places.

* [wasm] Better log, and surface errors in evaluation conditional

.. breakpoints.
Catch the proper exception `ReturnAsErrorException`, so we can get the
actual error message. And log that as an error for the user too.

* [wasm][debugger] Allow setting proxy port for BrowserDebugHost

.. with `--proxy-port=<port>`.

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

* [wasm][debugger] Handle errors in getting value for locals

Essentially, catch, and skip.

* message cleanup

* remove trailing space

2 years agoDisable packaging for DllImportGenerator for now (#65795)
Viktor Hofer [Wed, 23 Feb 2022 22:45:30 +0000 (23:45 +0100)]
Disable packaging for DllImportGenerator for now (#65795)

* Disable packaging for DllImportGenerator for now

For reasoning see https://github.com/dotnet/runtime/issues/65495#issuecomment-1049111768.

2 years agoAdd proposed plan for the COM source generator (#60143)
Jeremy Koritzinsky [Wed, 23 Feb 2022 22:26:24 +0000 (14:26 -0800)]
Add proposed plan for the COM source generator (#60143)

2 years ago[wasm][debugger] Add per-test ids, and save logs to files for the test, and proxy...
Ankit Jain [Wed, 23 Feb 2022 20:00:00 +0000 (15:00 -0500)]
[wasm][debugger] Add per-test ids, and save logs to files for the test, and proxy messages (#63564)

* [wasm][debugger] Add test ids, and log test output, and proxy messages

.. to files.

* log level cleanup

* [wasm][debugger] Allow setting proxy port for BrowserDebugHost

.. with `--proxy-port=<port>`.

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

2 years ago[LoongArch64] submit some compiling depended files. (#65769)
Qiao Pengcheng [Wed, 23 Feb 2022 18:59:06 +0000 (02:59 +0800)]
[LoongArch64] submit some compiling depended files. (#65769)

2 years agoMake NegotiatedCipherSuiteTests.SupportedNonTls13CipherSuites lazy (#65771)
Radek Zikmund [Wed, 23 Feb 2022 18:08:05 +0000 (19:08 +0100)]
Make NegotiatedCipherSuiteTests.SupportedNonTls13CipherSuites lazy (#65771)

This greatly reduces number of exceptions thrown when debugging
System.Net.Security tests on Unix platforms

2 years agoChange default of SslServerAuthenticationOptions.AllowRenegotiation to false (#65777)
Radek Zikmund [Wed, 23 Feb 2022 17:42:12 +0000 (18:42 +0100)]
Change default of SslServerAuthenticationOptions.AllowRenegotiation to false (#65777)

Fixes #65547

2 years agoImplement HttpTelemetry for HTTP/3 (#65644)
Miha Zupan [Wed, 23 Feb 2022 16:28:51 +0000 (08:28 -0800)]
Implement HttpTelemetry for HTTP/3 (#65644)

2 years agoOptimize the Regex source generator's handling of `Compilation` objects. (#65431)
Theodore Tsirpanis [Wed, 23 Feb 2022 13:54:47 +0000 (15:54 +0200)]
Optimize the Regex source generator's handling of `Compilation` objects. (#65431)

* Optimize the Regex source generator's handling of Compilation objects.

* Use the common downlevel IsExternalInit file in the regex source generator.

And remove a now-unused file.

* Address PR feedback; revert to the old way of matching symbols.

* Fix an outdated comment.

2 years agoAdd missing GC.SuppressFinalize (#64997)
Adam Sitnik [Wed, 23 Feb 2022 09:24:01 +0000 (10:24 +0100)]
Add missing GC.SuppressFinalize (#64997)

2 years ago[EventPipe] Fix reverse connection socket leaking to child processes. (#65365)
Juan Hoyos [Wed, 23 Feb 2022 08:21:20 +0000 (00:21 -0800)]
[EventPipe] Fix reverse connection socket leaking to child processes. (#65365)

* [EventPipe] Fix reverse connection socket leaking to child processes.

2 years agoFix unwanted session caching in mutual authentication tests (#65739)
Radek Zikmund [Wed, 23 Feb 2022 08:01:56 +0000 (09:01 +0100)]
Fix unwanted session caching in mutual authentication tests (#65739)

2 years agoJIT: Faster vector == Vector128.Zero on arm64 (#65632)
Egor Bogatov [Wed, 23 Feb 2022 07:40:50 +0000 (10:40 +0300)]
JIT: Faster vector == Vector128.Zero on arm64 (#65632)

2 years ago[wasm][tests] Fix use of `RandomTest*Orderer` with trimming (#65754)
Ankit Jain [Wed, 23 Feb 2022 05:12:02 +0000 (00:12 -0500)]
[wasm][tests] Fix use of `RandomTest*Orderer` with trimming (#65754)

With trimming the tests would fail to load the types:
```
[21:11:50] info: Discovered:  System.Runtime.Tests.dll (found 6200 of 6302 test cases)
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCaseOrderer' in TestUtilities for assembly-level test case orderer
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCollectionOrderer' in TestUtilities for assembly-level test collection orderer
```

2 years agoFix entrypoint name. (#65745)
Jeremy Koritzinsky [Wed, 23 Feb 2022 03:28:40 +0000 (19:28 -0800)]
Fix entrypoint name. (#65745)

Fixes #65648

2 years agoFix inlining of IPAddress ctor (#65735)
Stephen Toub [Wed, 23 Feb 2022 02:55:47 +0000 (21:55 -0500)]
Fix inlining of IPAddress ctor (#65735)

2 years agoCleanup platform-specific ifdefs (#65624)
Jan Kotas [Wed, 23 Feb 2022 02:01:04 +0000 (18:01 -0800)]
Cleanup platform-specific ifdefs (#65624)

2 years ago[mono][jit] Remove support for -O=-float32, i.e. treating r4 values as r8 on the...
Zoltan Varga [Wed, 23 Feb 2022 01:44:00 +0000 (20:44 -0500)]
[mono][jit] Remove support for -O=-float32, i.e. treating r4 values as r8 on the IL stack. (#65740)

This is not compatible with coreclr, and it has been disabled
and untested for a long time.

2 years agoDeduplicate some HWI codegen code (#65302)
SingleAccretion [Wed, 23 Feb 2022 01:14:51 +0000 (04:14 +0300)]
Deduplicate some HWI codegen code (#65302)

* Add OperandDesc

* Clean two 'instr_XYZ' methods up

* Clean HWI codegen up using OperandDesc

2 years ago[docs] Create mono-thread-state-machine.md (#65720)
Aleksey Kliger (λgeek) [Wed, 23 Feb 2022 00:50:33 +0000 (19:50 -0500)]
[docs] Create mono-thread-state-machine.md (#65720)

* Create mono-thread-state-machine.md

  Add the thread state machine design document

* Add some sequence diagrams

* Add hybrid suspend race sequence diagram

* More details on self-transitions

* fix coop GC suspend discussion

* undo accidental deletion

2 years ago[mono] Remove an usage of g_utf8_strup (), its not needed. (#65727)
Zoltan Varga [Tue, 22 Feb 2022 22:11:12 +0000 (17:11 -0500)]
[mono] Remove an usage of g_utf8_strup (), its not needed. (#65727)

2 years agoAdd back StructWithPublicDefaultConstructor test (#65616)
Badre BSAILA [Tue, 22 Feb 2022 20:48:40 +0000 (21:48 +0100)]
Add back StructWithPublicDefaultConstructor test (#65616)

2 years ago[wasm][debugger] Add support for using Conditional* attributes for tests (#65684)
Ankit Jain [Tue, 22 Feb 2022 20:02:28 +0000 (15:02 -0500)]
[wasm][debugger] Add support for using Conditional* attributes for tests (#65684)

- Discoverer for `ActiveIssue` doesn't seem to be running, so that is
  not working right now.
- Only, `ConditionalFact`, and `ConditionalTheory` work

2 years agoAlways dispose inner stream in StreamPipeWriter.Complete* (#65462)
William Godbe [Tue, 22 Feb 2022 17:41:06 +0000 (09:41 -0800)]
Always dispose inner stream in StreamPipeWriter.Complete* (#65462)

* Always dispose inner stream in StreamPipeWriter.Complete*

* Add tests

* Fixup

* Update StreamPipeWriterTests.cs

2 years agoDisable no_tiered_compilation scenario for mono in run-test-job.yml (#65701)
Alexander Köplinger [Tue, 22 Feb 2022 17:34:03 +0000 (18:34 +0100)]
Disable no_tiered_compilation scenario for mono in run-test-job.yml (#65701)

Mono doesn't do tiered compilation today so we're just duplicating work that runs the same config.

2 years agoNetworkAddressChange.Unix: use async Socket API to wait for events. (#64614)
Tom Deseyn [Tue, 22 Feb 2022 17:31:45 +0000 (18:31 +0100)]
NetworkAddressChange.Unix: use async Socket API to wait for events. (#64614)

* NetworkAddressChange.Unix: use async Socket API to wait for events.

By replacing the raw handle with a Socket, we ensure only the handle
we own gets used.

By using the Socket async APIs we no longer need a dedicated Thread
to synchronously read the events.

* Fix compilation.

* PR feedback.

* Add logging of unexpected errors.

* Assert lock is entered.

2 years agoAllow SslStream in ConnectCallback (#63851)
Tomas Weinfurt [Tue, 22 Feb 2022 17:22:55 +0000 (09:22 -0800)]
Allow SslStream in ConnectCallback (#63851)

* Allow SslStream in ConnectCallback

* fix win7

* disable win7

2 years ago[main] Update dependencies from dotnet/linker (#65561)
dotnet-maestro[bot] [Tue, 22 Feb 2022 17:08:37 +0000 (18:08 +0100)]
[main] Update dependencies from dotnet/linker (#65561)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
2 years agoFix slngen.proj and update solution files (#65711)
Viktor Hofer [Tue, 22 Feb 2022 16:18:54 +0000 (17:18 +0100)]
Fix slngen.proj and update solution files (#65711)

* Fix slngen.proj

The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.

* Update solution files

Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.

2 years agoDo not set GLOB_REF for invariant indirections (#65709)
SingleAccretion [Tue, 22 Feb 2022 15:37:25 +0000 (18:37 +0300)]
Do not set GLOB_REF for invariant indirections (#65709)

The GTF_GLOB_REF flag in the compiler has the meaning that
the node marked with it produces a value that could be modified
by a call or an indirect store. It is used for optimizations
that need to know whether it is safe to reorder two trees.

Invariant indirections, by definition, always produce the
same value, and as such do not need to be marked with GLOB_REF.

Some nice diffs from args sorting: string literals can now
be put in the "late args" list directly (without a temp).

2 years ago[mono][interp] Fix conv.r.un from r4 (#65697)
Vlad Brezae [Tue, 22 Feb 2022 14:43:53 +0000 (16:43 +0200)]
[mono][interp] Fix conv.r.un from r4 (#65697)

2 years agoFix scheduled search in issue cleanup (#65699)
Eirik Tsarpalis [Tue, 22 Feb 2022 14:28:42 +0000 (14:28 +0000)]
Fix scheduled search in issue cleanup (#65699)

2 years agoAdded OnesComplement, Sqrt, Negate vector intrinsics (#65438)
Meri Khamoyan [Tue, 22 Feb 2022 11:58:49 +0000 (15:58 +0400)]
Added OnesComplement, Sqrt, Negate vector intrinsics (#65438)

* Added Not, Sqrt, Negate vector intrinsics

2 years agoRoll out automated issue cleanup (#65576)
Eirik Tsarpalis [Tue, 22 Feb 2022 10:22:29 +0000 (10:22 +0000)]
Roll out automated issue cleanup (#65576)

* Roll out automated issue cleanup

* Update .github/fabricbot.json

* Update .github/fabricbot.json

2 years agoEnsure all expected paths are logged on test failure (#65666)
Adam Sitnik [Tue, 22 Feb 2022 09:40:20 +0000 (10:40 +0100)]
Ensure all expected paths are logged on test failure (#65666)

* move duplicated logic to a method

* ensure all paths are logged, so we can diagnose #65601

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoMore clean up for RegexOptions.NonBacktracking (#65479)
Stephen Toub [Tue, 22 Feb 2022 00:12:47 +0000 (19:12 -0500)]
More clean up for RegexOptions.NonBacktracking (#65479)

* More clean up for RegexOptions.NonBacktracking

- Added more comments
- Removed some dead code and ifdef'd some code to DEBUG-only
- Updated an IComparable implementation to IComparable<T>
- Sealed some internal types
- Made UnicodeCategoryTheory into a static type
- Made CharSetSolver into a singleton
- Renamed a bunch of Mk* methods to Create*
- Renamed Watchdog
- Removed duplicative helper functions
- Fixed thread-safety of UnicodeCategoryTheory (in practice it was probably fine but we now have true singletons)
- Changed some iterators to be lists
- Used var less
- Cleaned up the set parsing code in RegexNodeConverter
- Lazily-initialized a bunch of members of SymbolicRegexBuilder
- Fixed a bug in the handling of \w
- And some other style stuff...

* Rename file

2 years agoFix Type.IsPublic for pointer and byref types (#65156)
Buyaa Namnan [Mon, 21 Feb 2022 23:35:46 +0000 (15:35 -0800)]
Fix Type.IsPublic for pointer and byref types (#65156)

2 years ago[wasm] Add support for a random test case orderer, for xunit tests (#65628)
Ankit Jain [Mon, 21 Feb 2022 21:58:09 +0000 (16:58 -0500)]
[wasm] Add support for a random test case orderer, for xunit tests (#65628)

* [wasm] Add support for a random test case orderer, for xunit tests

This is enabled by default for wasm with
`$(XUnitUseRandomizedTestOrderer)=true`.

When the library tests run, they print two messages like:

```
  info: Using random seed for test cases: 700149826
  info: Using random seed for collections: 700149826
  info: Starting:    System.Collections.Immutable.Tests.dll
```

These seeds are picked randomly every time the tests are run. To run the
tests with a specific seed, use environment variable
`XUNIT_RANDOM_ORDER_SEED`.

When running with tests, this can be used as:

    `WasmXHarnessMonoArgs="--setenv=XUNIT_RANDOM_ORDER_SEED=<seed>`

* Enable test orderer only for libraries tests

* [wasm] Automatically pass XUNIT_RANDOM_ORDER_SEED envvar to wasm apps

* Disable random test ordering for `System.Xml.RW.XmlWriterApi.Tests`

`System.Xml.Tests.TCCloseOutput.*` tests seem to depend on the order of
execution.

```
[06:35:14] fail: [FAIL] System.Xml.Tests.TCCloseOutput.CloseOutput_4(utils: XmlWriterUtils { Async = False, WriterType = UTF8Writer }, outputType: "Stream")
[06:35:14] info: System.IO.FileNotFoundException : File Not Found: writer.out
[06:35:14] info:    at XmlCoreTest.Common.FilePathUtil.getStream(String filename)
[06:35:14] info:    at System.Xml.Tests.TCCloseOutput.CloseOutput_4(XmlWriterUtils utils, String outputType)
[06:35:14] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

* [wasm] Disable random tests ordering for `System.Runtime.Loader`

It seems to cause failures like, reproducible with
`XUNIT_RANDOM_ORDER_SEED=2106784294`:

```
[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual:   "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info:    at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

* [wasm] Disable random test ordering for `System.Runtime.Numerics`

Randomized runs seem to fail with:

```
[03:29:54] info: Starting:    System.Runtime.Numerics.Tests.dll
[03:29:58] fail: [FAIL] System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests
[03:29:58] info: Assert.Equal() Failure
[03:29:58] info:           ↓ (pos 0)
[03:29:58] info: Expected: -0
[03:29:58] info: Actual:   0
[03:29:58] info:           ↑ (pos 0)
[03:29:58] info:    at System.Numerics.Tests.cast_toTest.VerifyDoubleExplicitCastToBigInteger(Double value)
[03:29:58] info:    at System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests()
[03:29:58] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

Reproducible with `XUNIT_RANDOM_SEED_ORDER=1883302047`.

* Add issues for the failing tests

2 years agoFix PGO jobs on official builds (#65669)
Alexander Köplinger [Mon, 21 Feb 2022 21:02:29 +0000 (22:02 +0100)]
Fix PGO jobs on official builds (#65669)

After https://github.com/dotnet/runtime/pull/65603 the official build failed because we missed passing in the `isOfficialBuild` variable on the PGO jobs.

* Don't sign PGO bits

* Don't run upload-intermediate-artifacts-step.yml for PGO leg

2 years agoDo not number partial definitions and `ARGPLACE` nodes (#64898)
SingleAccretion [Mon, 21 Feb 2022 19:25:35 +0000 (22:25 +0300)]
Do not number partial definitions and `ARGPLACE` nodes (#64898)

* Refactor LCL_VAR/FLD numbering

Do not number "partial definitions" - it is simply wasted work.

* Don't create unnecessary unique VNs

For ARGPLACE nodes, they will be overwritten when numbering the call.
For nodes that do not produce values, they serve no purpose, and just
waste memory.

Also, delete RET_EXPR/FTN_ADDR handling. They will never appear in VN.

* Fix printing for ASG(struct, CALL)

2 years agoJIT: revise approach for x64 OSR epilogs (#65609)
Andy Ayers [Mon, 21 Feb 2022 19:08:33 +0000 (11:08 -0800)]
JIT: revise approach for x64 OSR epilogs (#65609)

Rework x64 OSR so OSR methods have standard epilogs.

Details in attached doc.

2 years agoMove more things out of Internal/Cryptography
Kevin Jones [Mon, 21 Feb 2022 18:17:32 +0000 (13:17 -0500)]
Move more things out of Internal/Cryptography

2 years agoCleanup CLRConfig (#65655)
Adeel Mujahid [Mon, 21 Feb 2022 17:01:43 +0000 (19:01 +0200)]
Cleanup CLRConfig (#65655)

* Cleanup CLRConfig

Co-authored-by: Robin Sue <robinsue@live.de>
2 years agoFix liveness for dead non-removable partial definitions (#65618)
SingleAccretion [Mon, 21 Feb 2022 16:47:16 +0000 (19:47 +0300)]
Fix liveness for dead non-removable partial definitions (#65618)

* Harmonize front-end liveness with SSA

It is the case that in our SSA model "partial defs" are considered uses.

However, liveness was not considering them as such in one particular
case: when a dead partial store wasn't removed. The consequence of this
is that SSA would miss pushing a definition for the "use" portion of the
partial def.

This change fixes that.

Notably, back-end liveness does not need to pessimize itself like that
because we don't have SSA in the backend.

* Add test

2 years agoMove iOS/tvOS simulator and Android emulator legs from runtime-staging to runtime...
Maxim Lipnin [Mon, 21 Feb 2022 16:00:48 +0000 (19:00 +0300)]
Move iOS/tvOS simulator and Android emulator legs from runtime-staging to runtime-extra-platforms pipeline (#65551)

This change is to move the Apple mobile simulator (iOS/tvOS x64, iOS arm64) and Android emulator (x86/x64) CI leg definitions, used to build the whole product using Mono and run libraries tests, from runtime-staging to runtime-extra-platforms pipeline. The iOS simulator arm64 leg will remain on rolling build until we can get significantly more devices.

2 years agoFix several casing mismatches causing failures on Unix (#65639)
Tomáš Rylek [Mon, 21 Feb 2022 14:16:42 +0000 (15:16 +0100)]
Fix several casing mismatches causing failures on Unix (#65639)

While there might be a way to make the merged test wrapper infra tolerant to these casing
mismatches, in general they amount to one-off typos and I believe they are worth fixing.

Thanks

Tomas

2 years agoAlways build ref pack even in servicing releases (#65579)
Santiago Fernandez Madero [Mon, 21 Feb 2022 12:17:41 +0000 (04:17 -0800)]
Always build ref pack even in servicing releases (#65579)

This was already done in release/6.0 branch, this is just making sure we have it in main so that in future servicing branches this is already taken care of.

2 years agoAllow to run tests for internal AzDo PRs (#65603)
Santiago Fernandez Madero [Mon, 21 Feb 2022 12:12:44 +0000 (04:12 -0800)]
Allow to run tests for internal AzDo PRs (#65603)

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

This allows to run tests when submitting PRs in AzDO.

2 years agoTreat TZCNT/POPCNT/LZCNT as never negative (#64951)
TrymPet [Mon, 21 Feb 2022 10:29:02 +0000 (11:29 +0100)]
Treat TZCNT/POPCNT/LZCNT as never negative (#64951)

2 years agoSuppress some new trimmer warnings (#65580)
Vitek Karas [Mon, 21 Feb 2022 10:28:47 +0000 (02:28 -0800)]
Suppress some new trimmer warnings (#65580)

The next update of linker will improve some data flow analysis and this uncovers more warnings in the libraries.
None of these warnings are a real problem, they're all basically inability to express the desired behavior with the current annotation system.

This change suppresses the new warnings.

2 years agoSlightly relax file pattern for copying native components (#65640)
Tomáš Rylek [Mon, 21 Feb 2022 08:41:29 +0000 (09:41 +0100)]
Slightly relax file pattern for copying native components (#65640)

Apparently not all native test components stick to the $(LibPrefix)
style; checking $(LibSuffix) should be sufficient for now.

Thanks

Tomas

2 years ago[mono][jit] Fix --break (#65467)
Vlad Brezae [Sun, 20 Feb 2022 20:03:17 +0000 (22:03 +0200)]
[mono][jit] Fix --break (#65467)

2 years agoRemove S.R.CS.Unsafe and Intrinsify Unsafe (#64861)
Wraith [Sun, 20 Feb 2022 05:50:14 +0000 (05:50 +0000)]
Remove S.R.CS.Unsafe and Intrinsify Unsafe (#64861)

* private assemblies moved from Internal to System Runtime.CompilerServices

* reformat existing unsafe vm intrinsics

* implement Copy, CopyBlock, CopyBlockUnaligned, InitBlock, InitBlockUnaligned, Unbox, Add, Subtract, SubtractByteOffset

* remove System.Runtime.CompilerServices.Unsafe il project and replace with forward only cs project

* change all ilproj references to csproj

* remove nativeaot Unsafe

* add conditional package reference for S.R.CS.Unsafe on netcoreapp 6.0

* regenerate solutions

* mono interp

* [mono][interp] Implement Copy and Unbox intrinsics

* [mono][jit] Implement Copy and Unbox intrinsics

Co-authored-by: Vlad Brezae <brezaevlad@gmail.com>
2 years agoFaster Math.Max/Min on arm64 (#65584)
Egor Bogatov [Sat, 19 Feb 2022 23:51:48 +0000 (02:51 +0300)]
Faster Math.Max/Min on arm64 (#65584)

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2 years agoPropagate native references to merged project wrapper outputs (#65592)
Tomáš Rylek [Sat, 19 Feb 2022 13:52:17 +0000 (14:52 +0100)]
Propagate native references to merged project wrapper outputs (#65592)

When building tests in merged mode, we need to copy the native
references along with the component test dlls to the output folder
to make them discoverable by the OS loader.

Thanks

Tomas

2 years agoDon't mark prefldinit4 as requiring process isolation (#65596)
Tomáš Rylek [Sat, 19 Feb 2022 13:51:29 +0000 (14:51 +0100)]
Don't mark prefldinit4 as requiring process isolation (#65596)

Turns out this particular test doesn't actually need process
isolation, I overzealously marked it as such in a previous wave
just because it's a static initialization test. This lets us
postpone dealing with out-of-process ilproj tests to a later
phase.

Thanks

Tomas

2 years agoFix HelperMethodFrame::UpdateRegDisplay on x86 (#65589)
Jan Vorlicek [Sat, 19 Feb 2022 07:20:29 +0000 (08:20 +0100)]
Fix HelperMethodFrame::UpdateRegDisplay on x86 (#65589)

While running managed debugger tests with x86 runtime debug build, I was
hiting an assert in MachineState::pRetAddress() method in a couple of
tests.
It turns out there was a bug in the HelperMethodFrame::UpdateRegDisplay
introduced about 5 years ago that only happens in DAC. The m_MachState
can be uninitialized when we enter the method and we were calling
m_MachState.pRetAddr() before performing the initialization.

This change fixes it.

2 years agoRemove ExactSpelling from GeneratedDllImport (#65343)
Jeremy Koritzinsky [Sat, 19 Feb 2022 06:51:27 +0000 (22:51 -0800)]
Remove ExactSpelling from GeneratedDllImport (#65343)

* Update conversion code fix to offer multiple fixes for appending each previously probed entry-point suffix when ExactSpelling is false.

* Remove ExactSpelling property and move properties that were relying on ExactSpelling = false to use explicit entrypoint names.

* Emit ExactSpelling = true for all of our emitted target DllImports.

* Fix a few entry points

* Add a comment around CharSet.Auto

* Update compatibility doc.

* Update docs/design/libraries/DllImportGenerator/Compatibility.md

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
2 years ago[wasm] Trigger all wasm jobs, if `eng/Version.Details.xml` has any chan… (#65451)
Ankit Jain [Sat, 19 Feb 2022 01:08:37 +0000 (20:08 -0500)]
[wasm] Trigger all wasm jobs, if `eng/Version.Details.xml` has any chan… (#65451)

* [wasm] Trigger all wasm jobs, if eng/Version.Details.xml has any changes, so we run a full check on emsdk updates

* fix yml

* Fix merge

* [wasm] Pass isRollingBuild to runtime-extra-platforms-wasm template, to correctly trigger the EAT/AOT builds

* .. and pass isWasmOnlyBuild also

2 years agoAllow Trace Samplers to Modify the Activity Trace State (#65530)
Tarek Mahmoud Sayed [Sat, 19 Feb 2022 00:46:07 +0000 (16:46 -0800)]
Allow Trace Samplers to Modify the Activity Trace State (#65530)

2 years ago[wasm] Make the sanitize pass less aggressive (#65571)
Larry Ewing [Fri, 18 Feb 2022 23:09:37 +0000 (17:09 -0600)]
[wasm] Make the sanitize pass less aggressive (#65571)

* Make the sanitize pass less aggressive

2 years agoDisable System.Diagnostics.Tests.EventLogRecordTests.ExceptionOnce on Windows Server...
Elinor Fung [Fri, 18 Feb 2022 23:06:24 +0000 (15:06 -0800)]
Disable System.Diagnostics.Tests.EventLogRecordTests.ExceptionOnce on Windows Server 2022 (#65588)

2 years ago[wasm] Implicit NodeJS version on Helix (#65514)
Marek Fišera [Fri, 18 Feb 2022 22:14:22 +0000 (23:14 +0100)]
[wasm] Implicit NodeJS version on Helix (#65514)

- Read first directory name under node instead of hardcoded version.

2 years agoImprove SuperPMI script robustness (#65586)
Bruce Forstall [Fri, 18 Feb 2022 21:33:17 +0000 (13:33 -0800)]
Improve SuperPMI script robustness (#65586)

1. Be more robust to temp directory removal failure

If we fail to remove a temporary directory, don't crash. Log the failure
and the set of directories and files still remaining, and continue.

We have seen this failure in at least one Linux x64 PMI coreclr_tests
SuperPMI collection:
```
[Errno 39] Directory not empty: '/datadisks/disk1/work/B18E0979/t/tmpov3b4_qa'
```

2. Limit the length of file names created by `make_safe_filename`. We were creating
file names out of full path names, where those paths contained long temporary directory
paths, and thus we were exceeding the maximum allowed file name component.

2 years agoClean-up slngen related logic (#65507)
Viktor Hofer [Fri, 18 Feb 2022 21:03:14 +0000 (22:03 +0100)]
Clean-up slngen related logic (#65507)

* Clean-up slngen related logic

* Update dotnet-tools.json

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoSkip RegexOptions.NonBacktracking phase 3 for some patterns (#65531)
Stephen Toub [Fri, 18 Feb 2022 20:41:08 +0000 (15:41 -0500)]
Skip RegexOptions.NonBacktracking phase 3 for some patterns (#65531)

* Skip RegexOptions.NonBacktracking phase 3 for some patterns

If a pattern doesn't have any captures and if any match of that pattern will always be the same length, we can skip the Phase 3 computation as, given the computed starting position of the match, we know exactly where it's going to end.

* Add example to the phase comments

2 years agoAllow constant propagation of Vector.Zero. (#65028)
Will Smith [Fri, 18 Feb 2022 19:51:53 +0000 (11:51 -0800)]
Allow constant propagation of Vector.Zero. (#65028)

* Initial work

* Added a comma to display

* Cleanup

* Fixing build

* More cleanup

* Update comment

* Update comment

* Added CompareEqual Vector64/128 with Zero tests

* Do not contain op1 for now

* Wrong intrinsic id used

* Removing generated tests

* Removing generated tests

* Added CompareEqual tests

* Supporting containment for first operand

* Fix test build

* Passing correct register

* Check IsVectorZero before not allocing a register

* Update comment

* Fixing test

* Minor format change

* Fixed formatting

* Renamed test

* Adding AdvSimd_Arm64 tests:

* Adding support for rest of 'cmeq' and 'fcmeq' instructions

* Removing github csproj

* Minor test fix

* Fixed tests

* Fix print

* Minor format change

* Fixing test

* Initial commit for Vector.Create to Vector.Zero normalization

* Added some emitter tests

* Feedback

* Update emitarm64.cpp

* Feedback

* Handling variations of Vector.Create

* Use Operands iterator instead of edges

* Fix condition

* Simplify

* format

* Fixed IsFloatPositiveZero

* Uncomment

* Updated tests to include Vector64.Create/Vector128.Create for ARM64

* Making implementation of IsFloatPositiveZero explicit

* Update src/coreclr/jit/gentree.cpp

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
* Feedback

* Update comment

* Update comment

* Do not perform optimization when VN CSE phase

* use ResetHWIntrinsicId

* Assert !optValnumCSE_phase

* Simplify IsVectorZero

* Simplify IsVectorZero

* Simplify some uses of Vector*_get_Zero

* Added another test

* Fixed formatting

* Revert lowering removal

* Initial work for optimizations on VectorZero value numbering

* Allowing all Vector.Zero to be constant prop'ed. Added VNFuncSimdTypeInfo.

* Update gentree.h

* Quick rename

* Removed extra variable

* Added default case

* Format

* Fixed vnDumpSimdType to take into account CorInfoType

* Fixed gtNewSimdZeroNode to produce the right Vector*_get_Zero based on simdSize

* Formatting

* Feedback and a loop test

* Added another test. Formatting fixes

* Added GetSimdBaseJitPreciseType

* Feedback

* Minor fix

* Minor comment update

* Added another comment

* Added another comment

* Added another comment

* Update comment

* Formatting

* Feedback

* Fixing build

* Feedback

* Update assertionprop.cpp

* Formatting

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
2 years agoFix Vector256.IsHardwareAccelerated in R2R binaries (#65351)
David Wrighton [Fri, 18 Feb 2022 19:35:57 +0000 (11:35 -0800)]
Fix Vector256.IsHardwareAccelerated in R2R binaries (#65351)

* Fix Vector256.IsHardwareAccelerated in R2R binaries
- If a function had a dependency on Vector256<T> but not on any Avx2 functionality then we would fail to produce an R2R image using a debug version of the compiler, and would generate an incorrect function where the result of calling Vector256.IsHardwareAccelerated would produce the wrong result.
- To fix this we now annotate the VectorXXX instruction sets so that if there is a negative depenedency on them during R2R generation, that the function is not available for use if the underlying actual instruction set is available to use at runtime.
- Adjust test Runtime_34587 to test instruction set manner in a way that allows testing crossgen2 instruction set variation
  - Move instruction set issupported checks into standalone functions to isolate the tests in the JIT/Crossgen2 compiler to better see exactly what is happening
  - Add diagnostic output to test, for better diagnosis of future failures.

2 years agoClass types with layout that inherit from System.Object should be ManagedSequential...
Jeremy Koritzinsky [Fri, 18 Feb 2022 18:05:18 +0000 (10:05 -0800)]
Class types with layout that inherit from System.Object should be ManagedSequential (#65447)

2 years agoForward DefaultDllImportSearchPathsAttribute to the inner P/Invoke. (#65458)
Jeremy Koritzinsky [Fri, 18 Feb 2022 18:04:03 +0000 (10:04 -0800)]
Forward DefaultDllImportSearchPathsAttribute to the inner P/Invoke. (#65458)

2 years agoFix missing zero-offset sequences and add checking (#64805)
SingleAccretion [Fri, 18 Feb 2022 17:51:51 +0000 (20:51 +0300)]
Fix missing zero-offset sequences and add checking (#64805)

* Add checking for zero-offset FldSeq addition

* Add a test

* Fix ADDR(LCL_VAR) Zero [FldSeq]

* Always add NotAField field sequences

* NotAField printing improvements

2 years agoFix assert (#65564)
SingleAccretion [Fri, 18 Feb 2022 17:48:22 +0000 (20:48 +0300)]
Fix assert (#65564)

We only require the "greater than" condition on x86.