platform/upstream/dotnet/runtime.git
3 years agoRespect EventSource::IsSupported setting in more codepaths (#51977)
Marek Safar [Wed, 23 Jun 2021 12:56:44 +0000 (14:56 +0200)]
Respect EventSource::IsSupported setting in more codepaths (#51977)

3 years agoRoot ComActivator for hosting (#54524)
Lakshan Fernando [Wed, 23 Jun 2021 12:11:42 +0000 (05:11 -0700)]
Root ComActivator for hosting (#54524)

* rooting ComActivator that is needed for hosting

* FB

3 years agoAdd ILLink annotations to S.D.Common related to DbConnectionStringBuilder (#54280)
Krzysztof Wicher [Wed, 23 Jun 2021 12:02:37 +0000 (14:02 +0200)]
Add ILLink annotations to S.D.Common related to DbConnectionStringBuilder (#54280)

* Add ILLink annotations to S.D.Common related to DbConnectionStringBuilder

* address some feedback

* Make GetEvents() safe

* make GetProperties safe

* Mark GetProperties with RUC

3 years agoFix finalizer issue with regions (#54550)
Peter Sollich [Wed, 23 Jun 2021 10:09:38 +0000 (12:09 +0200)]
Fix finalizer issue with regions (#54550)

This fixes an issue in Server GC where an item in the finalizer queue became stale due to not being relocated.

The problem was that a finalizable object was allocated on one heap, but registered in the finalizer queue of another heap (this is possible due to heap balancing). In CFinalize::UpdatePromotedGenerations, we ask for the generation of an object, and move the object to the correct section of the finalizer queue. In the error case, we obtained the wrong result for the generation of the object because it lived on another heap, and that heap hadn't set the final generation for the region containing the object yet. So we ended up moving the finalizer entry to the section corresponding to gen 2, and missed a relocation of the object occurring in a gen 1 collection afterwards.

Fix: It seems best to make sure an object is always registered for finalization on the heap it's allocated from, so the fix simply fetches the heap from the alloc context after the allocation in the case of SOH, or determines it by calling gc_heap::heap_of in the case of LOH and POH. In the case of SOH, I added an assert to ensure that the heap obtained agrees with the result of calling gc_heap::heap_of.

I also added some dprintf calls to the finalizer logic to aid in future investigations.

3 years agoAdd support for multi-arch install locations (#53763)
Mateo Torres-Ruiz [Wed, 23 Jun 2021 07:19:10 +0000 (00:19 -0700)]
Add support for multi-arch install locations (#53763)

* Add support for multiple architectures inside install_locations

* Add install_location tests

* Fallback to DOTNET_ROOT on win32

3 years agoUpdate library testing docs page to reduce confusion (#54324)
Noah Falk [Wed, 23 Jun 2021 07:00:47 +0000 (00:00 -0700)]
Update library testing docs page to reduce confusion (#54324)

* Add warning on unmaintained testing doc page

* Update testing.md

Some example text that seems more clear to me, but only offered as a suggestion.
Feel free to adjust it or if you want to use it as-is please double check what I wrote is accurate : )

I think the useful elements are:
1. Being explicit about what workflow steps need to happen in total
2. Being explicit about which commands are covering the entire workflow and which ones are only covering a part of it
3. Show the simple "do-it-all" options first before showing more complex partial options. Glancing at the first example and blindly copying it should land in the pit of success.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years ago[FileStream] handle UNC and device paths (#54483)
Adam Sitnik [Wed, 23 Jun 2021 06:53:55 +0000 (08:53 +0200)]
[FileStream] handle UNC and device paths (#54483)

* stop using NtCreateFile as there is no public and reliable way of mapping DOS to NT paths

3 years agoUpdate NetAnalyzers version (#54511)
Stephen Toub [Wed, 23 Jun 2021 06:34:38 +0000 (02:34 -0400)]
Update NetAnalyzers version (#54511)

* Update NetAnalyzers version

* Add NetAnalyzers to dependency flow

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoAdded runtime dependency to fix the intermittent test failures (#54587)
Daniel Genkin [Wed, 23 Jun 2021 04:46:38 +0000 (00:46 -0400)]
Added runtime dependency to fix the intermittent test failures (#54587)

* Added runtime dependency to hopefully fix the intermittent test failures

* addressed comments

* cleanup

* cleanup accidental spaces and tabs cleanup

* added Larry's comments

3 years agoDisable failing System.Reflection.Tests.ModuleTests.GetMethods (#54564)
Bruce Forstall [Wed, 23 Jun 2021 04:42:14 +0000 (21:42 -0700)]
Disable failing System.Reflection.Tests.ModuleTests.GetMethods (#54564)

Tracking: https://github.com/dotnet/runtime/issues/50831

3 years ago[wasm] Move AOT builds from `runtime-staging` to `runtime` (#54577)
Ankit Jain [Wed, 23 Jun 2021 03:46:33 +0000 (23:46 -0400)]
[wasm] Move AOT builds from `runtime-staging` to `runtime` (#54577)

These builds have had ~2-3 failures in the last 14 days (~90 builds).

3 years agoKeep obj node for ArrayIndex. (#54584)
Sergey Andreenko [Wed, 23 Jun 2021 01:58:23 +0000 (18:58 -0700)]
Keep obj node for ArrayIndex. (#54584)

3 years agoDisable another failing MemoryCache test (#54578)
Dan Moseley [Wed, 23 Jun 2021 01:08:12 +0000 (19:08 -0600)]
Disable another failing MemoryCache test (#54578)

3 years agoSet DLL flag on R2R binaries (#54533)
Anton Lapounov [Tue, 22 Jun 2021 22:45:36 +0000 (15:45 -0700)]
Set DLL flag on R2R binaries (#54533)

This is required for R2R relocations to be processed by the OS loader on Windows 7.

3 years agoAdd `SkipEnabledCheck` on `LoggerMessageAttribute` (#54305)
Maryam Ariyan [Tue, 22 Jun 2021 21:25:36 +0000 (17:25 -0400)]
Add `SkipEnabledCheck` on `LoggerMessageAttribute` (#54305)

* Add SkipEnabledCheck on LoggerMessageAttribute
* Make logging generator more robust with null input
* Adds LoggerMessageAttribute ctor overload
* properly identify misconfigured input

3 years agoImprove performance of IsRootScope check (#54555)
David Fowler [Tue, 22 Jun 2021 21:07:54 +0000 (14:07 -0700)]
Improve performance of IsRootScope check (#54555)

- Stash a field instead of doing an equality comparison.

Fixes #54351

3 years agoFix a memory corruption caused by an integer overflow (#54510)
Andrew Au [Tue, 22 Jun 2021 20:28:59 +0000 (13:28 -0700)]
Fix a memory corruption caused by an integer overflow (#54510)

3 years agoget rid of an unnecessary join (#54312)
Maoni Stephens [Tue, 22 Jun 2021 20:27:31 +0000 (13:27 -0700)]
get rid of an unnecessary join (#54312)

I think this join was left there by accident when we were doing the write watch feature. I'm puzzled why I didn't notice it. the comment was also inconsistent which strengthens my belief that this was a mistake. we don't need a join here (there used to not be a join) and disabling the dirty pages tracking can be done anywhere while the EE is stopped since write barriers cannot be invoked.

3 years agoDisable failing test BasicTestWithMcj under GCStress (#54566)
Bruce Forstall [Tue, 22 Jun 2021 20:12:05 +0000 (13:12 -0700)]
Disable failing test BasicTestWithMcj under GCStress (#54566)

Tracking: https://github.com/dotnet/runtime/issues/54203

3 years ago[Android] Fix AndroidAppBuilder to work w/ AOT+LLVM (#53643)
Steve Pfister [Tue, 22 Jun 2021 19:00:17 +0000 (15:00 -0400)]
[Android] Fix AndroidAppBuilder to work w/ AOT+LLVM (#53643)

We were missing a few key additions to make sure we can test against AOT+LLVM. This change will make sure we link against all the .dll-llvm.o files produced from the AOT compiler and include the right mtriple for each architecture.

Fixes #53628

3 years ago[mono]Re-enable runtime tests on Android arm64 (#49662)
Fan Yang [Tue, 22 Jun 2021 17:36:57 +0000 (13:36 -0400)]
[mono]Re-enable runtime tests on Android arm64 (#49662)

* Re-enable runtime tests on Android arm64

* disable irrelevant CI lanes

* Disable more dotnet-linker-tests and runtime-dev-innerloop CI lanes

* Comment out definition for DISABLE_LOGGING

* Remove defining logging for android

* Extend app installation timeout limit

* Fix command prefix for windows

* Enable tests excluded only for Android arm64

* Disable failed test on arm64

* Revert hacks

* Revert unintended changes

* More...

* Only run tests on arm64 for rolling build

* Fix merge error

3 years agoDisable failing tests under GCStress (#54532)
Bruce Forstall [Tue, 22 Jun 2021 16:57:09 +0000 (09:57 -0700)]
Disable failing tests under GCStress (#54532)

https://github.com/dotnet/runtime/issues/51477
https://github.com/dotnet/runtime/issues/53359

3 years agoImport the correct MacCatalyst workload pack (#54558)
Steve Pfister [Tue, 22 Jun 2021 16:44:55 +0000 (12:44 -0400)]
Import the correct MacCatalyst workload pack (#54558)

In https://github.com/dotnet/runtime/pull/54361 there was an incorrect import of the maccatalyst aot workload pack.  This fix corrects the problem.

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

3 years ago[wasm] Collect, and process satellite assemblies automatically (#53656)
Ankit Jain [Tue, 22 Jun 2021 16:35:38 +0000 (12:35 -0400)]
[wasm] Collect, and process satellite assemblies automatically (#53656)

3 years agoFail COM CoClass creation during construction instead of during jitting (#54508)
Jeremy Koritzinsky [Tue, 22 Jun 2021 16:32:53 +0000 (09:32 -0700)]
Fail COM CoClass creation during construction instead of during jitting (#54508)

3 years agoFix deadlock (#54426)
Andrew Au [Tue, 22 Jun 2021 16:00:43 +0000 (09:00 -0700)]
Fix deadlock (#54426)

3 years agoFix XML in Version.Details.xml
Stephen Toub [Tue, 22 Jun 2021 13:44:28 +0000 (09:44 -0400)]
Fix XML in Version.Details.xml

3 years ago[WIP][wasm][testing] remote loop network tests via xharness and websocket (#54289)
Pavel Savara [Tue, 22 Jun 2021 13:02:45 +0000 (15:02 +0200)]
[WIP][wasm][testing] remote loop network tests via xharness and websocket (#54289)

Makes it possible to run LoopbackServer tests with WASM
- conditional compilation of LoopbackServer via #if TARGET_BROWSER
- minimal implementation of WebSocketStream for the unit tests
- simple SocketWrapper class to abstract Socket and WebSocket close/dispose/shutdown
- added handling of CORS headers and pre-flight requests as necessary

- new xharness web server middleware
- adding it to helix payload

3 years agoRevert "[main] Update dependencies from 9 repositories (#54218)" (#54541)
Přemek Vysoký [Tue, 22 Jun 2021 11:20:02 +0000 (13:20 +0200)]
Revert "[main] Update dependencies from 9 repositories (#54218)" (#54541)

This reverts commit 04ad80aff37e2ef5eac0cc6d2a895ccf0f9d65a3.

3 years ago[main] Update dependencies from 9 repositories (#54218)
dotnet-maestro[bot] [Tue, 22 Jun 2021 09:53:13 +0000 (09:53 +0000)]
[main] Update dependencies from 9 repositories (#54218)

[main] Update dependencies from 9 repositories

 - Merge branch 'main' into darc-main-b0a81754-f267-416d-a8e2-cf56f8c1ee3e

 - PInvoke warnings fixes for OOB assemblies

 - Update testPackages.proj

 - Update testPackages.proj

 - Update dependencies from https://github.com/dotnet/arcade build 20210621.1

 - Merge branch 'main' into darc-main-b0a81754-f267-416d-a8e2-cf56f8c1ee3e

Conflicts:
eng/Version.Details.xml
eng/Versions.props

 - Fix xml

 - Update dependencies from https://github.com/dotnet/xharness build 20210622.2

3 years agoArPow stage 1: local source-build infrastructure (#53294)
Michael Simons [Tue, 22 Jun 2021 08:14:07 +0000 (03:14 -0500)]
ArPow stage 1: local source-build infrastructure (#53294)

* Initial arcade-powered source-build infra

* Add patches, fixup from 5.0

* Rename patches to match 6.0-p1 work

* Add source-build specific build script

* Incorporate build-source-build.sh, into eng/

* Run inner build script, through coreclr

* Initial source-build args based on live build (not props file)

* Cleanup: add RID comments, rm empty/absolute args

* Fix subsets

* Disable sourcelink in env, not args

* Fix CI NZEC

* Revert "Use same code to DetectCiphersuiteConfiguration for portable and non-portable builds"

This reverts commit 464010d9d0241bbdcbfbda25b32e78991ddf6093.

* Fix portability

* Fix AllJits build

* Fix missing crossgen2 for non-portable RID

* Create supplemental intermediate nupkgs

* Tweak category names

* Use centralized supplemental nupkg infra

* Add additional 6.0 patches

* Patch updates after merging in main

* SourceBuild.props cleanup

* Fix issue with incorrect patch merge

* Patch updates

* Edit clr.tools patch

* patch updates

* Revert patch integration

* Patch updates

* Edits per code review feedback

* ILAsm workaround

* patch updates

* Move logic to set ILAsmToolPath for source-build

* Update eng/SourceBuild.props

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
* Remove libraries specific patches

* Patch updates necessary with latest main merge

* Add back libraries-packages.proj harvesting patch

* Refactor intermediate package split to be chunkier

* Integrate patch 0017

* Subsets update per code review

* Remove obsolete patch

* Removed patches that were integrated into main

* Remove two additional patches

* Remove remaining patches

Co-authored-by: Davis Goodin <dagood@microsoft.com>
Co-authored-by: dseefeld <dseefeld@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoConvert some COM object checking functions to managed code (#54471)
Aaron Robinson [Tue, 22 Jun 2021 06:44:16 +0000 (23:44 -0700)]
Convert some COM object checking functions to managed code (#54471)

* Convert COM object checking to managed code

* Convert IsComWrapperClass to a managed "can cast to" implementation.

* Add testing for updates.

3 years ago[Test] Move leakwheel to Pri1 (#54522)
Fan Yang [Tue, 22 Jun 2021 01:58:30 +0000 (21:58 -0400)]
[Test] Move leakwheel to Pri1 (#54522)

* Move to Pri1

* Remove leakwheel from issues.targets file for mono

3 years agoremoving more crossgen code from being built. (#54458)
Manish Godse [Tue, 22 Jun 2021 01:52:40 +0000 (18:52 -0700)]
removing more crossgen code from being built. (#54458)

Should improve build times further.

3 years agoMore Parse tests for double, single and Half (#50394)
Prashanth Govindarajan [Tue, 22 Jun 2021 01:22:30 +0000 (18:22 -0700)]
More Parse tests for double, single and Half (#50394)

* Test ibm-fpgen locally for validation

* sq

3 years agoDisable mainv1 and mainv2 for GCStress due to #54203 (#54514)
Bruce Forstall [Tue, 22 Jun 2021 01:10:58 +0000 (18:10 -0700)]
Disable mainv1 and mainv2 for GCStress due to #54203 (#54514)

3 years agoSYSLIB0026: Obsolete mutable X509 certificate APIs
Kevin Jones [Mon, 21 Jun 2021 23:36:51 +0000 (19:36 -0400)]
SYSLIB0026: Obsolete mutable X509 certificate APIs

3 years agoAdd name of corrupted certificate to CryptographicException on Mac
Oded Hanson [Mon, 21 Jun 2021 22:14:16 +0000 (01:14 +0300)]
Add name of corrupted certificate to CryptographicException on Mac

* Add name of corrupted certificate to CryptographicException on Mac

When trying to create a CertificateData out of raw X509 byte array it might throw if the data is corrupted. The existing exception message does not provide any information which might help the user identify the corrupted certificate and fix it.

This change, makes a native call to SecCertificateCopySubjectSummary which will provide a human readable summary of the certificate, and will generate an exception message using this string.

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoDispose transient CFData in Interop.AppleCrypto.X509GetRawData
Oded Hanson [Mon, 21 Jun 2021 22:12:18 +0000 (01:12 +0300)]
Dispose transient CFData in Interop.AppleCrypto.X509GetRawData

3 years agoAdd code to flush JSON writer after root-level fast-path serialization (#54502)
Layomi Akinrinade [Mon, 21 Jun 2021 22:08:27 +0000 (15:08 -0700)]
Add code to flush JSON writer after root-level fast-path serialization (#54502)

3 years agoHTTP/3: Fix header field length calculation (#54442)
James Newton-King [Mon, 21 Jun 2021 21:45:57 +0000 (09:45 +1200)]
HTTP/3: Fix header field length calculation (#54442)

3 years ago[Mono] Enable runtime tests to run on Android x64 with interpreter (#54084)
Fan Yang [Mon, 21 Jun 2021 20:04:39 +0000 (16:04 -0400)]
[Mono] Enable runtime tests to run on Android x64 with interpreter (#54084)

* Enable Android x64 with interpreter

* Make variable RuntimeVariant available for testenvironment

* Pass down runtimeVariant

* Verify that tests are running with interpreter

* Pass MONO_ENV_OPTIONS value to the app

* Set ForceInterpreter to true

* Change default value for interp to false

* dummy commit

* dummy commit 2

* dummy commit

* Configure interp for Android

* Pass RuntimeVariant down as a parameter

* Add issue link

* Enable Mono with interpreter on desktop

* Disable Android x64 with JIT

* Revert hacks to enable all lanes

* revert unintentional change

* Disable Vector128_1_r*

3 years agoSwitch MsQuicOpen to MsQuicOpenVersion (#54443)
Thad House [Mon, 21 Jun 2021 19:56:27 +0000 (12:56 -0700)]
Switch MsQuicOpen to MsQuicOpenVersion (#54443)

* Switch MsQuicOpen to MsQuicOpenVersion

MsQuicOpenVersion is designed so we can update the API without breaking old consumers. The version of MsQuic specified in the readme already has this change, so it is safe to completely switch over.

Also switches the API to function pointers, as it was easier then updating the delegate too.

* Add version contant

3 years agoAdd UnixFilePermissions.xml for Mono AOT compilers (#54501)
Jo Shields [Mon, 21 Jun 2021 19:30:03 +0000 (15:30 -0400)]
Add UnixFilePermissions.xml for Mono AOT compilers (#54501)

* Add UnixFilePermissions.xml for Mono AOT compilers

Ref: https://github.com/dotnet/runtime/issues/53545
Ref: https://github.com/dotnet/sdk/issues/16894
Ref: https://github.com/xamarin/xamarin-macios/pull/11869
Ref: https://github.com/xamarin/xamarin-android/pull/6010

* Only set permissions on !windows

3 years agoAdd Cross DAC documentation (#54498)
Steve MacLean [Mon, 21 Jun 2021 19:10:16 +0000 (15:10 -0400)]
Add Cross DAC documentation (#54498)

* Add Cross DAC documentation

3 years agoAvoid Attribute.InternalGetCustomAttributes overheads when inherit==true is useless...
Stephen Toub [Mon, 21 Jun 2021 17:59:46 +0000 (13:59 -0400)]
Avoid Attribute.InternalGetCustomAttributes overheads when inherit==true is useless (#54402)

3 years agoSpecial-case no attributes in GetCustomAttributeData (#54405)
Stephen Toub [Mon, 21 Jun 2021 17:59:28 +0000 (13:59 -0400)]
Special-case no attributes in GetCustomAttributeData (#54405)

3 years agoBuild for any RID if building from source (#54223)
Michael Simons [Mon, 21 Jun 2021 17:42:57 +0000 (12:42 -0500)]
Build for any RID if building from source (#54223)

3 years agoRemove BitmapSelector.Suffix property (#54364)
Eric Erhardt [Mon, 21 Jun 2021 17:10:47 +0000 (12:10 -0500)]
Remove BitmapSelector.Suffix property (#54364)

With https://github.com/dotnet/runtime/issues/22761 and https://github.com/dotnet/corefx/pull/22833, BitmapSelector.Suffix will always be null. This means this feature is dead code, and users are unable to use it.

Removing this dead code because:

1. It doesn't do anything.
2. It is causing ILLink warnings, and it is easier to delete than to try to address the warnings.

I logged https://github.com/dotnet/runtime/issues/54363 to follow up and either re-implement this feature, or obsolete the attributes that no longer have any effect on the app.

3 years agoSyntax highlighted `type-loader.md` (#54497)
Takym (たかやま) [Mon, 21 Jun 2021 17:06:29 +0000 (02:06 +0900)]
Syntax highlighted `type-loader.md` (#54497)

* Syntax-highlighted `type-loader.md`

* Update type-loader.md

3 years agoFix the slot calculation for multiple services (#54462)
David Fowler [Mon, 21 Jun 2021 15:24:16 +0000 (08:24 -0700)]
Fix the slot calculation for multiple services (#54462)

3 years agoClarify Visual Studio minimum requirement (#52820)
xtqqczze [Mon, 21 Jun 2021 15:21:52 +0000 (16:21 +0100)]
Clarify Visual Studio minimum requirement (#52820)

3 years ago[WASM] Converted mono-config.js to mono-config.json (#53606)
Daniel Genkin [Mon, 21 Jun 2021 14:10:58 +0000 (10:10 -0400)]
[WASM] Converted mono-config.js to mono-config.json (#53606)

* converted mono-config.js to mono-config.json

* Fixed test

* fixed handling of case where Module isn't defined

* Fixed remaining failing tests

* Replaced alerts with console.log to fix Helix test

* replaced all vars with consts

* use fetch

* clean syntax

* prevent timeouts when the mono-config file fails to load

* Moved config file loading to preInit

* Fixed tests

* Adjusted file linking

* removed the unnecessary js_support.js

* cleaned up function

* updated samples

* removed lingering pre-js flag

* Fixed trimming tests

* addressed PR comments

* removed useless function

3 years agoRemove redundant P/Invoke-s in S.D.Process on Apple platforms (#54273)
Maxim Lipnin [Mon, 21 Jun 2021 07:20:03 +0000 (10:20 +0300)]
Remove redundant P/Invoke-s in S.D.Process on Apple platforms (#54273)

* Remove P/Invoke to SystemNative_ConfigureTerminalForChildProcess which doesn't exist on Apple platforms

* Address the feedback based on the ifdef approach

* Add IsiOSLike property

* Use a partial method approach

* Address the feedback

3 years agoAllow mono samples to build and run again (#54089)
Aleksey Kliger (λgeek) [Mon, 21 Jun 2021 07:13:44 +0000 (03:13 -0400)]
Allow mono samples to build and run again (#54089)

3 years agoRemove System.Security.Cryptography.Cng from ASP.NET transport package (#54428)
Eric StJohn [Sat, 19 Jun 2021 20:31:12 +0000 (13:31 -0700)]
Remove System.Security.Cryptography.Cng from ASP.NET transport package (#54428)

3 years agoDisable tests for #54007 (#54207)
Bruce Forstall [Sat, 19 Jun 2021 17:07:59 +0000 (10:07 -0700)]
Disable tests for #54007 (#54207)

3 years agoenable ZeroByteRead_BlocksUntilDataAvailableOrNops test for quic (#54431)
Tomas Weinfurt [Sat, 19 Jun 2021 00:37:42 +0000 (02:37 +0200)]
enable ZeroByteRead_BlocksUntilDataAvailableOrNops test for quic (#54431)

3 years agoRemove crossgen from test build and run scripts (#54348)
Bruce Forstall [Fri, 18 Jun 2021 23:57:05 +0000 (16:57 -0700)]
Remove crossgen from test build and run scripts (#54348)

3 years agoFix AMD64 epilog ABI (#54357)
Bruce Forstall [Fri, 18 Jun 2021 23:51:50 +0000 (16:51 -0700)]
Fix AMD64 epilog ABI (#54357)

* Fix AMD64 epilog ABI

The Windows AMD64 epilog ABI states that an `lea rsp,[rbp+constant]` instruction
may only be used if a frame pointer has been reported to the OS in the prolog
unwind info, otherwise an `add rsp, constant` instruction must be used.
There were a number of cases where the JIT used the `lea` form simply because
a frame pointer had been established and was available, even though it had not
been reported to the OS (and, thus, the frame was effectively an `rsp` frame).

Fix this by using the same condition in the epilog for determining which form
to use, `lea` or `add`, that was used in the prolog to determine whether or not
to report the frame pointer in the unwind info.

Fixes #54320

* Formatting

* Fix OSR

3 years agoDisable two Interop tests failing in outerloop under crossgen2 (#54435)
Bruce Forstall [Fri, 18 Jun 2021 23:48:58 +0000 (16:48 -0700)]
Disable two Interop tests failing in outerloop under crossgen2 (#54435)

https://github.com/dotnet/runtime/issues/54379
https://github.com/dotnet/runtime/issues/54316

3 years ago[wasm][aot] Add support for passing items to the aot/helix test project (#54425)
Ankit Jain [Fri, 18 Jun 2021 22:40:07 +0000 (18:40 -0400)]
[wasm][aot] Add support for passing items to the aot/helix test project (#54425)

3 years agoEnable loading composite r2r images from a singlefile bundle (#53739)
Vladimir Sadov [Fri, 18 Jun 2021 20:48:22 +0000 (13:48 -0700)]
Enable loading composite r2r images from a singlefile bundle (#53739)

* Enable loading composite r2r images from a singlefile bundle

3 years agoBackport bugfixes, infrastructural changes and perf improvements from the polymorphis...
Eirik Tsarpalis [Fri, 18 Jun 2021 20:17:18 +0000 (23:17 +0300)]
Backport bugfixes, infrastructural changes and perf improvements from the polymorphism feature branch (#54420)

* backport opportunistic bugfixes

* strengthen debug assertions and add clarifying comments

* Rework WriteStack/ReadStack implementations

* Use array instead of list for storing frames. Previous frames can now be passed by reference
* Ensure that the _count field always reflects the current depth.
* Remove StackFrame.Reset() methods which are occassionally a source of dirty frames being reused.

* Take advantage of JIT optimizations in the serialization hot path

* address PR feedback

3 years agoset UsableAfterCanceledReads for QUIC tests (#54416)
Tomas Weinfurt [Fri, 18 Jun 2021 19:40:18 +0000 (21:40 +0200)]
set UsableAfterCanceledReads for QUIC tests (#54416)

3 years agoCreate a summary Markdown file for all asm diffs (#54430)
Bruce Forstall [Fri, 18 Jun 2021 19:23:40 +0000 (12:23 -0700)]
Create a summary Markdown file for all asm diffs (#54430)

Create a per-MCH file summary.md file, then accumulate them all into
a single overall summary Markdown file, for use in GitHub comments.
Uses the existing `jit-analyze --md` functionality.

Also, change asm diffs to not report missing data or asm diffs as a
replay failure.

Finally, don't overwrite superpmi.log files (or the new diff_summary.md files):
create new, unique file names for each run.

3 years agoMake some p/invokes blittable (#54370)
Elinor Fung [Fri, 18 Jun 2021 14:55:08 +0000 (07:55 -0700)]
Make some p/invokes blittable (#54370)

3 years agofix some failing quic tests (#54326)
Tomas Weinfurt [Fri, 18 Jun 2021 14:03:39 +0000 (16:03 +0200)]
fix some failing quic tests (#54326)

* fix some failing quic tests

* feedback from review

* add comment

3 years agoCondition MibcArgs for source-build (#54225)
Michael Simons [Fri, 18 Jun 2021 13:26:13 +0000 (08:26 -0500)]
Condition MibcArgs for source-build (#54225)

3 years agoFix Linux x86 build (#50836)
Gleb Balykov [Fri, 18 Jun 2021 12:38:22 +0000 (15:38 +0300)]
Fix Linux x86 build (#50836)

3 years agoHTTP/3: Remove ASP.NET Core specific code from QPackEncoder (#54378)
James Newton-King [Fri, 18 Jun 2021 10:49:46 +0000 (22:49 +1200)]
HTTP/3: Remove ASP.NET Core specific code from QPackEncoder (#54378)

3 years agoExclude experimental projects from source-build (#54222)
Michael Simons [Fri, 18 Jun 2021 07:52:22 +0000 (02:52 -0500)]
Exclude experimental projects from source-build (#54222)

3 years agofix MsQuicStream counting on failure (#54249)
Tomas Weinfurt [Fri, 18 Jun 2021 07:00:05 +0000 (09:00 +0200)]
fix MsQuicStream counting on failure (#54249)

3 years agoImplement NativeMemory (#54006)
Tanner Gooding [Fri, 18 Jun 2021 02:06:29 +0000 (19:06 -0700)]
Implement NativeMemory (#54006)

* Implement NativeMemory

* Exposing additional APIs as approved

* Ensure we have a test covering alignment and size being less than sizeof(void*)

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs

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

* Adding additional alignment test coverage for 1 to 16384

* Add coverage for 65k and 1/2/4MB alignments

* Fixing the Native\Unix\System.Native\CMakeLists.txt

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Don't call Buffer.Memmove in NativeMemory.AlignedRealloc if ptr is null

* Updating NativeMemory.AlignedRealloc to correctly copy only the size of the last allocation

* Ensure check_symbol_exists(HAVE_ALIGNED_ALLOC) is under the non-apple paths

* Check for malloc_usable_size in malloc_np for FreeBSD and ensure tests compile

* Fix the ReallocSmallerToLargerTest test

* Handle that posix_memalign differs from aligned_alloc for size == 0

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoFix casing (#54384)
Larry Ewing [Fri, 18 Jun 2021 01:23:29 +0000 (20:23 -0500)]
Fix casing (#54384)

3 years agoOnly include Microsoft.NET.Runtime.RuntimeConfigParser.Task on mobile (#54361)
Larry Ewing [Fri, 18 Jun 2021 00:25:44 +0000 (19:25 -0500)]
Only include Microsoft.NET.Runtime.RuntimeConfigParser.Task on mobile (#54361)

* Only include Microsoft.NET.Runtime.RuntimeConfigParser.Task on mobile

* Add maccatalyst target imports per request

3 years agoLazy-allocate ValidationState.CurPos (#54346)
Stephen Toub [Thu, 17 Jun 2021 23:58:30 +0000 (19:58 -0400)]
Lazy-allocate ValidationState.CurPos (#54346)

The array is only used for a subset of validators; no point in paying for this array for every ValidationState instance even if it's not going to be used.

3 years agoFix lots of unnecessary XmlValueGetter delegate allocations (#54344)
Stephen Toub [Thu, 17 Jun 2021 23:57:43 +0000 (19:57 -0400)]
Fix lots of unnecessary XmlValueGetter delegate allocations (#54344)

3 years agoMs.Ext.Options.OptionsBuilder.BindConfiguration adds ConfigurationChangeTokenSource...
Fredrik Høisæther Rasch [Thu, 17 Jun 2021 22:15:45 +0000 (00:15 +0200)]
Ms.Ext.Options.OptionsBuilder.BindConfiguration adds ConfigurationChangeTokenSource to DI (#46740)

3 years agoCodesign apphosts on Mac (#53913)
Mateo Torres-Ruiz [Thu, 17 Jun 2021 22:09:27 +0000 (15:09 -0700)]
Codesign apphosts on Mac (#53913)

* Add CodeSign to HostWriter

* Fix test

* PR feedback

* Add EnableMacOSCodeSign to CreateAppHost
Add tests

* Check that OSPlatform is OSX before running codesign.

* Guard from filepaths containing spaces

* Move apphost exceptions to a single file
Modify apphost exceptions inheritance

* Move AppHostUpdateException

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Add exit code to AppHostSigningException

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoUpdate superpmi_setup.py script with more exclusions (#54309)
Bruce Forstall [Thu, 17 Jun 2021 21:13:47 +0000 (14:13 -0700)]
Update superpmi_setup.py script with more exclusions (#54309)

I noticed a bunch of failures trying to run crossgen2 on these binaries
in one of our collections.

Also, make the checking case-insensitive: I saw that we were failing to
match "corerun.exe" against "CoreRun.exe" that was in the exclusion list.

3 years agoAdd a test for Expression.Property and its handling of property accessors (#54279)
Vitek Karas [Thu, 17 Jun 2021 20:21:55 +0000 (22:21 +0200)]
Add a test for Expression.Property and its handling of property accessors (#54279)

* Add a test for Expression.Property and its handling of property accessors

This mostly a linker test as this effectively validates linker feature from https://github.com/mono/linker/pull/1880.

But having a clean trimming tests here is better validation for this specific case.

* Add one more test case as per feedback

* Remove debugging leftover

3 years ago[mono] Enable more HardwareIntrinsics tests and fix more amd64 intrinsics bugs (...
imhameed [Thu, 17 Jun 2021 17:04:56 +0000 (10:04 -0700)]
[mono] Enable more HardwareIntrinsics tests and fix more amd64 intrinsics bugs (#54127)

Enables nearly all disabled `JIT/HardwareIntrinsics` tests.
`StoreNonTemporal_{r,ro}` and `Sse42.X64/Crc32_{r,ro}` remain disabled due to
issues that are out of scope for this PR.

Changes:

* Enable `pclmul` and `aes` when AOT compiling runtime tests.

* Add a `immediate_unroll_unreachable_default`, used to mark the default case
  in an unrolled immediate switch as unreachable.

* Fix `OP_MULX_HL{32,64}`: the low-word address is sometimes an integer produced
  by ptrtoint

  Fixes compilation of `JIT/HardwareIntrinsics/X86/Bmi2/Bmi2_{r,ro}/**`
  and `JIT/HardwareIntrinsics/X86/Bmi2.X64/Bmi2.X64_{r,o}/**`.

* Implement immediate unrolling for `Ssse3.AlignRight`

  Fixes `JIT/HardwareIntrinsics/X86/Ssse3/Ssse3_{r,ro}/**`.

* Implement the 3-argument overload of `Bmi1.BitFieldExtract`

  Fixes `JIT/HardwareIntrinsics/X86/Bmi1/Bmi1_{r,ro}/**` and
  `JIT/HardwareIntrinsics/X86/Bmi1.X64/Bmi1.X64_{r,ro}/**`.

* Implement immediate unrolling for `Aes.KeygenAssist`

  Fixes `JIT/HardwareIntrinsics/X86/Aes/Aes_{r,ro}/**`.

* Implement immediate unrolling for `Sse41.MultipleSumAbsoluteDifferences`

  Fixes
  `JIT/HardwareIntrinsics/X86/Sse41/MultipleSumAbsoluteDifferences_{r,ro}/**`.

* Mask vector selection index in `OP_XEXTRACT_*` and `OP_XINSERT_*`

  LLVM `insertelement` and `extractelement` yield poison values for lane
  indices that are out of bounds, but the underlying instructions on amd64 only
  care about the lower few bits in the immediate octet and the
  `Extract.UInt64.129` etc. tests in
  `JIT/HardwareIntrinsics/X86/Sse41.X64/Sse41.X64_r` test for this.

  Also, rename `OP_SSE41_INSERT` to `OP_SSE41_INSERTPS` and specialize this to
  the `insertps` overload of `Sse41.Insert`.

  Implement immediate unrolling for `OP_SSE41_INSERTPS`.

  Fixes `JIT/HardwareIntrinsics/X86/Sse41.X64/Sse41.X64_{r,ro}/**` and .
  `JIT/HardwareIntrinsics/X86/Sse41/Sse41_{r,ro}/**`.

* Copy the upper lanes over to the destination in `OP_SSE_CMPSS` and `OP_SSE2_CMPSD`

  Also fix the overloaded types associated with SSE saturating arithmetic LLVM
  intrinsic functions.

  Fixes `JIT/HardwareIntrinsics/X86/Sse2/Sse2_{r,ro}/**` and
  `JIT/HardwareIntrinsics/X86/Sse/Sse_{r,ro}/**`.

* Implement immediate unrolling for `Pclmulqdq.CarrylessMultiply`

  Fixes `JIT/HardwareIntrinsics/X86/Pclmulqdq/Pclmulqdq_{r,ro}`.

3 years agoFix SuperPMI handling of resolveVirtualMethod (#54315)
Bruce Forstall [Thu, 17 Jun 2021 17:01:49 +0000 (10:01 -0700)]
Fix SuperPMI handling of resolveVirtualMethod (#54315)

Change #53567 introduced new functionality to the JIT-EE
resolveVirtualMethod() API. This fixes the SuperPMI implementation
in the case where the API returns `false`, where some data fields
are not initialized.

Fixes crossgen2 SuperPMI collections.

Fixes #54310

3 years agoFix Activity last tag deletion (#54306)
Tarek Mahmoud Sayed [Thu, 17 Jun 2021 16:23:07 +0000 (09:23 -0700)]
Fix Activity last tag deletion (#54306)

3 years agoRemove some overhead from XmlNode.SelectSingleNode (#54299)
Stephen Toub [Thu, 17 Jun 2021 15:27:09 +0000 (11:27 -0400)]
Remove some overhead from XmlNode.SelectSingleNode (#54299)

* Remove unnecessary cost from XmlNode.SelectSingleNode

It's currently implemented by delegating to SelectSingleNodes and returning the first one.  While the list is lazily-populated, this still entails creating an `XPathNodeList`, creating a `List<XmlNode>`, storing the enumerated into the list, and then returning the element from the list, which is then thrown away.  With just a few lines, we can cut through all of that.

* Make XPathScanner and XPathParser into structs

No need for these to be allocated classes.  They can just live on the stack where they're created.

* Reduce ScanName overhead

This shows up on the hot path of parsing the xpath expression.  We can use a span to avoid bounds checking.

* Avoid bounds check in NextChar

NextChar is used by lots of routines to advance to the next character.  We can streamline it to avoid the bounds check when indexing into the string.

* Optimize SkipSpace for there not being any

The typical case is there isn't any whitespace, so inline that fast check.  This was showing up as a few percentage of a simple scenario.

3 years agoDelete invalid assert in PathInternal.CaseSensitivity (#54325)
Stephen Toub [Thu, 17 Jun 2021 14:43:27 +0000 (10:43 -0400)]
Delete invalid assert in PathInternal.CaseSensitivity (#54325)

* Delete invalid assert in PathInternal.CaseSensitivity

* Update PathInternal.CaseSensitivity.cs

3 years agoResolving first part of System.Drawing.Common IlLink warnings (#54076)
Jose Perez Rodriguez [Thu, 17 Jun 2021 13:49:13 +0000 (06:49 -0700)]
Resolving first part of System.Drawing.Common IlLink warnings (#54076)

* Resolving first part of System.Drawing.Common IlLink warnings

* Address PR feedback

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoAdd Dependency for wcf projects to compat pack (#54319)
Viktor Hofer [Thu, 17 Jun 2021 13:19:05 +0000 (15:19 +0200)]
Add Dependency for wcf projects to compat pack (#54319)

3 years agoAdd PipeWriter CanGetUnflushedBytes and UnflushedBytes properties (#54164)
Wraith [Thu, 17 Jun 2021 13:14:16 +0000 (14:14 +0100)]
Add PipeWriter CanGetUnflushedBytes and UnflushedBytes properties  (#54164)

* Add PipeWriter CanGetUnflushedBytes and UnflushedBytes properties and covering tests

* address feedback

3 years ago[mono] Add accessors m_method_is_final and m_method_is_abstract (#54271)
Aleksey Kliger (λgeek) [Thu, 17 Jun 2021 13:05:14 +0000 (09:05 -0400)]
[mono] Add accessors m_method_is_final and m_method_is_abstract (#54271)

* [metadata] Cleanup redundant logic

Follow-up to 4e03f3665ad197b005b361b3b7cdf7fcac298ef2

* Add m_method_is_abstract and m_method_is_final accessors

3 years agoFix profiling R2R code on Windows x64 (#54318)
Anton Lapounov [Thu, 17 Jun 2021 11:33:13 +0000 (04:33 -0700)]
Fix profiling R2R code on Windows x64 (#54318)

The kernel requires the function table to be 4-byte aligned.

3 years ago[mono] Fix comparisons between non runtime types (#54062)
Vlad Brezae [Thu, 17 Jun 2021 08:40:36 +0000 (11:40 +0300)]
[mono] Fix comparisons between non runtime types (#54062)

* [interp] Fix comparisons between non runtime types

We know that the result of object.GetType and ldftn + GetTypeFromHandle are runtime types and we track it on the compilation stack. If type equality operator is applied on two runtime types we use reference equality comparison, otherwise we use the managed implementation which uses Type.Equals.

* [mini] Fix comparisons between non runtime types

We know that the result of object.GetType and ldftn + GetTypeFromHandle are runtime types and we track it on the compilation stack. If type equality operator is applied on two runtime types we use reference equality comparison, otherwise we use the managed implementation which uses Type.Equals.

* [interp] Resolve GetType on constrained valuetype to the actual type

3 years agoIssue 36015 new BinderOption to throw on missing configuration (#53852)
Steve Dunn [Thu, 17 Jun 2021 04:15:52 +0000 (05:15 +0100)]
Issue 36015 new BinderOption to throw on missing configuration (#53852)

3 years agoImprove live variable JitDump output (#54256)
Bruce Forstall [Wed, 16 Jun 2021 22:50:31 +0000 (15:50 -0700)]
Improve live variable JitDump output (#54256)

The variable live range output is unnecessarily verbose. Simplify it; clean it up;
make it smaller; use standard dumpers.

Example, before:
```
////////////////////////////////////////
////////////////////////////////////////
Variable Live Range History Dump for Block 2
IL Var Num 0:
[rcx [ (G_M13669_IG02,ins#0,ofs#0), (G_M13669_IG03,ins#1,ofs#2) ]; rbp[16] (1 slot) [ (G_M13669_IG03,ins#1,ofs#2), NON_CLOSED_RANGE ]; ]
IL Var Num 1:
[rsi [ (G_M13669_IG03,ins#1,ofs#2), NON_CLOSED_RANGE ]; ]
////////////////////////////////////////
////////////////////////////////////////
End Generating code for Block 2
```
After:
```
Variable Live Range History Dump for BB02
V00 this: rcx [(G_M13669_IG02,ins#0,ofs#0), (G_M13669_IG03,ins#1,ofs#2)]; rbp[16] (1 slot) [(G_M13669_IG03,ins#1,ofs#2), ...]
V01 loc0: rsi [(G_M13669_IG03,ins#1,ofs#2), ...]
```

And the end-of-dump output, before:
```
////////////////////////////////////////
////////////////////////////////////////
PRINTING VARIABLE LIVE RANGES:
IL Var Num 0:
[rsi [18 , B5 )rsi [100 , 13A )rsi [14D , 186 )rsi [196 , 1C5 )rsi [1E3 , 271 )rsi [280 , 285 )]
IL Var Num 1:
[rdi [18 , B9 )rdi [100 , 137 )rdi [14D , 184 )rdi [196 , 1C2 )rdi [1E3 , 271 )rdi [280 , 288 )]
IL Var Num 2:
[rbx [18 , CA )rbx [100 , 10D )rbx [14D , 15A )rbx [196 , 1C7 )rbx [1E3 , 271 )rbx [280 , 28B )]
IL Var Num 3:
[rbp [3A , F0 )rbp [100 , 141 )rbp [14D , 18C )rbp [196 , 1D6 )rbp [1E3 , 275 )]
IL Var Num 4:
[r14 [3E , EC )r14 [100 , 13D )r14 [14D , 188 )r14 [196 , 1D2 )r14 [1E3 , 271 )]
IL Var Num 5:
[rcx [22A , 263 )]
////////////////////////////////////////
////////////////////////////////////////
```
After:
```
VARIABLE LIVE RANGES:
V00 arg0: rsi [18, B5); rsi [100, 13A); rsi [14D, 186); rsi [196, 1C5); rsi [1E3, 271); rsi [280, 285)
V01 arg1: rdi [18, B9); rdi [100, 137); rdi [14D, 184); rdi [196, 1C2); rdi [1E3, 271); rdi [280, 288)
V02 arg2: rbx [18, CA); rbx [100, 10D); rbx [14D, 15A); rbx [196, 1C7); rbx [1E3, 271); rbx [280, 28B)
V03 loc0: rbp [3A, F0); rbp [100, 141); rbp [14D, 18C); rbp [196, 1D6); rbp [1E3, 275)
V04 loc1: r14 [3E, EC); r14 [100, 13D); r14 [14D, 188); r14 [196, 1D2); r14 [1E3, 271)
V05 loc2: rcx [22A, 263)
```

3 years agoRemove duplicate tests (#54230)
Bruce Forstall [Wed, 16 Jun 2021 22:48:09 +0000 (15:48 -0700)]
Remove duplicate tests (#54230)

csgen.1 also exists in src\tests\Regressions\coreclr\0582
simple1 also exists in src\tests\JIT\Directed\Arrays

3 years agoRemove System.Drawing code that doesn't work (#54245)
Eric Erhardt [Wed, 16 Jun 2021 22:47:59 +0000 (17:47 -0500)]
Remove System.Drawing code that doesn't work (#54245)

This code only runs on macOS, and expects mono's System.Windows.Forms assembly is loaded into the process. This is causing trim warnings, and it is easier just to delete this code than try to make ILLink happy.

This code is only called from Graphics.FromHwnd, which doesn't work because the Carbon.framework no longer exists on macOS. Issue https://github.com/dotnet/runtime/issues/22221 is tracking the test failures that use FromHwnd.

3 years agoImprove cancellation in StreamPipeReader.ReadAtLeastAsync (#53306)
Emmanuel André [Wed, 16 Jun 2021 22:41:57 +0000 (00:41 +0200)]
Improve cancellation in StreamPipeReader.ReadAtLeastAsync (#53306)

* Improve cancellation in StreamPipeReader.ReadAtLeastAsync

* Introduce task variable

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix tests

* Expect TaskCanceledException on canceled token

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFollow the same failure behavior for [ComImport] classes on Windows with built-in...
Jeremy Koritzinsky [Wed, 16 Jun 2021 22:05:54 +0000 (15:05 -0700)]
Follow the same failure behavior for [ComImport] classes on Windows with built-in COM disabled as non-Windows. (#54298)

3 years agoUpdate to latest version of source index package (#54292)
Alex Perovich [Wed, 16 Jun 2021 21:07:27 +0000 (14:07 -0700)]
Update to latest version of source index package (#54292)