platform/upstream/dotnet/runtime.git
3 years ago[mono] Add back mono_register_config_for_assembly (#50584)
Aleksey Kliger (λgeek) [Fri, 2 Apr 2021 04:33:28 +0000 (00:33 -0400)]
[mono] Add back mono_register_config_for_assembly (#50584)

Can't drop API symbols.

3 years agoSplit up complicated assert into parts. (#50620)
Aaron Robinson [Fri, 2 Apr 2021 02:29:46 +0000 (19:29 -0700)]
Split up complicated assert into parts. (#50620)

In an effort to narrow down a hard to repro GCStress issue, the assert
is being split into parts.

3 years agoDisable stackoverflowtester under gcstress (#50617)
Bruce Forstall [Fri, 2 Apr 2021 02:17:21 +0000 (19:17 -0700)]
Disable stackoverflowtester under gcstress (#50617)

This test currently fails under many gcstress legs.

Tracking issue: https://github.com/dotnet/runtime/issues/46279

3 years agoDisable TestDynamicAssembly tests (#50592)
Bruce Forstall [Fri, 2 Apr 2021 01:49:55 +0000 (18:49 -0700)]
Disable TestDynamicAssembly tests (#50592)

These fail under GCStress.

Issue: https://github.com/dotnet/runtime/issues/48579

3 years agoFix formatting string for assembly MVID mismatch (#50474)
Tomáš Rylek [Fri, 2 Apr 2021 01:24:14 +0000 (18:24 -0700)]
Fix formatting string for assembly MVID mismatch (#50474)

During development of the MVID check change I at some point ended
up with mismatched printf specifiers and arguments. This change fixes
this inconsistency.

Thanks

Tomas

3 years agoPool the underlying list and dictionary in scopes. (#50463)
David Fowler [Fri, 2 Apr 2021 00:04:24 +0000 (17:04 -0700)]
Pool the underlying list and dictionary in scopes. (#50463)

- This change pools a set of scopes assuming they are short lived.
- One breaking change is that after disposal, pooled scopes will throw if services are accessed afterwards on the scope.
- Modified test to throw after dispose

3 years agoFix variable reference (#50623)
Bill Wert [Thu, 1 Apr 2021 23:35:08 +0000 (16:35 -0700)]
Fix variable reference (#50623)

3 years agoFix x86 warning on latest VS dogfood (#50607)
Jan Kotas [Thu, 1 Apr 2021 23:21:35 +0000 (16:21 -0700)]
Fix x86 warning on latest VS dogfood (#50607)

* Fix x86 warning on latest VS dogfood

* Delete unnecessary warning disable

3 years agoExclude tvOS aot functional test from ci run (#50591)
Steve Pfister [Thu, 1 Apr 2021 21:23:01 +0000 (17:23 -0400)]
Exclude tvOS aot functional test from ci run (#50591)

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

3 years agoAndroid scenario fixes (#50596)
Bill Wert [Thu, 1 Apr 2021 19:00:27 +0000 (12:00 -0700)]
Android scenario fixes (#50596)

* fix path to workitems

* update queue

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210331.1 (#50555)
dotnet-maestro[bot] [Thu, 1 Apr 2021 18:30:40 +0000 (20:30 +0200)]
Update dependencies from https://github.com/mono/linker build 20210331.1 (#50555)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21180.4 -> To Version 6.0.100-preview.2.21181.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoFix dumping R2R embedded PGO data (#50533)
David Wrighton [Thu, 1 Apr 2021 17:47:20 +0000 (10:47 -0700)]
Fix dumping R2R embedded PGO data (#50533)

- Handle case where assembly has no embedded pgo data
- Handle case where method in file has no embedded pgo data but some other methods do

3 years agoSupport DOTNET_ prefix (#50507)
Aaron Robinson [Thu, 1 Apr 2021 17:20:22 +0000 (10:20 -0700)]
Support DOTNET_ prefix (#50507)

* Support and prefer DOTNET_ prefix.

Add support for EnableDOTNETPrefix to disable respecting the DOTNET_ prefix.

Enable environment variable caching on non-Windows platforms.

3 years agoFix GC overreporting with generics context + GS cookie (#50544)
Bruce Forstall [Thu, 1 Apr 2021 16:36:19 +0000 (09:36 -0700)]
Fix GC overreporting with generics context + GS cookie (#50544)

This is a case of a generics context in `this` where we need to keep
`this` alive (but aren't required to by the VM) with a GS cookie check
(due to "JitStress: STRESS_UNSAFE_BUFFER_CHECKS"), and maybe other
JitStress modes, where `genEmitGSCookieCheck` decides to use `rcx`
to load the cookie, even though it is alive. `this` is also mostly
in a register, but it reported live as a stack slot. When the GS
cookie label gets created, the "codegen" gc info hasn\92t been updated
with the killed register, so the emitter label gets the wrong GC info
and brings rcx back alive just for the `nop`. GC cookie checks kind
of do their own register allocation since they\92re part of the epilogs.

The GS cookie code checks for keep alive using "lvRegister", but that
isn't set, since the cookie is mostly alive in a stack slock, not
always in a register. Use `lvIsInReg()` instead, so GS cookie check
will use RDX to load the cookie instead.

Fixes #50404

3 years agoFix default nothrow behavior for MethodIL.GetObject (#50539)
Jan Kotas [Thu, 1 Apr 2021 15:31:07 +0000 (08:31 -0700)]
Fix default nothrow behavior for MethodIL.GetObject (#50539)

3 years agoFix closing tag (#50552)
Maxim Lipnin [Thu, 1 Apr 2021 14:31:37 +0000 (17:31 +0300)]
Fix closing tag (#50552)

Fixing the oversight in #50475

3 years agoFree temporary enums on failure (#50471)
Tom Deseyn [Thu, 1 Apr 2021 13:56:14 +0000 (15:56 +0200)]
Free temporary enums on failure (#50471)

* Free temporary enums on failure

* PR feedback

3 years agoDelete missed mono/netcore from the documentation (#50557)
SingleAccretion [Thu, 1 Apr 2021 13:27:57 +0000 (16:27 +0300)]
Delete missed mono/netcore from the documentation (#50557)

3 years agoSet iOSSimulator as TargetOS in case of empty value for the iOS functional tests...
Maxim Lipnin [Thu, 1 Apr 2021 06:54:57 +0000 (09:54 +0300)]
Set iOSSimulator as TargetOS in case of empty value for the iOS functional tests (#50475)

3 years agoAdd Random.Shared (#50297)
Stephen Toub [Thu, 1 Apr 2021 05:32:03 +0000 (01:32 -0400)]
Add Random.Shared (#50297)

* Add Random.Shared

* Disable on wasm test requiring parallelism

3 years agoBring up tvOS x64 staging pipeline leg (#50326)
Steve Pfister [Thu, 1 Apr 2021 04:24:08 +0000 (00:24 -0400)]
Bring up tvOS x64 staging pipeline leg (#50326)

Contributes to #33381

3 years ago[AndroidCrypto] Fix some leaks from missed local ref releases (#50534)
Elinor Fung [Thu, 1 Apr 2021 04:14:29 +0000 (21:14 -0700)]
[AndroidCrypto] Fix some leaks from missed local ref releases (#50534)

3 years agoFix A/V in ApplyUpdate API (#50452)
Mike McLaughlin [Thu, 1 Apr 2021 03:39:07 +0000 (20:39 -0700)]
Fix A/V in ApplyUpdate API (#50452)

* Fix A/V in ApplyUpdate API

Add thread suspend around the update API.

Issue: https://github.com/dotnet/runtime/issues/50445

* Remove thread suspension; switch to ResetCodeEntryPoint()

3 years agoAdd class as a target for RequiresUnreferencedCodeAttribute (#50064)
Tlakaelel Axayakatl Ceja [Thu, 1 Apr 2021 03:19:34 +0000 (20:19 -0700)]
Add class as a target for RequiresUnreferencedCodeAttribute (#50064)

3 years agoRemove a bunch of X509 PAL closures from FindCore
Stephen Toub [Thu, 1 Apr 2021 00:35:42 +0000 (20:35 -0400)]
Remove a bunch of X509 PAL closures from FindCore

3 years agoCleanup name of test exclusion itemgroup (#50513)
Alexander Köplinger [Thu, 1 Apr 2021 00:10:14 +0000 (02:10 +0200)]
Cleanup name of test exclusion itemgroup (#50513)

Follow up from feedback in https://github.com/dotnet/runtime/pull/50332

3 years agoAdd ExceptionDispatchInfo.SetRemoteStackTrace (#50392)
Levi Broderick [Thu, 1 Apr 2021 00:08:42 +0000 (17:08 -0700)]
Add ExceptionDispatchInfo.SetRemoteStackTrace (#50392)

3 years agoStop skipping entire System.Net.Http functional test suite on Android (#50509)
Elinor Fung [Thu, 1 Apr 2021 00:06:50 +0000 (17:06 -0700)]
Stop skipping entire System.Net.Http functional test suite on Android (#50509)

It is skipped based on flakiness/slowness on a Checked/Debug runtime, which we are not currently
using for Android tests. Put the test suite under Android test ProjectExclusions instead.

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210330.4 (#50481)
dotnet-maestro[bot] [Thu, 1 Apr 2021 00:06:35 +0000 (20:06 -0400)]
Update dependencies from https://github.com/mono/linker build 20210330.4 (#50481)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21180.1 -> To Version 6.0.100-preview.2.21180.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoBig-endian fix: Accessing OBJECTHEADER in ImageConverter (#50499)
Ulrich Weigand [Thu, 1 Apr 2021 00:06:05 +0000 (02:06 +0200)]
Big-endian fix: Accessing OBJECTHEADER in ImageConverter (#50499)

* Big-endian fix: Accessing OBJECTHEADER in ImageConverter

The GetBitmapStream routine in ImageConverter is supposed to
skip an embedded OBJECTHEADER structure.  However, this
structure needs to be read in little-endian mode, not in
native byte order.

Fixes the ImageConverterTest.ImageWithOleHeader test on
big-endian systems.

* Update src/libraries/System.Drawing.Common/src/System/Drawing/ImageConverter.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoAvoid closure in WebSocketHandle.ConnectAsync (#50502)
Stephen Toub [Thu, 1 Apr 2021 00:05:51 +0000 (20:05 -0400)]
Avoid closure in WebSocketHandle.ConnectAsync (#50502)

3 years agoFix accidental closure in Regex.Replace (#50512)
Stephen Toub [Thu, 1 Apr 2021 00:05:10 +0000 (20:05 -0400)]
Fix accidental closure in Regex.Replace (#50512)

And sprinkle some "static" around to help avoid this in the future.

3 years agofix XML tag (#50523)
Bill Wert [Wed, 31 Mar 2021 22:54:45 +0000 (15:54 -0700)]
fix XML tag (#50523)

3 years agoFix linux test legs (#50518)
Bill Wert [Wed, 31 Mar 2021 22:43:50 +0000 (15:43 -0700)]
Fix linux test legs (#50518)

3 years ago[main] Update dependencies from dotnet/arcade dotnet/icu dotnet/xharness dotnet/llvm...
dotnet-maestro[bot] [Wed, 31 Mar 2021 21:46:37 +0000 (21:46 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/icu dotnet/xharness dotnet/llvm-project (#50416)

[main] Update dependencies from dotnet/arcade dotnet/icu dotnet/xharness dotnet/llvm-project

 - Revert publishing branch changes

https://github.com/dotnet/arcade/issues/6987

 - reintroduce publishing branch workaround

https://github.com/dotnet/arcade/issues/6987

3 years agoFix msquic.dll loading (#50506)
Natalia Kondratyeva [Wed, 31 Mar 2021 21:40:43 +0000 (23:40 +0200)]
Fix msquic.dll loading (#50506)

3 years agoReenable Android.Device_Emulator.Aot.Test.csproj (#50332)
Alexander Köplinger [Wed, 31 Mar 2021 21:39:24 +0000 (23:39 +0200)]
Reenable Android.Device_Emulator.Aot.Test.csproj (#50332)

* Reenable Android.Device_Emulator.Aot.Test.csproj

Closes https://github.com/dotnet/runtime/issues/49757

* Update tests.proj

3 years agoAvoid closure in ValidationContext if serviceProvider is null (#50483)
Stephen Toub [Wed, 31 Mar 2021 21:25:52 +0000 (17:25 -0400)]
Avoid closure in ValidationContext if serviceProvider is null (#50483)

3 years agoadd android scenarios (#50407)
Bill Wert [Wed, 31 Mar 2021 21:06:48 +0000 (14:06 -0700)]
add android scenarios (#50407)

3 years agoFix usage of process_vm_readv in createdump (#50477)
Juan Hoyos [Wed, 31 Mar 2021 20:34:25 +0000 (13:34 -0700)]
Fix usage of process_vm_readv in createdump (#50477)

* Fix usage of process_vm_readv in createdump; fallback to pread64

* No-op logging

3 years agoProhibit BF unless the app opts in (#48527)
Prashanth Govindarajan [Wed, 31 Mar 2021 20:08:23 +0000 (13:08 -0700)]
Prohibit BF unless the app opts in (#48527)

* Prohibit BF unless the app opts in

* Address feedback

* First unit test

* 2nd unit test. Checkpoint

* sq

* sq

* sq

* Address Levi's feedback

* sq

* Address nits

* Linker changes and tests

* sq

* sq

* Linker warnings ids

* Address comments

* Change trimming test so linker can detect a pattern

* sq

* Address comments

* sq

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years ago[AndroidCrypto] Make SslStreamCertificateContext treat an empty chain as not finding...
Elinor Fung [Wed, 31 Mar 2021 19:09:35 +0000 (12:09 -0700)]
[AndroidCrypto] Make SslStreamCertificateContext treat an empty chain as not finding intermediates (#50195)

3 years agoAlso build bundleproj for PGO (#50434)
Andy Gocke [Wed, 31 Mar 2021 19:08:18 +0000 (12:08 -0700)]
Also build bundleproj for PGO (#50434)

I previously disabled publishing all but Microsoft.NETCore.App.sfxproj,
which publishes the dotnet-runtime-internal package. This is almost, but
not quite, the right package. It doesn't contain the host dependencies,
although it does contain the right runtime files. The right package is
Microsoft.NETCore.App.bundleproj, which builds dotnet-runtime. Unfortunately,
I didn't catch this in manual testing because I think copying over the temp
bits reused the host dependencies from the previous install location. I've
wiped this from scratch and it looks fine now. (crossed fingers)

3 years agoAdd option for building a test exe as single file (#42972)
Andy Gocke [Wed, 31 Mar 2021 18:34:05 +0000 (11:34 -0700)]
Add option for building a test exe as single file (#42972)

* Add option for building a test exe as single file

* Remove left over test

* Add target to exclude references from single-file

* First attempt at adding a CI job

* Opt-in specific libraries for single-file testing support

Start with System.Collections as all tests pass.

* Config testing using single-file in build.cmd

* Change yml suffix name to SingleFile

* Windows_NT_x64 -> windows_x64

* Fix for helix queueing

* Respond to host rename

* Change TargetOS to check for windows

* chmod test exe on linux

* Direct singlefilehost to the locally built copy

* Adjust singlefilehost copy+call

* Add .exe suffix on Windows

* Move libraries after hosts build to allow for libs.test to depend on hosts build

* Split up host and libs packaging and tests

* Move host packaging

* Move pretest up

* Move packages up as well

* Reorder libs pretest and libs.packages

* Add isSingleFile build parameter to limit Linux Helix jobs

* Typo

* Change conditional check

* Fix yml

* Fix yml

* Fix neq

* Fix subsets

* Typo

* Fix

* Adjust assert

* Include code from Michal to skip failing test

* Remove empty ItemGroup

* Update src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Update eng/testing/tests.singlefile.targets

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Apply suggestions from code review

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Use ProjectExclusions

* Update eng/testing/tests.singlefile.targets

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Revert changes

* Remove host build from tests

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
3 years agoRefactor missing reference errors to allow not throwing for all cases (#50437)
David Wrighton [Wed, 31 Mar 2021 17:50:25 +0000 (10:50 -0700)]
Refactor missing reference errors to allow not throwing for all cases (#50437)

- Build the concept of a cacheable resolution failure
- Plumb it through the Ecma type loader and the required public api surfaces
- Use it within the Mibc parser to avoid throwing

3 years agoSupport private SuperPMI MCH file stores (#50268)
Bruce Forstall [Wed, 31 Mar 2021 17:41:10 +0000 (10:41 -0700)]
Support private SuperPMI MCH file stores (#50268)

* Support private SuperPMI MCH file stores

In addition to the default Azure Storage SuperPMI location,
support private data stores via the new `-private_store` argument
to `replay` and `asmdiffs`. Private stores are typically file
system locations, or, on Windows, UNC paths.

There already exists the `-mch_files` argument, which allows you
to use any specified set of MCH files. However, when specifying
`-mch_files`, only those files are used and the normal stores are
ignored.

The private store mechanism is more convenient in some scenarios,
as it treats the specified private stores equivalently to the default
Azure Storage store.

In addition, both private stores and `-mch_files` handle downloading
ZIP files, un-ZIPping, and caching their contents.

Finally, a new top-level command `upload-private` is introduced to
help create private stores by specifying a set of MCH files to
use. It ZIP compresses the files to upload.

* Fix `-base_jit_path`

If `-base_jit_path` is specified on the command line, ensure it is a
full path before using it.

3 years agoAdd IsWellKnownStringComparer methods (#50312)
Levi Broderick [Wed, 31 Mar 2021 17:30:24 +0000 (10:30 -0700)]
Add IsWellKnownStringComparer methods (#50312)

3 years ago[mono] Fix the handling of jit icall wrappers in mono_aot_method_hash (), the name...
Zoltan Varga [Wed, 31 Mar 2021 17:21:16 +0000 (13:21 -0400)]
[mono] Fix the handling of jit icall wrappers in mono_aot_method_hash (), the name might be different at runtime if DISABLE_JIT is set. (#50482)

3 years agoUpdate testing-android.md (#50484)
Fan Yang [Wed, 31 Mar 2021 17:03:27 +0000 (13:03 -0400)]
Update testing-android.md (#50484)

3 years agoRename CreateInstanceT_StructWithoutDefaultConstructor_ThrowsMissingMethodException...
Eric Erhardt [Wed, 31 Mar 2021 16:13:49 +0000 (11:13 -0500)]
Rename CreateInstanceT_StructWithoutDefaultConstructor_ThrowsMissingMethodException test (#50191)

This doesn't throw an exception, so the test shouldn't be named "ThrowsMissingMethodException"

3 years agoFix a crash in WriteMethodProfileDataLogFile (#50473)
Dong-Heon Jung [Wed, 31 Mar 2021 15:42:59 +0000 (00:42 +0900)]
Fix a crash in WriteMethodProfileDataLogFile (#50473)

pEmitter is not assigned in https://github.com/dotnet/runtime/pull/50242

3 years agoAdd AsyncMethodBuilderOverride and PoolingAsyncValueTaskMethodBuilders (#50116)
Stephen Toub [Wed, 31 Mar 2021 13:30:24 +0000 (09:30 -0400)]
Add AsyncMethodBuilderOverride and PoolingAsyncValueTaskMethodBuilders (#50116)

* Add AsyncMethodBuilderOverride and PoolingAsyncValueTaskMethodBuilders

* Revise based on C# LDM changes to model

* Fix API compat errors

3 years agoAllow bounded channel to be created with drop delegate (#50331)
Ivan Beňovic [Wed, 31 Mar 2021 11:13:59 +0000 (13:13 +0200)]
Allow bounded channel to be created with drop delegate (#50331)

* Bounded channel can be created with drop delegate.

- Add additional CreateBounded overload with delegate parameter that will be called when item is being dropped from channel
- Added unit tests

* Fix typo in comment.

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Call drop delegate outside of lock statement.

* Use overload of CreateBounded method instead of calling ctor directly.

* Code review suggestions refactor.

* Move Monitor.Enter before try and use local scoped parent variable everywhere.

* Drop delegate should not be called while sync lock is held.

Enqueuing of new item should be done while sync lock is being held.
Added additional tests.

* Rerun gitlab CI.

* Do not run deadlock test for bounded channels if platform do not support threading.

* Apply suggestions from code review

Co-authored-by: Ivan Benovic <ivan.benovic@innovatrics.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix typo in `string.Join` (#50467)
xtqqczze [Wed, 31 Mar 2021 11:02:11 +0000 (12:02 +0100)]
Fix typo in `string.Join` (#50467)

Follow-up #44032.

3 years ago[FileStream] Rename "Legacy" to "Net5Compat" (#50470)
Adam Sitnik [Wed, 31 Mar 2021 11:01:20 +0000 (13:01 +0200)]
[FileStream] Rename "Legacy" to "Net5Compat" (#50470)

* rename Legacy => Net5Compat (System.Private.CoreLib)

* rename Legacy => Net5Compat (test projects)

3 years ago[interp] Fix tracing (#50415)
Vlad Brezae [Wed, 31 Mar 2021 08:32:05 +0000 (11:32 +0300)]
[interp] Fix tracing (#50415)

3 years agoAdd tracking a recursion depth in System.IO.FileSystem (#48148)
Ilya [Wed, 31 Mar 2021 08:02:48 +0000 (13:02 +0500)]
Add tracking a recursion depth in System.IO.FileSystem (#48148)

* Add tracking a depth recursion in System.IO.FileSystem

* Update src/libraries/System.IO.FileSystem/src/System/IO/EnumerationOptions.cs

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
* Fix docs

* Address feedbacks

* Fix typo

* Add MaxRecursionDepth value check

* Fix net48 build: Add string to MS.IO.Redist resx file

* Fix test and initialization.

* Address feedback

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: David Cantu <dacantu@microsoft.com>
3 years agoRename Random.LegacyImpl (#50456)
Stephen Toub [Wed, 31 Mar 2021 07:23:25 +0000 (03:23 -0400)]
Rename Random.LegacyImpl (#50456)

To be more specific about what it is.

3 years ago[tests] Add Mono issue to CallConvMemberFunction tests (#50461)
Aleksey Kliger (λgeek) [Wed, 31 Mar 2021 07:06:12 +0000 (03:06 -0400)]
[tests] Add Mono issue to CallConvMemberFunction tests (#50461)

3 years agoensure MetadataReader fast path works with every FileStream on every OS (#50367)
Adam Sitnik [Wed, 31 Mar 2021 06:53:52 +0000 (08:53 +0200)]
ensure MetadataReader fast path works with every FileStream on every OS (#50367)

3 years agoDont cache file length when handle has been exposed (#50424)
Adam Sitnik [Wed, 31 Mar 2021 06:42:18 +0000 (08:42 +0200)]
Dont cache file length when handle has been exposed (#50424)

3 years ago[mono] Address comments from PR #50328. (#50462)
Zoltan Varga [Wed, 31 Mar 2021 05:12:47 +0000 (01:12 -0400)]
[mono] Address comments from PR #50328. (#50462)

* Use g_slist_concat ().
* Add MemoryManagerLock to the lock tracer.
* Remove some dead code.

3 years agoResolve unknown platform name warnings (#50193)
Buyaa Namnan [Wed, 31 Mar 2021 04:41:14 +0000 (21:41 -0700)]
Resolve unknown platform name warnings (#50193)

* Add targets as supported platforms

* Update analyzer version

* Update comment, remove '' != 'false' condition

3 years agoSpecify the Size of List<T> Instances in InvokeTypeInfo (#50438)
Brian Robbins [Wed, 31 Mar 2021 04:28:50 +0000 (21:28 -0700)]
Specify the Size of List<T> Instances in InvokeTypeInfo (#50438)

* Initialize List<T> instances in InvokeTypeInfo with known sizes.

* Switch from List<T> to arrays.

3 years agoMerge REGUTIL logic for environment variables into CLRConfig (#50393)
Aaron Robinson [Wed, 31 Mar 2021 03:51:24 +0000 (20:51 -0700)]
Merge REGUTIL logic for environment variables into CLRConfig (#50393)

* Merge REGUTIL logic for environment variables into CLRConfig

Remove REGUTIL
Remove unused CLR configuration options

3 years agoAdded the `ConfigureDefaults` API, as an extension method of `IHostBuilder` (#50447)
David Pine [Wed, 31 Mar 2021 00:20:57 +0000 (19:20 -0500)]
Added the `ConfigureDefaults` API, as an extension method of `IHostBuilder` (#50447)

* Added the ConfigureDefaults API, as an extension method on the IHostBuilder interface. Fix #36003

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update src/libraries/Microsoft.Extensions.Hosting/src/Host.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoFix handling of array constructors in Crossgen2 (#48557)
Tomáš Rylek [Tue, 30 Mar 2021 23:44:40 +0000 (16:44 -0700)]
Fix handling of array constructors in Crossgen2 (#48557)

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

3 years agoMake CLOCK_MONOTONIC handling more precise in pal_threading.c (#50441)
Alexander Köplinger [Tue, 30 Mar 2021 23:42:47 +0000 (01:42 +0200)]
Make CLOCK_MONOTONIC handling more precise in pal_threading.c (#50441)

The root cause of the problem in https://github.com/dotnet/runtime/pull/50388 turned out to be because we do not have `pthread_condattr_setclock(..., CLOCK_MONOTONIC);` on iOS.
This caused the timeout argument for `pthread_cond_timedwait` to be interpreted as an _absolute system time_ (in seconds since the Unix epoch), however the value we got back from `clock_gettime(CLOCK_MONOTONIC, ...)` was actually some value based on the uptime of the system.
Since the uptime is much smaller than the system time the wait immediately returned.

Harden the handling by adding a check for `HAVE_PTHREAD_CONDATTR_SETCLOCK` like we already do in `SystemNative_LowLevelMonitor_Create()`

3 years ago[mono] Remove domain lock (#50328)
Zoltan Varga [Tue, 30 Mar 2021 23:18:03 +0000 (19:18 -0400)]
[mono] Remove domain lock (#50328)

* [mono] Reduce domain lock usage.

* Avoid double locking the loader+domain lock, its not needed.
* Use the mem manager lock and the loader lock in a few places instead of
  the domain lock.
* Use lock free code in mono_jit_runtime_invoke ().
* Avoid locking around mono_jit_info_table_add (), it does locking itself.

* [mono] Internalize access to MonoMemoryManager.mp to memory-manager.c.

Also add a separate non-coop lock to protect it, since its accessed
very frequently.

* Use a separate lock for each memory manager.

* Remove the domain lock.

3 years ago[mono] Move the jit info table definitions into a separate jit-info.h file, it no...
Zoltan Varga [Tue, 30 Mar 2021 23:17:23 +0000 (19:17 -0400)]
[mono] Move the jit info table definitions into a separate jit-info.h file, it no longer depends on domains. (#50423)

3 years agoRename the superpmi.py asmdiffs output directory (#50403)
Bruce Forstall [Tue, 30 Mar 2021 22:45:56 +0000 (15:45 -0700)]
Rename the superpmi.py asmdiffs output directory (#50403)

* Rename the superpmi.py asmdiffs output directory

Previously, the directory name was `asm.os.arch.build_flavor`.
Now, use the MCH file name instead. Since the MCH filename of our
collections has the target os/arch/flavor, those components will still
be there (but will be based on the MCH file, not the host; this is
important if you are doing cross-compile asm diffs). It will
also have the MCH base name, such as "benchmarks.run", to help
distinguish different runs. Of course, if there is a conflict with
a previous run, `.1`, `.2`, etc., is appended to the directory name.

Also, add a new, optional `-tag` option to `superpmi.py asmdiffs` to
allow specifying an additional word to prefix the artifacts folder
base name. This might help more easily distinguish different experiments.

So, `superpmi.py asmdiffs -filter benchmarks -tag test2` might give you
dasm files in these directories:
```
c:\runtime\artifacts\spmi\asm.test2.benchmarks.run.windows.x64.checked.3\base
c:\runtime\artifacts\spmi\asm.test2.benchmarks.run.windows.x64.checked.3\diff
```

* Review feedback

Created `create_artifacts_base_name()` function.

Fixed `run_and_log` to display command line of command being
invoked at the specified log level. Currently only affects invoking
`jit-analyze`, which makes the `jit-analyze` command line visible
on the console, not just in the log file.

3 years agoexpose alloc data on dbi (#50341)
Maoni Stephens [Tue, 30 Mar 2021 22:29:29 +0000 (15:29 -0700)]
expose alloc data on dbi (#50341)

we are already exposing this data for sos, should make this available for debuggers to use as well. it's very lightweight and would be very useful for things like showing exactly how many bytes were allocated on the thread between 2 breakpoints.

3 years agoUse OptimizeForSize condition in SPC only on Browser (#50413)
Alexander Köplinger [Tue, 30 Mar 2021 16:52:30 +0000 (18:52 +0200)]
Use OptimizeForSize condition in SPC only on Browser (#50413)

The size impact doesn't matter for tvOS.

3 years agoFileSystemGlobbing: Allow rootDir paths ending with separator to match files correctl...
David Cantú [Tue, 30 Mar 2021 16:45:10 +0000 (09:45 -0700)]
FileSystemGlobbing: Allow rootDir paths ending with separator to match files correctly (#45139)

* Allow rootDir paths ending with separator to match files correctly

* Avoid running tests with windows-like absolute paths on non-windows platforms

* Address test suggestion

3 years agoFix issues with JitDump (#50395)
Bruce Forstall [Tue, 30 Mar 2021 16:42:04 +0000 (09:42 -0700)]
Fix issues with JitDump (#50395)

1. On 64 bit platforms, with "long" bitset types (> 64 bits), when
converting to string format for display, we were only displaying
the low 32 bits of every 64 bit chunk.
2. Add display of the `IGF_ALIGN` flag.

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210330.1 (#50417)
dotnet-maestro[bot] [Tue, 30 Mar 2021 16:25:00 +0000 (11:25 -0500)]
Update dependencies from https://github.com/mono/linker build 20210330.1 (#50417)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21177.1 -> To Version 6.0.100-preview.2.21180.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoClean up allocated memory on error in CordbEval::NewParameterizedObject (#50371)
Omair Majid [Tue, 30 Mar 2021 16:08:02 +0000 (12:08 -0400)]
Clean up allocated memory on error in CordbEval::NewParameterizedObject (#50371)

pArgData is allocated in this piece of code; if we are failing and
returning early, we should deallocate this memory to avoid a memory
leak.

3 years agoincrease timout on ConnectTimeout_TimesOutSSLAuth_Throws test (#50351)
Tomas Weinfurt [Tue, 30 Mar 2021 16:04:42 +0000 (09:04 -0700)]
increase timout on ConnectTimeout_TimesOutSSLAuth_Throws test (#50351)

3 years agoFix waits on iOS (#50388)
Ryan Lucia [Tue, 30 Mar 2021 14:31:36 +0000 (10:31 -0400)]
Fix waits on iOS (#50388)

I don't understand why CLOCK_MONOTONIC doesn't work even in newer simulators here, but this will at least fix the problem for now.

3 years agoRevert "Fix release builds with latest VS dogfood (#49948)" (#50398)
Jan Kotas [Tue, 30 Mar 2021 14:10:16 +0000 (07:10 -0700)]
Revert "Fix release builds with latest VS dogfood (#49948)" (#50398)

This reverts commit 3961d91812c997af18ff1ebbdac53bcc4d84fb02.

This workaround is no longer needed.

3 years ago[interp] Add a few super instructions (#50361)
Vlad Brezae [Tue, 30 Mar 2021 11:23:03 +0000 (14:23 +0300)]
[interp] Add a few super instructions (#50361)

* [interp] Fix PROFILE_INTERP build

* [interp] Add ldc.i8.0 opcode, replacing ldnull on 64bit

We still need to use this opcode in more places, instead of the generic ldc.i8

* [interp] Add a few super instructions

We depend on the cprop pass to init local_ref_count. We only add a super instruction if the definition of the an intermediary result is done in the same basic block (the dreg is local var) and it is not used anywhere else, otherwise we can't clear the instruction.

* [interp] Improve the marvin block intrinsic

By removing also 2 additional ldloca instructions, and enabling cprop for these vars that no longer have their address taken.

3 years ago[main] Update dependencies from dotnet/runtime dotnet/xharness (#50358)
dotnet-maestro[bot] [Tue, 30 Mar 2021 11:21:28 +0000 (07:21 -0400)]
[main] Update dependencies from dotnet/runtime dotnet/xharness (#50358)

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

Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , Microsoft.NET.Sdk.IL , System.Runtime.CompilerServices.Unsafe , System.Text.Json
 From Version 6.0.0-preview.3.21169.6 -> To Version 6.0.0-preview.4.21178.6

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21176.1 -> To Version 1.0.0-prerelease.21179.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoAdd "Help Wanted" badge (#50352)
Ben Adams [Tue, 30 Mar 2021 11:19:31 +0000 (12:19 +0100)]
Add "Help Wanted" badge (#50352)

* Add "Help Wanted" badge

* Move help wanted second

3 years agos390x: Fixes to tailcall and array parameter fix (#49466)
Neale Ferguson [Tue, 30 Mar 2021 10:22:26 +0000 (20:22 +1000)]
s390x: Fixes to tailcall and array parameter fix (#49466)

### Small s390x fixes
- Add another tailcall disqualifying condition
- Minor formatting change

### New Array Parameter fix

We have been seeing msbuild tasks fail due to an OverflowException being raised in `(wrapper_alloc)_object:AllocVector` because the number of elements appears to be negative (0xffffffff00000088).

However, this is just the result of a missing type conversion somehow. The original C# code is simply:
```
_metadataStringTable = new string[_reader.ReadInt32()];
```
The IL corresponding to that line reads:
```
converting (in B2: stack: 2) IL_0021: callvirt 0x0a00035e
cmethod = int System.IO.BinaryReader:ReadInt32 ()
Call requires: 1 parameters
converting (in B2: stack: 2) IL_0026: newarr 0x010000b6
```
Note that the return from the `ReadInt32` call is of type `int` (i.e. 32 bits) and is passed unmodified as argument to `newarr`. This remains the same in the initial stages of Mono JIT compilation:
```
call_membase R43 <- [R45 + 0xe8] [int System.IO.BinaryReader:ReadInt32 ()] [s390_r2 <- R44] clobbers: c
il_seq_point il: 0x26, nonempty-stack
newarr R46 <- R43
```
But later the `newarr` is implemented in terms of a function call:
```
call_membase R43 <- [R45 + 0xe8] [int System.IO.BinaryReader:ReadInt32 ()] [s390_r2 <- R44] clobbers: c
il_seq_point il: 0x26, nonempty-stack
i8const R81 <- [2929315620864]
move R83 <- R81
move R84 <- R43
call R46 <- [(wrapper alloc) object object:AllocVector (intptr,intptr)] [s390_r2 <- R83] [s390_r3 <- R84] clobbers: c
```
And here the argument is of type `intptr` (i.e. 64 bits). But the return value of ReadInt32 is still passed through directly to `AllocVector` without any conversion, and this remains true in the final assembler code:
```
b2: 0d e1             basr %r14,%r1 // ReadInt32
b4: b9 04 00 32       lgr %r3,%r2 // <<- simple move of the return value
b8: c0 28 00 00 02 aa iihf %r2,682
be: c0 29 08 d1 28 00 iilf %r2,147924992
c4: c0 e8 00 00 03 ff iihf %r14,1023
ca: c0 e9 9d ec 97 08 iilf %r14,2649528072
d0: 0d ee             basr %r14,%r14 // AllocVector
```
This becomes a problem because the implementation of `AllocVector` does indeed expect a 64-bit input, and throws an exception if that is negative.

In addition, the implementation of `ReadInt32` only computes a 32-bit result in the low 32 bits of the register, and leaves the upper half undefined. Due to the particular code sequence we get a return with the upper half nonzero even though the lower half is a positive integer:
```
e6: e3 20 f0 e0 00 14  lgf %r2,224(%r15) <<- if this is a 32-bit value with the top bit set, then the upper half of %r2 is now 0xffffffff
ec: e3 20 f0 b8 00 50  sty %r2,184(%r15)
f2: b9 04 00 32        lgr %r3,%r2 <<- and so is %r3
f6: c0 01 00 ff 00 ff  lgfi %r0,16711935
fc: b9 e4 00 43        ngrk %r4,%r3,%r0
100: b9 14 00 24       lgfr %r2,%r4
104: 88 20 00 08       srl %r2,8
108: 89 40 00 18       sll %r4,24
10c: b9 e6 40 22       ogrk %r2,%r2,%r4
110: c0 01 ff 00 ff 00 lgfi %r0,-16711936 <<-- the upper half of %r0 is also 0xffffffff
116: b9 e4 00 43       ngrk %r4,%r3,%r0 <<-- and so is %r4
11a: b9 14 00 34       lgfr %r3,%r4
11e: 89 30 00 08       sll %r3,8
122: 88 40 00 18       srl %r4,24
126: b9 e6 40 33       ogrk %r3,%r3,%r4 <<- and now %r3
12a: b9 08 00 23       agr %r2,%r3 <<- and therefore %r2, where the upper half for 0 before
12e: e3 20 f0 b8 00 50 sty %r2,184(%r15)
134: a7 fb 00 f8       aghi %r15,248
138: eb 6e f0 30 00 04 lmg %r6,%r14,48(%r15)
13e: 07 fe             br %r14 <<- and here it is returned unchanged
```

3 years agoMore Mono unwind fixes for s390x (#49986)
Ulrich Weigand [Tue, 30 Mar 2021 09:51:36 +0000 (11:51 +0200)]
More Mono unwind fixes for s390x (#49986)

* mono_arch_unwind_frame: Handle FPRs during unwind.  (This is important
  since GCC will spill GPRs to FPRs instead of the stack when beneficial.)

* map_hw_reg_to_dwarf_reg: Implement DWARF register number mapping for FPRs.
  (https://github.com/IBM/s390x-abi/releases/download/v1.5/lzsabi_s390x.pdf)

* mono_arch_create_generic_trampoline: Fix incorrect start address.

3 years agoMove publishing off hosted ADO machines, again (#50405)
Lukas Lansky [Tue, 30 Mar 2021 09:48:34 +0000 (11:48 +0200)]
Move publishing off hosted ADO machines, again (#50405)

Co-authored-by: Matt Galbraith <MattGal@users.noreply.github.com>
3 years ago[WASM] Trim TimeZoneInfo to reduce size (#50266)
Matt Johnson-Pint [Tue, 30 Mar 2021 07:24:50 +0000 (00:24 -0700)]
[WASM] Trim TimeZoneInfo to reduce size (#50266)

* Trim TimeZoneInfo to reduce wasm size

* Use partial class files instead of ifdefs

3 years agoignore empty domain for digets auth (#50348)
Tomas Weinfurt [Tue, 30 Mar 2021 07:01:14 +0000 (00:01 -0700)]
ignore empty domain for digets auth (#50348)

* ignore empty domain for digets auth

* style cleanup

3 years agoAnnotate CreateInstanceForAnotherGenericParameter as PublicParameterlessConstructor...
Eric Erhardt [Tue, 30 Mar 2021 02:12:29 +0000 (21:12 -0500)]
Annotate CreateInstanceForAnotherGenericParameter as PublicParameterlessConstructor (#50390)

This allows private constructors on the Types to be trimmed.

Fix #50353

3 years agoDo not fold away double negation if the tree is a CSE candidate (#50373)
SingleAccretion [Tue, 30 Mar 2021 01:14:17 +0000 (04:14 +0300)]
Do not fold away double negation if the tree is a CSE candidate (#50373)

* Do not morph away double negation if it is a CSE candidate

* Added a test verifying that double negation is not removed for CSEs

* Bump the test's priority to zero

3 years agoAdd CancellationTokenSource.TryReset (#50346)
Stephen Toub [Tue, 30 Mar 2021 00:44:25 +0000 (20:44 -0400)]
Add CancellationTokenSource.TryReset (#50346)

* Add CancellationTokenSource.TryReset

* Update src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs

3 years agoSeveral WebProxy-related fixes (#50368)
Stephen Toub [Tue, 30 Mar 2021 00:40:33 +0000 (20:40 -0400)]
Several WebProxy-related fixes (#50368)

- Split browser from non-browser to avoid CA1416 suppressions, UnsupportedOSPlatform attributes, and PNSEs when used from browser
- Cache domain name and local addresses for use in IsLocal, along with clearing of the caches upon network change detection
- Removing redundant IPAddress.IsLoopback check that's covered by previous Uri.IsLoopback check
- Change IsMatchInBypassList to use string interpolation, such that the non-default port case will get better implicitly with C# 10 interpolated string improvements

3 years agoFix SuperPMI handling of missing data for asm diffs (#50309)
Bruce Forstall [Tue, 30 Mar 2021 00:12:57 +0000 (17:12 -0700)]
Fix SuperPMI handling of missing data for asm diffs (#50309)

Adjust the error code determination for asm diffs to not report
diffs if all the compilation failures were due to missing data
in the MCH files.

Update the SuperPMI end status line to report the count of MC
compilation failures due to missing data (and adjust parallel
SuperPMI to handle it as well).

As a result, with `superpmi.py asmdiffs` you won't see the message
"Asm diffs" if all the failures were due to missing data.

3 years agoSinglefile compression of native files (#49855)
Vladimir Sadov [Mon, 29 Mar 2021 23:16:14 +0000 (16:16 -0700)]
Singlefile compression of native files (#49855)

* versioning

* no need to support 2.0 bundle version

* enable compression

* fixes after rebase

* build fix for Unix

* Fix build with GCC

* disable a test temporarily to see what else breaks

* Add EnableCompression option to Bundler + PR feedback

* Couple more places should use version 6.0

* PR feedback (header versioning, more tests, fixed an assert)

* Suggestion from PR review

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

* should be bundle_major_version in two more places.

* More PR feedback

Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
3 years agoDon't throw when previous enum mapping is not found. (#49892)
Steve Molloy [Mon, 29 Mar 2021 22:46:54 +0000 (15:46 -0700)]
Don't throw when previous enum mapping is not found. (#49892)

3 years agoRemove unnecessary delegate/closure from NtProcessInfoHelper on Windows (#50387)
Stephen Toub [Mon, 29 Mar 2021 22:10:00 +0000 (18:10 -0400)]
Remove unnecessary delegate/closure from NtProcessInfoHelper on Windows (#50387)

3 years agoClean up REGUTIL/CLRConfig system (#50314)
Aaron Robinson [Mon, 29 Mar 2021 20:58:50 +0000 (13:58 -0700)]
Clean up REGUTIL/CLRConfig system (#50314)

* Convert all configuration options from REGUTIL to CLRConfig.

* Remove uses of REGUTIL outside of CLRConfig impl.

3 years agoSet IsTrimmable on CompilerServices.Unsafe (#50370)
Sven Boemer [Mon, 29 Mar 2021 20:14:51 +0000 (13:14 -0700)]
Set IsTrimmable on CompilerServices.Unsafe (#50370)

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

3 years agoFix unintended closure in RsaPaddingProcessor.OpenProcessor (#50377)
Stephen Toub [Mon, 29 Mar 2021 20:11:13 +0000 (16:11 -0400)]
Fix unintended closure in RsaPaddingProcessor.OpenProcessor (#50377)

3 years agoRemove some delegate/closures from X509Pal (#50376)
Stephen Toub [Mon, 29 Mar 2021 20:06:30 +0000 (16:06 -0400)]
Remove some delegate/closures from X509Pal (#50376)