platform/upstream/dotnet/runtime.git
4 years ago[JsonSerializer] Prevent arbitrary properties from being cached when deserializing...
Layomi Akinrinade [Fri, 7 Aug 2020 17:52:37 +0000 (10:52 -0700)]
[JsonSerializer] Prevent arbitrary properties from being cached when deserializing with parameterized ctors (#40495)

* [JsonSerializer] Prevent arbitrary properties from being cached when deserializing with parameterized ctors

* Address review feedback

* Correct check on when to grow property pool in sync code paths

4 years agoadd NetworkException (#40344)
Geoff Kizer [Fri, 7 Aug 2020 16:52:30 +0000 (09:52 -0700)]
add NetworkException (#40344)

* add NetworkException

4 years agoFix Japanese Abbreviated Era Names (#40300)
Tarek Mahmoud Sayed [Fri, 7 Aug 2020 16:18:40 +0000 (09:18 -0700)]
Fix Japanese Abbreviated Era Names (#40300)

4 years agoAdd -y to apt-get install commands (#40492)
Drew Scoggins [Fri, 7 Aug 2020 16:16:38 +0000 (09:16 -0700)]
Add -y to apt-get install commands (#40492)

4 years agoHandle 16 byte HFA fields in arm64 profiler (#40482)
Andy Ayers [Fri, 7 Aug 2020 16:05:39 +0000 (09:05 -0700)]
Handle 16 byte HFA fields in arm64 profiler (#40482)

Fixes #40277.

4 years agoDisable formatting for outerloop. (#40517)
Sergey Andreenko [Fri, 7 Aug 2020 15:56:52 +0000 (08:56 -0700)]
Disable formatting for outerloop. (#40517)

4 years agoAdd code to preserve public fields of input types to JsonSerializer (#40508)
Layomi Akinrinade [Fri, 7 Aug 2020 15:44:54 +0000 (08:44 -0700)]
Add code to preserve public fields of input types to JsonSerializer (#40508)

4 years ago[JsonSerializer] Verify null can't be assigned to non-nullable structs (#40446)
Layomi Akinrinade [Fri, 7 Aug 2020 15:36:19 +0000 (08:36 -0700)]
[JsonSerializer] Verify null can't be assigned to non-nullable structs (#40446)

4 years agoUse T? for unconstrained nullable types (#40197)
Stephen Toub [Fri, 7 Aug 2020 15:25:42 +0000 (11:25 -0400)]
Use T? for unconstrained nullable types (#40197)

* Temporarily upgrade compiler version for T? support

* Use T? for unconstrained nullable types

4 years agoIncrease multiple HTTP/2 connections test timeouts again (#40464)
Alexander Nikolaev [Fri, 7 Aug 2020 15:19:33 +0000 (17:19 +0200)]
Increase multiple HTTP/2 connections test timeouts again (#40464)

Fixes #40115
Fixes #40436

4 years agoAddress additional feedback from #40172 (#40505)
Layomi Akinrinade [Fri, 7 Aug 2020 15:18:09 +0000 (08:18 -0700)]
Address additional feedback from #40172 (#40505)

4 years agofix nullable annotation for ImmutableInterlocked.Update methods (#40459)
Eirik Tsarpalis [Fri, 7 Aug 2020 14:09:56 +0000 (15:09 +0100)]
fix nullable annotation for ImmutableInterlocked.Update methods (#40459)

4 years ago[Wasm] Rename System.Runtime.InteropServices.JavaScript to System.Private.Runtime...
Steve Pfister [Fri, 7 Aug 2020 13:45:17 +0000 (09:45 -0400)]
[Wasm] Rename System.Runtime.InteropServices.JavaScript to System.Private.Runtime.InteropServices.JavaScript (#40478)

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

4 years ago[Wasm] Ensure monovm_initialize is called on startup and address other startup items...
Steve Pfister [Fri, 7 Aug 2020 13:30:15 +0000 (09:30 -0400)]
[Wasm] Ensure monovm_initialize is called on startup and address other startup items (#39446)

This PR addresses:

- Calling monovm_initialize matches how other mono platforms init themselves (Fixes https://github.com/dotnet/runtime/issues/39074)
- Set the entry assembly (Fixes https://github.com/dotnet/runtime/issues/38994)
- Make sure the assembly location is set to empty for assemblies that are loaded from memory (Fixes https://github.com/dotnet/runtime/issues/39650)

4 years ago[mono][interp] Optimize box+unbox to no-op (#40017)
Egor Bogatov [Fri, 7 Aug 2020 13:07:56 +0000 (16:07 +0300)]
[mono][interp] Optimize box+unbox to no-op (#40017)

4 years agoEnable CBOR property tests in CI runs (#40135)
Eirik Tsarpalis [Fri, 7 Aug 2020 10:52:56 +0000 (11:52 +0100)]
Enable CBOR property tests in CI runs (#40135)

* enable cbor property tests in CI runs

* address feedback

4 years agoRemove new platform members from OSPlatform (#40373)
Adam Sitnik [Fri, 7 Aug 2020 10:18:34 +0000 (12:18 +0200)]
Remove new platform members from OSPlatform (#40373)

* Remove new platform members from OSPlatform

* remove IsOSPlatformEarlierThan and IsOSPlatformOrLater methods

* remove unused resource and dependency

* delegate RuntimeInformation.IsOSPlatform to call OperatingSystem.IsOSPlatform. it won't compile now as the new guards have not been merged yet (#40457)

* remove OSPlatform.Browser and it's usage

4 years agoTrim async debugging when debugging feature is disabled (#40400)
Marek Safar [Fri, 7 Aug 2020 09:03:27 +0000 (11:03 +0200)]
Trim async debugging when debugging feature is disabled (#40400)

4 years agoImplement platform guards in OperatingSystem class (#40457)
Adam Sitnik [Fri, 7 Aug 2020 07:16:19 +0000 (09:16 +0200)]
Implement platform guards in OperatingSystem class (#40457)

* add Is$OsName methods to OperatingSystem class

* add OperatingSystem.*VersionAtLeast methods

* add IsOSPlatform and IsOSPlatformVersionAtLeast

* add xml comments

* address code review suggestions

* move TARGET_* defines to a common file

4 years agoFix caching EH clause type handle problem in a conservative fashion (#40493)
David Wrighton [Fri, 7 Aug 2020 03:56:25 +0000 (20:56 -0700)]
Fix caching EH clause type handle problem in a conservative fashion (#40493)

This caching was intended to improve performance of repeatedly catching exceptions. As it happens, the critical section that was being used to protect the cache could trigger a GC, and cause a failure under stress. However, some years ago, the eh clause as operated on by the ResolveEHClause method was changed to be a copy of the EHClause stored during the JIT operation, and thus the caching efforts done in this function did not provide value, and in fact are a minor source of multithread scaling concerns.

- Remove the dynamic caching. (Note, the TypeHandle member variable and the HasCachedTypeHandle function, are still used for LCG dynamic methods.)
- Rename the critical section used to protect the cache, as it is now only used to protect from loading multiple copies of the JIT.

4 years agoAdd DesignerAttribute to types that had it in full framework (#40425)
Santiago Fernandez Madero [Fri, 7 Aug 2020 03:03:19 +0000 (22:03 -0500)]
Add DesignerAttribute to types that had it in full framework (#40425)

* Add DesignerAttribute to types that had it in full framework

* Move DesignerAttributeTests to Primitives and fix test errors

* Remove DesignerAttribute.cs from TypeConverter

4 years agoMake ComponentModel intrinsic TypeConverters linker-safe (#39973)
Layomi Akinrinade [Fri, 7 Aug 2020 00:35:14 +0000 (17:35 -0700)]
Make ComponentModel intrinsic TypeConverters linker-safe (#39973)

* Make ComponentModel intrinsic TypeConverters linker-safe

* Avoid reflection in converter func lookup

* Re-add code path that supports editors

* Consolidate intrinsic converter caches, move converter-specific code to new method, add trimming tests

* Address feedback

* Revert change to GetIntrinsicTypeEditor method

* Handle inheritance with Uri and CultureInfo types

* Add heirarchy-related comments to cache docs

4 years agoAdd nullability annotations for *XPath* files in Xml/Dom and Xml/Xsl (#40295)
David Cantu [Fri, 7 Aug 2020 00:00:09 +0000 (17:00 -0700)]
Add nullability annotations for *XPath* files in Xml/Dom and Xml/Xsl (#40295)

* Add nullability annotations for *XPath* files in Xml/Dom and Xml/Xsl

* Fix build issues

* Address feedback

* Add TODO for replacing MaybeNull attributes

4 years agoFix gc stress coverage handling of epilogs on X86 (#40432)
David Wrighton [Thu, 6 Aug 2020 23:48:52 +0000 (16:48 -0700)]
Fix gc stress coverage handling of epilogs on X86 (#40432)

Epilog checking relies on precise control of when instrumentation for the  first prolog
instruction is enabled or disabled. In particular, if a function has multiple epilogs, or
the first execution of the function terminates via an exception, and subsequent completions
do not, then the function may trigger a false stress fault if epilog checks are not disabled.

This fix makes it so that if the first instruction is hit during a GC coverage in a situation where
the epilog could be examined in the future, that the epilog verification is disabled.

Also an opportunistic fix for a probably unimportant race condition around checking the
callerThread during epilog processing.

4 years agoRemove workaround in DefaultValueAttributeCtorTest trimming test (#40448)
Layomi Akinrinade [Thu, 6 Aug 2020 23:44:35 +0000 (16:44 -0700)]
Remove workaround in DefaultValueAttributeCtorTest trimming test (#40448)

4 years agoimport array access as OBJ for structs. (#40488)
Sergey Andreenko [Thu, 6 Aug 2020 23:08:09 +0000 (16:08 -0700)]
import array access as OBJ for structs. (#40488)

4 years agoAllow execution of R2R code in singlefile app on windows. (#40104)
Vladimir Sadov [Thu, 6 Aug 2020 22:00:33 +0000 (15:00 -0700)]
Allow execution of R2R code in singlefile app on windows. (#40104)

* Keep executable PE sections executable in LayoutILOnly.

* Install unwind handlers if present

* do not do RtlAddFunctionTable on x86

* Check for Cor header before checking for R2R header.

* Delete function table in image dtor

* Avoid PAGE_EXECUTE_READWRITE, we should not need writeable for R2R

* Do relocations in ConvertedImageLayout only if the file is in a bundle. (otherwise R2R stays disabled)

4 years ago[Arm64] Treat Math/MathF.FusedMultiplyAdd as intrinsics (#40124)
Egor Chesakov [Thu, 6 Aug 2020 21:56:56 +0000 (14:56 -0700)]
[Arm64] Treat Math/MathF.FusedMultiplyAdd as intrinsics (#40124)

* Transform Math{F}.FusedMultiplyAdd(x,y,z) into

AdvSimd.FusedMultiplyAddScalar(
  Vector64.CreateScalarUnsafe(z),
  Vector64.CreateScalarUnsafe(y),
  Vector64.CreateScalarUnsafe(x)).ToScalar() on Arm64 in importer.cpp

* Add containment analysis for AdvSimd_FusedMultiplyAddScalar in lower.h lowerarmarch.cpp

* Set tgtPrefOp1 for intrinsics with SIMD-to-SIMD move semantics in lsraarm64.cpp

4 years agoQUIC and HTTP/3 fixes (#40468)
Cory Nelson [Thu, 6 Aug 2020 19:43:49 +0000 (12:43 -0700)]
QUIC and HTTP/3 fixes (#40468)

Update/fix MsQuic P/invoke layer.
Fix a race condition in MsQuicListener setting MsQuicConnection.Connected.
Some MsQuic cleanup.
Remove (un-reviewed) HttpVersion.Version30 and SslApplicationProtocol.Http3 APIs.
Fix Alt-Svc support.
Make Alt-Svc tests timeout properly.

4 years agomap TcpListener APM methods to Task-based methods (#40476)
Geoff Kizer [Thu, 6 Aug 2020 19:20:25 +0000 (12:20 -0700)]
map TcpListener APM methods to Task-based methods (#40476)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
4 years agoJIT: Properly handle a switch opt case during early flow opts (#40434)
Andy Ayers [Thu, 6 Aug 2020 19:01:01 +0000 (12:01 -0700)]
JIT: Properly handle a switch opt case during early flow opts (#40434)

Don't try rethreading statement lists if we're doing and early flow opt.

Fixes #40195.

4 years agoRevert " Define SIGSTOP for architecture mips (#40299)" (#40470)
Santiago Fernandez Madero [Thu, 6 Aug 2020 18:35:48 +0000 (11:35 -0700)]
Revert " Define SIGSTOP for architecture mips (#40299)" (#40470)

This reverts commit 0f7370baa68c5809f93095cbce9bf614f44cc731.

4 years agoSimplify JS interop for Blazor WebAssembly (#40467)
Steve Sanderson [Thu, 6 Aug 2020 18:25:59 +0000 (19:25 +0100)]
Simplify JS interop for Blazor WebAssembly (#40467)

4 years agoRe-enable debug_levels less than zero to indicate debugging without debug logging...
Larry Ewing [Thu, 6 Aug 2020 18:19:59 +0000 (13:19 -0500)]
Re-enable debug_levels less than zero to indicate debugging without debug logging (#40458)

4 years agoAdd nodejs and npm install steps (#40474)
Drew Scoggins [Thu, 6 Aug 2020 17:35:56 +0000 (10:35 -0700)]
Add nodejs and npm install steps (#40474)

4 years agoFix several typos in bash script generation for Crossgen2 (#40417)
Tomáš Rylek [Thu, 6 Aug 2020 16:39:42 +0000 (18:39 +0200)]
Fix several typos in bash script generation for Crossgen2 (#40417)

4 years ago[wasm] Fix GC support in ves_icall_get_trace (). (#40384)
Zoltan Varga [Thu, 6 Aug 2020 14:52:46 +0000 (10:52 -0400)]
[wasm] Fix GC support in ves_icall_get_trace (). (#40384)

* [wasm] Fix GC support in ves_icall_get_trace ().

* Fix a c++-ism.

4 years ago[System.Console] Fix manual test (#39460)
Eirik Tsarpalis [Thu, 6 Aug 2020 11:28:06 +0000 (12:28 +0100)]
[System.Console] Fix manual test (#39460)

* do not report '\n' as Ctrl+Enter on unix

* add macos instructions

* add windows test instructions

4 years agoCheck more patterns for retBuffer. (#40340)
Sergey Andreenko [Thu, 6 Aug 2020 07:57:33 +0000 (00:57 -0700)]
Check more patterns for retBuffer. (#40340)

* Check more patterns for retBuffer.

We force return buffers containing GC pointers to be on the stack and before we make a copy we check if the return buffer is already on the stack. Fix the check by adding `LCL_VAR_ADDR`, `ADD(LCL_VAR_ADDR, CNST)` patterns.

* Clear `EnableExtraSuperPmiQueries` during SPMI replay.

It is set during collection for easier test of struct promotion enhancements but it could let to chk/rel diffs if used during replay.

4 years agoRemove EventSourceAttribute usages when EventSource feature is disabled (#40329)
Marek Safar [Thu, 6 Aug 2020 07:42:59 +0000 (09:42 +0200)]
Remove EventSourceAttribute usages when EventSource feature is disabled (#40329)

4 years ago Define SIGSTOP for architecture mips (#40299)
SUN Guoyun [Thu, 6 Aug 2020 05:06:02 +0000 (13:06 +0800)]
 Define SIGSTOP for architecture mips (#40299)

 define SIGSTOP 19 is just ok for architecture x86、arm、s390、powerpc and so on.
 but others architecture has different values.

Co-Authored-By: hev <wangrui@loongson.cn>
4 years agoFix Docker cross-build command (#40433)
Oleksandr Tymoshenko [Thu, 6 Aug 2020 04:58:39 +0000 (07:58 +0300)]
Fix Docker cross-build command (#40433)

4 years agoImprove dictionary & hashset lookup perf for OrdinalIgnoreCase (#36252)
Levi Broderick [Thu, 6 Aug 2020 04:16:21 +0000 (21:16 -0700)]
Improve dictionary & hashset lookup perf for OrdinalIgnoreCase (#36252)

4 years agoAdd HeaderEncodingSelector to MultipartContent (#39169)
Miha Zupan [Thu, 6 Aug 2020 02:56:52 +0000 (04:56 +0200)]
Add HeaderEncodingSelector to MultipartContent (#39169)

* Add HeaderEncodingSelector to MultipartContent

* Test cleanup

* Avoid WriteLatin1 logic duplication

* Move to common HeaderEncodingSelector<TContext>

* Fix indentation

4 years agoConsider debug levels less than zero disabled (#40429)
Larry Ewing [Thu, 6 Aug 2020 02:28:31 +0000 (21:28 -0500)]
Consider debug levels less than zero disabled (#40429)

4 years agoFix -numproc script handling (#40437)
Steve MacLean [Thu, 6 Aug 2020 01:54:00 +0000 (21:54 -0400)]
Fix -numproc script handling (#40437)

4 years agoFix crossgenning of sparse COM interface types on non-Windows and add test (#40404)
Jeremy Koritzinsky [Thu, 6 Aug 2020 00:52:34 +0000 (17:52 -0700)]
Fix crossgenning of sparse COM interface types on non-Windows and add test (#40404)

4 years ago[mono] Don't save byref `System.Void` into `MonoDomain::typeof_void`. (#40405)
imhameed [Thu, 6 Aug 2020 00:49:12 +0000 (17:49 -0700)]
[mono] Don't save byref `System.Void` into `MonoDomain::typeof_void`. (#40405)

`mono_type_get_object_checked` will return the `MonoReflectionType`
referred to by `MonoDomain::typeof_void` if present. If a byref
`System.Void` is stored in this field, then
`get_ContainsGenericParameters` applied to `System.Void` will loop
indefinitely, because our implementation of
`get_ContainsGenericParameters` expects `GetElementType` to yield a
`MonoReflectionType` with one layer of "type function application"
removed.

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

4 years agoTurnoff wasm runs for CI (#40421)
Drew Scoggins [Wed, 5 Aug 2020 23:12:54 +0000 (16:12 -0700)]
Turnoff wasm runs for CI (#40421)

4 years agoRefactor Microsoft.Extensions TargetFrameworks (#40397)
Eric StJohn [Wed, 5 Aug 2020 22:59:28 +0000 (15:59 -0700)]
Refactor Microsoft.Extensions TargetFrameworks (#40397)

I went through every Microsoft.Extensions project to try to either
reduce the number of TargetFrameworks they build for, or add
a TargetFramework to avoid the need of bringing an additional
dependency on Microsoft.Bcl.AsyncInterfaces.

4 years ago[wasm] Moving wasm debugger to dotnet/runtime (#40146)
Thays Grazia [Wed, 5 Aug 2020 22:34:41 +0000 (19:34 -0300)]
[wasm] Moving wasm debugger to dotnet/runtime (#40146)

* Moving Wasm debugger to dotnet/runtime

The build is working.
The tests are running.
- make -C src/mono/wasm/ run-debugger-tests

4 years agoBuild Globalization native shim as C++ and don't define __typeof (#40352)
Santiago Fernandez Madero [Wed, 5 Aug 2020 22:22:51 +0000 (15:22 -0700)]
Build Globalization native shim as C++ and don't define __typeof (#40352)

* Build Globalization native shim as C++ and don't define __typeof
intrinsic

* PR Feedback, use TYPEOF in all shims

4 years agoAdding support for X86Base.CpuId (#40167)
Tanner Gooding [Wed, 5 Aug 2020 22:16:05 +0000 (15:16 -0700)]
Adding support for X86Base.CpuId (#40167)

* Adding support for X86Base.CpuId

* Rename getcpuid and getextcpuid to __cpuid and __cpuidex, respectively

* Removing xchg from the Unix x64 __cpuid implementation

* Add a comment as to why the X86/X86Base/CpuId test limits the checked vendors

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Adding back a missing parentheses

* Fixing a typo in the isGenuineIntel check

* Avoid a conflict around cpuInfo

* Avoid an implicit cast when comparing the cpuidInfo

* Separate the __cpuidex qcall into coreclr and mono specific variants

* Add the partial modifier to the X86Base.PlatformNotSupported.cs file

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years ago[test] fix hang in macOS variants of reverse diagnostics server tests (#40225)
John Salem [Wed, 5 Aug 2020 21:39:45 +0000 (14:39 -0700)]
[test] fix hang in macOS variants of reverse diagnostics server tests (#40225)

Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
4 years agoAdd wasm runs (#39548)
Drew Scoggins [Wed, 5 Aug 2020 21:38:10 +0000 (14:38 -0700)]
Add wasm runs (#39548)

* Add WASM microbenchmark runs

This commit adds WASM microbenchmark support to the perf lab.

* Increase timeout for first run

* Add runkind

* Update proj file selection

4 years agoSystem.Diagnostics.Activity Perf Improvement (#40362)
Mikel Blanchard [Wed, 5 Aug 2020 20:45:22 +0000 (13:45 -0700)]
System.Diagnostics.Activity Perf Improvement (#40362)

4 years ago[mono] Pass delegate target when using CreateDelegate (#40321)
Vlad Brezae [Wed, 5 Aug 2020 20:04:00 +0000 (23:04 +0300)]
[mono] Pass delegate target when using CreateDelegate (#40321)

* Pass delegate target when using CreateDelegate

* [tests] Add test that checks `this` with CreateDelegate API

4 years agoAdd support for reporting byrefs to RVA static fields of collectible assemblies ...
David Wrighton [Wed, 5 Aug 2020 19:54:45 +0000 (12:54 -0700)]
Add support for reporting byrefs to RVA static fields of collectible assemblies (#40346)

- Keep track of all RVA static field locations
  - For assemblies loaded from PE files, use a range that is the entire PE range
  - For assemblies dynamically created, use piecemeal ranges for each individual RVA static field
- Report byref references via the GcReportLoaderAllocator mechanism in PromoteCarefully

- Add a test to cover this scenario, and thread statics
  - disable test on Mono, as it doesn't pass there yet

4 years agoIn mono_wasm_invoke_js_marshalled, pass through treatResultAsVoid parameter (#39435)
Steve Sanderson [Wed, 5 Aug 2020 19:10:13 +0000 (20:10 +0100)]
In mono_wasm_invoke_js_marshalled, pass through treatResultAsVoid parameter (#39435)

4 years agoAdd savepoint API to DbTransaction (#34561)
Shay Rojansky [Wed, 5 Aug 2020 19:02:13 +0000 (22:02 +0300)]
Add savepoint API to DbTransaction (#34561)

Closes #33397

4 years agoIssue 39764 fix: Host and Application Lifetime Notifications (#39832)
Werner Mairl [Wed, 5 Aug 2020 18:48:57 +0000 (20:48 +0200)]
Issue 39764 fix: Host and Application Lifetime Notifications (#39832)

4 years agoTransform dead late arg store to NOP (#40348)
Carol Eidt [Wed, 5 Aug 2020 18:33:30 +0000 (11:33 -0700)]
Transform dead late arg store to NOP (#40348)

When deleting a dead store, preserve the GTF_LATE_ARG and transform it to NOP.

Fix #39742

4 years agoremove dead code (#40363)
Geoff Kizer [Wed, 5 Aug 2020 17:48:27 +0000 (10:48 -0700)]
remove dead code (#40363)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
4 years agoAdd BindConfiguration extension method for OptionsBuilder (#39825)
Fredrik Høisæther Rasch [Wed, 5 Aug 2020 16:50:22 +0000 (18:50 +0200)]
Add BindConfiguration extension method for OptionsBuilder (#39825)

4 years agoMark System.Security.Cryptography.OpenSsl as unsupported on Windows, fixes #40101...
Adam Sitnik [Wed, 5 Aug 2020 16:25:25 +0000 (18:25 +0200)]
Mark System.Security.Cryptography.OpenSsl as unsupported on Windows, fixes #40101 (#40377)

4 years agoMark existing Windows-specific APIs without a version number, fixes #40095 (#40375)
Adam Sitnik [Wed, 5 Aug 2020 16:24:03 +0000 (18:24 +0200)]
Mark existing Windows-specific APIs without a version number, fixes #40095 (#40375)

4 years agoWhen invoking class constructor ensure class is initialized (#40293)
David Wrighton [Wed, 5 Aug 2020 16:10:15 +0000 (09:10 -0700)]
When invoking class constructor ensure class is initialized (#40293)

When invoking the class constructor method via reflection invoke, ensure that the class constructor is run via the standard run class constructor pathway instead of running it explicitly. Do the same for module constructors.

4 years agoRename MinimumOSPlatformAttribute and RemovedInOSPlatformAttribute (#40371)
Adam Sitnik [Wed, 5 Aug 2020 11:47:50 +0000 (13:47 +0200)]
Rename MinimumOSPlatformAttribute and RemovedInOSPlatformAttribute (#40371)

* rename attributes:

* MinimumOSPlatformAttribute -> SupportedOSPlatformAttribute
* RemovedInOSPlatformAttribute -> UnsupportedOSPlatformAttribute

* update src and ref files

* update .targets file

* update comment ;)

4 years agoUnix: throw PNSE from BeginAccept/EndAccept that attempts to receive a buffer (#40292)
Anton Firszov [Wed, 5 Aug 2020 11:32:28 +0000 (13:32 +0200)]
Unix: throw PNSE from BeginAccept/EndAccept that attempts to receive a buffer (#40292)

Resolve #32633
- BeginAccept/EndAccept overloads which are attempting to also receive a buffer are currently only supported on Windows, therefore PNSE is thrown on Unix
- When the operation is supported, the returned buffer is never null, therefore the out byte[] buffer parameters are altered to be non-nullable

4 years agoDo not trim generic interfaces implemented by arrays (#40260)
Michal Strehovský [Wed, 5 Aug 2020 10:59:48 +0000 (12:59 +0200)]
Do not trim generic interfaces implemented by arrays (#40260)

Logic within the CoreCLR VM depends on the order of methods on these interfaces to find methods on SZArrayHelper.

SZArrayHelper is already rooted from MscorlibBinder, but the interface methods are referenced only implicitly through their slots and need a dedicated entry.

4 years agoFix corerun binplacing in testhost (#40341)
Viktor Hofer [Wed, 5 Aug 2020 07:40:55 +0000 (09:40 +0200)]
Fix corerun binplacing in testhost (#40341)

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

4 years ago[master] Update dependencies from dotnet/icu dotnet/llvm-project mono/linker (#40268)
dotnet-maestro[bot] [Wed, 5 Aug 2020 05:08:27 +0000 (05:08 +0000)]
[master] Update dependencies from dotnet/icu dotnet/llvm-project mono/linker (#40268)

[master] Update dependencies from dotnet/icu dotnet/llvm-project mono/linker
- Updates:
  - Microsoft.NET.ILLink.Tasks: from 5.0.0-preview.3.20378.1 to 5.0.0-preview.3.20403.5

- Updates:
  - Microsoft.NETCore.Runtime.ICU.Transport: from 5.0.0-preview.8.20378.2 to 5.0.0-preview.8.20403.1

- Updates:
  - runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
  - runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1

 - Fix linker tests by fixing some warnings, and suppressing reflection warnings during the linker tests.

 - Merge remote-tracking branch 'upstream/master' into UpdateLinker

 - Suppress IL2008;IL2009 on non-Windows linker tests.

 - Suppress more linker warnings on non-Windows.

 - Suppress more linker warnings

4 years agoClean up more byte packing/unpacking. (#40334)
Kevin Jones [Wed, 5 Aug 2020 05:01:13 +0000 (01:01 -0400)]
Clean up more byte packing/unpacking. (#40334)

4 years agoRemove potential NULLCHECK creation after LIR on arm32. (#40349)
Sergey Andreenko [Wed, 5 Aug 2020 04:02:17 +0000 (21:02 -0700)]
Remove potential NULLCHECK creation after LIR on arm32. (#40349)

* Use `TransformUnusedIndirection` in LIR liveness.

* Use `TYP_INT` as `TransformUnusedIndirection` does.

* fix grammar.

4 years agoAdd runtime feature checks for 5.0 browser (#40347)
Larry Ewing [Wed, 5 Aug 2020 03:58:54 +0000 (22:58 -0500)]
Add runtime feature checks for 5.0 browser (#40347)

4 years agoAnnotate Extensions.Options to make it linker friendly (#40294)
Eric Erhardt [Wed, 5 Aug 2020 02:13:21 +0000 (21:13 -0500)]
Annotate Extensions.Options to make it linker friendly (#40294)

* Annotate Extensions.Options to make it linker friendly

Fix #40236

4 years agoAdd Browser specific PersistedFiles implementation (#39350)
Marek Safar [Wed, 5 Aug 2020 02:00:13 +0000 (04:00 +0200)]
Add Browser specific PersistedFiles implementation (#39350)

* Add Browser specific PersistedFiles implementation

Simplified the implementation removes dependency on several native calls
which all return only default values.

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoAdd LoggerColorBehavior (#40221)
Maryam Ariyan [Wed, 5 Aug 2020 00:25:03 +0000 (17:25 -0700)]
Add LoggerColorBehavior (#40221)

4 years ago[wasm] Make mono_wasm_get_obj_type () GC safe by doing all object access before calli...
Zoltan Varga [Tue, 4 Aug 2020 22:18:21 +0000 (18:18 -0400)]
[wasm] Make mono_wasm_get_obj_type () GC safe by doing all object access before calling into the runtime. (#40312)

Part of the fix for https://github.com/dotnet/runtime/issues/40132.

4 years agoDon't suspend for debugger while holding the slot backpatching lock (#40060)
Koundinya Veluri [Tue, 4 Aug 2020 22:02:35 +0000 (18:02 -0400)]
Don't suspend for debugger while holding the slot backpatching lock (#40060)

- Mostly reverted the previous workaround for the issue (commit fc06054a774e28a5a47bbe862adcf03251abb43c)
- Added a forbid-suspend-for-debugger region in preemptive GC mode
- Added a crst holder type that acquires a lock and enters the forbid region
- Where the slot backpatching lock would be taken where cooperative GC mode may be entered inside that lock, the new crst holder is used
- When a suspend for debugger is requested, a thread in preemptive GC mode that is in the forbid region is considered not yet suspended and is synched later similarly to threads in cooperative GC mode

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

4 years agoMono: Ensure tasklets are removed in netcore build (#40324)
Alexander Köplinger [Tue, 4 Aug 2020 20:25:58 +0000 (22:25 +0200)]
Mono: Ensure tasklets are removed in netcore build (#40324)

Tasklets were an old mono-specific extension for continuations that is no longer relevant.

4 years agoMake macOS targets in global build job template default to 120 minutes timeout (...
Santiago Fernandez Madero [Tue, 4 Aug 2020 19:59:46 +0000 (12:59 -0700)]
Make macOS targets in global build job template default to 120 minutes timeout (#40330)

4 years agoFix warning in debugger-agent.c (#40325)
Alexander Köplinger [Tue, 4 Aug 2020 19:48:16 +0000 (21:48 +0200)]
Fix warning in debugger-agent.c (#40325)

```
  CC       libmono_dbg_la-debugger-agent.lo
/Users/runner/work/1/s/src/mono/mono/mini/debugger-agent.c:1088:9: warning: unused variable 'argv' [-Wunused-variable]
                char *argv [ ] = {
```

4 years agofix typo: fuitful -> fruitful (#40333)
Bruno Garcia [Tue, 4 Aug 2020 19:44:28 +0000 (15:44 -0400)]
fix typo: fuitful -> fruitful (#40333)

4 years agoAdd more runtime GC counters (#38851)
Sung Yoon Whang [Tue, 4 Aug 2020 19:17:16 +0000 (12:17 -0700)]
Add more runtime GC counters (#38851)

* Add more GC counters

* Cleanup

* Change size of last GC stats arrays from total_generation_count to max_generation

* add asserts and fix error

* fix typo

* Fix Windows build

* Remove pause time / time between GC counters as discussed in design PR

* revert changes to GC for unused counters

* more unnecessary changes

* build fix

* last bit of undoing changes

* CR feedback

4 years agoAdd step to run linker on entire runtime pack during libraries build (#40172)
Layomi Akinrinade [Tue, 4 Aug 2020 18:43:24 +0000 (11:43 -0700)]
Add step to run linker on entire runtime pack during libraries build (#40172)

* Add step to run linker on entire runtime pack during libraries build

* Address feedback

* Only run for NetCoreAppCurrent

* Include appropriate S.P.CoreLib

* Address review feedback

* Add common property group for shared linker args; remove unneeded changes from PR

* Rename illink-sharedframeworks.targets to illink-sharedframework.targets

* Address review feedback

4 years agoMinimum CMake downgrade for Linux (#39044)
Jeremy Koritzinsky [Tue, 4 Aug 2020 18:04:05 +0000 (11:04 -0700)]
Minimum CMake downgrade for Linux (#39044)

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
4 years agocleanup schannel pal (#39755)
Tomas Weinfurt [Tue, 4 Aug 2020 17:28:04 +0000 (10:28 -0700)]
cleanup schannel pal (#39755)

* cleanup schannel pal

* fix netfx

4 years agoFix logger output. (#40291)
Larry Ewing [Tue, 4 Aug 2020 17:09:27 +0000 (12:09 -0500)]
Fix logger output. (#40291)

4 years ago[runtime] Handle null byref returns in runtime invokes. (#40071)
Zoltan Varga [Tue, 4 Aug 2020 17:06:36 +0000 (13:06 -0400)]
[runtime] Handle null byref returns in runtime invokes. (#40071)

* [runtime] Handle null byref returns in runtime invokes.

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

* Reenable fixed test

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoNormalize array magic numbers and remove switch (#40279)
Larry Ewing [Tue, 4 Aug 2020 16:50:39 +0000 (11:50 -0500)]
Normalize array magic numbers and remove switch (#40279)

4 years ago[browser][io] Workaround for issue MoveDirectory (#40310)
Kenneth Pouncey [Tue, 4 Aug 2020 14:57:14 +0000 (16:57 +0200)]
[browser][io] Workaround for issue MoveDirectory (#40310)

* [browser][io] Workaround for issue MoveDirectory

- Issue workaround while waiting for emscripten fix.  https://github.com/dotnet/runtime/issues/40305
- The following code checks for the existence of the source and destination directories which replaces the same code in the emscripten code.

emscripten tracking issue:  https://github.com/emscripten-core/emscripten/issues/11804

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

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoFix hang in HTTP/2 handling of canceling credit waits (#40243)
Stephen Toub [Tue, 4 Aug 2020 14:31:40 +0000 (10:31 -0400)]
Fix hang in HTTP/2 handling of canceling credit waits (#40243)

* Re-combine CreditWaiter and CancelableCreditWaiter

The split was to optimize the case when there's no cancellation token, but based on the evolution of the codebase, that doesn't really happen, and it makes the common cancellation case a bit more expensive (and convoluted).

* Fix hang in HTTP/2 handling of canceling credit

The CreditWaiter took a lock to protect its ManualResetValueTaskSourceCore state.  The lock was also shared with its parent.  This could result in a situation where the parent was holding the lock and called into the CreditWaiter to dispose of it and in turn dispose of the registration with the CancellationToken.  That registration could have represented an in-flight cancellation callback, which would also try to take the lock in order to complete the MRVTSC.  And since CancellationTokenRegistration.Dispose blocks waiting for an in-flight cancellation callback to complete, this could deadlock, with a thread holding the lock while waiting for another thread that tries to take the lock to make forward progress.

This fixes it simply by avoiding the lock entirely and instead using a simple compare-exchange to protect the right to complete the MRVTSC.

* Address PR feedback

4 years agoXml docs for SocketsHttpHandler's IsSupported and EnableMultipleHttp2Connections...
Alexander Nikolaev [Tue, 4 Aug 2020 14:12:11 +0000 (16:12 +0200)]
Xml docs for SocketsHttpHandler's IsSupported and EnableMultipleHttp2Connections (#40308)

Fixes #39489

4 years agoCleanup EventSource (#40204)
Jan Kotas [Tue, 4 Aug 2020 13:42:19 +0000 (06:42 -0700)]
Cleanup EventSource (#40204)

* Move StubEnvironment.cs to Microsoft.Diagnostics.Tracing.EventSource.Redist

* Delete ES_BUILD_PCL and ES_BUILD_AGAINST_DOTNET_V35

4 years agoBump timeout in global-build.yml for debug runtime builds (#40309)
Alexander Köplinger [Tue, 4 Aug 2020 13:40:00 +0000 (15:40 +0200)]
Bump timeout in global-build.yml for debug runtime builds (#40309)

A good build of the `runtime-live-build` pipeline takes between 45-55mins for the debug runtime configurations already so we sometimes run into the 60mins default Azure DevOps timeout if we happen to catch a slow machine.

Bumping the timeout to 120mins like we do in other pipelines to fix this.

4 years agoReduce binary size by moving data definitions out of headers. (#40254)
Austin Wise [Tue, 4 Aug 2020 11:08:56 +0000 (04:08 -0700)]
Reduce binary size by moving data definitions out of headers. (#40254)

4 years agoIncreased timeouts, fixed indentation. (#40273)
Marie Píchová [Tue, 4 Aug 2020 10:51:04 +0000 (12:51 +0200)]
Increased timeouts, fixed indentation. (#40273)

4 years ago[Wasm] Enable System.Data.Common tests (#39463)
Steve Pfister [Tue, 4 Aug 2020 09:44:58 +0000 (05:44 -0400)]
[Wasm] Enable System.Data.Common tests (#39463)

Disable the tests that require SQL Server.

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Maxim Lipnin <v-maxlip@microsoft.com>
4 years agoWASM: Pump timer queue in xharness when running unit tests (#40278)
Alexander Köplinger [Tue, 4 Aug 2020 09:39:15 +0000 (11:39 +0200)]
WASM: Pump timer queue in xharness when running unit tests (#40278)

* WASM: Pump timer queue in xharness when running unit tests

We only pumped the threadpool but we didn't pump the timer queue inside the xharness runner, so in the case of Task.Delay() it'll schedule a callback on the timer queue and that will never happen which leads to the infinite loop waiting for the test to finish.
To fix that we call an internal method to pump the timer queue like we do for the threadpool.

Requires an xharness bump to include https://github.com/dotnet/xharness/pull/290

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

* Don't nullref if no timers were started