platform/upstream/dotnet/runtime.git
2 years agoMerge pull request #59568 from steveharter/JsonDocumentArrayPool
Dan Moseley [Fri, 24 Sep 2021 23:46:38 +0000 (17:46 -0600)]
Merge pull request #59568 from steveharter/JsonDocumentArrayPool

[release/6.0-rc2] Fix ArrayPool leak with JsonDocument

2 years ago[release/6.0-rc2] Fix behavior ObjectCollection for single item contains (#59557)
github-actions[bot] [Fri, 24 Sep 2021 22:03:27 +0000 (15:03 -0700)]
[release/6.0-rc2] Fix behavior ObjectCollection for single item contains (#59557)

* Fix behavior ObjectCollection for single item contains

* Address PR feedback

Co-authored-by: Juan Sebastian Hoyos Ayala <juhoyosa@microsoft.com>
2 years ago[release/6.0-rc2] [wasm][debugger] Reusing buffer to avoid allocate every debugger...
github-actions[bot] [Fri, 24 Sep 2021 21:55:37 +0000 (14:55 -0700)]
[release/6.0-rc2] [wasm][debugger] Reusing buffer to avoid allocate every debugger message (#59523)

* Reusing buffer to avoid allocate every debugger message.

* Fixing what was suggested by @radical.

* cleaning code.

* Changing what was suggested by @radical

Co-authored-by: Thays <thaystg@gmail.com>
2 years agoFix krb5 library SO name in the gcc api shim (#59566)
github-actions[bot] [Fri, 24 Sep 2021 21:53:24 +0000 (14:53 -0700)]
Fix krb5 library SO name in the gcc api shim (#59566)

The library name used in the shim is a name of the build time library which
is usually installed only for development purposes. We should use
libgssapi_krb5.so.2 which is the underlying runtime library.

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
2 years ago[release/6.0-rc2] XmlSerializer support for IsDynamicCodeSupported=false (#59507)
github-actions[bot] [Fri, 24 Sep 2021 21:52:55 +0000 (14:52 -0700)]
[release/6.0-rc2] XmlSerializer support for IsDynamicCodeSupported=false (#59507)

* XmlSerializer support for IsDynamicCodeSupported=false

Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly.

These changes were ported from
* https://github.com/dotnet/runtimelab/pull/593
* https://github.com/dotnet/runtimelab/pull/600

Fix #59167

* Fix a bug in XmlSerializer.CanDeserialize when in ReflectionOnly mode.

* Port UAP code for CanDeserialize

* PR feedback

* Add a linker test to ensure linker option '--enable-opt sealer' works when IsDynamicCodeSupported==false.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years ago[release/6.0-rc2] File preallocationSize: align Windows and Unix behavior. (#59532)
David Cantú [Fri, 24 Sep 2021 21:52:17 +0000 (14:52 -0700)]
[release/6.0-rc2] File preallocationSize: align Windows and Unix behavior. (#59532)

* Align preallocationSize behavior (#58726)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* File preallocationSize: align Windows and Unix behavior. (#59338)

* File preallocationSize: align Windows and Unix behavior.

This aligns Windows and Unix behavior of preallocationSize for the
intended use-case of specifing the size of a file that will be written.

For this use-case, the expected FileAccess is Write, and the file should be
a new one (FileMode.Create*) or a truncated file (FileMode.Truncate).
Specifing a preallocationSize for other modes, or non-writable files throws ArgumentException.

The opened file will have a length of zero, and is ready to be written to by the user.

If the requested size cannot be allocated, an IOException is thrown.

When the OS/filesystem does not support pre-allocating, preallocationSize is ignored.

* fix pal_io preprocessor checks

* pal_io more fixes

* ctor_options_as.Windows.cs: fix compilation

* Update tests

* tests: use preallocationSize from all public APIs

* pal_io: add back FreeBSD, fix OSX

* tests: check allocated is zero when preallocation is not supported.

* Only throw for not enough space errors

* Fix compilation

* Add some more tests

* Fix ExtendedPathsAreSupported test

* Apply suggestions from code review

Co-authored-by: David Cantú <dacantu@microsoft.com>
* Update System.Private.CoreLib Strings.resx

* PR feedback

* Remove GetPathToNonExistingFile

* Fix compilation

* Skip checking allocated size on mobile platforms.

Co-authored-by: David Cantú <dacantu@microsoft.com>
* Fix unused fileDescriptor

* void fd when unused

* Address feedback

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Tom Deseyn <tom.deseyn@gmail.com>
2 years ago[release/6.0-rc2] Update dependencies from dotnet/emsdk (#59529)
dotnet-maestro[bot] [Fri, 24 Sep 2021 19:59:21 +0000 (12:59 -0700)]
[release/6.0-rc2] Update dependencies from dotnet/emsdk (#59529)

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

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.2.21464.1 -> To Version 6.0.0-rc.2.21473.1

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

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.2.21464.1 -> To Version 6.0.0-rc.2.21474.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20210923.5 (#59575)
dotnet-maestro[bot] [Fri, 24 Sep 2021 19:58:54 +0000 (12:58 -0700)]
Update dependencies from https://github.com/dotnet/arcade build 20210923.5 (#59575)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[release/6.0-rc2] MonoAOTCompiler: detect when nothing has changed, and skip any...
Ankit Jain [Fri, 24 Sep 2021 17:24:18 +0000 (17:24 +0000)]
[release/6.0-rc2] MonoAOTCompiler: detect when nothing has changed, and skip any precompiling (#58979)

* Refactor to allow fast-path

* implement fast-path for MonoAOTCompiler when nothing has changed

* re-enable some tests that got disabled by mistake

2 years ago[release/6.0-rc2] Check if External Object Context is still active after a possible...
github-actions[bot] [Fri, 24 Sep 2021 17:23:55 +0000 (10:23 -0700)]
[release/6.0-rc2] Check if External Object Context is still active after a possible GC (#59436)

* Check if External Object Context is still active after a possible GC

* Update interoplibinterface_comwrappers.cpp

Check if `IsActive()` during consideration too.

* Issues can occur during the multiple managed allocations.

* Add validation of non-null elements in ReleaseObjects() API call. Use detach state instead of IsActive state for EOC.

* Apply suggestions from code review

Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Review feedback

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
2 years agoFix ArrayPool leak with JsonDocument
Steve Harter [Fri, 24 Sep 2021 13:52:32 +0000 (08:52 -0500)]
Fix ArrayPool leak with JsonDocument

2 years agoMerge pull request #59553 from dotnet/backport/pr-59552-to-release/6.0-rc2
Eric StJohn [Fri, 24 Sep 2021 02:36:26 +0000 (19:36 -0700)]
Merge pull request #59553 from dotnet/backport/pr-59552-to-release/6.0-rc2

[release/6.0-rc2] Add execute bit to postinstall script

2 years agoAdd execute bit to postinstall script
Eric StJohn [Thu, 23 Sep 2021 23:45:15 +0000 (16:45 -0700)]
Add execute bit to postinstall script

2 years agoUse the dual signed wix version for workload msis (#59501)
github-actions[bot] [Thu, 23 Sep 2021 18:34:07 +0000 (11:34 -0700)]
Use the dual signed wix version for workload msis (#59501)

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years agoMerge pull request #59506 from dotnet/backport/pr-59487-to-release/6.0-rc2
Dan Moseley [Thu, 23 Sep 2021 18:07:17 +0000 (12:07 -0600)]
Merge pull request #59506 from dotnet/backport/pr-59487-to-release/6.0-rc2

[release/6.0-rc2] Fix buffering bugs in TextFieldParser

2 years agoBig-endian fixes: PDB creation by ilasm (#59484)
github-actions[bot] [Thu, 23 Sep 2021 16:45:13 +0000 (09:45 -0700)]
Big-endian fixes: PDB creation by ilasm (#59484)

* Fix byte order of debug directory fields

* Fix byte order of PDB stream data (PdbHeap::SetData)

Co-authored-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2 years agoFix buffering bugs in TextFieldParser
Stephen Toub [Wed, 22 Sep 2021 14:21:31 +0000 (10:21 -0400)]
Fix buffering bugs in TextFieldParser

Three bugs being fixed here:
1. The SlideCursorToStartOfBuffer method is incorrectly assuming that the buffer is filled to its end (that m_Buffer.Length = m_CharsRead).  As a result, two things happen.  First, we copy more data than is needed to the temporary buffer; that's just unnecessary but not harmful.  But second, when it issues a read to fill the remainder of the buffer, it does so at the wrong position, both leaving zeros in the buffer that end up getting parsed as real data and losing real data from the end.
2. IncreaseBufferSize assumes m_CharsRead = m_Buffer.Length, which may not be the case.  As with (1), this can result in it reading into the wrong part of the array and leaving garbage that gets processed.
3. IncreaseBufferSize is always increasing the buffer size, even if only a small portion of the buffer is used.  This can then result in the whole operation failing when it repeatedly increases the buffer size and ends up failing due to ticking over the max buffer threshold.

(1) doesn't exist in .NET Framework 4.8 but (2) and (3) do.  (1) is easily triggered by a stream that sporadically doesn't produce all the data requested; (2) and (3) end up needing a stream that frequently produces much less than requested.  This PR fixes all three.

2 years agoMerge pull request #59485 from ericstj/6.0-arch-install-location
Eric StJohn [Wed, 22 Sep 2021 22:18:29 +0000 (15:18 -0700)]
Merge pull request #59485 from ericstj/6.0-arch-install-location

[release/6.0-rc2] Split install_location to file-per-architecture

2 years ago[Release/6.0] Add uploading of intermediate package assets (#59291)
Anirudh Agnihotry [Wed, 22 Sep 2021 20:42:12 +0000 (13:42 -0700)]
[Release/6.0] Add uploading of intermediate package assets (#59291)

* add uploading of intermediate package assets

* dont push or sign sourcebuild packages in normal leg to avoid duplication

* add comments

2 years agoSet install_location arch specific (#59441)
Eric StJohn [Wed, 22 Sep 2021 17:03:25 +0000 (10:03 -0700)]
Set install_location arch specific (#59441)

Also don't write to paths when running translated (rosetta)

2 years agoSplit install_location to file-per-architecture (#59404)
Vitek Karas [Wed, 22 Sep 2021 17:04:00 +0000 (10:04 -0700)]
Split install_location to file-per-architecture (#59404)

On non-Windows we used install_location file with multiple lines which contained locations per-architecture (and the default).

This changes the host to use separate file for each architecture:
* `install_location_<arch>` for the architecture specific
* `install_location` for the "legacy" file

This is a much easier format for installers to handle (and it also simplifies the apphost code a little bit).

Adapted tests to the new behavior. Removed some tests which don't make sense anymore. Some small test cleanup to deduplicate code.

Changed the test-only env. variable to point to the directory with configuration files instead of to the configuration file itself.

2 years ago[release/6.0-rc2] Fix gtCloneExpr when cloning during R2R compilation a GT_ALLOCOBJ...
github-actions[bot] [Wed, 22 Sep 2021 16:46:53 +0000 (09:46 -0700)]
[release/6.0-rc2] Fix gtCloneExpr when cloning during R2R compilation a GT_ALLOCOBJ node (#59438)

* Fix gtCloneExpr when cloning during R2R compilation a GT_ALLOCOBJ node - Without this fix cloned expressions with allocations will fail - This is most common in profile guided code around devirtualization, but I believe it can occur in other where gtCloneExpr is used - Symptom of the failure is a compilation failure during crossgen2

* Jit formatting

* 6.0 branch uses FEATURE_READYTORUN_COMPILER instead of FEATURE_READYTORUN

Co-authored-by: David Wrighton <davidwr@microsoft.com>
2 years ago[release/6.0-rc2] [wasm][debugger] Fix concurrent access to cache. (#59423)
github-actions[bot] [Wed, 22 Sep 2021 16:46:34 +0000 (09:46 -0700)]
[release/6.0-rc2] [wasm][debugger] Fix concurrent access to cache. (#59423)

* Fix concurrent access to cache.

* Fixing test case.

* Changing what was suggested by @radical.

Co-authored-by: Thays <thaystg@gmail.com>
2 years ago[interp] Disable optimization if the var index is greater than G_MAXUINT16 (#59261)
github-actions[bot] [Tue, 21 Sep 2021 23:54:16 +0000 (16:54 -0700)]
[interp] Disable optimization if the var index is greater than G_MAXUINT16 (#59261)

We store the var index in the guint16 slots of the instruction

Co-authored-by: Brezae Vlad <brezaevlad@gmail.com>
2 years agoFixing memory corruption. (#59420)
github-actions[bot] [Tue, 21 Sep 2021 23:54:10 +0000 (16:54 -0700)]
Fixing memory corruption. (#59420)

Co-authored-by: Thays <thaystg@gmail.com>
2 years ago[release/6.0-rc2] Fix issues where the module index GUID table isn't properly compute...
github-actions[bot] [Tue, 21 Sep 2021 23:53:54 +0000 (16:53 -0700)]
[release/6.0-rc2] Fix issues where the module index GUID table isn't properly computed (#59377)

* Fix issues where the module index GUID table isn't properly computed - Since there are two possible places where the module indices must be up to date, ensure that they are finalized before either Node writes its data - Ensure that module indices are precomputed when needed from inlinee data

* Apparently the InstanceEntryPointTableNode also needs to materialize its signatures when an input bubble is present as well

Co-authored-by: David Wrighton <davidwr@microsoft.com>
2 years ago[release/6.0-rc2] [interp] Add wide data item index static load and stores (#59262)
github-actions[bot] [Tue, 21 Sep 2021 20:45:00 +0000 (16:45 -0400)]
[release/6.0-rc2] [interp] Add wide data item index static load and stores (#59262)

Backport of #59220

Add ldsdfld.w and stsfld.w opcodes to the interpreter. These are needed for some machine-generated methods in Android projects that use AndroidX, MAUI, SkiaSharp or other toolkits. The app's Resource::UpdateIdValues can grow to exceed 64k interpreter data items, which means that 16-bit data item indices will roll over.

Resolves https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1398069

2 years ago[release/6.0-rc2] [MonoVM] Reduce P/Invoke GC transition asserts in release builds...
github-actions[bot] [Tue, 21 Sep 2021 20:43:26 +0000 (16:43 -0400)]
[release/6.0-rc2] [MonoVM] Reduce P/Invoke GC transition asserts in release builds (#59269)

Backport of #59029

Profiling shows that large part of the GC transition overhead (~30%) in #58939 is caused by assert-style checks. Disabling them seems to be the best bang-for-the-buck option for reducing the overhead without fundamental changes to the code.

Co-authored-by: Filip Navara <navara@emclient.com>
2 years ago[release/6.0-rc2] [iOS] Make sure IPGlobalProperties and NetworkInterface.GetIsNetwor...
github-actions[bot] [Tue, 21 Sep 2021 20:42:06 +0000 (16:42 -0400)]
[release/6.0-rc2] [iOS] Make sure IPGlobalProperties and NetworkInterface.GetIsNetworkAvailable methods return the correct info (#59258)

Backport of #57096

This change makes sure some of the IPGlobalProperties stop throwing exceptions and return the correct values.

GetIPv4GlobalStatistics, GetIcmpV4Statistics, GetTcpIPv4Statistics, GetUdpIPv4Statistics no longer throw NetworkInformationException.

GetActiveTcpConnections no longer returns TcpConnectionInformation instances only with the State of Unknown.

GetActiveTcpListeners return the correct IPEndPoint details for the IPV6 loopback.

NetworkInterface.GetIsNetworkAvailable no longer returns false for every call.

The reason these methods were behaving incorrectly on iOS is due to Apple not including the public headers for icmp_var.h, ip_var.h, tcp_fsm.h, if_media.h, and udp_var.h in the iOS SDK. This would lead to, for example, pal_tcpstate.c always returning TcpState_Unknown even if the underlying native value was TCPS_ESTABLISHED. This change includes the missing public headers in our build.

Fixes #36890

2 years agoRelease 6.0 rc2 localized manifest (#59379)
William Li [Tue, 21 Sep 2021 20:21:14 +0000 (13:21 -0700)]
Release 6.0 rc2 localized manifest (#59379)

Part of https://github.com/dotnet/sdk/issues/20497

2 years agoWork around for forbidden "Roslyn4.0" in test name on Android (#59263) (#59281)
Jo Shields [Tue, 21 Sep 2021 17:58:39 +0000 (13:58 -0400)]
Work around for forbidden "Roslyn4.0" in test name on Android (#59263) (#59281)

Android apk names must be valid Java class names, and It is forbidden in Java for a class name component to have a leading numeric digit. So whilst "net.dot.foo3_1" is legal, "net.dot.foo3.1" is illegal. Use a Regex to detect and rewrite all cases of this in AndroidAppBuilder

2 years ago[release/6.0-rc2] [wasm][debugger] Reverting the old behavior of scope id numeration...
github-actions[bot] [Tue, 21 Sep 2021 17:06:23 +0000 (10:06 -0700)]
[release/6.0-rc2] [wasm][debugger] Reverting the old behavior of scope id numeration (#59372)

* Keeping the old behavior of scope id what we have before start using debugger-agent.

* Fix compilation.

* Fix compilation.

Co-authored-by: Thays <thaystg@gmail.com>
2 years agoEnable experimental nuget retry on rc2 lanes (already enabled on main) (#59360)
Larry Ewing [Tue, 21 Sep 2021 00:41:58 +0000 (19:41 -0500)]
Enable experimental nuget retry on rc2 lanes (already enabled on main) (#59360)

2 years ago[release/6.0-rc2] Generic Math Preview - Use correct NumberStyle when parsing double...
github-actions[bot] [Tue, 21 Sep 2021 00:40:41 +0000 (18:40 -0600)]
[release/6.0-rc2] Generic Math Preview - Use correct NumberStyle when parsing double and float (#59366)

* User correct NumberStyle when parsing double and float

IParseable<float> and IParseable<double> would fail when parsing
a decimal point number due to incorrect NumberStyles parameter.

E.g. IParseable<double>.TryParse would fail as opposed to
IParseable<double>.Parse because the former explicitly states to use
NumberStyles.Integer

* Adding tests covering parse for float/double/half

* Delete MSBuild_pid-37116_6904092b1c9a481da960c9e28eba2a27.failure.txt

Co-authored-by: Richard Sefr <richard.sefr@solarwinds.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2 years ago[release/6.0] x64 on ARM64 fixes (#59295)
Eric StJohn [Mon, 20 Sep 2021 20:17:54 +0000 (13:17 -0700)]
[release/6.0] x64 on ARM64 fixes (#59295)

* Retarget DOTNETHOME when installing x64 on ARM64 (#58669)

* Only set path in x64 mac installer when installing on x64 (#59210)

* Only set path in x64 mac installer when installing on x64

In other words don't set the path for x64 installer on ARM64

* Remove postinstall script from hostfxr

There should be no need for both the host and hostfxr to set the path to dotnet.

Since the host installs dotnet, it should be the only package responsible for this.

* Make postinstall set install_location on mac

Also refactor script to use a template so that we don't need to fork the script.

* fix some syntax errors in script

* Update src/installer/pkg/sfx/installers/dotnet-host.proj

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Refine uname regular expressions

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Updating dependencies from https://github.com/dotnet/arcade build 20210917.3

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years ago[release/6.0-rc2] Create and publish missing symbols (#59259)
github-actions[bot] [Mon, 20 Sep 2021 19:41:38 +0000 (12:41 -0700)]
[release/6.0-rc2] Create and publish missing symbols (#59259)

* Fix symbols for Microsoft.MonoTargets.Sdk

* Build and include .pdb file on Windows builds of mono-aot-cross

* Only TARGET_PDB_FILE on HOST_WIN32

* Another conditional

* Output directly "mono-aot-cross.exe", don't rename "mono-sgen.exe"

Co-authored-by: Jo Shields <directhex@apebox.org>
Co-authored-by: Jo Shields <joshield@microsoft.com>
2 years ago[release/6.0-rc2] Undo breaking change compat in GetMethodNativeMap (#59231)
github-actions[bot] [Mon, 20 Sep 2021 17:20:33 +0000 (10:20 -0700)]
[release/6.0-rc2] Undo breaking change compat in GetMethodNativeMap (#59231)

* Undo breaking change compat

* Fix compilation

Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
2 years ago[release/6.0-rc2] Update source-gen APIs according to review (#59243)
github-actions[bot] [Sat, 18 Sep 2021 16:12:04 +0000 (10:12 -0600)]
[release/6.0-rc2] Update source-gen APIs according to review (#59243)

* Update source-gen APIs according to review

* Rename fast-path func name and add src-gen/JsonNode interop support

* Address review feedback

* Disable src-gen tests in browser target OS

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
2 years ago[release/6.0-rc2] Implement UriCreationOptions (#59274)
github-actions[bot] [Fri, 17 Sep 2021 22:45:13 +0000 (16:45 -0600)]
[release/6.0-rc2] Implement UriCreationOptions (#59274)

* Add UriCreationOptions

Includes DangerousDisablePathAndQueryCanonicalization

* Add /// comments

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
2 years ago[release/6.0] Fix Logging Source Generator to handle file-scoped namespaces (#57894...
Maryam Ariyan [Fri, 17 Sep 2021 22:40:07 +0000 (15:40 -0700)]
[release/6.0] Fix Logging Source Generator to handle file-scoped namespaces (#57894) (#59100)

* Handle file-scoped namespaces (#57894)

Handle namespace not being emitted when file-scoped
namespaces are used for a log class.
Relates to #57880.

* Fix build issue

Co-authored-by: Martin Costello <martin@martincostello.com>
2 years agoUpdate dependencies from https://github.com/dotnet/emsdk build 20210914.1 (#59264)
dotnet-maestro[bot] [Fri, 17 Sep 2021 21:22:46 +0000 (14:22 -0700)]
Update dependencies from https://github.com/dotnet/emsdk build 20210914.1 (#59264)

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rtm.21464.2 -> To Version 6.0.0-rc.2.21464.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[release/6.0-rc2] Fix corner-case handling of cancellation exception in ForEachAsync...
github-actions[bot] [Fri, 17 Sep 2021 13:27:49 +0000 (09:27 -0400)]
[release/6.0-rc2] Fix corner-case handling of cancellation exception in ForEachAsync (#59237)

* Fix corner-case handling of cancellation exception in ForEachAsync

If code in Parallel.ForEachAsync throws OperationCanceledExceptions containing the CancellationToken passed to the iteration and that token has _not_ had cancellation requested (so why are they throwing with it) and there are no other exceptions, the ForEachAsync will effectively hang after failing to complete the task returned from it.

The issue stems from how we treat cancellation.  If the user-supplied token hasn't been canceled but we have OperationCanceledExceptions for the token passed into the iteration (the "internal" token), it can only have been canceled because an exception occurred.  We filter out these cancellation exceptions, leaving just the exceptions that are deemed to have caused the failure in the first place.  But the code doesn't currently account for the possibility that the developer is (arguably erroneously) throwing such an OperationCanceledException with the internal cancellation token as that root failure. The fix is to only filter out these OCEs if there are other exceptions besides them.

* Stop filtering out cancellation exceptions in Parallel.ForEachAsync

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoDo not use copy-on-write on windows (#59194)
github-actions[bot] [Fri, 17 Sep 2021 12:55:06 +0000 (06:55 -0600)]
Do not use copy-on-write on windows (#59194)

Co-authored-by: vsadov <8218165+VSadov@users.noreply.github.com>
2 years agoBump intellisense version to RC1 (main) (#59115) (#59223)
Carlos Sanchez [Fri, 17 Sep 2021 12:45:51 +0000 (05:45 -0700)]
Bump intellisense version to RC1 (main) (#59115) (#59223)

* Bump intellisense version to RC1

* Use package pushed to correct feed (dotnet6-transport)

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoRequire UTF8 encoding in GetX509NameInfo. (#59172)
github-actions[bot] [Fri, 17 Sep 2021 02:18:49 +0000 (20:18 -0600)]
Require UTF8 encoding in GetX509NameInfo. (#59172)

Co-authored-by: Kevin Jones <kevin@vcsjones.com>
2 years ago[release/6.0] Emit diagnostics & exceptions for sourcegen handling init-only properti...
github-actions[bot] [Wed, 15 Sep 2021 22:03:50 +0000 (15:03 -0700)]
[release/6.0] Emit diagnostics & exceptions for sourcegen handling init-only properties & JsonInclude attributes (#59097)

* Emit diagnostic warnings and exceptions when sourcegen is handling init-only inaccessible JsonInclude properties.

* add localizations for runtime exception messages

* remove exception messages from resource strings

* fix alphabetical ordering

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2 years agoSet the publishing infra version to 3 (#59166)
Matt Mitchell [Wed, 15 Sep 2021 21:53:54 +0000 (14:53 -0700)]
Set the publishing infra version to 3 (#59166)

Before this was not important because runtime was calling its own publishing tasks with the property explicitly set, but since the introduction of arcade powered source build this property is needed to avoid ArPow from defaulting to v2.

2 years agoAdd SetLastError to GdiPlus methods (#59151)
github-actions[bot] [Wed, 15 Sep 2021 18:05:47 +0000 (11:05 -0700)]
Add SetLastError to GdiPlus methods (#59151)

System.Drawing uses the last Win32 error in CheckErrorStatus to try to
guess at why a GdiPlus draw method failed and ignore some failures.

This was broken in .NETCore when SetLastError was removed from PINvokes.

Bring back SetLastError for all PInvokes that use CheckErrorStatus.

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
2 years agoDon't force using the system libunwind for source-build (#58911)
Omair Majid [Wed, 15 Sep 2021 18:05:20 +0000 (14:05 -0400)]
Don't force using the system libunwind for source-build (#58911)

Instead, use the runtime's normal detection logic to decide what to do.

Backport of https://github.com/dotnet/runtime/pull/58641 to release/6.0.

See: https://github.com/dotnet/source-build/issues/2408

2 years ago[release/6.0] fix TLS 1.3 in WinHttpHandler (#59159)
github-actions[bot] [Wed, 15 Sep 2021 18:03:59 +0000 (11:03 -0700)]
[release/6.0] fix TLS 1.3 in WinHttpHandler (#59159)

* add W11 test queue

* move to release config

* move to x66

* fix tls13 detection

* disable failing EventLog tests

* Remove WIndows 11 from CI matrix

Co-authored-by: wfurt <tweinfurt@yahoo.com>
Co-authored-by: Jan Jahoda <jajahoda@microsoft.com>
2 years ago[release/6.0] fix SendAsync from impersonificated context with default credentials...
github-actions[bot] [Wed, 15 Sep 2021 17:45:55 +0000 (10:45 -0700)]
[release/6.0]  fix SendAsync from impersonificated context with default credentials (#59155)

* fix SendAsync from inpersonificated context and default credentials

* add missing file

* remove dead code

* feedback from review

* name cleanup

Co-authored-by: wfurt <tweinfurt@yahoo.com>
2 years agoAvoid unnecessary deps in M.E.Logging.Abstractions (#59162)
Viktor Hofer [Wed, 15 Sep 2021 17:26:08 +0000 (19:26 +0200)]
Avoid unnecessary deps in M.E.Logging.Abstractions (#59162)

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

The System.Buffers and System.Memory packages are
dependencies of the net6.0 M.E.Logging.Abstractions
library even though these libraries are part of the
.NETCoreApp shared framework.

It's undesirable to have the dependencies in the graph
as these aren't built live anymore and are only serviced
on demand.

2 years agoMulti-target Json and Logger Source Generators between Roslyn v3.11 and v4.0 (#58446...
Eric Erhardt [Wed, 15 Sep 2021 14:20:07 +0000 (08:20 -0600)]
Multi-target Json and Logger Source Generators between Roslyn v3.11 and v4.0 (#58446) (#59074)

* Multi-target LoggerMessageGenerator between Roslyn v3.11 and v4.0

* Include a .targets file in NuGet packages which will select the correct analyzer assembly depending on which Roslyn version will be used to compile.

* Multi-target JsonSourceGenerator between Roslyn v3.11 and v4.0

* Fix restore

* Update NuGet package MSBuild logic to detect when SupportsRoslynComponentVersioning is not available, and use the lowest analyzer available.

* Handle non-SDK projects by running after ResolveNuGetPackageAssets

* Respond to PR feedback

- Name .cs and .csproj files with Roslyn in the name
- Upgrade to Roslyn 3.11 so IsExplicitlyNamedTupleElement API is available
- Fix some references to the test projects
- Fix incremental pack of the analyzer targets

2 years agoHarden native gate thread against affinity mask growth (#59132)
Koundinya Veluri [Wed, 15 Sep 2021 14:08:56 +0000 (07:08 -0700)]
Harden native gate thread against affinity mask growth (#59132)

Hardened ThreadpoolMgr::GateThreadStart against the possibility that the observed group-local affinity mask contains set bits at positions higher than the total group-local CPU count that was captured during earlier initialization.

This fixes customer-reported crashes which have occurred on multi-group machines with heterogenous CPU counts across groups (but the same crash can probably also occur on single-group VMs if CPUs are hot-added and are then manually added to the process affinity mask).

2 years ago[release/6.0] [mono] Update attribute name used for controlling frame pointer elimina...
github-actions[bot] [Wed, 15 Sep 2021 13:23:31 +0000 (15:23 +0200)]
[release/6.0] [mono] Update attribute name used for controlling frame pointer elimination (#59091)

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
2 years ago[release/6.0] WasmAppBuilder: publish only once per target framework instead of invok...
Ankit Jain [Wed, 15 Sep 2021 13:21:47 +0000 (13:21 +0000)]
[release/6.0] WasmAppBuilder: publish only once per target framework instead of invoking publish explicitly. (#59136)

2 years ago[release/6.0][wasm] Add support for native relinking after Build, and AOT after publi...
Ankit Jain [Wed, 15 Sep 2021 13:16:48 +0000 (13:16 +0000)]
[release/6.0][wasm] Add support for native relinking after Build, and AOT after publish (#58913)

2 years ago[release/6.0] Update dependencies from dotnet/emsdk dotnet/arcade (#59081)
dotnet-maestro[bot] [Wed, 15 Sep 2021 13:16:06 +0000 (15:16 +0200)]
[release/6.0] Update dependencies from dotnet/emsdk dotnet/arcade (#59081)

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

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

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

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.2.21451.1 -> To Version 6.0.0-rtm.21464.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[Tell-mode][release/6.0] Use arcade power source build infra (#59108)
github-actions[bot] [Wed, 15 Sep 2021 09:03:23 +0000 (02:03 -0700)]
[Tell-mode][release/6.0] Use arcade power source build infra  (#59108)

* add yml files

* add file version and condition package reference on source build

* to avoid copying the file from the cache

Co-authored-by: Anirudh Agnihotry <anagniho@microsoft.com>
2 years ago[release/6.0] Use caching ConsoleStream for both iOS and Android (#59088)
github-actions[bot] [Wed, 15 Sep 2021 06:29:51 +0000 (08:29 +0200)]
[release/6.0] Use caching ConsoleStream for both iOS and Android (#59088)

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years ago[release/6.0] [mono] Use SROA-friendly struct type declarations (#59060)
imhameed [Wed, 15 Sep 2021 06:12:27 +0000 (02:12 -0400)]
[release/6.0] [mono] Use SROA-friendly struct type declarations (#59060)

2 years agoRemove SupportedOSPlatforms windows on Hosting WindowsServices (#59064)
github-actions[bot] [Wed, 15 Sep 2021 02:27:03 +0000 (20:27 -0600)]
Remove SupportedOSPlatforms windows on Hosting WindowsServices (#59064)

Fix #59037

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years ago[release/6.0] Increment source generator assembly versions with every build (#58919)
github-actions[bot] [Wed, 15 Sep 2021 00:33:02 +0000 (17:33 -0700)]
[release/6.0] Increment source generator assembly versions with every build (#58919)

* increment source generator assembly versions with every build

* use isGenerator Project property

* add comment

* Replacement tokens in logging test baseline files (#58220)

* Replacement tokens in logging test baseline files

Instead of using a hardcoded version of the assembly version
on the logging generated baseline files used by tests we use
replacement tokens and at runtime we replace them.

fixes #58175

Co-authored-by: Anirudh Agnihotry <anagniho@microsoft.com>
Co-authored-by: Allan Targino <13934447+allantargino@users.noreply.github.com>
2 years ago[release/6.0] Remove benign assert (#59044)
github-actions[bot] [Tue, 14 Sep 2021 23:32:23 +0000 (16:32 -0700)]
[release/6.0] Remove benign assert (#59044)

* Remove benign assert

It is perfectly possible for us to replace a promoted struct by its only
field where that field is marked do-not-enregister. Since this path does
handle the proper retyping when normalization is required this assertion
is benign.

Fix #58972

* Fix test

Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>
2 years agoFix sample profiler resolution on Windows. (#59056)
github-actions[bot] [Tue, 14 Sep 2021 22:21:17 +0000 (15:21 -0700)]
Fix sample profiler resolution on Windows. (#59056)

If sample profiler was initially created before sampling has been
enabled, happens when setting up sessions during startup,
sample_profiler_load_dependecies won't get called, meaning we won't
setup timeBeginPeriod/timeEndPeriod on Windows, and won't adjust
default scheduling resolution to 1ms staying on default 16ms.

There is a ref count check in current sample_profiler_enable checking
if we should call sample_profiler_load_dependecies (_ref_count == 0),
but in case where we can't start profiling _can_start_sampling == false,
we won't call sample_profiler_enable but always increase _ref_count
that in turn will prevent calls to sample_profiler_load_dependecies when
enabling sample profiler and that in turn won't call timeBeginPeriod
staying on default scheduling resolution.

Fix is to always call sample_profiler_load_dependecies making sure we
will setup needed dependencies when _ref_count == 0.

Co-authored-by: lateralusX <lateralusx.github@gmail.com>
2 years ago[release/6.0] Support JsonExtensionData in STJ source-gen (#59047)
github-actions[bot] [Tue, 14 Sep 2021 16:26:29 +0000 (10:26 -0600)]
[release/6.0] Support JsonExtensionData in STJ source-gen (#59047)

* Support JsonExtensionData in STJ source-gen

* Address review feedback

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
2 years ago[release/6.0] Change PKCS12 password to assist with credscan (#59080)
github-actions[bot] [Tue, 14 Sep 2021 16:03:43 +0000 (10:03 -0600)]
[release/6.0] Change PKCS12 password to assist with credscan (#59080)

* Change PKCS12 password to assist with credscan

* Use placeholder for password

Co-authored-by: Kevin Jones <kevin@vcsjones.com>
2 years ago[wasm] Fix circular dependency in WasmAppBuilder (#58905)
github-actions[bot] [Tue, 14 Sep 2021 07:49:59 +0000 (09:49 +0200)]
[wasm] Fix circular dependency in WasmAppBuilder (#58905)

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

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years ago[release/6.0] [wasm][debugger] Fix pause on exception behavior (#58895)
github-actions[bot] [Tue, 14 Sep 2021 07:48:34 +0000 (09:48 +0200)]
[release/6.0] [wasm][debugger] Fix pause on exception behavior (#58895)

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Thays <thaystg@gmail.com>
2 years ago[release/6.0] [tvOS] Be less eager in creating the non-existent special folders ...
github-actions[bot] [Tue, 14 Sep 2021 07:48:00 +0000 (09:48 +0200)]
[release/6.0] [tvOS] Be less eager in creating the non-existent special folders (#59024)

Co-authored-by: Filip Navara <navara@emclient.com>
2 years ago[release/6.0] Set generic type arguments nullability for value types (#58390)
github-actions[bot] [Tue, 14 Sep 2021 06:52:58 +0000 (23:52 -0700)]
[release/6.0] Set generic type arguments nullability for value types (#58390)

* Set generic type arguments nullability for value types

* Skip test on mono

* Apply commment

* Separate var name parts with _

* Reflection nullability API: improve test coverage, fix bug found (#58479)

* Add/remove some tests, fix generics indexing bug

Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
2 years agoFix variables names in perf automation (#59046)
Bill Wert [Mon, 13 Sep 2021 23:32:33 +0000 (16:32 -0700)]
Fix variables names in perf automation (#59046)

2 years ago[release/6.0] [wasm][debugger] Clear cache after don't stop in a conditional breakpoi...
github-actions[bot] [Mon, 13 Sep 2021 17:35:30 +0000 (13:35 -0400)]
[release/6.0] [wasm][debugger] Clear cache after don't stop in a conditional breakpoint (#58910)

Backport of #58908 to release/6.0

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1390250?src=WorkItemMention&src-action=artifact_link

2 years ago[release/6.0] Throw on unsupported types in src gen (#58983)
github-actions[bot] [Mon, 13 Sep 2021 17:27:16 +0000 (11:27 -0600)]
[release/6.0] Throw on unsupported types in src gen (#58983)

* Throw on unsupported types in src gen

* Misc non-functional changes and feedback

* Fix typo

* Change disallowed terminology to unsupported

Co-authored-by: Steve Harter <steveharter@users.noreply.github.com>
2 years agoDeadlock during rundown using interpreter. (#59023)
github-actions[bot] [Mon, 13 Sep 2021 16:52:13 +0000 (09:52 -0700)]
Deadlock during rundown using interpreter. (#59023)

Identified deadlock between finalizer thread and rundown enumerating
all interpreter method. Since rundown will query for method name
in callback when iterating interpreter methods, interp_jit_info_foreach,
that might lead to additional loader activity. The hash map in
interpreter keeping the methods is locked with default JIT memory manager,
but since the callback might end up in mono_class_create_from_typedef
that will take loader lock, we get the following lock order on that
code path, memory manager->loader lock. Finalizer thread invokes
OnThreadExiting using interpreter and that might end up with a reverse
lock order, loader lock->memory manager on that code path, so these
two have a potential to deadlock. This is not a problem under JIT
or AOT since the JIT hash table is lock free therefore not causing
any deadlocks due to lock order between memory manager and loader lock.

Could be fixed by changing into a lock free hash table in interpreters
for interp_code_hash might be to risky at this point. A more safe fix
is to take a copy of the pointers while holding lock and then iterate
using local copy (simple array of pointers). Since this method is
only called during rundown, only when using interpreter, and only
include the pointers (InterpMethod *) we use with the callback,
it will have some temporary memory impact (allocating an array
of pointers), but will mitigate the deadlock since we can safely
call iterator callback without holding the lock. It will also
improve interpreter performance in situations where we run session
rundown, since lock will be held a much shorter amount of time.

Co-authored-by: lateralusX <lateralusx.github@gmail.com>
2 years ago[release/6.0] [mini] Use alloca for runtime_invoke retval buffer (#59006)
github-actions[bot] [Mon, 13 Sep 2021 16:52:00 +0000 (09:52 -0700)]
[release/6.0] [mini] Use alloca for runtime_invoke retval buffer (#59006)

* [mini] Use alloca for runtime_invoke retval buffer

Fixes https://github.com/dotnet/runtime/issues/58957
Related to https://github.com/dotnet/runtime/pull/58215 which was attempting to
fix https://github.com/dotnet/runtime/issues/58190

* Set initial return buffer size to TARGET_SIZEOF_VOID_P

In the common case we use the return buffer just to hold a pointer to
the return value

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
Co-authored-by: Aleksey Kliger <aleksey@lambdageek.org>
2 years agoAddress Windows recommendations for Link APIs (#58592) (#58926)
David Cantú [Mon, 13 Sep 2021 16:44:10 +0000 (09:44 -0700)]
Address Windows recommendations for Link APIs  (#58592) (#58926)

* NT prefix shall not be treated as a relative path

* Remove file-folder-match validation

* Use SubstituteName instead of PrintName since the latter is just for display and can be misleading

* Fix MS.IO.Redist

* Fix whitespace in Strings.resx

* Address suggestions

2 years ago[release/6.0] [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory (...
github-actions[bot] [Mon, 13 Sep 2021 16:43:51 +0000 (09:43 -0700)]
[release/6.0] [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory (#58917)

* [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory

Reference the same versions of System.Threding.Tasks.Extensions and
System.Text.Json that MSBuild in Visual Studio 2022 uses.

Fixes build errors on maui-ios (and possibly blazorwasm) targets on Windows
like:

```
System.MissingMethodException: Method not found: 'System.Threading.Tasks.ValueTask`1<!!0> System.Text.Json.JsonSerializer.DeserializeAsync(System.IO.Stream, System.Text.Json.JsonSerializerOptions, System.Threading.CancellationToken)'.
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.<GetJsonAsync>d__24.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.GetJsonAsync(String jsonFilePath, FileStream file)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.TryGetJson(String jsonFilePath, JsonModelRoot& json)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at
   Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
```

from `C:\Program
Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk\6.0.0-rc.1.21451.13\Sdk\RuntimeComponentManifest.targets`

* assembly version is 4.2.0.1, but nuget version is 4.5.4, apparently

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
2 years ago[release/6.0] Skip test suites crashing on CI for iOS/tvOS/MacCatalyst and test fixes...
Mitchell Hwang [Mon, 13 Sep 2021 14:46:42 +0000 (10:46 -0400)]
[release/6.0] Skip test suites crashing on CI for iOS/tvOS/MacCatalyst and test fixes for Android (#58841)

Manual backport of #57208, #58519, #58562, #58210, #57732, #58428, #58586, #58745, #57687 to release/6.0

Numerous test suites have been failing for iOS/tvOS/MacCatalyst consistently on CI without useful logs as to why. Moreover, some of these suites pass locally.

This PR looks to reduce the failures on CI by skipping the problematic suites
Skips test suites logged in #53624

ActiveIssues
#58440
#58418
#58367
#58584

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Jo Shields <directhex@apebox.org>
2 years agoFix SIMD temp register interference (#58990)
github-actions[bot] [Mon, 13 Sep 2021 14:41:06 +0000 (07:41 -0700)]
Fix SIMD temp register interference (#58990)

On Windows/x86, if a call returns a SIMD8 in two registers
(eax, edx), and needs to be assembled and stored into a single
SIMD register, AND we don't have the SSE41 ABI available (because
the hardware doesn't support it, or we specifically disable it),
then we need a temporary register. In the failure case, the target
register and temporary register were the same, and then interfered
with each other. The fix is to force the temporary register to
be different from the target register.

Fixes #58899

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
2 years agoUpdate dependencies from https://github.com/dotnet/runtime-assets build 20210910...
dotnet-maestro[bot] [Sat, 11 Sep 2021 10:12:26 +0000 (12:12 +0200)]
Update dependencies from https://github.com/dotnet/runtime-assets build 20210910.2 (#58936)

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21457.5 -> To Version 6.0.0-beta.21460.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 agoAdd crossgen2 runs for x86 (#58053) (#58892)
Alicia Li [Fri, 10 Sep 2021 20:54:44 +0000 (13:54 -0700)]
Add crossgen2 runs for x86 (#58053) (#58892)

* Add crossgen2 runs for x86 and Arm64

* Remove Arm64 for now

Co-authored-by: Drew Scoggins <anscoggi@microsoft.com>
2 years ago[release/6.0] Use separate VNs for DBL2INT_OVF helpers (#58931)
github-actions[bot] [Fri, 10 Sep 2021 18:09:33 +0000 (11:09 -0700)]
[release/6.0] Use separate VNs for DBL2INT_OVF helpers (#58931)

* Use separate VNs for DBL2INT_OVF helpers

* Update Runtime_58832.cs

Co-authored-by: EgorBo <egorbo@gmail.com>
2 years ago[release/6.0] Consider finally that jumps to itself as non-empty (#58881)
github-actions[bot] [Fri, 10 Sep 2021 18:08:53 +0000 (11:08 -0700)]
[release/6.0] Consider finally that jumps to itself as non-empty (#58881)

* decrement the reference of unreachable finally

* Proper fix

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
2 years ago[release/6.0] Add cast when replacing promoted struct with field in lowering (#58951)
github-actions[bot] [Fri, 10 Sep 2021 18:07:30 +0000 (11:07 -0700)]
[release/6.0] Add cast when replacing promoted struct with field in lowering (#58951)

* Add cast when replacing promoted struct with field in lowering

We may need to sign/zero-extend when we do this replacement very late.
Normally this cast would be inserted in morph.

Fix #58373

* Add test

* Fix formatting

* Fix test cases

* Type returned-struct-as-primitive correctly for normalization

Retyping it to the type of the ret node is not right when reinterpreting
small structs as a type that needs to be normalized.

* Fix assertion

* Run jit-format

Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>
2 years agoUpdate dependencies from https://github.com/mono/linker build 20210909.1 (#58888)
dotnet-maestro[bot] [Fri, 10 Sep 2021 16:02:51 +0000 (18:02 +0200)]
Update dependencies from https://github.com/mono/linker build 20210909.1 (#58888)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoReport correct DLL name when P/Invoke lookup fails (#58863)
github-actions[bot] [Fri, 10 Sep 2021 16:01:39 +0000 (18:01 +0200)]
Report correct DLL name when P/Invoke lookup fails (#58863)

Without this PR when a P/Invoke lookup fails we'll return an exception message that refers to `libcoreclr` instead of the real native library name since we have logic to retry the lookup using libcoreclr. This is very confusing for customers as can be seen in https://github.com/dotnet/runtime/issues/58185.

Co-authored-by: Filip Navara <navara@emclient.com>
2 years ago[release/6.0] Fix an issue with ILStripping mscorlib.dll (#58935)
Alexander Köplinger [Fri, 10 Sep 2021 15:36:11 +0000 (17:36 +0200)]
[release/6.0] Fix an issue with ILStripping mscorlib.dll (#58935)

We considered mscorlib.dll as the "core" assembly instead of System.Private.CoreLib.dll which meant Cecil hit an issue while resolving types in it.
This only happened when the IL Linker was not being used since it'd have removed the mscorlib.dll facade.

Brings in https://github.com/dotnet/runtime-assets/pull/176

2 years agoAdd info about .NET 6 compatibility with Intel CET shadow stacks and how to try it...
Koundinya Veluri [Fri, 10 Sep 2021 13:44:15 +0000 (06:44 -0700)]
Add info about .NET 6 compatibility with Intel CET shadow stacks and how to try it (#58891)

2 years ago[release/6.0] Fix publishing symbols for `dotnet` and `hostpolicy` (#58902)
github-actions[bot] [Fri, 10 Sep 2021 13:42:20 +0000 (06:42 -0700)]
[release/6.0] Fix publishing symbols for `dotnet` and `hostpolicy` (#58902)

* Fix symbol package output path for host pkgproj

* Update src/installer/pkg/projects/Directory.Build.targets

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoEnhance CrossGen2 to emit PerfMap debug directory entry (#58929)
Juan Hoyos [Fri, 10 Sep 2021 13:40:17 +0000 (06:40 -0700)]
Enhance CrossGen2 to emit PerfMap debug directory entry (#58929)

This is used to correlate PE's with their corresponding PerfMaps. For example the header in the perfmap could be:
```
FFFFFFFF 00 026D4D21B3EE3D93843FF7A964235822
FFFFFFFE 00 1
FFFFFFFD 00 1
FFFFFFFC 00 3
FFFFFFFB 00 1
```
And the PE will have the corresponding entries in the PE as:
```
PerfMap (Type 21):
        System.Private.CoreLib.ni.r2rmap, Signature = 026d4d21b3ee3d93843ff7a964235822, Version = 1
```

2 years agoIgnore the DuplicateExtension status from macOS 12. (#58889)
github-actions[bot] [Fri, 10 Sep 2021 04:01:15 +0000 (22:01 -0600)]
Ignore the DuplicateExtension status from macOS 12. (#58889)

MacOS 12 introduces a new X.509 chain status, DuplicateExtension. As we do not report this in Windows and nor do we have a flag to map it to, we ignore it from macOS.

Co-authored-by: Kevin Jones <kevin@vcsjones.com>
2 years ago[release/6.0] Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled...
github-actions[bot] [Thu, 9 Sep 2021 18:18:26 +0000 (11:18 -0700)]
[release/6.0] Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled (#58850)

* Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled

The NI_Vector256_GetElement intrinsic, in some situations, requires
a stack temporary. With AVX2 disabled, this temporary was getting
allocated as a TYP_SIMD16 instead of a TYP_SIMD32, leading to overwriting
the local variable.

Add a type argument to the temp variable allocation, and allocate the
temp as the largest sized type required by any use.

Fixes #58295

* Code review change: improve arm64 SIMD temp creation type

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
2 years agoAdd linker flags to add fixup data to PDBs (#58417)
Andy Gocke [Thu, 9 Sep 2021 17:50:27 +0000 (10:50 -0700)]
Add linker flags to add fixup data to PDBs (#58417)

Fixup data can assist native debugging tools in providing more accurate data

2 years agoPort fixes for perf pipeline from main branch (#58843)
Alicia Li [Thu, 9 Sep 2021 16:34:21 +0000 (09:34 -0700)]
Port fixes for perf pipeline from main branch (#58843)

* fix merge conflict

* Fix ios build (#57776)

* add deployandrun to ios

* build with DEPLOY_AND_RUN=false for ios

Co-authored-by: Bill Wert <billwert@microsoft.com>
2 years ago[release/6.0] Fix Windows 8 detection in Pbkdf2 (#58823)
github-actions[bot] [Thu, 9 Sep 2021 15:00:11 +0000 (09:00 -0600)]
[release/6.0] Fix Windows 8 detection in Pbkdf2 (#58823)

* Fix Windows 8 detection.

Windows 8's actual version is 6.2, not 8. The test would succeed only on Windows 10+.

* Explain that Windows 8's version is 6.2.

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Theodore Tsirpanis <12659251+teo-tsirpanis@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
2 years ago[release/6.0] Add explicit APIs to Double/Single/Half/TimeOnly (#58845)
github-actions[bot] [Thu, 9 Sep 2021 14:58:51 +0000 (08:58 -0600)]
[release/6.0] Add explicit APIs to Double/Single/Half/TimeOnly (#58845)

* Add explicit APIs to Double/Single/Half/TimeOnly

* sq

* Fix get accessor in ref

Co-authored-by: Prashanth Govindarajan <prgovi@microsoft.com>
2 years agoUse non-deprecated Android Helix queue (#58862)
github-actions[bot] [Thu, 9 Sep 2021 13:13:38 +0000 (15:13 +0200)]
Use non-deprecated Android Helix queue (#58862)

Ubuntu.1804.Amd64.Android.Open was redirected to Ubuntu.1804.Amd64.Android.29.Open, use that in the .yml

Fixes https://github.com/dotnet/core-eng/issues/13179

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years ago[release/6.0] Support duplicated type names with src gen (#58766)
github-actions[bot] [Wed, 8 Sep 2021 21:18:53 +0000 (15:18 -0600)]
[release/6.0] Support duplicated type names with src gen (#58766)

* Support duplicated type names with src gen

* Move helpers to common location

Co-authored-by: Steve Harter <steveharter@users.noreply.github.com>
2 years agoUpdate dependencies from https://github.com/dotnet/runtime-assets build 20210907...
dotnet-maestro[bot] [Wed, 8 Sep 2021 17:39:49 +0000 (10:39 -0700)]
Update dependencies from https://github.com/dotnet/runtime-assets build 20210907.5 (#58797)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>