platform/upstream/dotnet/runtime.git
3 years agoFix memory errors related to EventPipe setup with COMPlus_EventPipeConfig (#44068)
Gleb Balykov [Thu, 17 Dec 2020 18:28:45 +0000 (21:28 +0300)]
Fix memory errors related to EventPipe setup with COMPlus_EventPipeConfig (#44068)

- XplatEventLoggerConfiguration configuration owns strings passed to EventPipeProviderConfiguration pProviders, and configurations are freed before pProviders are copied to EventPipeSessionProvider
  - NewArrayHolder shoud be used for pProviders to fix memory leak (delete[] instead of delete)

3 years agoChange CookieParser to handle Expires as a UTC DateTime (#45558)
Michael Bisbjerg [Thu, 17 Dec 2020 18:08:36 +0000 (19:08 +0100)]
Change CookieParser to handle Expires as a UTC DateTime (#45558)

This changes the DateTime parsing to not convert the parsed Expires value to a Local datetime, potentially adding hours to it and making it invalid if it surpasses `DateTime.MaxValue`.

Fixes #45491

3 years agoFix invalid access of Target in SafeCredentialReference (#36875)
Jan Jahoda [Thu, 17 Dec 2020 17:13:49 +0000 (18:13 +0100)]
Fix invalid access of Target in SafeCredentialReference  (#36875)

* Fix invalid test of SafeCredentialReference

* Remove commented code

* fix csproj

* add forgot namespace

* Extract SafeCredentialReference to new file

* Clean up

* Apply suggestions from code review

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

* Fix null ref exception when accessing SecuritySafeHandler in SslSessionSache

* Remove var

* Revert to back cache crearing mechanizm

* Revert "Removed nightly to workaround failing Kestrel init. (#41934)"

This reverts commit a84720cb68b940374e1955783ad55abb119e2fd3.

* Test invalid credentials

* fix windows test csproj

* Clean up cred cache shrink method

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years ago[master] Update dependencies from dotnet/runtime (#46137)
dotnet-maestro[bot] [Thu, 17 Dec 2020 17:08:39 +0000 (17:08 +0000)]
[master] Update dependencies from dotnet/runtime (#46137)

[master] Update dependencies from dotnet/runtime

 - Merge branch 'master' into darc-master-9bfc901c-7973-42f0-ba43-44e57ffa6f96

3 years ago[metadata] If a static field fails while computing size, fail the class (#45918)
monojenkins [Thu, 17 Dec 2020 15:53:21 +0000 (10:53 -0500)]
[metadata] If a static field fails while computing size, fail the class (#45918)

Fixes https://github.com/mono/mono/issues/20650

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
3 years ago[mono] Move noilgen marshaling functions to a separate file (#46046)
Ryan Lucia [Thu, 17 Dec 2020 09:48:39 +0000 (04:48 -0500)]
[mono] Move noilgen marshaling functions to a separate file (#46046)

3 years agoUse destType for size instead of srcType when writing a variable from a register...
Jeremy Koritzinsky [Thu, 17 Dec 2020 04:37:41 +0000 (20:37 -0800)]
Use destType for size instead of srcType when writing a variable from a register to the stack. (#46176)

3 years agoFix performance regression in Activator.CreateInstance on Mono (#46173)
Jan Kotas [Thu, 17 Dec 2020 04:22:22 +0000 (20:22 -0800)]
Fix performance regression in Activator.CreateInstance on Mono (#46173)

Fixes #46170

3 years agofix over-estimation for broadcast* instructions (#46108)
Kunal Pathak [Thu, 17 Dec 2020 03:41:51 +0000 (19:41 -0800)]
fix over-estimation for broadcast* instructions (#46108)

3 years ago[master] Update dependencies from dotnet/icu dotnet/arcade dotnet/xharness dotnet...
dotnet-maestro[bot] [Thu, 17 Dec 2020 03:28:15 +0000 (04:28 +0100)]
[master] Update dependencies from dotnet/icu dotnet/arcade dotnet/xharness dotnet/llvm-project (#46038)

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.20611.1 -> To Version 1.0.0-prerelease.20614.1

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

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

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-alpha.1.20607.1 -> To Version 6.0.0-alpha.1.20614.1

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

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

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.20611.1 -> To Version 1.0.0-prerelease.20615.1

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

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years agoRyuJIT: Don't emit cast helpers for (T)array.Clone() (#45311)
Egor Bogatov [Thu, 17 Dec 2020 01:42:02 +0000 (04:42 +0300)]
RyuJIT: Don't emit cast helpers for (T)array.Clone() (#45311)

Note that Array.Clone()'s return type is the same as the type of its first operand.

This allows optimization of casts on the result of calls to Clone().

3 years agoRemove checkout bundle and job to improve reliability (#46107)
Santiago Fernandez Madero [Thu, 17 Dec 2020 01:08:53 +0000 (17:08 -0800)]
Remove checkout bundle and job to improve reliability (#46107)

* Remove checkout bundle and job to improve reliability

* comment

* Fix build error

* Rename evaluate paths job to a valid name

* Fix references to evaluate path variables

* Condition evaluate paths dependency on common parameter

* Bring back fetch depth to 20

* PR Feedback

3 years agoFix complus casing (#46167)
Dan Moseley [Thu, 17 Dec 2020 00:45:32 +0000 (16:45 -0800)]
Fix complus casing (#46167)

3 years agoFix issue number for the disabled tests. (#46163)
Sergey Andreenko [Thu, 17 Dec 2020 00:40:42 +0000 (16:40 -0800)]
Fix issue number for the disabled tests. (#46163)

3 years agoRe-use ImportThunks in Crossgen2 (#45747)
Simon Nattress [Thu, 17 Dec 2020 00:24:27 +0000 (16:24 -0800)]
Re-use ImportThunks in Crossgen2 (#45747)

Reduce the number of thunks generated to be in line with Crossgen1. Each unique method that is called currently gets its own thunk used for that specific import section entry. Change the thunk calling pattern to match Crossgen1, allowing a small handful of thunks to be re-used for all method / virtual method calls. Overall Crossgen2'd framework size reduced from 92,392,504bytes -> 87,051,832bytes (5.8%)

* Create ImportThunks using the `NodeFactory` instead of allocating directly to allow sharing between different imports.

* On x64, switch method call helper thunk to use following assembly:
```
xor eax, eax
push index
push [module]
jmp [helperCell]
```

* Previously we emitted this assembly for the thunks:
```
lea eax, [instanceCell]
push index
push [module]
jmp [helperCell]
```

* The runtime doesn't need the import cell for the call passing in - it finds it by disassembling the address from `call [helper]`.

* Each thunk encodes the containing import section index; duplication of thunks is thus allowed per import section.

* Share virtual method call fixup cells between all invocations of a given virtual method. Currently, each unique method calling a given virtual method gets a fixup. That can have a runtime performance gain but comes at the expense of binary size. Match Crossgen1 behavior and use a single fixup cell per virtual method.

3 years agoFixes for disassembly support in x86-hosted R2RDump (#46102)
Tomáš Rylek [Thu, 17 Dec 2020 00:00:26 +0000 (01:00 +0100)]
Fixes for disassembly support in x86-hosted R2RDump (#46102)

1) We need to remove the PlatformTarget spec to make sure
x86-hosted R2RDump actually runs under 32-bit host, otherwise it
fails to load x86-targeting coredistools.dll. Thanks to Michal
for pointing that out.

2) I have removed Zach's workaround blocking disassembly on x86.

3) Based on JanV's advice I have marked all the interface methods
as using the cdecl calling convention in accordance with the
native declarations.

4) I found out that Address was incorrectly declared as a 64-bit
integer in the PInvoke declaration while in reality it should be
an IntPtr (native int).

With these changes I'm for the first time able to disassemble
x86-targeting System.Private.CoreLib using the x86-hosted R2RDump.

Thanks

Tomas

3 years agoFix some regressions in ASP.NET benchmarks (#46120)
Koundinya Veluri [Wed, 16 Dec 2020 23:27:34 +0000 (15:27 -0800)]
Fix some regressions in ASP.NET benchmarks (#46120)

- https://github.com/dotnet/runtime/pull/44265 seems to have caused large regressions on Windows and Linux-arm64. During that change we had tested adding the `Sleep(1)` to some `ConcurrentQueue` operations in contending cases, and not spin-waiting at all in forward-progressing cases. Not spin-waiting at all where possible in contending cases seemed to be better or equal for the most part (compared with spin-waiting without `Sleep(1)`), so I have removed spin-waiting in forward-progressing cases in `ConcurrentQueue`.
- There were some regressions from the portable thread pool on Windows. I have moved/tweaked a slight delay that I had added early on, after changes thereafter it lost its intention, with the changes it goes back to the original intention and seems to resolve some of the gap, but maybe not all of it in some tests. We'll check the graphs after this change and see if there is more to investigate. There are also other things to improve on Windows, and many of those may be separate from the portable thread pool but some may be relevant to the changes in perf characteristics.

3 years agoremove workaround in #40310 (#46154)
Larry Ewing [Wed, 16 Dec 2020 22:41:52 +0000 (16:41 -0600)]
remove workaround in #40310 (#46154)

3 years agoMake StartInfo_TextFile_ShellExecute test more reliable (#46133)
Adam Sitnik [Wed, 16 Dec 2020 20:25:29 +0000 (21:25 +0100)]
Make StartInfo_TextFile_ShellExecute test more reliable (#46133)

* nits

* use notepad.exe in explicit way, don't rely on it being associated with .txt files

otherwise things like notepad++ gets opened (common on dev machines) and the test fails

* run the tests for all cultures

* Revert "use notepad.exe in explicit way, don't rely on it being associated with .txt files"

This reverts commit e7ec66d49fe9f301987d4dd2d2ef8e03092f7a10.

* add FileAssociations helpers

* use a unique extension name and associate Notepad with it so we are always sure that Notepad will be used (not other text editors)

3 years agoUse InstallerPackageVersion for hostfxr dependency on dotnet-host package. (#46099)
Jeremy Koritzinsky [Wed, 16 Dec 2020 20:12:20 +0000 (12:12 -0800)]
Use InstallerPackageVersion for hostfxr dependency on dotnet-host package. (#46099)

3 years agoRemove eventpipe from old Mono makefile build. (#46065)
Johan Lorensson [Wed, 16 Dec 2020 20:01:44 +0000 (21:01 +0100)]
Remove eventpipe from old Mono makefile build. (#46065)

3 years ago[mono] Use [MSBuild]::NormalizeDirectory in more places (#46145)
Aleksey Kliger (λgeek) [Wed, 16 Dec 2020 19:59:30 +0000 (14:59 -0500)]
[mono] Use [MSBuild]::NormalizeDirectory in more places (#46145)

3 years agoGeneralize SuperPMI for cross-compilation scenarios (#46114)
Bruce Forstall [Wed, 16 Dec 2020 18:20:10 +0000 (10:20 -0800)]
Generalize SuperPMI for cross-compilation scenarios (#46114)

Now, you can do Linux arm32 asm diffs on Windows x86, using the
pre-created Linux arm collection, as follows:

```
src\coreclr\scripts\superpmi.py asmdiffs -arch x86 -target_arch arm -jit_name clrjit_unix_arm_x86.dll -target_os Linux
```

You can do the same on Windows x64, using:
```
src\coreclr\scripts\superpmi.py asmdiffs -arch x64 -target_arch arm -jit_name clrjit_unix_arm_x64.dll -target_os Linux
```
but there are many failures in that scenario that still need to be investigated.

This change:
1. Fixes a bug with 32-bit pointer to 64-bit unsigned integer sign extension
(we don't want sign extension).
2. Allows more general specification of target to account for more general
coredistools (removes the "arm64 on x64" and "arm32 on x86" only rule).

Fixes #46095

3 years agoFix and reenable TestUserCredentialsPropertiesOnWindows (#46083)
Adam Sitnik [Wed, 16 Dec 2020 17:46:07 +0000 (18:46 +0100)]
Fix and reenable TestUserCredentialsPropertiesOnWindows  (#46083)

* add missing CharSet = CharSet.Unicode so the NetUserDel can work properly

* make the user name more unique, ensure that it's always removed properly

* ensure the new user can access the .exe (otherwise you get Access is denied exception)

* remove active issue attribute

* nits

* don't run this test on Nano, as it has no "netapi32.dll"

3 years agoFix missing versions file and variable for packages (#46143)
Viktor Hofer [Wed, 16 Dec 2020 17:32:32 +0000 (18:32 +0100)]
Fix missing versions file and variable for packages (#46143)

Regressed with https://github.com/dotnet/runtime/commit/f272bc5cf7737a3ce73b88083fed5cace52a2b16 which changed the default target from Build to Pack. Hooking onto both Build and Pack just for safety.

3 years agoRemove redundant and incorrect checking. (#46094)
Fan Yang [Wed, 16 Dec 2020 17:29:39 +0000 (12:29 -0500)]
Remove redundant and incorrect checking. (#46094)

3 years agore-enable GetProcessesByName_ProcessName_ReturnsExpected test which used to fail...
Adam Sitnik [Wed, 16 Dec 2020 15:57:33 +0000 (16:57 +0100)]
re-enable GetProcessesByName_ProcessName_ReturnsExpected test which used to fail on Nano (#46140)

3 years agoSort stable versions in pkgindex (#46135)
Viktor Hofer [Wed, 16 Dec 2020 14:35:58 +0000 (15:35 +0100)]
Sort stable versions in pkgindex (#46135)

3 years agoAdd a few tests for Env Vars edge cases (#46039)
Adam Sitnik [Wed, 16 Dec 2020 14:27:18 +0000 (15:27 +0100)]
Add a few tests for Env Vars edge cases (#46039)

3 years agoUse MonoProjectRoot in the Mono sample project references (#46129)
Maxim Lipnin [Wed, 16 Dec 2020 13:31:10 +0000 (16:31 +0300)]
Use MonoProjectRoot in the Mono sample project references (#46129)

3 years ago[master] Update dependencies from dotnet/runtime (#45387)
dotnet-maestro[bot] [Wed, 16 Dec 2020 13:19:12 +0000 (14:19 +0100)]
[master] Update dependencies from dotnet/runtime (#45387)

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20580.7

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20601.3

* Replace obsoleted json serializer option

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.'

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

runtime.native.System.IO.Ports , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20602.2

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20603.3

* Use PDFMT=PORTABLE option for ilproj

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20603.13

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20604.10

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20605.2

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20606.6

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20608.2

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20609.2

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20609.15

* Add workaround for #45908

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20611.2

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20611.23

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

runtime.native.System.IO.Ports , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NET.Sdk.IL , Microsoft.NETCore.DotNetHost , System.Text.Json
 From Version 5.0.0-alpha.1.19563.3 -> To Version 6.0.0-alpha.1.20612.4

* Update versions

* Remove PDBFMT option

* Apply ilasm .locals workaround for more files

See https://github.com/dotnet/runtime/issues/45908

* Revert "Apply ilasm .locals workaround for more files"

This reverts commit 54eb3ee53970b430b87ea2044475a2bbc872f20f.

* Revert "Add workaround for #45908"

This reverts commit 290631058301fc791d261395f436b3b875a003ca.

* Update versions

* Disable tests that fail on Mono due to https://github.com/dotnet/runtime/issues/46124

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoFix cross compiling linux managed assemblies on windows (#45975)
Alex Perovich [Wed, 16 Dec 2020 11:10:10 +0000 (03:10 -0800)]
Fix cross compiling linux managed assemblies on windows (#45975)

* Fix cross compiling linux managed assemblies on windows

This is needed to fix the source index.

* More targeted fix

* Update Configurations.props

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoRun wasm console sample on Helix (#45768)
Maxim Lipnin [Wed, 16 Dec 2020 10:03:58 +0000 (13:03 +0300)]
Run wasm console sample on Helix (#45768)

- Included the WASM console sample project to the library test build. The sample can still be built/run locally using make file.
- Added zipping/copying the sample application to helix directory from where it can be consumed by CI.
- To run on Helix, tried to use a simple helix work item which wouldn't rely on generated RunTests.sh and just call the xharness command directly.

Relates to https://github.com/dotnet/runtime/issues/43865

3 years agoMisc fixes from runtimelab:NativeAOT (#46112)
Jan Kotas [Wed, 16 Dec 2020 09:46:42 +0000 (01:46 -0800)]
Misc fixes from runtimelab:NativeAOT (#46112)

3 years ago[mono] Make HelloWorld and wasm samples compile again (#46113)
Aleksey Kliger (λgeek) [Wed, 16 Dec 2020 07:42:02 +0000 (02:42 -0500)]
[mono] Make HelloWorld and wasm samples compile again (#46113)

* [mono] Make HelloWorld sample compile again

Since 296aaf818ec02101226845aea39ca14d32519cf2 it seems we need
`$(NetCoreAppToolCurrent)` as the `TargetFramework`

* Also fixup wasm samples

3 years agoMake the native thread pool initialization variable volatile (#46115)
Koundinya Veluri [Wed, 16 Dec 2020 06:50:12 +0000 (22:50 -0800)]
Make the native thread pool initialization variable volatile (#46115)

- Necessary on arm32/arm64 such that if `IsInitialized()` returns true, initialized variables will also be observed correctly
- Fixes https://github.com/dotnet/runtime/issues/46084

3 years agoFix format of JIT-EE version GUID (#46116)
Bruce Forstall [Wed, 16 Dec 2020 06:42:27 +0000 (22:42 -0800)]
Fix format of JIT-EE version GUID (#46116)

3 years agoFix remaining ILLink warnings in System.Reflection (#45984)
Eric Erhardt [Wed, 16 Dec 2020 03:33:00 +0000 (21:33 -0600)]
Fix remaining ILLink warnings in System.Reflection (#45984)

* Add RequiresUnreferencedCode to Delegate constructors

Contributes to #45623

* Add RequiresUnreferencedCode to some internal Reflection methods to address ILLink warnings.

* Address remaining ILLink warnings in Reflection.Emit.

* Respond to PR feedback

Annotate Delegate.BindToMethod with DynamicallyAccessedMembers

Fix up requires unreferenced code comments

* Update API Compat txt for Delegate.CreateDelegate attribute removal

* Fix Mono ILLink warnings

3 years agouse pack on csproj to build the packages (#45564)
Anirudh Agnihotry [Wed, 16 Dec 2020 03:31:50 +0000 (19:31 -0800)]
use pack on csproj to build the packages (#45564)

* use pack on csproj to build the packages

* having projectreferences available during project evaluation and then having pack task handling is project isPackable or not

* default target as pack

* using default sdk tags and adding missing ilproj

* exclude shproj

* Do not use a recursive regex

* add csproj for projects with no build output

* adding comments about purpose of wrapper projects

3 years agoAdd another way to re-trigger pipelines in PR.
Santiago Fernandez Madero [Wed, 16 Dec 2020 02:03:50 +0000 (18:03 -0800)]
Add another way to re-trigger pipelines in PR.

3 years ago[wasm][tests] Exit the script if `WasmTestRunner` build fails (#46048)
Ankit Jain [Wed, 16 Dec 2020 00:51:10 +0000 (19:51 -0500)]
[wasm][tests] Exit the script if `WasmTestRunner` build fails (#46048)

* [wasm][tests] Exit the script if `WasmTestRunner` build fails

If building the `WasmTestRunner.proj` on helix fails, then the error
gets ignored, and script execution continues. And that results in the
failure to be shown as:

```
      /home/helixbot/work/9CE408BA/w/BF5C0A02/e/JIT/Methodical/eh/interactions/throw1dimarray_d/throw1dimarray_d.sh: line 136: cd: WasmApp: No such file or directory
      /home/helixbot/work/9CE408BA/w/BF5C0A02/e/JIT/Methodical/eh/interactions/throw1dimarray_d/throw1dimarray_d.sh: line 137: ./run-v8.sh: No such file or directory
```

.. which is misleading. Looking at the execution log shows that the real error was:
```
      Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
      Copyright (C) Microsoft Corporation. All rights reserved.

        AppDir: /home/helixbot/work/9CE408BA/w/BF5C0A02/e/JIT/Methodical/eh/interactions/throw1dimarray_d/WasmApp/
        TestBinDir: /home/helixbot/work/9CE408BA/w/BF5C0A02/e/JIT/Methodical/eh/interactions/throw1dimarray_d
        ArtifactsBinDir:
      /home/helixbot/work/9CE408BA/p/build/WasmApp.targets(11,5): error : Failed to load assembly reference 'System.Windows.Forms, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' for 'Except, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null': Could not find assembly 'System.Windows.Forms, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly. [/home/helixbot/work/9CE408BA/p/wasm-test-runner/WasmTestRunner.proj]
```

So, exit the script if the build fails.

* [wasm] Support RunOnly tests with wasm

Some test projects have `<CLRTestKind>RunOnly</CLRTestKind>`, eg.
`GitHub_26491_SingleReturnSynchronized`. In this particular project, it
doesn't have it own code/assembly, and just runs another assembly.

But the default script generated for the test adds the build command for
`WasmTestRunner.proj`, which fails here because there is no assembly to
bundle!

This manifested for
`JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized/GitHub_26491_SingleReturnSynchronized.sh` as:

```
      BEGIN EXECUTION
      Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
      Copyright (C) Microsoft Corporation. All rights reserved.

        AppDir: /home/helixbot/work/AA96097C/w/9CC508B9/e/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized/WasmApp/
        TestBinDir: /home/helixbot/work/AA96097C/w/9CC508B9/e/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized
        ArtifactsBinDir:
      /home/helixbot/work/AA96097C/p/build/WasmApp.targets(11,5): error : Could not find assembly '/home/helixbot/work/AA96097C/w/9CC508B9/e/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized/GitHub_26491_SingleReturnSynchronized.dll' [/home/helixbot/work/AA96097C/p/wasm-test-runner/WasmTestRunner.proj]
      Test Harness Exitcode is : 1
```

This *test* wasn't failing earlier, because the build command would
fail, but the script continued execution. And the subsequent shell
script worked as expected. But now we exit if the build command fails,
causing the whole test to fail!

Solution: Honor `$(CLRTestKind) == RunOnly`, and don't emit the build
command in that case.

* Just to give this more context:

this was for `src/tests/JIT/Regression/JitBlue/GitHub_2649`

it has two projects:

A: `GitHub_26491_MultipleReturns.ilproj`
B: `GitHub_26491_SingleReturnSynchronized.ilproj`
Project A produces the test assembly. And we generate a wasm app for that.

Project B is just meant to run Project A's assembly. It does not need it's own wasm app. That's why it has
`<CLRTestKind>RunOnly</CLRTestKind>`

So, as the fix, we add the build WasmTestRunner.proj command to the generated shell script only if `CLRTestKind==BuildAndRun`.

3 years agoRemove extraneous UsingTask (#46097)
Jeremy Koritzinsky [Wed, 16 Dec 2020 00:38:51 +0000 (16:38 -0800)]
Remove extraneous UsingTask (#46097)

We no longer use the CopyNupkgAndChangeVersion task, so we can remove it.

3 years agoFix MethodDesc validation for FCalls (#45998)
Jan Kotas [Wed, 16 Dec 2020 00:07:34 +0000 (16:07 -0800)]
Fix MethodDesc validation for FCalls (#45998)

3 years agoFollow-up fix for some PAL tests that compare sleep/wait times from one thread to...
Koundinya Veluri [Tue, 15 Dec 2020 23:06:20 +0000 (15:06 -0800)]
Follow-up fix for some PAL tests that compare sleep/wait times from one thread to another (#46060)

Follow-up fix for some PAL tests that compare sleep/wait times from one thread to another

Follow-up fix to https://github.com/dotnet/runtime/pull/45948, need to reset the global variable before creating the thread, as the test runs more than once

3 years agoFix building the crossdacs with ninja. (#46089)
Jeremy Koritzinsky [Tue, 15 Dec 2020 21:48:24 +0000 (13:48 -0800)]
Fix building the crossdacs with ninja. (#46089)

3 years agoFix assert in SampleProfiler enabling on startup (#46045)
Sung Yoon Whang [Tue, 15 Dec 2020 21:47:27 +0000 (13:47 -0800)]
Fix assert in SampleProfiler enabling on startup (#46045)

3 years agoFix ilasm crash on empty local variable name (#46080)
Jan Kotas [Tue, 15 Dec 2020 21:28:05 +0000 (13:28 -0800)]
Fix ilasm crash on empty local variable name (#46080)

Fixes #45908

3 years agoSocketAsyncContext.Unix: fix double processing of AsyncOperations (#45683)
Tom Deseyn [Tue, 15 Dec 2020 21:04:37 +0000 (22:04 +0100)]
SocketAsyncContext.Unix: fix double processing of AsyncOperations (#45683)

* SocketAsyncContext.Unix: fix double processing of AsyncOperations

When a socket event occurs, the pending operations gets triggered
to continue their work by calling the Process method.

The changes in https://github.com/dotnet/runtime/pull/37974
cause Process to be called twice on the same AsyncOperation.

When Process is called, the operation can complete, and the
AsyncOperation instance may be reused for a different operation.

* Remove processAsyncEvents

3 years agoadding null check on provider registration (#46002)
Ove Bastiansen [Tue, 15 Dec 2020 18:57:52 +0000 (19:57 +0100)]
adding null check on provider registration (#46002)

fix #45599

3 years agoEnable crossgen SPMI collection for libraries (#46058)
Kunal Pathak [Tue, 15 Dec 2020 18:47:35 +0000 (10:47 -0800)]
Enable crossgen SPMI collection for libraries (#46058)

* Better printing of files getting copied

* Exclude Core_Root folder for tests collection

* Perform libraries collection using crossgen

3 years agoMake EventLog work without .NETFramework (#45884)
Eric StJohn [Tue, 15 Dec 2020 17:33:01 +0000 (09:33 -0800)]
Make EventLog work without .NETFramework (#45884)

* Make EventLog work without .NETFramework

* Use a project file instead of targets to create message DLL

* Add EventLogMessagesTests

* Address feedback

* Exclude EventLogMessage tests on net48

* Apply code review feedback

Also fix one test which would fail on machine without .NETFramework.

* Fix HelpLink test

3 years agoImplementation of full EventPipeDiagnosticServer C library CoreClr shim. (#45354)
Johan Lorensson [Tue, 15 Dec 2020 07:49:56 +0000 (08:49 +0100)]
Implementation of full EventPipeDiagnosticServer C library CoreClr shim. (#45354)

Break out build of eventpipe library into vm/eventing/eventpipe
(both for C++ as well as C library).

Introduce ability to build CoreClr with C++ or C version of
EventPipe/DiagnosticServer library. Beneficial during transition
to have both library useable, C++ library is still default,
but new cmake feature FEATURE_PERFTRACING_C_LIB can be defined
in order to build and use C library instead of C++ version.

Due to restrictions around standard headers in CoreClr,
moved out C library IPC PAL into debug_pal
(where C++ library has its IPC PAL). This unfortunately came
with some additional needed changes since library had dependencies
against runtime, so needed to make PAL sources independent of
majority of EventPipe library. Added same feature as for
EventPipe/DiagnosticServer library, possible to build debug_pal
with C or C++ IPC PAL sources.

Complemented a couple of CoreClr types with NoThrow methods
so they could be used in shim containers without need for
try/catch, CQuickArray::PushNoThrow, SHash::AddNoThrow.

Missing strtoull on non Windows, add PAL_strtoull
into PAL (PAL already included UTF16 version of the same functionality).

3 years agoEnable non-blittable struct returns on UnmanagedCallersOnly (#45625)
Jeremy Koritzinsky [Tue, 15 Dec 2020 06:26:30 +0000 (22:26 -0800)]
Enable non-blittable struct returns on UnmanagedCallersOnly (#45625)

* Allow non-primitive struct returns to not require a stub. Fixes #35928.

* Support propagating the UnmanagedCallersOnly calling convention to the JIT. Block UnmanagedCallersOnly in crossgen1 since the attribute parsing code isn't included.

* Support passing through the calling convention for UnmanagedCallersOnly in crossgen2

* Fix clang errors.

* Fix stack calculation.

* Fix usings

* Clean up jitinterface.

* Remove invalid assert.

* Fix up stdcall name mangling lookup.

* Fix flag condition.

* Use the register var type when copying from the register to the stack.

* Change flag check for readability.

* Rename variables to remove shadowing.

* Fix formatting.

* Create new getEntryPointCallConv method on the EE-JIT interface to handle all calling convention resolution and support extensible calling conventions.

* Remove unreachable code.

* Remove now unused getUnmanagedCallConv jitinterface method (replaced by getEntryPointCallConv).

* Fix formatting.

* Rename getEntryPointCallConv and only call it with a method when it's a P/Invoke or Reverse P/Invoke.

* Pass SuppressGCTransition through the getUnmanagedCallConv JIT-EE interface API.

* Refactor callconv handling so we can handle reverse P/Invokes with the callconv in the signature (and not in an UnmanagedCallersOnly attribute).

* Clean up whitespace.

* Pass MethodIL as the scope for the signature to enable propagating down annotations for calli's in P/Invokes.

* Remove usages of CORINFO_CALLCONV_FOO where FOO is an unmanaged callconv. move the definitions of those ones to the interpreter since that's the only place they're used.

* SuppressGC cleanup.

* Rename superpmi struct

* Add default condition to make clang happy.

* change enums to make clang happy.

* Remove CORINFO_CALLCONV_C and family from interpreter.

* Fix up handling of managed function pointers and remove invalid assert.

* Continue to use sigflag for suppressgc workaround.

* Clean up comment wording.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Remove more MethodIL passing we don't need any more

* Update src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix SigTypeContext creation.

* Pass context by ptr.

* Fix formatting.

* Clear the Reverse P/Invoke flag when compiling inlinees. It's only needed on the entry-point functions.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoFix GC vars dump at call sites for arm/arm64 (#46056)
Bruce Forstall [Tue, 15 Dec 2020 03:37:27 +0000 (19:37 -0800)]
Fix GC vars dump at call sites for arm/arm64 (#46056)

3 years agoEnable File.Copy to EXFAT volumes when not running as root (#46027)
Dan Moseley [Tue, 15 Dec 2020 03:20:09 +0000 (19:20 -0800)]
Enable File.Copy to EXFAT volumes when not running as root (#46027)

* Allow File.Copy to succeed when futimens fails with EPERM

* Manual test

* Update pal_io.c

3 years agoPR: Add test code coverage for Host.StopAsync (#40875)
Werner Mairl [Tue, 15 Dec 2020 02:16:09 +0000 (03:16 +0100)]
PR: Add test code coverage for Host.StopAsync (#40875)

* Add test code coverage for Host.StopAsync

Verifies StopAsync() doesn't throw CanceledException given a canceled token

Fix #40700

* implement using/dispose for hosts inside tests

3 years agoFix bad case-insensitive ASCII equality check (#45928)
Levi Broderick [Tue, 15 Dec 2020 01:01:29 +0000 (17:01 -0800)]
Fix bad case-insensitive ASCII equality check (#45928)

3 years agoFix previously overlooked path to pgocheck.py (src/coreclr/src) (#46019)
Tomáš Rylek [Mon, 14 Dec 2020 23:56:53 +0000 (00:56 +0100)]
Fix previously overlooked path to pgocheck.py (src/coreclr/src) (#46019)

Looking around the script I also noticed that __SourceDir
is not used anymore so I removed it.

Thanks

Tomas

3 years agoUpdating darc dependencies and enabling closure (#45781)
Anirudh Agnihotry [Mon, 14 Dec 2020 22:40:50 +0000 (14:40 -0800)]
Updating darc dependencies and enabling closure (#45781)

* automatic version updates

* coreclr projects retargets to net5.0

* Removing manual addition of knownFrameworkReference

* disavling implicit references for sfx projects

* mono changes

* enable package testing

* installer changes

* installer tests ref pack changes

* remove the known framework reference for unit tests

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
* TestInfraTargetFramework -> to net5.0

* set netcoremaxversion property for test utils

* retargeting mono sample apps to net5.0

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoEnable Supported attributes from sdk for non browser build, fix related warnings...
Buyaa [Mon, 14 Dec 2020 22:31:44 +0000 (14:31 -0800)]
Enable Supported attributes from sdk for non browser build, fix related warnings (#45504)

3 years ago[wasm] Move Wasm app building targets to new WasmApp.targets (#45977)
Ankit Jain [Mon, 14 Dec 2020 22:13:38 +0000 (17:13 -0500)]
[wasm] Move Wasm app building targets to new WasmApp.targets (#45977)

* [wasm] Don't quote multiple msbuild args

Else it ends up in the command line as:
    `dotnet build foo.proj "/p:TargetOS=Browser /p:Configuration=Release"`
instead of
    `dotnet build foo.proj /p:TargetOS=Browser /p:Configuration=Release`

* [wasm] Fix the name for MicrosoftNetCoreAppRuntimePackRidDir

We have `MicrosoftNetCoreAppRuntimePackDir=artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/`

.. and `MicrosoftNetCoreAppRuntimePack*Rid*Dir` as `$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/browser-wasm/`.

But the wasm samples, and debugger test project files mixed up the
naming, though with correct paths. The following commit will move the
wasm build stuff to a single file, and this change will be useful to
have uniform, and correct naming.

* [wasm] Add new `WasmApp.targets`

Move the uses of `WasmAppBuilder`, and
`WasmLoadAssembliesAndReferences` tasks to a single targets file -
`src/mono/wasm/build/WasmApp.targets`.

- Any project that wants to use that, can import the file, and set up the
various properties before the target `WasmBuildApp` gets executed.

- `WasmBuildApp` is not run by default. The importing project will have
to do that.

- By default, the `WasmLoadAssembliesAndReferences` task is not run, and
the specified `@(WasmAssembliesToBundle)` are directly passed to
`WasmAppBuilder`.
    - If the project needs assembly dependencies to be resolved, then
    set `$(WasmResolveAssembliesBeforeBuild) == true`.

- Assemblies to be bundled with the app are set via
`@(WasmAssembliesToBundle)` (which optionally will have dependencies
resolved)

The various task inputs correspond to properties as:

```
      AssemblySearchPaths               : @(WasmAssemblySearchPaths)

      Assemblies                        : @(WasmAssembliesToBundle)

      AppDir                            : $(WasmAppDir)
      MicrosoftNetCoreAppRuntimePackDir : $(MicrosoftNetCoreAppRuntimePackRidDir)
      MainAssembly                      : $(WasmMainAssemblyPath)
      MainJS                            : $(WasmMainJSPath)
      InvariantGlobalization            : $(WasmInvariantGlobalization)
      SatelliteAssemblies               : @(WasmSatelliteAssemblies)
      FilesToIncludeInFileSystem        : @(WasmFilesToIncludeInFileSystem)
      DebugLevel                        : $(WasmDebugLevel)
```

This should be a step towards eventually having this build as a sdk.

* [wasm] Use the correct assembly path property

* Check for TargetOS==Browser

* Pass remaining WasmAppBuilder args - IcuDataFileName, and RemoteSources

* WasmAppBuilder: don't emit run-v8.sh in the task

* WasmTestRunner: use the new WasmApp.targets

* Include WasmMainAssemblyPath for dependency resolution, by default

* Remove unused run-v8.sh generation

* Add back run-v8.sh for console sample, WasmTestRunner, and lib tests

* WasmApp.targets: Use a default path for run-v8.sh

.. and control it's generation through `$(WasmGenerateRunV8Script)`

* run-v8.sh: use only the filename on the command line

* update README.md

* [wasm] Make the wasm targets conditional on `TargetOS==Browser`

.. instead of conditionally importing `WasmApp.targets`. This allows
other targets to depend on wasm targets, and execute only if it makes
sense.

Based on @lewing's feedback.

* [wasm][tests] fix check for when to generate run-v8.sh

* WasmTestRunner.proj: fix typo

* [wasm] Always generate the run-v8.sh script, for browser runs

The `Scenario==WasmTestOnBrowser` seems to fail for JIT tests, which
don't use the browser.

* [wasm] Fix tests

The real issue seems to be that the helix bundle doesn't have
`WasmApp.targets`. Fixing that, which should hopefully fix the tests!

* [wasm] Another attempt at fixing the tests

Mimic earlier behavior of having a `BundleTestWasmApp`, and making it
conditional on `TargetOS == Browser`.

* fix property reference

* [wasm] skip missing assemblies for the jit tests, same as the original code

3 years agoUse netfxreference.props to provide the shims for the platform manifest. (#45573)
Jeremy Koritzinsky [Mon, 14 Dec 2020 21:21:32 +0000 (13:21 -0800)]
Use netfxreference.props to provide the shims for the platform manifest. (#45573)

* Use netfxreference.props to provide the shims for the platform manifest.

* PR feedback.

3 years agoAuto-generate all C++ header overrides of the entire jit interface (#45920)
David Wrighton [Mon, 14 Dec 2020 20:47:32 +0000 (12:47 -0800)]
Auto-generate all C++ header overrides of the entire jit interface (#45920)

* Auto-generate all C++ header overrides of the entire jit interface
- This reduces the amount of manual change required when updating the jit interface to just implementation changes
- Will cause compile errors if any api is removed from the interface, but not removed from various implementations

* Consistently specify override on the jit ee interface header
- Satisfies warnings on clang

3 years agoUpdate testing.md (#46043)
Fan Yang [Mon, 14 Dec 2020 20:39:06 +0000 (15:39 -0500)]
Update testing.md (#46043)

skipstressdependencies switch was removed from the runtime tests build script.

3 years agoCreate more informational assert collection log for FunctionalTests o… (#44350)
LateApexEarlySpeed [Mon, 14 Dec 2020 16:15:59 +0000 (00:15 +0800)]
Create more informational assert collection log for FunctionalTests o… (#44350)

3 years ago[mono] Fix race condition in Utils + remove duplicated code (#46029)
Egor Bogatov [Mon, 14 Dec 2020 12:31:52 +0000 (15:31 +0300)]
[mono] Fix race condition in Utils + remove duplicated code (#46029)

3 years ago[master] Update dependencies from mono/linker (#45926)
dotnet-maestro[bot] [Mon, 14 Dec 2020 11:29:08 +0000 (12:29 +0100)]
[master] Update dependencies from mono/linker (#45926)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoDisable tests for 43931 and 46030 (#46031)
Miha Zupan [Mon, 14 Dec 2020 11:17:24 +0000 (12:17 +0100)]
Disable tests for 43931 and 46030 (#46031)

* Disable tests for 43931 and 46030

* Add [ActiveIssue] in comment

3 years agoOptimize percent-encoded UTF8 processing in Uri (#32552)
Miha Zupan [Mon, 14 Dec 2020 11:01:12 +0000 (12:01 +0100)]
Optimize percent-encoded UTF8 processing in Uri (#32552)

* Optimize percent-encoded UTF8 processing in Uri

* Rename charsConsumed to bytesConsumed

* Use ValueStringBuilder Append(char*, int) instead of Append(ROS<char>)

* Add tests for PercentEncodingHelper

* Use string literals instead of char.ConvertFromUtf32

* Use sizeof(uint) instead of 4

* Add missing license headers

* Improve codegen by using temporary local copy

* Correct Debug asserts

* Add ValueStringBuilder.Append(Rune)

* Improve hex decoding throughput

* Move VSB.Append(Rune) to a Uri-specific partial VSB file

* Add missing csproj link

* Add more comments documenting PercentEncodingHelper's logic

* Fix rebase conflicts

* Address PR feedback

3 years agoSortedDictionary Copy optimization (#45659)
John Call [Mon, 14 Dec 2020 10:56:01 +0000 (02:56 -0800)]
SortedDictionary Copy optimization (#45659)

* Sorted Dictionary Copy optimization

* Update src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs

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

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoRemove nonsensical comments about fixed statement (#46013)
xtqqczze [Mon, 14 Dec 2020 01:46:25 +0000 (01:46 +0000)]
Remove nonsensical comments about fixed statement (#46013)

3 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20201210.4 (#46004)
dotnet-maestro[bot] [Sun, 13 Dec 2020 23:59:00 +0000 (15:59 -0800)]
Update dependencies from https://github.com/dotnet/arcade build 20201210.4 (#46004)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoFix FC_NO_TAILCALL with newer compilers (#45999)
Jan Kotas [Sun, 13 Dec 2020 20:05:48 +0000 (12:05 -0800)]
Fix FC_NO_TAILCALL with newer compilers (#45999)

The C11 standard treats trivial infinite loops as undefined behavior and allows
compilers to optimize them out completely.

Add "volatile" on FC_NO_TAILCALL to defeat this optimization

3 years ago[aot] Quote the -Wl,install_name argument to clang. (#46000)
monojenkins [Sun, 13 Dec 2020 07:47:18 +0000 (02:47 -0500)]
[aot] Quote the -Wl,install_name argument to clang. (#46000)

Fixes https://github.com/mono/mono/issues/20606.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoFix macos DAC & DBI search dependency paths (#45978)
Steve MacLean [Sat, 12 Dec 2020 22:23:29 +0000 (17:23 -0500)]
Fix macos DAC & DBI search dependency paths (#45978)

* Fix macos DAC & DBI search dependency paths

* Only apply changes to macos-arm64

3 years agosuperpmi.py: Add support for easily collecting crossgen of assemblies (#45996)
Bruce Forstall [Sat, 12 Dec 2020 20:52:27 +0000 (12:52 -0800)]
superpmi.py: Add support for easily collecting crossgen of assemblies (#45996)

Add a new `--crossgen` option to `collect` that will do a SuperPMI
collection by invoking crossgen on the set of assemblies specified
by the `-assemblies` argument.

Renamed the `-pmi_assemblies` argument to `-assemblies` so it can be
used by both `--pmi` and the new `--crossgen` option.

You can use both `--pmi` and `--crossgen` to collect both a PMI
and crossgen run across the same set of assemblies.

3 years agoRemove superpmi.py asmdiff view with VS Code options (#45993)
Bruce Forstall [Sat, 12 Dec 2020 20:50:14 +0000 (12:50 -0800)]
Remove superpmi.py asmdiff view with VS Code options (#45993)

The superpmi.py asmdiffs code is complicated by the existence of
various options to invoke VS Code to view diffs. Remove these options
(which I believe are unused, and shouldn't be in this location anyway)
and simplify the code.

3 years agoAdd a GC info option to superpmi.py asm diffs (#45992)
Bruce Forstall [Sat, 12 Dec 2020 20:46:56 +0000 (12:46 -0800)]
Add a GC info option to superpmi.py asm diffs (#45992)

Add `--gcinfo` to an `asmdiffs` command to get asm diffs with GC
info dumped via the `COMPlus_JitGCDump` / `COMPlus_NgenGCDump` variables.

Improved the output of dasm/dump locations if there are no seen diffs.

3 years agoUse C# 7.3 pattern-based fixed statement (#45969)
xtqqczze [Sat, 12 Dec 2020 15:11:58 +0000 (15:11 +0000)]
Use C# 7.3 pattern-based fixed statement (#45969)

Documentation for `ValueStringBuilder.GetPinnableReference()` suggests using pattern-matching instead of the explicit method call.

3 years ago[wasm] provision-wasm: always install the "official" version (#45990)
Ankit Jain [Sat, 12 Dec 2020 04:07:02 +0000 (23:07 -0500)]
[wasm] provision-wasm: always install the "official" version (#45990)

if `EMSDK_PATH` was unset, or set to the default path, then
`provision-wasm` target would become a no-op. Instead, always install it
to the default path.

It can be useful to have the official version available, even if you
have a different one installed, so you can do comparisons etc. - Zoltan

3 years agoJIT: consistently mark method table accesses as invariant (#45854)
Andy Ayers [Sat, 12 Dec 2020 01:40:11 +0000 (17:40 -0800)]
JIT: consistently mark method table accesses as invariant (#45854)

Introduce a new utility method to create the IR for method table access,
marking the resulting indir as invariant. This allows method table access
CSEs (which will be increasingly common with the advent of PGO-enabled
Guarded Devirtualization).

Add a workaround to assertion prop for method table to be able to see
through a CSE'd method table access.

Remove a few optimizer inhibitions related to colon cond.

3 years agoDelete non-supported handling of Windows-specific PDBs in ilasm (#45979)
Jan Kotas [Sat, 12 Dec 2020 01:22:23 +0000 (17:22 -0800)]
Delete non-supported handling of Windows-specific PDBs in ilasm (#45979)

I do not expect we will ever add the classic PDB support back in ilasm.

Fixes #45492

3 years agoUpdate issues-pr-management.md (#45693)
Dan Moseley [Sat, 12 Dec 2020 00:43:48 +0000 (16:43 -0800)]
Update issues-pr-management.md (#45693)

Change to present tense, as we're now merged.
Document workflow enabled in https://github.com/dotnet/runtime/issues/44775

3 years agoFix superpmi.py argument parsing (#45983)
Bruce Forstall [Fri, 11 Dec 2020 23:47:20 +0000 (15:47 -0800)]
Fix superpmi.py argument parsing (#45983)

1. Hoist out argument parsing/verification of target_os/target_arch/mch_arch
so they apply to more commands that require them, e.g., "list-collections".
2. Rename `-jit` argument to `-jit_name` to be more explicit, and differentiate
it from the pre-existing `-jit_path` argument.
3. Hoist verification of `-jit_ee_version` to reduce code duplication.

Fixes #45981

3 years agoMark some pipelines as pr:none (#45973)
Sergey Andreenko [Fri, 11 Dec 2020 22:54:03 +0000 (14:54 -0800)]
Mark some pipelines as pr:none (#45973)

* Follow-up for #45931

* Add superpmi

3 years agoFontConverter restore order of font properties (#45746)
Igor Velikorossov [Fri, 11 Dec 2020 21:48:09 +0000 (08:48 +1100)]
FontConverter restore order of font properties (#45746)

.NET Framework implementation of `FontConverter` provided a different
order of font properties, that can be observed by inspecting an instance
of a font in a `PropertyGrid`.

Restore the original sort order.

The .NET Framework implementation has another sort argument "Weight",
which however doesn't appear to be a property of `Font` type.
It is possible this property has existed at some point, or the converter
may have been expected to work for instances of `IFontDisp` object.
Either way presence or absence of "Weight" doesn't appear to make any
difference, hence it has not been ported across.

Fixes #45631

3 years agoImprove PUTARG_STK generation for Arm/Arm64. (#45824)
Sergey Andreenko [Fri, 11 Dec 2020 21:27:09 +0000 (13:27 -0800)]
Improve PUTARG_STK generation for Arm/Arm64. (#45824)

* Improve PUTARG_STK generation.

Allow non pointer-size put args for structs.
It was an old CQ issue but now it is an Arm64 apple requirement.

* Update src/coreclr/jit/codegenarmarch.cpp

* Update src/coreclr/jit/codegenarmarch.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoFix reporting of negative ISA uses in crossgen2 (#45892)
Jan Kotas [Fri, 11 Dec 2020 21:07:43 +0000 (13:07 -0800)]
Fix reporting of negative ISA uses in crossgen2 (#45892)

Fixes #45852

3 years agoFix for Issue 44895 (#45284)
Brian Sullivan [Fri, 11 Dec 2020 20:58:06 +0000 (12:58 -0800)]
Fix for Issue 44895 (#45284)

* Fix for Issue 44895
- Fix: Don't allow an unwrapped promoted field of TYP_REF to be returned when we are expecting a TYP_STRUCT

Backout change in gtGetStructHandleIfPresent for GT_RETURN as it isn't needed for this fix
Deoptimize all GT_RETURN's with mismatched types for promoted struct fields.

* Allow both GT_ADDR and GT_ASG as a parent node

* Add second test case Repro2_44895.cs

* Change assert about Incompatible types to be a noway_assert in gtNewTempAssign

* Only use the smaller repro case for Runtime_44895.cs

* Added noway_assert in release build for an assignment of a TYP_REF to a TYP_STRUCT

* rerun jit-format

3 years ago[master] Update dependencies from dotnet/xharness dotnet/arcade (#45956)
dotnet-maestro[bot] [Fri, 11 Dec 2020 19:12:54 +0000 (19:12 +0000)]
[master] Update dependencies from dotnet/xharness dotnet/arcade (#45956)

[master] Update dependencies from dotnet/xharness dotnet/arcade

3 years agoRun Mono Android sample on Helix (#45109)
Maxim Lipnin [Fri, 11 Dec 2020 17:43:05 +0000 (20:43 +0300)]
Run Mono Android sample on Helix (#45109)

- Included the android sample project to the library test build.
- Added copying resulting HelloAndroid.apk to helix test directory from where it can be consumed by CI.
- Set up the return value (42) as an expected exit code for xharness.
- Xharness for android doesn't support running an application w/o test runner yet

Related issue: #43865

3 years ago[metadata] Generate type-3 GUIDs for interfaces. (#43677)
monojenkins [Fri, 11 Dec 2020 15:12:35 +0000 (10:12 -0500)]
[metadata] Generate type-3 GUIDs for interfaces. (#43677)

I'm opening this although it's still WIP, for discussion, as I'm not sure what else I should be adding. Tests probably, of course, but also I was wondering if it should be plugged to RuntimeType.GUID / Marshal.GenerateGuidForType. I'm not entirely sure if that's desired as I've seen clues in the reference source that the GUID generation has issues.

I've left class GUID generation aside, as it doesn't seem so useful for COM interop, and the algorithm uses some Assembly properties to seed the GUID, and retrieving that is currently beyond my understanding of the code.

Also I'm a bit lost regarding which RuntimeType.GUID it should be added to: there's at least two places that looked appropriate : in `mono/netcore/System.Private.CoreLib/src/RuntimeType.Mono.cs` and in `mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs`.

Co-authored-by: rbernon <rbernon@users.noreply.github.com>
3 years agoAdd test leg to run runtime tests on Android devices (#44560)
Fan Yang [Fri, 11 Dec 2020 14:58:51 +0000 (09:58 -0500)]
Add test leg to run runtime tests on Android devices (#44560)

* Add test leg to run runtime tests on Android devices

* Add a new variable to describe the host OS of test wrappers for runtime tests

* Set win-x64 runtime for Android arm64

* Add missing %

* Use TestWrapperTargetsWindows when checking script targeting platform

* Fix variable usage format on windows

* Fix file path for windows

* Make file path portable

* Add debug info

* Add debug info to output instead of testOutput

* Add more debug info

* Add debug info in batch file

* Turn on echo for batch script

* Add another missing % and some debug info

* Fix test running command

* Remove extra double quotes

* Turn on verbose mode for xharness command and fix msbuild special characters

* Choose batch or bash script based on var TestWrapperTargetsWindows, when building Android apps

* Clean up

* Enable all tests

* Disable tests belonging to big work items

* Disable more long running work items

* Disable more long running tests

* Disable more long running tests and shorten the timeout threshold

* Increase timeout threshold

* For debugging, print out logs when passing

* Disable more tests to avoid long running tests

* Add Android tests to staging pipeline and revert previous debugging hack

3 years agoFix some PAL tests that compare sleep/wait times from one thread to sleep/wait times...
Koundinya Veluri [Fri, 11 Dec 2020 13:26:10 +0000 (05:26 -0800)]
Fix some PAL tests that compare sleep/wait times from one thread to sleep/wait times on another thread (#45948)

- This affects some tests where the main thread T0 creates another thread T1, T0 sleeps for some time while T1 waits, then after waking up T0 interrupts T1's wait with an APC, and measures the expected sleep duration with the other thread's wait duration before interrupt
- In the failures T0 is likely starting to sleep for the interrupt delay before T1 has recorded the pre-wait timestamp, so the interrupt occurs sooner than intended and the expectation later fails
- Fix T0 to wait for T1 to record the pre-wait timestamp before sleeping for the interrupt delay

Hopefully fixes https://github.com/dotnet/runtime/issues/42669

3 years agoFixes for VS preview (#45902)
Steve MacLean [Fri, 11 Dec 2020 13:01:58 +0000 (08:01 -0500)]
Fixes for VS preview (#45902)

* Fixes for VS preview

Stop using c++latest and designated initializers for Windows crossdac
Disable warning about overriding /TP with /TC

3 years agoRun Mono iOS sample on Helix (#44462)
Maxim Lipnin [Fri, 11 Dec 2020 12:00:05 +0000 (15:00 +0300)]
Run Mono iOS sample on Helix (#44462)

- Included the ios sample project to the library test build. The sample still can be build/run locally using make file.
- Added copying resulting HelloiOS.app to helix directory from where it can be consumed by CI.
- Changed the sample to return 42 when building for CI, which is used as an expected exit code for xharness.
- Xharness for iOS supports running an application on a simulator w/o test runner inside, the sample is run by this approach.
- Checked locally that xharness can run HelloiOS.app successfully.

Related issue: #43865

3 years agoAdd botr doc on managed type system (#45891)
Jan Kotas [Fri, 11 Dec 2020 11:55:08 +0000 (03:55 -0800)]
Add botr doc on managed type system (#45891)

3 years agoAdd support for global aggressive-linining optimization. (#45822)
monojenkins [Fri, 11 Dec 2020 08:06:38 +0000 (03:06 -0500)]
Add support for global aggressive-linining optimization. (#45822)

Currently we do support aggressive inlining per method using attributes. This commit adds a new global mono optimization flag that does similar thing, but whiout the need to annotate methods. There is still one big difference and that is the effect of cost. The new global optimization does not override cost evaluation, so if a method is to expensive to inline with regards to inline limit, it won't be inlined. In order to get the full "forced" inlining. method attributes should still be used.

This new optimization is not default and needs to be enabled using:

--optimize=aggressive-inlining

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
3 years agoFix GC hole with STOREIND of LCL_VAR_ADDR/LCL_FLD_ADDR (#45818)
Bruce Forstall [Fri, 11 Dec 2020 07:43:55 +0000 (23:43 -0800)]
Fix GC hole with STOREIND of LCL_VAR_ADDR/LCL_FLD_ADDR (#45818)

* Fix GC hole with STOREIND of LCL_VAR_ADDR/LCL_FLD_ADDR

We were updating the GC liveness of the ADDR node, but
`genUpdateLife()` expects to get the parent node, so no
liveness was ever updated.

There were 4 SPMI GC info diffs in the libraries, all
related to uses of `System.Collections.Immutable.ImmutableArray`
where we struct promote fields who are themselves single-element
gc ref structs that are kept on the stack and not in registers.
In all cases, the liveness of the stack local was not reflected
in codegen's GC sets, but it was reflected in the emitter's GC
sets, so it was marked as a GC lifetime. However, that lifetime
would get cut short if we hit a call site before the last use,
as calls (sometimes) carry the full set of live variables across
the call. So, variables not in this set (including the
"accidental" emitter-created GC lifetimes here) would get killed,
leaving a hole between the intermediate call and actual stack
local last use.

Fixes #45557

* Add unit test

* Add comment to `emitInsLoadInd()`

3 years agoJIT: implement return merging stress mode (#45917)
Andy Ayers [Fri, 11 Dec 2020 06:57:18 +0000 (22:57 -0800)]
JIT: implement return merging stress mode (#45917)

Under stress, optionally limit methods to having just one return block,
to stress the logic involved in merging returns.