platform/upstream/dotnet/runtime.git
3 years agoDon't use interfaces for sharing Tuple implementation methods (#44684)
Marek Safar [Tue, 17 Nov 2020 12:06:08 +0000 (13:06 +0100)]
Don't use interfaces for sharing Tuple implementation methods (#44684)

3 years agoAvoid string/StringBuilder/char[] allocation in LogValuesFormatter's ctor (#44746)
Stephen Toub [Tue, 17 Nov 2020 10:33:54 +0000 (05:33 -0500)]
Avoid string/StringBuilder/char[] allocation in LogValuesFormatter's ctor (#44746)

This is producing thousands of allocations at ASP.NET startup, due to almost 1000 call sites to LoggerMessage.Define.

3 years agoAdjust Mono EventPipe/DiagnosticServer C library to better support CoreCLR shim....
Johan Lorensson [Tue, 17 Nov 2020 08:24:39 +0000 (09:24 +0100)]
Adjust Mono EventPipe/DiagnosticServer C library to better support CoreCLR shim. (#44527)

* Adjust EventPipe/DiagnosticServer C library to support CoreCLR shim.

Adjustments done to better align with implementation of CoreCLR shim
using CoreCLR artifacts and C++ code (CoreCLR implementation done in
separate PR).

Disconnect runtime specific shim info from shared sources, all included
shim files handled through defines.

Exception safety and improved error handling, adding error checking
and error returns into shim container functions.

Walkthrough of codebase, aligning with gaps from CoreCLR + port of
sample profiler and json file serializer.

Implement core dump diagnostic command and runtime layer (needed by CoreCLR,
currently not implemented on Mono).

Implemented process env diagnostic command and runtime layer.

Implemented profiler attach diagnostic command and runtime layer (needed by
CoreCLR, currently not implemented on Mono).

Fix native EventPipe test aligning with changes.

* Fix build errors.

* Review feedback.

3 years agoRemove use of Tuple<> from corelib (#44706)
Stephen Toub [Tue, 17 Nov 2020 07:23:52 +0000 (02:23 -0500)]
Remove use of Tuple<> from corelib (#44706)

3 years agoRemove ALT_JIT define and replace with runtime logic (#44565)
David Wrighton [Tue, 17 Nov 2020 07:21:59 +0000 (23:21 -0800)]
Remove ALT_JIT define and replace with runtime logic (#44565)

* Remove ALT_JIT define and replace with runtime logic

* Fix SuperPMI for new altjit jit flag

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
3 years agoReplace Tuples with ValueTuples (#44712)
Stephen Toub [Tue, 17 Nov 2020 06:28:01 +0000 (01:28 -0500)]
Replace Tuples with ValueTuples (#44712)

Some help to remove allocation, some just help to avoid pulling in Tuple and likely increasing build size.

* Update src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoSpecial-case zero parameters in GetParameters (#44759)
Stephen Toub [Tue, 17 Nov 2020 06:25:50 +0000 (01:25 -0500)]
Special-case zero parameters in GetParameters (#44759)

3 years agoDrop ReadOnlyCollection dependency from TaskExceptionHolder (#44757)
Marek Safar [Tue, 17 Nov 2020 06:22:47 +0000 (07:22 +0100)]
Drop ReadOnlyCollection dependency from TaskExceptionHolder (#44757)

it's used only to copy data aroud locally

3 years agoRemove unnecessary closure / delegate allocation from CallSiteFactory.GetCallSite...
Stephen Toub [Tue, 17 Nov 2020 06:21:12 +0000 (01:21 -0500)]
Remove unnecessary closure / delegate allocation from CallSiteFactory.GetCallSite (#44755)

Nothing is ever removed from the cache, and CreateCallSite is already storing the newly created ServiceCallSite into the dictionary, so GetOrAdd isn't providing any meaningful value: we can simply TryGetValue and then call CreateCallSite if it fails.

3 years agoAvoid MediaTypeHeaderValue.ToString allocation when no parameters (#44750)
Stephen Toub [Tue, 17 Nov 2020 06:19:55 +0000 (01:19 -0500)]
Avoid MediaTypeHeaderValue.ToString allocation when no parameters (#44750)

3 years agoHarmonize pointer type handling (#44465)
Michal Strehovský [Tue, 17 Nov 2020 06:06:29 +0000 (07:06 +0100)]
Harmonize pointer type handling (#44465)

* CoreCLR treats pointer types as UIntPtr in a couple places.

* Regression test

3 years agoarm64 osx: support byte sizes from lowering to codegen. (#43024)
Sergey Andreenko [Tue, 17 Nov 2020 05:38:53 +0000 (19:38 -1000)]
arm64 osx: support byte sizes from lowering to codegen. (#43024)

* arm64 osx: support byte sizes from lowering to codegen.

* a better message about GT_PUTARG_SPLIT.

* Fix arm

* Response review.

* format GenTreePutArgStk(genTreeOps.

* response Egor's review.

3 years agoMake DirectoryInfoWrapper better handle missing directories (#44671)
Eric StJohn [Tue, 17 Nov 2020 05:38:38 +0000 (21:38 -0800)]
Make DirectoryInfoWrapper better handle missing directories (#44671)

EnumerateFileSystemInfos tries to noop when root directory does not exist
but the directory might be deleted between the time it checks Exists and
begins enumerating.  The value for Exists might also be stale as it is cached.

3 years agoSystem.Memory.Data (#44633)
Eric StJohn [Tue, 17 Nov 2020 04:50:13 +0000 (20:50 -0800)]
System.Memory.Data (#44633)

* Add BinaryData

Ported from https://github.com/Azure/azure-sdk-for-net/commit/995a13b14c5f635b293c117bfb657d9532b2a202

* Make System.Memory.Data build and fix tests

* Simplify type default

* Respond to feedback

* Use common ReadOnlyMemoryStream

Make common ReadOnlyMemoryStream support compiling for NETFramework and
NETStandard2.0, and add ObjectDisposedException checking.

* Add tests cases for null objects/types

* Fix System.Text.Json reference

* Simplify ReadOnlyMemoryStream.Dispose

* Throw on Disposed for more cases in ReadOnlyMemoryStream

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
3 years agoMake System.Guid readonly (#44629)
Levi Broderick [Tue, 17 Nov 2020 04:36:08 +0000 (20:36 -0800)]
Make System.Guid readonly (#44629)

3 years agoFix RCS1036: Remove redundant empty line (#44631)
xtqqczze [Tue, 17 Nov 2020 03:54:49 +0000 (03:54 +0000)]
Fix RCS1036: Remove redundant empty line (#44631)

Sync with PowerShell/PowerShell#13404

3 years agoAvoid MemoryMarshal.Cast unaligned accesses in Marvin (#44617)
Levi Broderick [Tue, 17 Nov 2020 02:30:34 +0000 (18:30 -0800)]
Avoid MemoryMarshal.Cast unaligned accesses in Marvin (#44617)

3 years agoSupport System.Type.Missing arguments for late bound calls to IDynamicObject methods...
Charles Stoner [Mon, 16 Nov 2020 18:01:30 +0000 (10:01 -0800)]
Support System.Type.Missing arguments for late bound calls to IDynamicObject methods with 8 or more arguments (#44434)

3 years agoDelete unnecessary entry in global.json (#44709)
Jan Kotas [Mon, 16 Nov 2020 14:45:20 +0000 (06:45 -0800)]
Delete unnecessary entry in global.json (#44709)

3 years agoOrganize SendReceive tests and isolate non-parallel test collection (#44591)
Anton Firszov [Mon, 16 Nov 2020 12:50:48 +0000 (13:50 +0100)]
Organize SendReceive tests and isolate non-parallel test collection (#44591)

Some `SendReceive` socket tests may be prone to timing issues on CI. This seems to be the root cause of #1712. We need a reliable way to run such tests to unblock the work on new UDP socket API-s in #33418.

This PR defines a new `SendReceiveNonParallel` test group, moving `SendToRecvFrom_Datagram_UDP` into that group. Since this is already a significant reorganization, it seemed reasonable to also:
- Harmonize naming: all SendReceive test classses are now named either  `SendReceive_[SubVariant]`
 or `SendReceiveNonParallel_[SubVariant]`
- Split `SendReceive.cs` into multiple files:
    - `SendReceive.cs` for the parallel variants
    - `SendReceiveNonParallel.cs` for the new, non-parallel variants
    - Rename the non-generic class `SendReceive` to `SendReceiveMisc` (to avoid name collision and confusion with `SendReceive<T>`) and move it to `SendReceiveMisc.cs`
    - Move `SendReceiveListener` and `SendReceiveUdpClient` to separate files, rename `SendReceiveListener` to `SendReceiveTcpClient`

3 years agoFix `-output_mch_path` argument to superpmi.py (#44693)
Bruce Forstall [Mon, 16 Nov 2020 03:49:11 +0000 (19:49 -0800)]
Fix `-output_mch_path` argument to superpmi.py (#44693)

Convert the given path argument to an absolute path. Without this,
the `collect` command changes the current directory before doing its
work, so the file doesn't end up where you expeect it to.

Also, print the given argument in any error message.

3 years agoFixed various comments and minor refactor ServiceController. (#44014)
Shreyas Jejurkar [Sun, 15 Nov 2020 23:32:35 +0000 (05:02 +0530)]
Fixed various comments and minor refactor ServiceController. (#44014)

* Fixed various comments in ServiceController.

1. Fixed comments, so that VS can infer and show in tooltip.
2. Removed redundant base constructor call.
3. Used auto-properties.

* Addressed PR feedback

* Update src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs

Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoimprove parsing network files on WSL (#44680)
Tomas Weinfurt [Sun, 15 Nov 2020 17:50:22 +0000 (09:50 -0800)]
improve parsing network files on WSL (#44680)

* improve parsing network files on WSL

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRemove allocations from IsCustomAttributeDefined (#44694)
Ben Adams [Sun, 15 Nov 2020 03:23:30 +0000 (03:23 +0000)]
Remove allocations from IsCustomAttributeDefined (#44694)

3 years agoFix Android runtime tests to upload .apk per work item (#44662)
Alexander Köplinger [Sat, 14 Nov 2020 10:25:15 +0000 (11:25 +0100)]
Fix Android runtime tests to upload .apk per work item (#44662)

Instead of uploading all .apk's as a correlation payload.

3 years agoOnly sign in the official build pipeline, not in any other pipeline (#44668)
Jeremy Koritzinsky [Sat, 14 Nov 2020 02:00:26 +0000 (18:00 -0800)]
Only sign in the official build pipeline, not in any other pipeline (#44668)

* Only sign in the official build pipeline, not in any other pipeline (was breaking the perf pipeline).

* Pass signBinaries directly to crossdac-build

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Only install MicroBuild when we are signing.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
3 years agoFix MONO exports not actually being callable through Module (#44634)
Katelyn Gadd [Sat, 14 Nov 2020 01:39:52 +0000 (17:39 -0800)]
Fix MONO exports not actually being callable through Module (#44634)

3 years agoRemove extraneous dependency ignore. (#44672)
Jeremy Koritzinsky [Sat, 14 Nov 2020 01:35:59 +0000 (17:35 -0800)]
Remove extraneous dependency ignore. (#44672)

3 years agoAdd allocation-free StringInfo APIs, improve unit tests (#44609)
Levi Broderick [Fri, 13 Nov 2020 22:36:09 +0000 (14:36 -0800)]
Add allocation-free StringInfo APIs, improve unit tests (#44609)

3 years agoCheck args before asking runtime to resolve fqns to avoid assert (#44635)
Katelyn Gadd [Fri, 13 Nov 2020 21:27:46 +0000 (13:27 -0800)]
Check args before asking runtime to resolve fqns to avoid assert (#44635)

3 years agoSupport multi-buffer sends in WebAssembly WebSockets (#44611)
Brennan [Fri, 13 Nov 2020 21:08:14 +0000 (13:08 -0800)]
Support multi-buffer sends in WebAssembly WebSockets (#44611)

* Support multi-buffer sends in WebAssembly WebSockets

Proposed fix for https://github.com/dotnet/runtime/issues/44551

* Update BrowserWebSocket.cs

* Whitespace

* TryGetBuffer

3 years agoAdd feature switch for disabling startup hooks (#44050)
Mateo Torres-Ruiz [Fri, 13 Nov 2020 21:04:25 +0000 (13:04 -0800)]
Add feature switch for disabling startup hooks (#44050)

* Introduce feature switch for startup hook

* Add test

* Update md

* Update src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Add UnreferencedCode attribute

* Apply suggestions from code review

Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
* Update message

* Update baseline

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
3 years agoAdd link to github issues (#44650)
Fan Yang [Fri, 13 Nov 2020 20:28:34 +0000 (15:28 -0500)]
Add link to github issues (#44650)

3 years agoDon't build archives or installers for Mono builds. (#44656)
Jeremy Koritzinsky [Fri, 13 Nov 2020 20:12:48 +0000 (12:12 -0800)]
Don't build archives or installers for Mono builds. (#44656)

3 years agoupdate version (#44478)
Anirudh Agnihotry [Fri, 13 Nov 2020 19:42:49 +0000 (11:42 -0800)]
update version (#44478)

3 years agoRuntimeResourceSet improvements (#44454)
Marek Safar [Fri, 13 Nov 2020 19:03:25 +0000 (20:03 +0100)]
RuntimeResourceSet improvements (#44454)

* RuntimeResourceSet improvements

- remove unnecessary base class calls to trim more of base type
- remove code paths which were never executed
- replaced nested locking with simple locks
- fix caching for case insensitive mode
- add tests for more code paths

* Move local caseInsensitiveTable initialisation

* Clean up unused code

* Revert "Clean up unused code"

It's actually used via reflection in System.Resources.Extensions

3 years agoEnable WASM AOT option in build and update MonoAOTCompiler (#44468)
Alexander Köplinger [Fri, 13 Nov 2020 16:25:02 +0000 (17:25 +0100)]
Enable WASM AOT option in build and update MonoAOTCompiler (#44468)

Allows creating AOT images for WASM with the AOT compiler and consuming them in the runtime.

Use `make build AOT=1` in `src/mono/netcore/sample/wasm/console` to try it out.

--

Also fix a regression in aot-compiler.c regarding SPC->corlib assembly name:

In https://github.com/dotnet/runtime/commit/035ebeab160b9a281e5fbb3fa0c237f244c81b7a we added a simplified prefix for symbol names in System.Private.CoreLib.
However this shouldn't happen for the actual assembly name otherwise we aren't able to find the AOT module linked statically into the binary.

3 years agoMove PollingFileProviderShouldntConsumeINotifyInstances to outerloop (#44651)
Eric StJohn [Fri, 13 Nov 2020 16:19:49 +0000 (08:19 -0800)]
Move PollingFileProviderShouldntConsumeINotifyInstances to outerloop (#44651)

3 years agoFix race condition in TestExited_SynchronizingObject test (#44627)
Stephen Toub [Fri, 13 Nov 2020 16:08:09 +0000 (11:08 -0500)]
Fix race condition in TestExited_SynchronizingObject test (#44627)

3 years agoPut the Crossgen2 assertion check in sync with actual intrinsic count (#44624)
Tomáš Rylek [Fri, 13 Nov 2020 15:05:02 +0000 (16:05 +0100)]
Put the Crossgen2 assertion check in sync with actual intrinsic count (#44624)

* Put the Crossgen2 assertion check in sync with actual intrinsic count

Recent removal of two intrinsics from the CorInfoIntrinsics enumeration
started tripping the assertion failure verifying the expected number
of intrinsics. I'm just updating the expected count.

* Remove the assertion per JanK's PR feedback

3 years agoAdjust method table pointer masks (#44637)
Peter Sollich [Fri, 13 Nov 2020 15:04:03 +0000 (16:04 +0100)]
Adjust method table pointer masks (#44637)

* Adjusting more places where method table pointers get masked.

3 years ago[master] Update dependencies from mono/linker (#44557)
dotnet-maestro[bot] [Fri, 13 Nov 2020 09:22:53 +0000 (10:22 +0100)]
[master] Update dependencies from mono/linker (#44557)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20560.1 -> To Version 6.0.0-alpha.1.20561.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoDoubly linked freelist fix (#44585)
Peter Sollich [Fri, 13 Nov 2020 09:20:52 +0000 (10:20 +0100)]
Doubly linked freelist fix (#44585)

Details:

In gc_heap::allocate_uoh_object. we set the background mark bit if the new object is in a range that has mark bits committed.

However, if the object is in a segment that is allocated during background_sweep, we won't actually sweep the segment, and so the background mark bits stays on, causing confusion in the next background GC - the object itself will survive, but we won't keep the objects that it points at, so we'll have heap corruption.

3 years agoAdd example to test doc for generating Core_Root without building tests (#44504)
Elinor Fung [Fri, 13 Nov 2020 08:46:13 +0000 (00:46 -0800)]
Add example to test doc for generating Core_Root without building tests (#44504)

3 years agoDon't force unused reg arg to the stack. (#44555)
Carol Eidt [Fri, 13 Nov 2020 04:13:20 +0000 (20:13 -0800)]
Don't force unused reg arg to the stack. (#44555)

* Don't force unused reg arg to the stack.

3 years agoupdate assemblyVersion, packageIndex & resources data (#44373)
Anirudh Agnihotry [Fri, 13 Nov 2020 03:59:41 +0000 (19:59 -0800)]
update assemblyVersion, packageIndex & resources data (#44373)

* updated package indes

* Fix the failures in all config build

* add "5.0.0.0" : "5.0.0" entry

* correct the system.net.quic and system.security.access control

* add inbox libraries for net6.0

* fix system.net.quic

* disable closure verify for net6.0

* harvest net5.0 asset and include net6.0 asset in package

* some extra changes reverted

* updating some other assembly verisons

* remove package version and use major and minor version to get the assembly version

* Update Directory.Build.props

3 years agoincrease timeout on WebRequest timeout test (#44612)
Tomas Weinfurt [Fri, 13 Nov 2020 03:01:23 +0000 (19:01 -0800)]
increase timeout on WebRequest timeout test (#44612)

3 years agoSwitch to new Microsoft.DotNet.SharedFramework.Sdk and refactor Host/Installer build...
Jeremy Koritzinsky [Fri, 13 Nov 2020 01:50:31 +0000 (17:50 -0800)]
Switch to new Microsoft.DotNet.SharedFramework.Sdk and refactor Host/Installer build subsets (#38457)

* Start creating runtime, apphost, and targeting packs using the new SDK in the NewSFX subset.

* Fix generation of runtime package, runtime symbols package, and host symbols package.

* Correcly include hosting files and DIA in the shared framework archives and packages

* Include PackageOverrides.txt in the ref pack.

* Fix product brand prefix.

* Add the shared host installer.

* Add the hostfxr build and clean up MacOS building.

* Rename host and hostfxr projects to ensure we don't collide with the nuget packaging projects.

* Add bundle installer.

* Update platform manifest entries to include linux/mac file variations from the runtime.

* Update apphost pack to match master.

* Fix typo

* Include manpages and fix linux package properties.

* Fix linux package properties.

* Match short-description from packages in master.

* Update to uploaded package.

* Update metadata and SDK to generate an exact match of the productbuild xml file.

* First draft moving crossgen2 to new SDK.

* Get crossgen2 pack working with updated SDK.

* Build archives from the installer and bundle projects.

* Move the dotnet-runtime-deps installers to use the new SDK.

* Rough attempt to convert the build to use the new sfx sdk.

* Remove now empty subsets.

* Update installer subsets for testing.

* Remove non-existent packaging project from subsets.

* Add missing Windows api shim dll to platform manifest.

* Update sharedfx sdk.

* Add both versions of the long-name dac to the platform manifest.

* Skip builds for non-relevant components on Mono.

* Remove installer tests by default temporarily to validate product build.

* Remove pkgprojs subset from mono installer build since it doesn't build the hosts.

* Skip the apphost pack on mono.

* Update host test infra to use the new sfx projects.

* Delete an out of date test (the alternative case this test exercises is now the only case in this repo)

* Fix packaging tests and remove NETStandard packaging tests since we aren't producing that ref pack any more.

* Fixes for test official build failures. Re-eneable installer tests by default.

* Fix condition for building linux installers.

* Exclude Mono header files from the deps.json. They don't need to be in it.

* Don't include the host files on the sfxproj.

* Add mono-specific files to the platform manifest.

* Remove extra copy step in installer job.

* Include libmonosgen-2.0.a in platform manifest.

* Fix change in linux-x64 test steps.

* Fix display name of linux package steps.

* Build the installers based on the portable build when applicable so they can find their artifacts.

* The installer build no longer consumes Microsoft.NETCore.Platforms and Microsoft.NETCore.Targets, try removing the dependency on the AllConfigurations leg from the installer build.

* Set PackageBrandNameSuffix for runtime-deps packages.

* Updated sharedfx sdk

* Fix debian runtime-deps dependency elements.

* Add new platform manifest entries.

* Add icudt.dat to the platform manifest.

* Invert conditions to correctly skip generating installers on non-applicable platforms.

* Create extra installer subset so we can build just the installers (and avoid double-building nuget packages). Rename the newsfx subset and folder to sfx.

* Fix Crossgen2 package name.

* Clean up some dead MSBuild goo and update the sharedfx package so we can override the crossgen2 package name without breaking the default package id logic.

* Update SharedFX SDK.

* Fix discovery of the built dotnet layout for installer tests. Clean up some MSBuild along this path.

* Update to use the new refactored packages.

* Fix macOS build failures.

* Fix linux installer build.

* Upgrade to newest version of the SDK and centrally manage versions.

* Update SDK to fix build skipping for the shared framework sdk.

* Update SDK with full fix for skipbuild with packaging.

* Another try for fixing the build-skip infra.

* Upgrade SDK.

* Fix package ids for mono packages.

* Fix installer tests after update.

* Add System.Private.Runtime.InteropServices.Javascript.dll to platform manifest

* Fix Crossgen2 package to place all files in the tools folder.

* Update to SDK with validation targets.

* Add new ICU files to manifest.

* Crossgen2 doesn't need to go through framework resolution so we can permit non-file-versioned dlls. (jitinterface.dll is currently unversioned).

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Put the property in a property group.

* Ensure we build corehost before sfx since we no longer directly build the project from the sfx projects.

* Add missing entry for additional ICU data file.

* Remove step downloading all artifacts and remove MSBuild glue to hook up looking up artifacts in the full download.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Update SDK

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Update SDK to get MSI fix.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Don't even try building the hosting, crossgen2, or bundle installers when RuntimeFlavor is Mono.

* Remove out of date comment.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Rename subsets based on PR discussion.

* Update platform manifest and fix path to 3rd party notices for installer.

* Remove test feed.

* Update subset references I missed.

* Fixed the subset arguments in other yaml files.

* Add NuGet metadata to packs.

* Add diagnostics-specific incremental signing in CoreCLR when the files are produced so the installer portion doesn't need to sign them.

* Pass sign type to job.

* Add new WASM files.

* Enable static graph restore for the whole repo

* Fix nits

* Add back the runtime-deps packages. They were lost when we moved away from globs.

* Don't disable NuGet static graph restore.

* Make sure we sign the cross-arch same-os DAC

* Update installers package.

* Update Installers package from arcade

* Update installers package.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoSubtle fixes for JIT build mode (#44615)
Tomáš Rylek [Fri, 13 Nov 2020 01:49:38 +0000 (02:49 +0100)]
Subtle fixes for JIT build mode (#44615)

Maoni expressed interest in experimenting with the R2RTest tool
for the purpose of running arbitrary CoreCLR test subsets. As
until now we've seldom used the tool in JIT mode, this naturally
uncovered a bit of bitrot, frankly speaking less than I expected.

Thanks

Tomas

3 years agoFix race conditions in CG2 runs (#44492)
Tomáš Rylek [Fri, 13 Nov 2020 01:49:04 +0000 (02:49 +0100)]
Fix race conditions in CG2 runs (#44492)

While we do lock the test folder during CG2 compilation, we always
run the compilation which means that it can race with execution of
the already CG2-compiled executable which also locks the PE file.

While I'm not super happy about introducing more state, I believe
the easiest way to fix this is the same way CG1 works - compiling
opportunistically upon first build of the project and skipping the
compilation subsequently.

Thanks

Tomas

3 years agoFix trimming linker tests (#44613)
Santiago Fernandez Madero [Fri, 13 Nov 2020 01:27:41 +0000 (17:27 -0800)]
Fix trimming linker tests (#44613)

3 years ago[Android] Split android_security.c into multiple files (#44603)
Egor Bogatov [Fri, 13 Nov 2020 00:12:28 +0000 (03:12 +0300)]
[Android] Split android_security.c into multiple files (#44603)

3 years agoRemove the experimental Utf8String type and tests from the runtime repo (#44574)
Tomáš Rylek [Thu, 12 Nov 2020 23:41:21 +0000 (00:41 +0100)]
Remove the experimental Utf8String type and tests from the runtime repo (#44574)

3 years agoReduce Process test time (#44593)
Stephen Toub [Thu, 12 Nov 2020 23:22:33 +0000 (18:22 -0500)]
Reduce Process test time (#44593)

Fix a test that was taking 30 seconds, and make another test outerloop.

3 years agoFix zh cultures parent chain (#44607)
Tarek Mahmoud Sayed [Thu, 12 Nov 2020 23:22:17 +0000 (15:22 -0800)]
Fix zh cultures parent chain (#44607)

3 years agoMark R2RDumpTests as incompatible with GC stress (#44586)
Tomáš Rylek [Thu, 12 Nov 2020 22:33:54 +0000 (23:33 +0100)]
Mark R2RDumpTests as incompatible with GC stress (#44586)

The purpose of this test is not to stress the runtime, it's relatively
lengthy as it processes the entire System.Private.CoreLib framework
assembly and so it's timing in GC stress runs.

Thanks

Tomas

3 years agoOSX Add option -no_code_signature_warning (#44604)
Steve MacLean [Thu, 12 Nov 2020 21:46:09 +0000 (16:46 -0500)]
OSX Add option -no_code_signature_warning (#44604)

When building on Apple Silicon the stripping pass warns about breaking signing
despite not having signed the binary yet. Disable the warning

3 years agoOverride Read/Write for spans on ConsoleStream (#44597)
Stephen Toub [Thu, 12 Nov 2020 20:31:12 +0000 (15:31 -0500)]
Override Read/Write for spans on ConsoleStream (#44597)

Console.WriteLine ends up calling Write(span) in some cases, which incurs unnecessary additional cost to call through to Write(byte[], ...).

3 years agoSpecial-case SocketsHttpHandler.MaxResponseDrainTime == 0 (#44568)
Stephen Toub [Thu, 12 Nov 2020 18:12:10 +0000 (13:12 -0500)]
Special-case SocketsHttpHandler.MaxResponseDrainTime == 0 (#44568)

If the drain size is set to 0, any attempts to drain end up failing with a 1st-chance exception that's logged and eaten, when we should just be skipping all the associated work and failing immediately.

3 years agoValidate ref/src parameter names (#43838)
Eric StJohn [Thu, 12 Nov 2020 16:00:18 +0000 (08:00 -0800)]
Validate ref/src parameter names (#43838)

Ensure our reference assembly parameter names match implementation.  Align all current mismatches.

3 years ago[Android] Use Android SDK instead of OpenSSL where possible (#43740)
Egor Bogatov [Thu, 12 Nov 2020 15:54:54 +0000 (18:54 +0300)]
[Android] Use Android SDK instead of OpenSSL where possible (#43740)

This PR redirects all RandomNumberGenerator, MD5, Sha1-512, HMAC and AES APIs to use Android SDK instead of OpenSSL.

3 years agoRemove dependency on System.Linq from debug build (#44531)
Steve Harter [Thu, 12 Nov 2020 15:39:28 +0000 (09:39 -0600)]
Remove dependency on System.Linq from debug build (#44531)

3 years agoMake PhysicalFilesWatcher exclusively use polling when pollForChanges=true and no...
Eric StJohn [Thu, 12 Nov 2020 15:16:18 +0000 (07:16 -0800)]
Make PhysicalFilesWatcher exclusively use polling when pollForChanges=true and no FSW is provided (#41426)

When a FileSystemWatcher is not passed to the PhysicalFileWatcher
we'll permit construction (if polling is enabled) and have it behave as
exclusively polling.

The PhysicalFileProvider will use this mode when both
UsePollingFileWatcher and UseActivePolling are set which is what happens
when the DOTNET_USE_POLLING_FILE_WATCHER environment variable is set.

3 years agoRemove LazyInitializer usage from corelib (#44409)
Stephen Toub [Thu, 12 Nov 2020 14:33:57 +0000 (09:33 -0500)]
Remove LazyInitializer usage from corelib (#44409)

It's fine for higher layers, but in corelib we don't want to forcibly prevent LazyInitializer from being trimmed nor pay the overheads of additional cached delegates.

3 years agoFix 5-minute hang in Process tests (#44571)
Stephen Toub [Thu, 12 Nov 2020 14:00:28 +0000 (09:00 -0500)]
Fix 5-minute hang in Process tests (#44571)

3 years agoUse Dictionary for underlying cache of ResourceSet (#44521)
Marek Safar [Thu, 12 Nov 2020 13:13:23 +0000 (14:13 +0100)]
Use Dictionary for underlying cache of ResourceSet (#44521)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoCopy OpenSSL binaries (#44577)
Fan Yang [Thu, 12 Nov 2020 12:30:35 +0000 (07:30 -0500)]
Copy OpenSSL binaries (#44577)

This PR could resolve some failures mentioned in https://github.com/dotnet/runtime/issues/44306

3 years agoFix race condition in Hosting test (#44548)
Eric Erhardt [Thu, 12 Nov 2020 11:32:28 +0000 (05:32 -0600)]
Fix race condition in Hosting test (#44548)

Change Task.Delay(1) to Task.Yield() to avoid a super race condition.

Fix #43389

3 years agoSantiago's suggestion (#44554)
Sergey Andreenko [Thu, 12 Nov 2020 05:47:33 +0000 (19:47 -1000)]
Santiago's suggestion (#44554)

3 years agoFix RCS1049: Simplify boolean comparison (#44564)
xtqqczze [Thu, 12 Nov 2020 05:32:06 +0000 (05:32 +0000)]
Fix RCS1049: Simplify boolean comparison (#44564)

3 years ago[RyuJIT] Unroll single-iteration loops (#43947)
Egor Bogatov [Thu, 12 Nov 2020 04:50:24 +0000 (07:50 +0300)]
[RyuJIT] Unroll single-iteration loops (#43947)

* Unroll empty loops

* Unroll single-iteration loops

* Update optimizer.cpp

* clean up

* Update optimizer.cpp

3 years agoRemove unused RCW/CCW code paths (#44121)
Aaron Robinson [Thu, 12 Nov 2020 03:16:53 +0000 (19:16 -0800)]
Remove unused RCW/CCW code paths (#44121)

* Remove unused checks for DCOM proxies.

* Remove empty API for WinRT scenarios.

* Remove unused static functions from runtimecallablewrapper.cpp.

* Remove unused functions in comcallablewrappers.

* Remove unused or irrelevant functions in interoputil.cpp.

Remove WinRT focused code path in ComInterfaceMarshaler.
  - ICOMInterfaceMarshalerCallback usage

3 years agoRemove unused Crst entries and regenerate header. (#44556)
Aaron Robinson [Thu, 12 Nov 2020 03:14:15 +0000 (19:14 -0800)]
Remove unused Crst entries and regenerate header. (#44556)

* Remove unused Crst entries and regenerate header.

3 years agoFix remote-unwind for TARGET_ARM crossdac (#44553)
Steve MacLean [Thu, 12 Nov 2020 02:30:21 +0000 (21:30 -0500)]
Fix remote-unwind for TARGET_ARM crossdac (#44553)

3 years agodocs: fix MSBuild property InvariantGlobalization (#44572)
谭九鼎 [Thu, 12 Nov 2020 02:20:25 +0000 (10:20 +0800)]
docs: fix MSBuild property InvariantGlobalization (#44572)

3 years agoCrossgen2 support for System.Private.CoreLib compilation in CoreCLR build (#44090)
Tomáš Rylek [Thu, 12 Nov 2020 02:01:15 +0000 (03:01 +0100)]
Crossgen2 support for System.Private.CoreLib compilation in CoreCLR build (#44090)

This change moves the logic for crossgenning System.Private.CoreLib to the crossgen-corelib.proj script, no longer calling out to the OS-specific scripts crossgen-corelib.cmd / crossgen-corelib.sh, and adds the support for using Crossgen2 for the System.Private.CoreLib compilation. As of this commit Crossgen2 is not set as the default because the System.Utf8.Experimental libraries tests fail with Crossgen2-compiled CoreLib. I'm working on fixing this as the next step.

Thanks

Tomas

3 years agoFix StartInfo test (#44392)
Dan Moseley [Thu, 12 Nov 2020 01:58:23 +0000 (17:58 -0800)]
Fix StartInfo test (#44392)

* Stabilize StartInfo_NotepadWithContent_withArgumentList

* Add state in failed SetApartmentState exception

* Same for other tests

* Extract common code

* Modify

* Extract common code

* Pass down throwOnError

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* feedback

* Add process for disposal

* Make slow test outer loop

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoA couple of R2RDump fixes (#44558)
Andrew Au [Thu, 12 Nov 2020 01:39:29 +0000 (17:39 -0800)]
A couple of R2RDump fixes (#44558)

3 years agoFix arm64 disasm failures (#44547)
Bruce Forstall [Thu, 12 Nov 2020 00:36:24 +0000 (16:36 -0800)]
Fix arm64 disasm failures (#44547)

GTF_ICON_STATIC_HDL and GTF_ICON_FTN_ADDR can't be converted
to names using eeGetFieldName and eeGetMethodFullName, respectively.
So, just print out the type of the target.

Fixes #40354

3 years agoAdd Type.GetMethod overload that takes Name, BindingFlags, and Parameter Types (...
Eric Erhardt [Wed, 11 Nov 2020 23:43:33 +0000 (17:43 -0600)]
Add Type.GetMethod overload that takes Name, BindingFlags, and Parameter Types (#44529)

* Add Type.GetMethod overload that takes Name, BindingFlags, and Parameter Types

Adding overloads to GetConstructor and GetMethod that don't take a Binder or parameter modifiers.

Fix #42753

3 years agoUse fcntl(F_FLUSHFSYNC) on OSX and make FlushAsync() to behave like Flush(false)...
David Cantú [Wed, 11 Nov 2020 23:27:39 +0000 (15:27 -0800)]
Use fcntl(F_FLUSHFSYNC) on OSX and make FlushAsync() to behave like Flush(false) on Unix (#44443)

* Use fcntl(F_FLUSHFSYNC) on OSX and make FlushAsync to behave like Flush on Unix

* Remove HAVE_F_FULLFSYNC from mono/cmake/config.h.in

* Address FlushAsyncInternal feedback

* Address feedback: use fcntl only for OSX

3 years agoDrop support for IID_ICorDebugProcess10 and fix thread suspend logic (#44549)
Steve MacLean [Wed, 11 Nov 2020 23:24:33 +0000 (18:24 -0500)]
Drop support for IID_ICorDebugProcess10 and fix thread suspend logic (#44549)

* Stop providing IID_ICorDebugProcess10

Prevent older VS versions from setting managed data breakpoints.

* Simplify the thread collision logic to prevent deadlock

This is a simplification of https://github.com/dotnet/runtime/pull/44539
as proposed by @kouvel

3 years agoAdd signing information to asset manifest (port #41889 and #42688) (#43896)
Matt Mitchell [Wed, 11 Nov 2020 23:15:31 +0000 (15:15 -0800)]
Add signing information to asset manifest (port #41889 and #42688) (#43896)

* Post build signing

* Add PostBuildSign flag

3 years agoConvert aka.ms links to https (#44501)
Levi Broderick [Wed, 11 Nov 2020 21:03:43 +0000 (13:03 -0800)]
Convert aka.ms links to https (#44501)

3 years agoRemove internal NuGet.config that is not needed anymore (#44507)
Santiago Fernandez Madero [Wed, 11 Nov 2020 18:42:09 +0000 (10:42 -0800)]
Remove internal NuGet.config that is not needed anymore (#44507)

3 years agoUpdate buildtriage.md (#44538)
Jan Jahoda [Wed, 11 Nov 2020 18:28:41 +0000 (19:28 +0100)]
Update buildtriage.md (#44538)

3 years agoRemove dead code in MarshalNative (#44506)
Elinor Fung [Wed, 11 Nov 2020 18:15:00 +0000 (10:15 -0800)]
Remove dead code in MarshalNative (#44506)

3 years agoAdd ICorDebugHeapValue4 -- CreatePinnedHandle (#44471)
Steve MacLean [Wed, 11 Nov 2020 18:08:17 +0000 (13:08 -0500)]
Add ICorDebugHeapValue4 -- CreatePinnedHandle (#44471)

* Add ICorDebugHeapValue4
* Add EnableGCNotificationEvents deprecation comment

3 years agolog exception if Timeout_SetTenMillisecondsOnLoopback_ThrowsWebException test fails...
Tomas Weinfurt [Wed, 11 Nov 2020 17:21:57 +0000 (09:21 -0800)]
log exception if Timeout_SetTenMillisecondsOnLoopback_ThrowsWebException test fails (#44509)

* log exception if Timeout_SetTenMillisecondsOnLoopback_ThrowsWebException test fails

* check exception type before checking time range

3 years agoadd CancelWaiter assert (#44510)
Geoff Kizer [Wed, 11 Nov 2020 14:17:54 +0000 (06:17 -0800)]
add CancelWaiter assert (#44510)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoRemove some allocation at "hello world" startup (#44469)
Stephen Toub [Wed, 11 Nov 2020 14:15:06 +0000 (09:15 -0500)]
Remove some allocation at "hello world" startup (#44469)

* Specialize `EqualityComparer<string>.Default`

Removes ~80 allocations at startup.

* Avoid loading Encoding.Unicode just for CodePage

* Use fixed instead of GCHandle.Alloc in EventSource.Initialize

* Remove lock / lock object from EncodingProvider.AddProvider

* Remove lock object from AppDomain.cs

* Lazily allocate EventSource's m_createEventLock

It's only used on an error path.  We don't need to allocate it for each EventSource that's created.

* Avoid unnecessary CultureInfo access in derived TextWriters

SyncTextWriter already overrides FormatProvider, in which case the t.FormatProvider passed to the base will never be used, so this call is incurring a virtual dispatch for no benefit.  And NullTextWriter needn't access InvariantCulture and force it into existence if it isn't yet, as the formatting should never actually be used, and if it is, its FormatProvider override can supply the culture.

* Avoid allocating AssemblyLoadContext's dictionary if no direct interaction with ALC

AssemblyLoadContext.OnProcessExit gets called by EventSource, which in turn forces s_allContexts into existence in order to lock on it in order to enumerate all active contexts, and if there's been no interaction with AssemblyLoadContext, there won't be any to enumerate.  So delay allocate the object.

* Address PR feedback

* Call EventListener.DisposeOnShutdown from AppContext.OnProcessExit

Avoids the need to register with AppContext.ProcessExit, avoiding an EventHandler allocation, and avoids the need in the common case to fire AppContext.ProcessExit, which in turn avoids allocating an AppDomain and EventArgs if they weren't otherwise created, plus it avoids the delegate invocation.

* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

3 years agoUpdate dependencies from https://github.com/mono/linker build 20201110.1 (#44499)
dotnet-maestro[bot] [Wed, 11 Nov 2020 13:12:39 +0000 (14:12 +0100)]
Update dependencies from https://github.com/mono/linker build 20201110.1 (#44499)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20559.3 -> To Version 6.0.0-alpha.1.20560.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoReduce StreamWriter allocation (#44495)
Stephen Toub [Wed, 11 Nov 2020 10:23:36 +0000 (05:23 -0500)]
Reduce StreamWriter allocation (#44495)

* Lazily-allocate StreamWriter's byte[] buffer

The byte[] buffer is used just when flushing to the underlying stream, to store the intermediate bytes as generated from the characters by the encoding.  Currently the byte[] buffer is allocated in the constructor, but for relatively small strings written/flushed synchronously (such as those often used with Console.Write), we can avoid the buffer entirely via stack allocation (in Flush); for all other cases, we can allocate it on demand.

(I considered using ArrayPool to rent/return in each Flush{Async} call, but opted not to in this change.  Someone could investigate that subsequently.)

* Undo use of static async helpers

In .NET Framework, there was a non-trivial penalty due to StreamWriter deriving from MarshalByRefObject and the impact that had on async methods accessing lifted locals on the state machine (it made them significantly more expensive).  The workaround was to make the async methods be statics and pass in all of the relevant instance state needed.  That workaround is no longer necessary on core, where MarshalByRefObjects are nops, leaving behind a workaround that is not just clunkier, but actually makes things more expensive because more state needs to be stored on the state machine objects (all of the arguments, which can instead just be accessed off of `this`).  Undo that whole change.

* Address PR feedback

3 years agoUse corlib instead of System.Private.CoreLib as a name prefix in AOT symbol names...
Zoltan Varga [Wed, 11 Nov 2020 07:11:57 +0000 (02:11 -0500)]
Use corlib instead of System.Private.CoreLib as a name prefix in AOT symbol names. (#44235)

3 years agoWASM Bindings optimizations and fixes (#41808)
Katelyn Gadd [Wed, 11 Nov 2020 04:46:06 +0000 (20:46 -0800)]
WASM Bindings optimizations and fixes (#41808)

* Fix MarshalTypedArrayByte and re-enable it. Re-enable TestFunctionApply

* Re-enable MarshalTypedArray

* Detect when the managed wrapper for a JS object has been collected and create a new one

* Remove debugging code

* Maintain a small pool of temporary root instances to minimize GC pressure. Improve benchmark

* Don't use release_roots in call_method due to varargs overhead

* Various call_method optimizations

* Checkpoint: Don't rely on finally block for teardown in call path, because it has a performance cost

* Checkpoint: Unboxing fast path for primitives

* Checkpoint: Fix unboxing fast path

* Update bindings to use bound static methods instead of call_method in various places

* Address PR feedback

* Revert sample and add separate proj for benchmark

* Fix benchmark

* Revert test change

* Fix passing mono object ptrs to bound functions
Fix passing strings across the boundary
Fix JS strings being truncated at the first null when passed to mono

* Implement unboxing for chars
Slightly optimize the unboxing slow path

* Don't allocate a root buffer for arguments if nothing needs to be rooted. Reuse scratch native buffer across calls unless re-entrant to avoid per-invoke malloc

* Fix whitespace damage from merge

* Tweaks to try and prevent boxing/gc

* Fix typo

* Add some tests

* Fix test failures

* Add more error handling and diagnostic messages
Fix a couple broken tests

* Repair merge damage

* Remove bindings benchmark

* Use TypedArray.fill 3-argument version to zero memory

* Checkpoint: Introduce format strings

* Fix interpolated strings

* Test refactoring

* Checkpoint: Add more test coverage for bindings and interop

* Checkpoint: Enum marshaling works

* Improve test coverage

* Checkpoint: Unify unboxing of primitive types

* Checkpoint: Unify unboxing of primitive types

* Checkpoint: Restore fn to satisfy runtime-test.js

* Checkpoint: Unify boxing for primitives

* Remove now-unused box methods

* Don't store names for null method IDs

* Fix indentation damage

* Add test

* Satisfy CI

* Accept weaker promises

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoJIT: preliminary version of profile-based inline policy (#44427)
Andy Ayers [Wed, 11 Nov 2020 03:45:06 +0000 (19:45 -0800)]
JIT: preliminary version of profile-based inline policy (#44427)

Add a new inline policy that can be used when a method has profile data.

It uses the call site frequency to boost profitability. Size and per-call
benefit are currently using the estimates done by the model policy.

Not on by default. Set COMPlus_JitInlinePolicyProfile=1 to enable.
Add testing to weekly experimental runs.

3 years agoImplement internal ISpanFormattable on {U}IntPtr (#44496)
Stephen Toub [Wed, 11 Nov 2020 03:33:05 +0000 (22:33 -0500)]
Implement internal ISpanFormattable on {U}IntPtr (#44496)

Allows nint and nuint to participate in the same optimizations in string building / formatting as do the other primitives.

3 years agoAdd libs.native subset when using the runtime helper target in the wasm makefile...
Zoltan Varga [Wed, 11 Nov 2020 01:08:07 +0000 (20:08 -0500)]
Add libs.native subset when using the runtime helper target in the wasm makefile (#44450)

Ensures libSystem.Native.a/libSystem.IO.Compression.Native.a end up in the runtime pack.

3 years agoRevert "Use Dictionary for underlying cache of ResourceSet (#44104)" (#44482)
Jan Kotas [Tue, 10 Nov 2020 22:40:57 +0000 (14:40 -0800)]
Revert "Use Dictionary for underlying cache of ResourceSet (#44104)" (#44482)

This reverts commit a6835438581730da23fb3d4eea7ea7c4af1b00a3.

3 years agoFix R2RDump test in CG2 pipelines (#44460)
Tomáš Rylek [Tue, 10 Nov 2020 20:35:47 +0000 (21:35 +0100)]
Fix R2RDump test in CG2 pipelines (#44460)

Our scripts normally assume that all test projects are at least
two nesting levels deep under $(TestBinDir); the r2rdump test was
violating that and, in doing so, it was triggering a failure in
CG2 compilation.

After I decided to fix this by moving the r2rdump folder under
"readytorun" I found out that there already is a r2rdump folder
there - apparently Amy during her initial R2RDump implementation
authored a basic test suite even though it's disabled right now.

I have resolved this by moving the original test under
"readytorun/r2rdump" to "readytorun/r2rdump/BasicTests" and I moved
Andrew's new test under "readytorun/r2rdump/FrameworkTests".
I'm not super happy about the naming but I don't have any better
ideas at the moment, I'll be happy to improve this based on PR
feedback.

Thanks

Tomas