platform/upstream/dotnet/runtime.git
3 years ago[main] Update dependencies from mono/linker (#50779)
dotnet-maestro[bot] [Wed, 7 Apr 2021 08:18:59 +0000 (10:18 +0200)]
[main] Update dependencies from mono/linker (#50779)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21203.1 -> To Version 6.0.100-preview.2.21205.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years ago[mono] More domain cleanup (#50771)
Zoltan Varga [Wed, 7 Apr 2021 07:26:48 +0000 (03:26 -0400)]
[mono] More domain cleanup (#50771)

* [mono] Remove appdomains_list variable, it shouldn't be needed.

* Remove some GC domain code.

* Remove domains from sre.c.

* Remove domains from the jit info code.

* Remove more domain usage from the JIT code.

3 years agoRace condition in Mock reference tracker runtime with GC. (#50804)
Aaron Robinson [Wed, 7 Apr 2021 04:32:41 +0000 (21:32 -0700)]
Race condition in Mock reference tracker runtime with GC. (#50804)

3 years agoRemove IAssemblyName (and various fusion remnants) (#50755)
Elinor Fung [Wed, 7 Apr 2021 04:11:04 +0000 (21:11 -0700)]
Remove IAssemblyName (and various fusion remnants) (#50755)

3 years agoDisable failing test for GCStress. (#50828)
Aaron Robinson [Wed, 7 Apr 2021 02:15:11 +0000 (19:15 -0700)]
Disable failing test for GCStress. (#50828)

3 years ago[WASM] Use consistent display names for UTC time zone (#50650)
Matt Johnson-Pint [Wed, 7 Apr 2021 02:14:41 +0000 (19:14 -0700)]
[WASM] Use consistent display names for UTC time zone (#50650)

3 years agoFix to build mono on Windows with ninja by default as well (#50793)
Alexander Köplinger [Tue, 6 Apr 2021 22:58:00 +0000 (00:58 +0200)]
Fix to build mono on Windows with ninja by default as well (#50793)

This got broken by https://github.com/dotnet/runtime/commit/8c2158f9fe12c82cd3c0a7f4150773654bc78aaf since we no longer passed /p:Ninja=true down to mono.proj

3 years agoLimit superpmi replay failures using 'failureLimit' command line option (#50516)
Kunal Pathak [Tue, 6 Apr 2021 21:59:17 +0000 (14:59 -0700)]
Limit superpmi replay failures using 'failureLimit' command line option (#50516)

* Limit superpmi replay failures

* Introduce errorCount2

* reword error message

* Introduce failureLimit commandline option

* Add error handling

3 years agoClarify that Ninja is required for the default build experience. (#50809)
Jeremy Koritzinsky [Tue, 6 Apr 2021 21:20:40 +0000 (14:20 -0700)]
Clarify that Ninja is required for the default build experience. (#50809)

3 years ago[arm64] Fix wrong marshalling in gsharedvt transition (#50772)
Vlad Brezae [Tue, 6 Apr 2021 19:57:09 +0000 (22:57 +0300)]
[arm64] Fix wrong marshalling in gsharedvt transition (#50772)

Transitioning from ArgVtypeByRefOnStack to ArgVtypeByRef requires no marshalling. The reference ends up being saved on stack the same way and the stack slot just needs to be copied (in mono_arm_start_gsharedvt_call).

3 years ago[mono] More Threading changes (#49637)
Ryan Lucia [Tue, 6 Apr 2021 19:55:26 +0000 (15:55 -0400)]
[mono] More Threading changes (#49637)

* Move CurrentOSThreadId to shared

* Set t_currentThread in managed

* Remove native abandon_mutexes calls

Abandoning in managed seems to work fine

* Switch to managed Sleep

* Remove threads shutting_down state

* Remove more domain usage

* Move some files to shared per feedback

* Re-add shutting_down flag

* Eliminate helper method for timeout verification

* Remove argument validation in ThreadNative::Sleep

* Abandon mutexes on finalizer thread

* Rename to thread_exiting

* Move OnThreadExiting to Thread

* Fix build

* Build build part 2

* Switch to DynamicDependency

* Avoid calling managed while holding a lock

* Don't leak gchandles

* Clean up rebase

* Pt 2

3 years agoMove performance support files out of eng/common (#50625)
Bill Wert [Tue, 6 Apr 2021 19:16:58 +0000 (12:16 -0700)]
Move performance support files out of eng/common (#50625)

* Move performance support files out of eng/common

* move template out of common

* fix path to pipeline-logging-functions.ps1

* missed directory

3 years agoUse runtimconfig.template.json file for Android functional test for JIT (#50612)
Fan Yang [Tue, 6 Apr 2021 19:07:14 +0000 (15:07 -0400)]
Use runtimconfig.template.json file for Android functional test for JIT (#50612)

* Use runtimconfig.template.json file for Android functional test for JIT

* Parse the generated runtimeconfig.json file

* Update names

* Address more review feedbacks

* Update src/tasks/AndroidAppBuilder/Templates/monodroid.c

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Update src/tasks/AndroidAppBuilder/Templates/monodroid.c

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Update src/tasks/AndroidAppBuilder/Templates/monodroid.c

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Updata variable name for the return of snprintf

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
3 years agoJIT: move and revise fgExpandRunRarelyBlocks (#50765)
Andy Ayers [Tue, 6 Apr 2021 18:51:15 +0000 (11:51 -0700)]
JIT: move and revise fgExpandRunRarelyBlocks (#50765)

Move to fgopt, and rework to make its operation a bit more obvious.

3 years agoImprove Http Telemetry tests (#50226)
Miha Zupan [Tue, 6 Apr 2021 17:27:40 +0000 (19:27 +0200)]
Improve Http Telemetry tests (#50226)

3 years agoSimplify superpmi.py `-jitoption` (#50756)
Bruce Forstall [Tue, 6 Apr 2021 17:13:16 +0000 (10:13 -0700)]
Simplify superpmi.py `-jitoption` (#50756)

Remove `-jitoption` from `asmdiffs` and `collect` commands.
asmdiffs has `-base_jit_option` and `-diff_jit_option`.
Collect doesn't need the option, but processing the args does need
to set it to None since collect does a verification replay which
will check if the argument is set.

3 years agoUnblock clean CI (#50494)
Maryam Ariyan [Tue, 6 Apr 2021 16:23:46 +0000 (12:23 -0400)]
Unblock clean CI  (#50494)

* unblock clean CI

* correcting active issue to its dupe

3 years agoUpdate the minimum version of the SDK to 6.0 P2 (#50084)
Viktor Hofer [Tue, 6 Apr 2021 15:27:20 +0000 (17:27 +0200)]
Update the minimum version of the SDK to 6.0 P2 (#50084)

3 years ago[mbr] Add Apple sample (#50740)
Aleksey Kliger (λgeek) [Tue, 6 Apr 2021 13:04:57 +0000 (09:04 -0400)]
[mbr] Add Apple sample (#50740)

* [mbr] Add an apple sample

   Works on iOS simulator and Mac Catalyst

* delete unused DeltaHelper code

   Now that System.Reflection.Metadata.AssemblyExtensions.ApplyUpdate is in the BCL officially, I don't need the reflection-based invoke code anymore

3 years agomake EstablishProxyTunnelAsync throw on failure status code from proxy (#50763)
Geoff Kizer [Tue, 6 Apr 2021 08:29:27 +0000 (01:29 -0700)]
make EstablishProxyTunnelAsync throw on failure status code from proxy (#50763)

* make EstablishProxyTunnelAsync throw on failure status code from proxy and fix relevant test

* ensure tunnelResponse is disposed on exception

* Update src/libraries/System.Net.Http/src/Resources/Strings.resx

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoImprove RGB Min Max evaluation performance by using 2 or 3 comparison… (#50622)
Mansoor Saqib [Tue, 6 Apr 2021 04:41:26 +0000 (21:41 -0700)]
Improve RGB Min Max evaluation performance by using 2 or 3 comparison… (#50622)

3 years ago[mono] More domain cleanups (#50479)
Zoltan Varga [Tue, 6 Apr 2021 04:08:54 +0000 (00:08 -0400)]
[mono] More domain cleanups (#50479)

* [mono] More domain cleanups.

* [mono] Move the storage of the loaded assemblies list to assembly-load-context.c.

Add a mono_alc_get_all_loaded_assemblies () helper function to return a
array of all the loaded assemblies. Use this instead of accessing
domain->loaded_assemblies directly.

* [mono] Move externally called domain related API functions to external-only.c.

* [mono] Simplify the domain creation code since there is only one domain.

* Remove domain argument from mono_domain_assembly_open_internal ().

* [mono] Make mono_domain_foreach () external only.

* Fix the build.

* [mono] Remove more unused 'domain' arguments.

Move functions from appdomain.c to more assembly-load-context.c/
extern-only.c.

3 years agoFix Crossgen2 of PlatformDefaultMemberFunction methods and calls. (#50754)
Jeremy Koritzinsky [Tue, 6 Apr 2021 03:10:34 +0000 (20:10 -0700)]
Fix Crossgen2 of PlatformDefaultMemberFunction methods and calls. (#50754)

* Fix Crossgen2 of PlatformDefaultMemberFunction methods and calls.

* Update CorInfoImpl.cs

3 years agoDisable EventSource generator in design-time builds (#50741)
Stephen Toub [Tue, 6 Apr 2021 02:35:54 +0000 (22:35 -0400)]
Disable EventSource generator in design-time builds (#50741)

3 years agoFix X509 test failures on Android (#50301)
Jeremy Koritzinsky [Tue, 6 Apr 2021 02:12:38 +0000 (19:12 -0700)]
Fix X509 test failures on Android (#50301)

* Disable tests on Android that use unsupported features (Brainpool curve, PSS padding in cert signatures)

* Handle JNI thread shutdown

* On older Android API levels, ECPrivateKey does not implement Destroyable

* On older API levels, we can end up getting a certificate with a null public key. Return early with null instead of crashing with an assert.

* Condition another test on SupportsBrainpool for clarity.

* Fix X509 test failures found when running against an API Level 21 Android simulator.

* Reuse existing item groups when possible.

* Remove extraneous test suppression and handle exceptions.

* Fix bug in x509 get certs.

* Disable X509 tests on brower with ProjectExclusions.

* Fix ChainTests.TestResetMethod test fix.

* PR feedback.

* Fix test project path.

3 years agoDo not confuse fgDispBasicBlocks in fgMorphBlocks (#50703)
SingleAccretion [Tue, 6 Apr 2021 00:08:58 +0000 (03:08 +0300)]
Do not confuse fgDispBasicBlocks in fgMorphBlocks (#50703)

The logic in "fgDispBasicBlocks" has a check for promoted implicit by-refs
that only allows them during global morph via an 'assert(fgGlobalMorph)'.
However, "fgMorphBlocks" was calling "fgDispBasicBlocks" after having set "fgGlobalMorph" to "false",
leading it to falsely believe it was not actually being called during global morph
and asserting with a message like "assertion failed 'fgGlobalMorph' - during 'Morph - Global'".
Fix this by setting "fgGlobalMorph" to "false" at the very end of "fgMorphBlocks".

3 years agoEnforce 64KB event payload size limit on EventPipe (#50600)
Sung Yoon Whang [Mon, 5 Apr 2021 23:27:39 +0000 (16:27 -0700)]
Enforce 64KB event payload size limit on EventPipe  (#50600)

* allow >100KB events to be written

* prevent events > 64KB from being written

* code review feedback

* increment seq num

* fix build

* fix build on clang

* fix mono build

3 years agoReorganize CoreCLR native build to reduce CMake reconfigures when the build system...
Jeremy Koritzinsky [Mon, 5 Apr 2021 22:05:34 +0000 (15:05 -0700)]
Reorganize CoreCLR native build to reduce CMake reconfigures when the build system is untouched (#49906)

3 years ago[mbr] Turn on hot reload for iOS, tvOS and MacCatalyst (#50458)
Aleksey Kliger (λgeek) [Mon, 5 Apr 2021 19:16:50 +0000 (15:16 -0400)]
[mbr] Turn on hot reload for iOS, tvOS and MacCatalyst (#50458)

* [mbr] Turn on hot reload for iOS, tvOS and MacCatalyst

* [mbr] Mark some unused variables with G_GNUC_UNUSED

   Fixes build on MacCatalyst

3 years agoimprove connection scavenge logic by doing zero-byte read (#50545)
Geoff Kizer [Mon, 5 Apr 2021 19:10:09 +0000 (12:10 -0700)]
improve connection scavenge logic by doing zero-byte read (#50545)

* improve connection usability check in scavenge logic by doing zero-byte read

* fix assert re read buffer state in ReadAheadWithZeroByteReadAsync

* Update src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* simplify waiter dequeue

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoResolve call mdtokens when making tier 1 inline observations (#50675)
Tanner Gooding [Mon, 5 Apr 2021 19:04:14 +0000 (12:04 -0700)]
Resolve call mdtokens when making tier 1 inline observations (#50675)

* Add some basic handling to allow resolving call tokens in fgFindJumpTargets when in Tier1 making inline observations

* Don't count prefix opcodes as instructions and handle NI_IsSupported_True/False as constants in fgFindJumpTargets

* Update src/coreclr/jit/fgbasic.cpp

* Applying formatting patch

3 years agoAnnotate APIs in System.Private.Xml (#49682)
Andy Gocke [Mon, 5 Apr 2021 18:59:41 +0000 (11:59 -0700)]
Annotate APIs in System.Private.Xml (#49682)

Mostly adds RequiresUnreferencedCode, and propagates the results
outward.

Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
3 years agoSupport compiling against OpenSSL 3 headers
Jeremy Barton [Mon, 5 Apr 2021 18:07:29 +0000 (11:07 -0700)]
Support compiling against OpenSSL 3 headers

Building against OpenSSL 3's headers fails to compile, as X509_V_ERR_INVALID_CA has changed from 24 to 79, tripping a static assert.

* Rename the managed X509VerifyStatusCode enum to X509VerifyStatusCodeUniversal, to represent the name/values that are present in all current versions of OpenSSL (1.0.2, 1.1.1, 3.0 alpha)
* Add new enums for the name/value pairs that are unique to a given version
* Add an X509VerifyStatusCode struct that just wraps the int and is a faux-union of the various enums
* Use the OpenSSL runtime version to determine which mapping table to use (after the Universal table fails)

In addition to that, there are a few const-related changes in the 3.0 headers that are addressed.

`runtime/src/libraries/Native$ ./build_native.sh -portablebuild=false` on systems where find_package(OpenSSL) maps to 3.0 succeeds with these changes.  Portable builds still fail.

Not all tests pass with OpenSSL 3.0 (alpha 13) with these changes, but it does reduce to three categories of error:

* ICryptoTransform reset/reuse tests fail (OpenSSL regression is open)
* DSA small key generation fails (OpenSSL has fixed the regression for the next alpha/beta release)
* Some OuterLoop X.509 tests are failing as positively revoked when they expect ambiguous revocation states (investigation pending)

3 years agoChange Configuration.Json to use a regular Dictionary. (#50611)
Eric Erhardt [Mon, 5 Apr 2021 18:05:24 +0000 (13:05 -0500)]
Change Configuration.Json to use a regular Dictionary. (#50611)

The other Configuration providers use a regular Dictionary.

This allows for SortedDictionary to be trimmed in a default Blazor WASM app, saving roughly 4 KB .br compresse.

3 years agoRemove unused BigNumFromBinary P/Invoke (#50670)
Elinor Fung [Mon, 5 Apr 2021 17:14:53 +0000 (10:14 -0700)]
Remove unused BigNumFromBinary P/Invoke (#50670)

3 years agoMake Ninja the default CMake generator on Windows for the repo (#49715)
Jeremy Koritzinsky [Mon, 5 Apr 2021 16:28:04 +0000 (09:28 -0700)]
Make Ninja the default CMake generator on Windows for the repo (#49715)

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
3 years ago[AppleAppBuilder] Entitlements to run tests on catalyst using the JIT (#50637)
Aleksey Kliger (λgeek) [Mon, 5 Apr 2021 15:22:12 +0000 (11:22 -0400)]
[AppleAppBuilder] Entitlements to run tests on catalyst using the JIT (#50637)

* [catalyst] Add jit entitlements to AppleAppBuilder

to use the JIT on MacCatalyst we need the hardened runtime and the JIT
entitlement.  Otherwise mmap() with a MAP_JIT argument fails with EINVAL.

* [catalyst] also add disable library validation entitlement

To load libSystem.Native.dylib from the Resources/ directory in the .app
bundle.  (And possibly to load libicu from homebrew)

* [AppleAppBuilder] cleanup entitlements generation a little

Use a list in the builder instead of hardcoding in the template.

* [mono] update iOS sample to run on Catalyst too

use `make run-catalyst`

* fix typos and address feedback

3 years ago[mono] Fix delegate invokes to dynamic methods in mixed mode. (#50547)
Zoltan Varga [Mon, 5 Apr 2021 13:43:21 +0000 (09:43 -0400)]
[mono] Fix delegate invokes to dynamic methods in mixed mode. (#50547)

In mixed mode, when compiling a call to a delegate invoke, add
an interp entry wrapper for the signature used by the actual method
which is called by the invoke, which might be a dynamic method whose
signature is otherwise not present in the program.

3 years agoUpdate iOS workflow docs to clarify simulator/device os split (#50366)
Ryan Lucia [Mon, 5 Apr 2021 11:55:20 +0000 (07:55 -0400)]
Update iOS workflow docs to clarify simulator/device os split (#50366)

3 years agoUpdate ref assemblies libraries unsupported on mobile (#50616)
Marek Safar [Mon, 5 Apr 2021 07:08:50 +0000 (09:08 +0200)]
Update ref assemblies libraries unsupported on mobile (#50616)

* Update ref assemblies libraries unsupported on mobile

* Add tvOS to known platforms list

3 years agoDisable crossroot_determinism for GCStress runs (#50706)
Aaron Robinson [Mon, 5 Apr 2021 05:33:37 +0000 (22:33 -0700)]
Disable crossroot_determinism for GCStress runs (#50706)

3 years agoClean up string formatting in a variety of places (#50267)
Stephen Toub [Mon, 5 Apr 2021 03:16:23 +0000 (23:16 -0400)]
Clean up string formatting in a variety of places (#50267)

Mostly just replacing string.Format calls with equivalent interpolated string uses.  In some cases, I replaced lots of string creations with a StringBuilder or equivalent.

3 years agoUse GC.AllocateUninitializedArray in MemoryStream.ToArray (#50692)
Bruce Bowyer-Smyth [Mon, 5 Apr 2021 02:19:41 +0000 (12:19 +1000)]
Use GC.AllocateUninitializedArray in MemoryStream.ToArray (#50692)

* Use GC.AllocateUninitializedArray in MemoryStream.ToArray

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix SHL/SHR/SAR PerfScores (#49620)
Pent Ploompuu [Sun, 4 Apr 2021 23:17:27 +0000 (02:17 +0300)]
Fix SHL/SHR/SAR PerfScores (#49620)

* Fix SHL/SHR/SAR PerfScore

* Tune MUL/IMUL latency.

* Sum memory + instruction latency.
Fix some RCR/RCL latencies also.

* Fix DIV/IDIV latencies

* Address PR feedback

3 years agoJIT: fixes for mixed PGO/nonPGO compiles (#50633)
Andy Ayers [Sun, 4 Apr 2021 18:18:42 +0000 (11:18 -0700)]
JIT: fixes for mixed PGO/nonPGO compiles (#50633)

Always scale inlinee counts, independent of the pgo status of the
call site and inlinee, even if we have to scale inlinee counts to zero.

Get rid of `setBBWeight` and `modifyBBWeight` as they are attractive
nuisances that lead to bad habits. Use `inherit` and `scale` instead as
new counts should always be based on old.

Account for cases where there are methods in the inline tree with PGO
data but the root method doesn't have PGO, and vice versa.

3 years agoRemove code that references resolved issues (#50698)
Aaron Robinson [Sun, 4 Apr 2021 14:19:27 +0000 (07:19 -0700)]
Remove code that references resolved issues (#50698)

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210403.1 (#50697)
dotnet-maestro[bot] [Sun, 4 Apr 2021 09:25:20 +0000 (09:25 +0000)]
Update dependencies from https://github.com/mono/linker build 20210403.1 (#50697)

[main] Update dependencies from mono/linker

3 years agoObsolete message should contain property name. (#50693)
Aaron Robinson [Sun, 4 Apr 2021 04:11:00 +0000 (21:11 -0700)]
Obsolete message should contain property name. (#50693)

3 years agoFix FreeBSD __NumProc calculation (#50691)
Adeel Mujahid [Sun, 4 Apr 2021 02:48:46 +0000 (05:48 +0300)]
Fix FreeBSD __NumProc calculation (#50691)

3 years ago[main] Update dependencies from dotnet/arcade (#50685)
dotnet-maestro[bot] [Sat, 3 Apr 2021 20:29:12 +0000 (20:29 +0000)]
[main] Update dependencies from dotnet/arcade (#50685)

[main] Update dependencies from dotnet/arcade

 - Revert changes to publish-using-darc.ps1

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

3 years ago[mono] AOT instances of SZGenericArrayEnumerator for primitive types, its needed...
Zoltan Varga [Sat, 3 Apr 2021 11:03:00 +0000 (07:03 -0400)]
[mono] AOT instances of SZGenericArrayEnumerator for primitive types, its needed by the IEnumerable wrappers for arrays. (#50681)

3 years agoReenable tests after recent impacting JIT fix (#50679)
Aaron Robinson [Sat, 3 Apr 2021 10:20:49 +0000 (03:20 -0700)]
Reenable tests after recent impacting JIT fix (#50679)

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210401.3 (#50642)
dotnet-maestro[bot] [Sat, 3 Apr 2021 08:04:52 +0000 (08:04 +0000)]
Update dependencies from https://github.com/mono/linker build 20210401.3 (#50642)

[main] Update dependencies from mono/linker

3 years agoFix some linker annotations in S.CM.TypeConverter (#50593)
Prashanth Govindarajan [Sat, 3 Apr 2021 07:25:21 +0000 (00:25 -0700)]
Fix some linker annotations in S.CM.TypeConverter (#50593)

3 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness (#50553)
dotnet-maestro[bot] [Sat, 3 Apr 2021 07:23:54 +0000 (09:23 +0200)]
[main] Update dependencies from dotnet/arcade dotnet/xharness (#50553)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ricardo Arenas <riarenas@microsoft.com>
3 years agoRemove duplicate WaitHandle tests from src/tests (#50677)
Aaron Robinson [Sat, 3 Apr 2021 06:26:10 +0000 (23:26 -0700)]
Remove duplicate WaitHandle tests from src/tests (#50677)

3 years agoReenable readytorun/coreroot_determinism since referenced issues are closed. (#50676)
Aaron Robinson [Sat, 3 Apr 2021 06:24:02 +0000 (23:24 -0700)]
Reenable readytorun/coreroot_determinism since referenced issues are closed. (#50676)

* Both referenced issues have been closed.

* Other tests that are disable with closed issue.

3 years agoAdd GC committed bytes counter (#50604)
Sung Yoon Whang [Sat, 3 Apr 2021 05:48:55 +0000 (22:48 -0700)]
Add GC committed bytes counter (#50604)

* Add GC committed bytes counter

* Add tests

* fix test

3 years agoUse a smart pointer to prevent Zap memory leak (#50425)
Omair Majid [Sat, 3 Apr 2021 05:26:36 +0000 (01:26 -0400)]
Use a smart pointer to prevent Zap memory leak (#50425)

We allocate a Zap in CreatePDBWorker, but we never deallocate it.
Assuming the object instance is no longer needed, this fixes a memory
leak.

3 years agoAdd a System.Text.Json threat model doc (#50541)
Layomi Akinrinade [Sat, 3 Apr 2021 04:30:24 +0000 (21:30 -0700)]
Add a System.Text.Json threat model doc (#50541)

* Add a System.Text.Json threat model doc

* Address review feedback

3 years agoAnnotate Interop APIs that always throw PNSE as Obsolete (#50666)
Aaron Robinson [Sat, 3 Apr 2021 02:07:19 +0000 (19:07 -0700)]
Annotate Interop APIs that always throw PNSE as Obsolete (#50666)

* Annotate Interop APIs that always throw PNSE as Obsolete

3 years agoEnable limited Apple Silicon GCStress testing (#50117)
Steve MacLean [Sat, 3 Apr 2021 01:06:40 +0000 (21:06 -0400)]
Enable limited Apple Silicon GCStress testing (#50117)

* Enable limited Apple Silicon GCStress testing

* Mark providervalidation GCStressIncompatible

tracing/eventpipe/providervalidation test generates 100k events and takes a very long time
in GCStress. Mark it GCStressIncompatible.

* Mark profiler/transitions GCStressIncompatible for Apple Silicon

* Apple Silion mark VolatileTest_op_* GCStressIncompatible

* Disable more 50381 failures

* Disable Apple Silicon GcStress timeouts

3 years agoAdd a missing fclose in jitutils MethodSet constructor (#50282)
Omair Majid [Sat, 3 Apr 2021 00:49:51 +0000 (20:49 -0400)]
Add a missing fclose in jitutils MethodSet constructor (#50282)

The file methodSetFile is never used outside of the constructor, but the
file is never closed, leaking a resource handle. Lets close it manually.

3 years agoDisable test VerifyInMemoryDirectoryInfo_IsNotEmpty to address issue 50648 (#50660)
Carlos Sanchez [Fri, 2 Apr 2021 23:33:58 +0000 (16:33 -0700)]
Disable test VerifyInMemoryDirectoryInfo_IsNotEmpty to address issue 50648 (#50660)

3 years agoKeep blittable layout class In/Out by default (#50655)
Elinor Fung [Fri, 2 Apr 2021 23:09:37 +0000 (16:09 -0700)]
Keep blittable layout class In/Out by default (#50655)

3 years agoMake Microsoft.NETCore.Platforms pack from CSProj (#50468)
Eric StJohn [Fri, 2 Apr 2021 22:42:55 +0000 (15:42 -0700)]
Make Microsoft.NETCore.Platforms pack from CSProj (#50468)

* Use CSProj for packing Platforms package

* Port GenerateRuntimeGraph task

This ports the GenerateRuntimeGraph task from arcade as of
https://github.com/dotnet/arcade/tree/d005a8ce6bb81129f9c3a4a907e1b7ccbf2504d5

* Refactor GenerateRuntimeGraph into separate files

* Add test for GenerateRuntimeGraph

* Fix up path to runtime.json

* Don't filter inner builds when building Platforms task

* Skip tests RuntimeGraph task tests on some platforms

* Exclude browser from testing instead of wasm

* Another try at suppressing testing on Browser

3 years agoDisable test, to mitigate failures from https://github.com/dotnet/runtime/issues...
Jo Shields [Fri, 2 Apr 2021 22:05:24 +0000 (18:05 -0400)]
Disable test, to mitigate failures from https://github.com/dotnet/runtime/issues/50238 (#50241)

3 years agoAdd back missing gcstress0xf pipeline. (#50618)
Aaron Robinson [Fri, 2 Apr 2021 21:51:49 +0000 (14:51 -0700)]
Add back missing gcstress0xf pipeline. (#50618)

3 years agoAdd PhysicalMemoryLimit capabilities for /proc/meminfo OS's like Linux. (#47783)
Steve Molloy [Fri, 2 Apr 2021 21:51:29 +0000 (14:51 -0700)]
Add PhysicalMemoryLimit capabilities for /proc/meminfo OS's like Linux. (#47783)

* Add PhysicalMemoryLimit capabilities for non-Windows OS's.

* Use GC.GetGCMemoryInfo as primary source for non-windows.

* Don't bother with /proc/meminfo

* Support this down to 3.1

* Don't need to protect against 'browser' platform in 3.1.

3 years agoDisable Test49826 for ilasm round-trip testing (#50649)
Bruce Forstall [Fri, 2 Apr 2021 20:43:43 +0000 (13:43 -0700)]
Disable Test49826 for ilasm round-trip testing (#50649)

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

3 years agoCorrecting proclib function that did not adhere to filemap wrappers (#50643)
monojenkins [Fri, 2 Apr 2021 19:55:42 +0000 (15:55 -0400)]
Correcting proclib function that did not adhere to filemap wrappers (#50643)

During our upgrade of the mono runtime we ran into a situation where `mono_pe_file_map` was being called as part of opening an image now on android. This function did not currently adhere to the filemap wrapper functions so the difference in data types being used by Unity caused crashes.

Co-authored-by: UnityAlex <UnityAlex@users.noreply.github.com>
3 years agoshould be GetThreadNULLOk (otherwise debugger crashes in checked) (#50614)
Vladimir Sadov [Fri, 2 Apr 2021 18:08:03 +0000 (11:08 -0700)]
should be GetThreadNULLOk (otherwise debugger crashes in checked) (#50614)

3 years agoFix setting or getting pointer fields with reflection (#50460)
Aleksey Kliger (λgeek) [Fri, 2 Apr 2021 18:00:28 +0000 (14:00 -0400)]
Fix setting or getting pointer fields with reflection (#50460)

Setting a pointer via reflection incorrectly added an extra layer of
indirection, and getting a pointer via reflection incorrectly
dereferenced the value once.

As a result, setting and then getting only via reflection worked
correctly, but doing either step by directly accessing the field and the
other via reflection was broken.

Also adjusts `FieldInfoTest` to test this, for both static and instance
fields (the set path especially is different for those.)

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

This change is released under the MIT license.

Co-authored-by: Sebastian Paarmann <sebastian@s-paarmann.de>
3 years agoMoving Suppress message to assembly level and adding Scope in order to get right...
Jose Perez Rodriguez [Fri, 2 Apr 2021 16:23:28 +0000 (09:23 -0700)]
Moving Suppress message to assembly level and adding Scope in order to get right suppressing behavior (#50626)

* Moving Suppress message to assembly level and adding Scope in order to get right suppressing behavior

* Fixing indentation

3 years agoUse EVP_PKEY for RSA signing operations
Jeremy Barton [Fri, 2 Apr 2021 16:10:08 +0000 (09:10 -0700)]
Use EVP_PKEY for RSA signing operations

With this change all RSA private key operations (excluding import/export) use the EVP_PKEY APIs.

* RSAPaddingProcessor is no longer used in conjunction with the private keys, on Linux.
* The pal_rsa.c copy of HasPrivateKey has been removed.

3 years agoMore precise descriptor for Mono's Enum/String types (#50640)
Marek Safar [Fri, 2 Apr 2021 16:08:36 +0000 (18:08 +0200)]
More precise descriptor for Mono's Enum/String types (#50640)

3 years ago[iOS/tvOS] Fix TargetOS case-sensitivity in tests (#50582)
Maxim Lipnin [Fri, 2 Apr 2021 15:36:44 +0000 (18:36 +0300)]
[iOS/tvOS] Fix TargetOS case-sensitivity in tests (#50582)

* Fix TargetOS case-sensitivity in tests

* Fix TargetOS in AppleAppBuilder

* Remove the switch

3 years agoAllow exact duplicate input entries when bundling single file (#50476)
Vitek Karas [Fri, 2 Apr 2021 14:02:56 +0000 (07:02 -0700)]
Allow exact duplicate input entries when bundling single file (#50476)

SDK can (and will) produce inputs for bundling which contain exact duplicate entries (same source path and same target relative path). Currently publishing such app as non-single-file works just fine (files are overwritten), but publishing it as single-file fails.

Fixing this in the SDK seems like a rather complex problem - see dotnet/sdk#16576 for more details.

There's no harm in allowing exact duplicates and ignoring them when bundling (only one copy of the file is bundled) as that will be the same behavior as non-single-file publish.

If the duplicates are not exact (different source path) then still reject those. SDK currently allows that, but it's very problematic (effectively random output).

3 years ago[wasm] Fix the handling of float arguments in the icall table generator. (#50627)
Zoltan Varga [Fri, 2 Apr 2021 10:49:29 +0000 (06:49 -0400)]
[wasm] Fix the handling of float arguments in the icall table generator. (#50627)

The runtime icall tables use "single" instead of "float".

3 years agoRemove AssemblyName from SPC descriptor (#50605)
Marek Safar [Fri, 2 Apr 2021 08:46:08 +0000 (10:46 +0200)]
Remove AssemblyName from SPC descriptor (#50605)

It's not needed as the runtime bridge uses MonoAssemblyName

3 years agoRemove unused MonoIOError file (#50610)
Marek Safar [Fri, 2 Apr 2021 08:22:24 +0000 (10:22 +0200)]
Remove unused MonoIOError file (#50610)

3 years agoUse existing HexConvertor method for ascii to hex digit conversion (#50558)
Marek Safar [Fri, 2 Apr 2021 08:11:05 +0000 (10:11 +0200)]
Use existing HexConvertor method for ascii to hex digit conversion (#50558)

3 years agomono_breakpoint_clean_code always returns TRUE. (#50599)
monojenkins [Fri, 2 Apr 2021 07:08:11 +0000 (03:08 -0400)]
mono_breakpoint_clean_code always returns TRUE. (#50599)

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
3 years agoSimplify Comparer_get_Default (#50602)
Egor Bogatov [Fri, 2 Apr 2021 05:10:39 +0000 (08:10 +0300)]
Simplify Comparer_get_Default (#50602)

3 years agoDisable test b426654 for GCStress (#50628)
Bruce Forstall [Fri, 2 Apr 2021 04:54:00 +0000 (21:54 -0700)]
Disable test b426654 for GCStress (#50628)

It has been failing with timeouts on GCStress=3.

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

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)