platform/upstream/dotnet/runtime.git
3 years agoSPMI fixes for missing info. (#48360)
Sergey Andreenko [Wed, 17 Feb 2021 08:10:33 +0000 (00:10 -0800)]
SPMI fixes for missing info. (#48360)

* SPMI hacks/fixes.

* review response.

3 years agoUpdate comment and add test for Marshal.GetDelegateForFunctionPointer (#48362)
Jan Kotas [Wed, 17 Feb 2021 07:38:54 +0000 (23:38 -0800)]
Update comment and add test for Marshal.GetDelegateForFunctionPointer (#48362)

* Update comment and fix test for Marshal.GetDelegateForFunctionPointer argument validation

* Disable test on Mono

3 years agoAdd staging job to build Android using native crypto instead of OpenSSL (#48373)
Elinor Fung [Wed, 17 Feb 2021 06:09:22 +0000 (22:09 -0800)]
Add staging job to build Android using native crypto instead of OpenSSL (#48373)

* Fix x86 build

3 years agoAdd intepretation of MOV ESP, EBX to unwindLazyState (#45906)
Juan Hoyos [Wed, 17 Feb 2021 05:14:54 +0000 (21:14 -0800)]
Add intepretation of MOV ESP, EBX to unwindLazyState (#45906)

3 years agoPriorityQueue: Apply Comparer<T>.Default optimization (#48346)
Eirik Tsarpalis [Wed, 17 Feb 2021 04:37:10 +0000 (04:37 +0000)]
PriorityQueue: Apply Comparer<T>.Default optimization (#48346)

* PriorityQueue: inline Comparer<T>.Default.Compare calls

* address feedback

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

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* address feedback

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

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRename LargeHeapHandle* to PinnedHeapHandle* to reflect what it actually does (#48371)
Andrew Au [Wed, 17 Feb 2021 03:54:42 +0000 (19:54 -0800)]
Rename LargeHeapHandle* to PinnedHeapHandle* to reflect what it actually does (#48371)

3 years agoAdd initial support for Vector64 on Arm64 and Amd64 (#47618)
Fan Yang [Wed, 17 Feb 2021 02:04:30 +0000 (21:04 -0500)]
Add initial support for Vector64 on Arm64 and Amd64 (#47618)

Contributes to #42350

This change:

- Conditionally marks Vector64<T> as a SIMD type. Vector64<T> is treated as a
SIMD type on amd64 and arm64 only when the LLVM backend is in use. Vector128<T>
continues to be supported with both LLVM and mini on amd64, as before; on arm64,
it continues to only be supported with LLVM.

- Checks vector widths for compatibility when bitcasting.

- Slightly cleans up return value handling for SIMD value types--conversion
from an aggregate to an LLVM vector-typed value now happens in one location.

- Removes a 128-bit SIMD assumption in the lowering code for OP_SETRET.

- Renames `emit_vector128` to `emit_sri_vector` and makes it width-agnostic.

- Improves the generated IR for non-broadcasting Vector64/Vector128.Create; the
resulting code works entirely in registers and does not depend on temporary
stack storage for writing values into individual vector lanes.

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
3 years agoFix using .NET COM server with `dynamic` keyword (#48037)
Elinor Fung [Wed, 17 Feb 2021 00:32:42 +0000 (16:32 -0800)]
Fix using .NET COM server with `dynamic` keyword  (#48037)

3 years agoUpdate incremental servicing condition for pkgs (#48330)
Viktor Hofer [Wed, 17 Feb 2021 00:09:40 +0000 (01:09 +0100)]
Update incremental servicing condition for pkgs (#48330)

* Update incremental servicing condition for pkgs

3 years agoSwitch over framework packaging to use Crossgen2 (#47349)
Tomáš Rylek [Tue, 16 Feb 2021 23:01:14 +0000 (00:01 +0100)]
Switch over framework packaging to use Crossgen2 (#47349)

3 years agoFix build errors with Android crypto native (#48359)
Elinor Fung [Tue, 16 Feb 2021 20:40:48 +0000 (12:40 -0800)]
Fix build errors with Android crypto native (#48359)

3 years agoRemove net5 feeds (#41620)
Viktor Hofer [Tue, 16 Feb 2021 18:53:40 +0000 (19:53 +0100)]
Remove net5 feeds (#41620)

https://github.com/dotnet/runtime/issues/41593

3 years agoSet *ppIndirection to NULL in MethodContext::repGetAddrOfCaptureThreadGlobal() if...
Egor Chesakov [Tue, 16 Feb 2021 18:44:56 +0000 (10:44 -0800)]
Set *ppIndirection to NULL in MethodContext::repGetAddrOfCaptureThreadGlobal() if there is corresponding GetAddrOfCaptureThreadGlobal LWM (#48260)

3 years agoRyuJIT: Fix logic to test bits in a constant vector (Vector256) (#47385)
Egor Bogatov [Tue, 16 Feb 2021 18:35:22 +0000 (21:35 +0300)]
RyuJIT: Fix logic to test bits in a constant vector (Vector256) (#47385)

Co-authored-by: Sergey Andreenko <seandree@microsoft.com>
3 years agoFix undisposed enumerators (#48322)
Newell Clark [Tue, 16 Feb 2021 18:33:44 +0000 (13:33 -0500)]
Fix undisposed enumerators (#48322)

-Fix converters not disposing enumerators (issue #46349)
-Add tests

3 years agoRemove some duplicated installer.tasks tasks (#48339)
Viktor Hofer [Tue, 16 Feb 2021 17:45:55 +0000 (18:45 +0100)]
Remove some duplicated installer.tasks tasks (#48339)

* Remove some duplicated installer.tasks tasks

in favor of Arcade's implementation.

3 years agoDon't assume result is non-NULL if its type is not TYPE_VOID when tracing. (#48335)
monojenkins [Tue, 16 Feb 2021 17:10:42 +0000 (12:10 -0500)]
Don't assume result is non-NULL if its type is not TYPE_VOID when tracing. (#48335)

On a CEE_MONO_ICALL set to **mono_threads_detach_coop** (from native to managed), the profile code is always emitted without a return value, since it's not at a ret. This means it's never set, even if there actually is a return type (other than TYPE_VOID). When tracing, it's assumed that valid result types other than TYPE_VOID can be dereferenced, even though in this case no result has been set. This causes a null dereference fault.

Co-authored-by: g-insn <g-insn@users.noreply.github.com>
3 years agofix task doc typo (#48332)
Eirik Tsarpalis [Tue, 16 Feb 2021 16:38:03 +0000 (16:38 +0000)]
fix task doc typo (#48332)

3 years ago[mono] Bump emscripten to 2.0.12 (#48334)
Kenneth Pouncey [Tue, 16 Feb 2021 16:13:44 +0000 (17:13 +0100)]
[mono] Bump emscripten to 2.0.12 (#48334)

3 years agoThrow instead of returning null in XNodeReader.GetAttribute(int) (#44589)
Lennart Brüggemann [Tue, 16 Feb 2021 15:43:38 +0000 (16:43 +0100)]
Throw instead of returning null in XNodeReader.GetAttribute(int) (#44589)

* Throw exception on non-interactive mode and invalid index instead of returning null

* Adapt unit tests to exceptions

* Move tests from XCMLReaderAttrTest to XNodeReaderAttributeTests.

Remove these test cases from FunctionTests' children

* Migrate attribute tests toward XUnit

* Remove migrated tests and distinguish between int and string indexer

* Throw ArgumentOutOfRangeException when index is above upper bound and update tests

3 years agoMultiple s390x fixes (#48329)
Neale Ferguson [Tue, 16 Feb 2021 15:12:12 +0000 (01:12 +1000)]
Multiple s390x fixes (#48329)

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210216.1 (#48327)
dotnet-maestro[bot] [Tue, 16 Feb 2021 12:40:50 +0000 (12:40 +0000)]
Update dependencies from https://github.com/mono/linker build 20210216.1 (#48327)

[master] Update dependencies from mono/linker

3 years agoFix IndexOutOfRangeException in PriorityQueue.EnqueueDequeue (#48323)
Stephen Toub [Tue, 16 Feb 2021 11:51:30 +0000 (06:51 -0500)]
Fix IndexOutOfRangeException in PriorityQueue.EnqueueDequeue (#48323)

3 years agoAvoid nulling out in PriorityQueue.Remove if it's not needed (#48324)
Stephen Toub [Tue, 16 Feb 2021 11:48:03 +0000 (06:48 -0500)]
Avoid nulling out in PriorityQueue.Remove if it's not needed (#48324)

3 years agoUse live dependencies for netcoreapp3.0 depencies (#48176)
Viktor Hofer [Tue, 16 Feb 2021 11:24:23 +0000 (12:24 +0100)]
Use live dependencies for netcoreapp3.0 depencies (#48176)

* Use live dependencies for netcoreapp3.0 deps

3 years agoAssemblyLoadContext.CurrentContextualReflectionContext and instantiating AssemblyBuil...
Nikitin A. Kirill [Tue, 16 Feb 2021 10:41:16 +0000 (14:41 +0400)]
AssemblyLoadContext.CurrentContextualReflectionContext and instantiating AssemblyBuilder (#48072)

Added the ability to use AssemblyLoadContext.CurrentContextualReflectionContext when instantiating AssemblyBuilder

3 years ago[mono] Adjust wasm gitignore (#48325)
Kenneth Pouncey [Tue, 16 Feb 2021 08:34:13 +0000 (09:34 +0100)]
[mono] Adjust wasm gitignore (#48325)

- move the responsibility of ignoring wasm files to the mono/wasm .gitignore

3 years agoTrim assembly level attributes which are not useful and can contain (#48301)
Marek Safar [Tue, 16 Feb 2021 07:29:37 +0000 (08:29 +0100)]
Trim assembly level attributes which are not useful and can contain (#48301)

very long string value

3 years agoUpdate runparallel.sh for Apple Silicon bringup (#46935)
Steve MacLean [Tue, 16 Feb 2021 04:23:07 +0000 (23:23 -0500)]
Update runparallel.sh for Apple Silicon bringup (#46935)

Use syntax available on OSX

Stabilize counting

Simplify termination logic

Simplify polling intermediate results

3 years agoJIT: allow inlinee profile scale-up (#48280)
Andy Ayers [Tue, 16 Feb 2021 03:58:01 +0000 (19:58 -0800)]
JIT: allow inlinee profile scale-up (#48280)

We can't always be sure that callee entry counts will be greater than or equal
to call site counts. For example a callee could be tiered up before a caller,
and so have relatively smaller counts.

So, when computing inline scale, allow callee counts to be scaled up as well as
scaled down.

3 years agoRemove some code duplication in System.Net.Http.Headers (#48297)
Marek Safar [Tue, 16 Feb 2021 02:48:40 +0000 (03:48 +0100)]
Remove some code duplication in System.Net.Http.Headers (#48297)

* Remove some code duplication in System.Net.Http.Headers

* Update src/libraries/System.Net.Http/tests/UnitTests/Headers/NameValueHeaderValueTest.cs

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoAdd missing XML comments on PriorityQueue public API (#48316)
Stephen Toub [Tue, 16 Feb 2021 02:03:30 +0000 (21:03 -0500)]
Add missing XML comments on PriorityQueue public API (#48316)

3 years agoAvoid QueueUserWorkItem allocation in rare Channel race condition (#48313)
Stephen Toub [Tue, 16 Feb 2021 02:02:55 +0000 (21:02 -0500)]
Avoid QueueUserWorkItem allocation in rare Channel race condition (#48313)

3 years agoFix typo endinanness -> endianness (#48319)
Björn Harrtell [Tue, 16 Feb 2021 01:06:38 +0000 (02:06 +0100)]
Fix typo endinanness -> endianness (#48319)

3 years agoSimplify PriorityQueue enumerator, and fix tuple element names (#48315)
Stephen Toub [Tue, 16 Feb 2021 00:52:32 +0000 (19:52 -0500)]
Simplify PriorityQueue enumerator, and fix tuple element names (#48315)

- Rewritten to match `List<T>.Enumerator` line for line
- Tuples, according to our guidelines, use PascalCased element names

3 years agoExpand Virtual Call targets earlier in Morph and allow CSE of the indirections (...
Brian Sullivan [Tue, 16 Feb 2021 00:27:18 +0000 (16:27 -0800)]
Expand Virtual Call targets earlier in Morph and allow CSE of the indirections (#47808)

* Added GTF_CALL_M_EXPANDED_EARLY to flag virtual calls that should be expanded early during fgMorph
Added COMPlus_JitExpandCallsEarly variable to enable virtual calls to be expanded early on a per method basis
Set opts.compExpandCallsEarly to true when we are optimizing and have COMPlus_JitExpandCallsEarly enabled
Update gtSetEvalOrder to also include the call->gtControlExpr
Update morph to call fgExpandVirtualVtableCallTarget when we are expanding early
Update lower to not call LowerVirtualVtableCall when we have already expanded it early
Modify CheckTreeId to print the duplicated gtTreeID before it asserts.

All tests are passing when using COMPLUS_JitExpandCallsEarly=*

Expand the Virtual Call target after we morph the args
Fix an inadvertent change in the GT_CALL weights

* Changed the default for Virtual calls to be expanded early in Morph
Use COMPlus_JitExpandCallsEarly=0 to disable and use old behavior

* Code Review feedback
Added comment stating the the isRelative code path is never executed

* Fixes for propagating gtControlExpr->gtFlags

* Fix a few code size regressions when we perform a tail call

* Tailcall lower fix

* Code Review changes

* Fixes for the TAILCALL_HELPER path for x86

* Address the Arm/Linux failure

3 years agoAllow the icu native code to be linked out when invariant globalization is enabled...
Zoltan Varga [Tue, 16 Feb 2021 00:25:56 +0000 (19:25 -0500)]
Allow the icu native code to be linked out when invariant globalization is enabled. (#48120)

* Disable the dynamic loading of icu functions on WASM.

* Preserve GetICUVersion using a DynamicDependency attribute so its only preserved for the tests which need it.

* Add GetICUVersion to .LibraryBuild.xml so its retained during the class libs build.

* Set InvariantGlobalization based on WasmInvariantGlobalization.

* Fix the framework build.

* Avoid linking in the libicu libraries on wasm in invariant mode.

* Move ICU tests dependency to libraries build descriptor file

* Hook up the shared file in the build

* Fix conditionals.

* Remove WasmInvariantGlobalization msbuild variable.

Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years ago[master] Update dependencies from dotnet/runtime dotnet/xharness (#48303)
dotnet-maestro[bot] [Mon, 15 Feb 2021 21:23:52 +0000 (21:23 +0000)]
[master] Update dependencies from dotnet/runtime dotnet/xharness (#48303)

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

3 years agoAdd PriorityQueue to System.Collections.Generic (#43957) (#46009)
Patryk Golebiowski [Mon, 15 Feb 2021 19:54:37 +0000 (20:54 +0100)]
Add PriorityQueue to System.Collections.Generic (#43957) (#46009)

* Add PriorityQueue to System.Collections.Generic (#43957)

This commit adds a new data structure, priority queue.

Fixes #43957

* (draft step, to squash) Modify API reference

In this commit, I modified the API reference using [these guidelines](https://github.com/dotnet/runtime/blob/4d784693ebc5f91c7eede32170046355ef3969b2/docs/coding-guidelines/updating-ref-source.md), following the advice from @danmosemsft.

The automatically generated code (with `dotnet msbuild /t:GenerateReferenceAssemblySource`) didn't build out of the box and I tweaked it manually.

* (draft step, to squash) Add tests for PriorityQueue

Added generic tests for <int, int> and <string, string>. Removed non-generic tests.

* (draft step, to squash) Add initial implementation

This commit adds the core of the heap implementation for the priority queue.

It doesn't implement the method `EnqueueDequeue`, as I'm not convinced by it. It also doesn't implement the method `CopyTo(Array array, int index)`, leaving this one for later.

* (draft step, to squash) Rename parameters

* (draft step, to squash) Replace `this.nodes` with `_nodes`

* (draft step, to squash) Use an array and handle sizing ourselves

* (draft step, to squash) Create UnorderedItemsCollection lazily

* (draft step, to squash) Deduplicate constructors

* (draft step, to squash) Replace excessive `var` with explicit types

* (draft step, to squash) Remove `this.` in front of methods

* (draft step, to squash) Improve out-of-range-argument exceptions

* (draft step, to squash) Use error messages from .resx

* (draft step, to squash) Use positive case first in try methods

* (draft step, to squash) Implement UnorderedItemsCollection.CopyTo

* (draft step, to squash) Optimize expressions involving Arity

* (draft step, to squash) Adjust implementation to be consistent with reference

* (draft step, to squash) Implement method `EnqueueDequeue`

* (draft step, to squash) Make EnsureCapacity return int

* (draft step, to squash) Simplify lazy initialization of _unorderedItems

* (draft step, to squash) Use `out _` discard for unused properties

* (draft step, to squash) Relax null checks on elements and priorities

* (draft step, to squash) Simplify method SetCapacity

* (draft step, to squash) Remove MethodImplOptions.AggressiveInlining attributed

* (draft step, to squash) Use Array.Empty if the initial capacity is zero

* (draft step, to squash) Simplify UnorderedItemsCollection.Enumerator declaration

* (draft step, to squash) Simplify GetEnumerator methods

* (draft step, to squash) Optimize EnqueueRange methods

* (draft step, to squash) Capitalize members of (TElement, TPriority)[]

* (draft step, to squash) Improve resize constants

* (draft step, to squash) Remove redundant `.this`

* (draft step, to squash) Optimize EnqueueDequeue

* (draft step, to squash) Reduce indentation

* (draft step, to squash) Simplify math expressions

* (draft step, to squash) Remove the PutAt helper method

* (draft step, to squash) Make the UnorderedItemsCollection constructor internal

* (draft step, to squash) Clear last node slot on removal

* (draft step, to squash) Improve next growth capacity computation

* (draft step, to squash) Optimize Enqueue method

* (draft step, to squash) Make UnorderedItemsCollection.CopyTo implemented explicitly on ICollection

* (draft step, to squash) Improve priority queue tests

* (draft step, to squash) Drop redundant casting

* (draft step, to squash) Cosmetic improvements

* (draft step, to squash) Change signature of UnorderedItemsCollection

* (draft step, to squash) Add test PriorityQueue_Generic_EnqueueDequeue_EqualToMin

* (draft step, to squash) Add tests of enqueue null functionality

* (draft step, to squash) Add test PriorityQueue_Generic_EnsureCapacity_Negative

* (draft step, to squash) Check underlying buffer length in tests with reflection

* (draft step, to squash) Check enumeration invalidation

* (draft step, to squash) Simplify code and improve documentation

3 years agoAdd Enumerable.TryGetNonEnumeratedCount (Implements #27183) (#48239)
Eirik Tsarpalis [Mon, 15 Feb 2021 17:15:15 +0000 (17:15 +0000)]
Add Enumerable.TryGetNonEnumeratedCount (Implements #27183) (#48239)

* implement Enumerable.TryGetEnumeratingCount

* address feedback

* update consistency tests

* Replace EnumerableHelpers.TryGetCount with new method

* Rename to method name as approved

* make method is renamed in all projects

3 years ago[browser][build] Synchronize emsdk version with build tools docker version (#48300)
Kenneth Pouncey [Mon, 15 Feb 2021 16:59:09 +0000 (17:59 +0100)]
[browser][build] Synchronize emsdk version with build tools docker version (#48300)

- version specified here:  https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/master/src/ubuntu/18.04/webassembly/Dockerfile#L19

3 years ago[master] Update dependencies from mono/linker (#48298)
dotnet-maestro[bot] [Mon, 15 Feb 2021 16:46:02 +0000 (16:46 +0000)]
[master] Update dependencies from mono/linker (#48298)

[master] Update dependencies from mono/linker

3 years agoFollow-up to Enumerable.Min/Max Comparer<T>.Default optimization (#48289)
Stephen Toub [Mon, 15 Feb 2021 14:06:31 +0000 (09:06 -0500)]
Follow-up to Enumerable.Min/Max Comparer<T>.Default optimization (#48289)

I didn't notice the same pattern was employed in the `Func<TSource, TResult>` overloads, so changing them, too.

3 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20210215.1 (#48299)
dotnet-maestro[bot] [Mon, 15 Feb 2021 13:29:34 +0000 (13:29 +0000)]
Update dependencies from https://github.com/dotnet/xharness build 20210215.1 (#48299)

[master] Update dependencies from dotnet/xharness

3 years agomap Interop.Sys.LockType to distro-specific values (#47994)
Adam Sitnik [Mon, 15 Feb 2021 10:22:00 +0000 (11:22 +0100)]
map Interop.Sys.LockType to distro-specific values (#47994)

* the managed enum Interop.Sys.LockType has no 1:1 mapping with corresponding Unix values

which can be different per distro:
https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/alpha/include/uapi/asm/fcntl.h#L48-L50
https://github.com/freebsd/freebsd-src/blob/fb8c2f743ab695f6004650b58bf96972e2535b20/sys/sys/fcntl.h#L277-L279

fixes #26726

3 years agoFix violation in System.Private.DataContractSerialization (#48274)
Newell Clark [Mon, 15 Feb 2021 03:47:52 +0000 (22:47 -0500)]
Fix violation in System.Private.DataContractSerialization (#48274)

- Prefer 'AsSpan' over 'Substring' when span-based overloads are available.

3 years agoUse 'AsSpan' over 'Substring' in 'System.Private.Xml' (#48277)
Newell Clark [Mon, 15 Feb 2021 03:47:28 +0000 (22:47 -0500)]
Use 'AsSpan' over 'Substring' in 'System.Private.Xml' (#48277)

* Fix violation in System.Private.Xml

- Prefer 'AsSpan' over 'Substring' when span-based overloads are available.

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifier.cs

Apply suggested optimization.

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoUse size_t for hostfxr info count members (#48276)
Adeel Mujahid [Mon, 15 Feb 2021 03:03:57 +0000 (05:03 +0200)]
Use size_t for hostfxr info count members (#48276)

3 years agoUnset FEATURE_EVENTSOURCE_XPLAT in macOS builds (#48244)
Sung Yoon Whang [Mon, 15 Feb 2021 01:58:41 +0000 (17:58 -0800)]
Unset FEATURE_EVENTSOURCE_XPLAT in macOS builds (#48244)

3 years agoSPMI: adjust near differ offset compare logic (#48245)
Andy Ayers [Sun, 14 Feb 2021 17:45:14 +0000 (09:45 -0800)]
SPMI: adjust near differ offset compare logic (#48245)

Add a clause that maps result1 and result2 offsets to a common base and
then compares that result.

This fixes some noisy diffs from instrumented Tier0 compiles, where the
probe addresses can vary from run to run.

3 years agoOptimize Enumerable.Min/Max<T> with Comparer<T>.Default intrinsic (#48273)
Stephen Toub [Sun, 14 Feb 2021 13:45:54 +0000 (08:45 -0500)]
Optimize Enumerable.Min/Max<T> with Comparer<T>.Default intrinsic (#48273)

3 years agoMemorify DeflateManagedStream in System.IO.Compression (#48085)
Newell Clark [Sun, 14 Feb 2021 10:13:42 +0000 (05:13 -0500)]
Memorify DeflateManagedStream in System.IO.Compression (#48085)

3 years agoRemove dead code (#48241)
Dan Moseley [Sun, 14 Feb 2021 03:51:21 +0000 (19:51 -0800)]
Remove dead code (#48241)

* Remove unnecessary dead creds from S.DS.AM

* Remove hardcoded test cred from process

* remove invalid param

* Update src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoskip SslStream_ClientCertificate_SendsChain test if chain is not valid (#48261)
Tomas Weinfurt [Sat, 13 Feb 2021 21:38:58 +0000 (13:38 -0800)]
skip SslStream_ClientCertificate_SendsChain test if chain is not valid (#48261)

* skip SslStream_ClientCertificate_SendsChain test if chain is not valid

* make test conditional

3 years agoUpdate dependencies from https://github.com/dotnet/runtime-assets build 20210212...
dotnet-maestro[bot] [Sat, 13 Feb 2021 17:03:21 +0000 (17:03 +0000)]
Update dependencies from https://github.com/dotnet/runtime-assets build 20210212.1 (#48268)

[master] Update dependencies from dotnet/runtime-assets

3 years agoMove corehost under src/native (#48071)
Adeel Mujahid [Sat, 13 Feb 2021 16:33:56 +0000 (18:33 +0200)]
Move corehost under src/native (#48071)

* Move corehost under src/native

* Move content out of cli/ directory

* Update configurations post-move

* Update docs

3 years ago[mono] Remove the unused attach support. (#48262)
Zoltan Varga [Sat, 13 Feb 2021 14:56:50 +0000 (09:56 -0500)]
[mono] Remove the unused attach support. (#48262)

3 years ago[master] Update dependencies from mono/linker (#48231)
dotnet-maestro[bot] [Sat, 13 Feb 2021 08:35:59 +0000 (08:35 +0000)]
[master] Update dependencies from mono/linker (#48231)

[master] Update dependencies from mono/linker

3 years agoAdd typeforwards for Stack<T> and Queue<T> to mscorlib shim (#48258)
Alexander Köplinger [Sat, 13 Feb 2021 04:32:38 +0000 (05:32 +0100)]
Add typeforwards for Stack<T> and Queue<T> to mscorlib shim (#48258)

Old Xamarin implemented these types in mscorlib so we need to add typeforwarders for them.

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

3 years ago[wasm][bindings] Treat null string as null when converting (#47341)
Larry Ewing [Sat, 13 Feb 2021 02:40:32 +0000 (20:40 -0600)]
[wasm][bindings] Treat null string as null when converting (#47341)

* Treat null string as null objects

3 years agoMono: Remove remoting code. (#48227)
Zoltan Varga [Sat, 13 Feb 2021 01:20:53 +0000 (20:20 -0500)]
Mono: Remove remoting code. (#48227)

* Remove remoting code.

* Remove more unused code.

3 years agoAdd hostfxr_get_dotnet_environment_info API (#48097)
Mateo Torres-Ruiz [Sat, 13 Feb 2021 00:48:48 +0000 (16:48 -0800)]
Add hostfxr_get_dotnet_environment_info API (#48097)

* Add hostfxr_get_dotnet_environment_info

* Change access modifiers in structs

* Remove unnecessary context local

* Use global install location if no dotnet_root is specified

* Add framework tests

* Update framework_info comparison

* Remove commented code

* Remove unnecessary marshaling
Export fn

* Add hostfxr_get_dotnet_environment_info to hostfxr exports

* Fail if result is nullptr
Validate size of structs
Test that result_context isn't modified

* Remove version_as_str
Update tests

* Add tests for invalid args

3 years agoSuperpmi on Microbenchmarks (#47900)
Kunal Pathak [Sat, 13 Feb 2021 00:43:34 +0000 (16:43 -0800)]
Superpmi on Microbenchmarks (#47900)

* Superpmi on Microbenchmarks

* Fix the mch file path name

* distribute the benchmarks in 30 partitions

* Set input directory for benchmarks

* Some fixes to superpmi_benchmarks

Also update the GUID so we don't overwrite the existing collections.

* fix the name of partition_index and partition_count

* Point the core_root path to the superpmi script

* fix python to invoke for setup

* Add verbosity and include all benchmarks

* Fix the benchmarks invocation

* use benchmarks_ci.py script

* run all benchmarks

* fix the performance source code path

* see why dotnet install fails

* Comment all jobs except benchmarks

* update the right fork

* Switch back to doing installing dotnet on azure machine

* Put dotnet in script

* fix dumpMap, revert change in superpmi.py

* Produce artifacts in temp folder

- Disable mcs -strip for now
- Pass the JitName variable

* Experimental: Exit on failure

* Revert "Produce artifacts in temp folder"

This reverts commit afdfbd4b03a684d780ef06f644dba0dcf0621438.

* Use JitName

* Use workitem folder instead of correlation

* fix typo in WorkItemDirectory

* Set the payload directory

* print error message before exiting

* fix some linux issues

* Make dotnet executable

* resolve merge conflicts

* fix typo from merge conflict

* add logging around chmod

* fix the is_windows condition

* cleanup and disable linux arm/arm64

* remove the unwanted parameter

3 years agoRID for Exherbo linux (#47232)
Maxime SORIN [Fri, 12 Feb 2021 23:01:15 +0000 (00:01 +0100)]
RID for Exherbo linux (#47232)

* RID for Exherbo linux

* delete versions

3 years agoSPMI: tolerate null pResolvedToken (#48208)
Andy Ayers [Fri, 12 Feb 2021 20:54:18 +0000 (12:54 -0800)]
SPMI: tolerate null pResolvedToken (#48208)

We can see this from `getTailCallHelpers` for indirect calls.
Fixes a few recording failures when running coreclr tests under spmi.

3 years agoInline platform package version (#48230)
Viktor Hofer [Fri, 12 Feb 2021 20:27:33 +0000 (21:27 +0100)]
Inline platform package version (#48230)

* Inline platform package version

The platform package version doesn't need to be defined centrally anymore.

3 years agoShow state on failed assertion in EmptyAiaResponseIsIgnored
Kevin Jones [Fri, 12 Feb 2021 19:38:55 +0000 (14:38 -0500)]
Show state on failed assertion in EmptyAiaResponseIsIgnored

3 years agoOptimize readonly char[] in System.Text.Encodings.Web (#48181)
Eric Erhardt [Fri, 12 Feb 2021 19:30:09 +0000 (13:30 -0600)]
Optimize readonly char[] in System.Text.Encodings.Web (#48181)

* Optimize readonly char[] in System.Text.Encodings.Web

Also replace some unsafe code with Span.

* Convert to use const strings.

3 years agoAvoid race conditions when building linker tests (#48028)
Viktor Hofer [Fri, 12 Feb 2021 19:16:27 +0000 (20:16 +0100)]
Avoid race conditions when building linker tests (#48028)

* Avoid race conditions when building linker tests

3 years agoRemove some linker warnings from NullableTypeInfo (#48002)
Andy Gocke [Fri, 12 Feb 2021 18:08:29 +0000 (10:08 -0800)]
Remove some linker warnings from NullableTypeInfo (#48002)

Removes all nullable warnings from NullableTypeInfo by using boxing to
retrieve the underlying value from `Nullable<T>` instead of `Value/HasValue`.

3 years ago[master] Update dependencies from mono/linker (#48222)
dotnet-maestro[bot] [Fri, 12 Feb 2021 18:04:37 +0000 (18:04 +0000)]
[master] Update dependencies from mono/linker (#48222)

[master] Update dependencies from mono/linker

3 years ago[RyuJIT] Devirtualize Comparer<T>.Default (#48160)
Egor Bogatov [Fri, 12 Feb 2021 16:56:39 +0000 (19:56 +0300)]
[RyuJIT] Devirtualize Comparer<T>.Default (#48160)

3 years agoInitial Android SSLStream impl (#47690)
Egor Bogatov [Fri, 12 Feb 2021 16:56:02 +0000 (19:56 +0300)]
Initial Android SSLStream impl (#47690)

3 years agoAllow only HTTP requests during X509 chain building
Krzysztof Wicher [Fri, 12 Feb 2021 16:55:01 +0000 (17:55 +0100)]
Allow only HTTP requests during X509 chain building

Specifically, do not follow an HTTP->HTTPS redirect.  Primary HTTPS URLs were already ignored.

3 years agoRefactor ForbidHtmlCharacters to allow for more trimming. (#48172)
Eric Erhardt [Fri, 12 Feb 2021 15:41:36 +0000 (09:41 -0600)]
Refactor ForbidHtmlCharacters to allow for more trimming. (#48172)

Having a static method on an uninstanstiated class is causing the class to be preserved along with its base hierarchy. And any overriden methods to satisfy abstract base methods.

3 years agoOnly use ninja on Windows for Mono cross AOT compiler build (#48218)
Alexander Köplinger [Fri, 12 Feb 2021 15:10:45 +0000 (16:10 +0100)]
Only use ninja on Windows for Mono cross AOT compiler build (#48218)

* Only use ninja on Windows for Mono cross AOT compiler build

Ninja isn't installed on the CentOS Linux Docker image we're using. This got broken by https://github.com/dotnet/runtime/pull/47589.

* Fix Windows leg

3 years ago[Mono] Fix EnumCompareTo for small integers (#48192)
Egor Bogatov [Fri, 12 Feb 2021 15:10:34 +0000 (18:10 +0300)]
[Mono] Fix EnumCompareTo for small integers (#48192)

3 years agoAdd Mono EventPipe Sample Profiler support. (#47858)
Johan Lorensson [Fri, 12 Feb 2021 14:20:46 +0000 (15:20 +0100)]
Add Mono EventPipe Sample Profiler support. (#47858)

Implement support for EventPipe Sample Profiler on Mono inline with CoreClr Sample Profiler behaviour. By default CoreClr sample profiler tries to run at 1000 hertz (every ms) and on each sample it will stop runtime, snap callstacks for all managed threads, submit EventPipe sample profile events and resume runtime. Doing a full stop/restart of the runtime on every sample could be quite invasive, but is probably the most portable way of implementing it working on most platforms.

This PR implements the same logic, but on Mono runtime, stopping the runtime, record all callstacks for all managed threads that should be sampled, restart runtime and then write all sample profile events into EventPipe. Note that events are written after the runtime has resumed since all code executed when runtime is stopped needs to be async safe (needed when running in preemptive mode) so we can't call into EventPipe at that point.

Going forward we should investigate alternative ways to do sample profiling depending on underlying platform and OS support. Currently implementation will work on all supported platforms, but it will not be as accurate as it could be (especially when using safe points and coop enabled runtime) and impacts measured target. Mono's profiler uses Signals/SuspendThread and for platforms supporting these API's, that could be an alternative implementation. It could also be worth to look into CPU hardware counters using ETW kernel log session on Windows and perf_event_open on Linux.

3 years agoRemove duplication with regard to ReadyToRun compiler resolution (#48201)
Tomáš Rylek [Fri, 12 Feb 2021 08:29:33 +0000 (09:29 +0100)]
Remove duplication with regard to ReadyToRun compiler resolution (#48201)

3 years ago[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet...
dotnet-maestro[bot] [Fri, 12 Feb 2021 07:27:42 +0000 (07:27 +0000)]
[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu dotnet/arcade dotnet/xharness (#48054)

[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu dotnet/arcade dotnet/xharness

 - Update arcade tfm package deps to netcoreapp3.1

3 years agoFix failure with `reimportSpillClique=true`. (#48152)
Sergey Andreenko [Fri, 12 Feb 2021 07:16:59 +0000 (23:16 -0800)]
Fix failure with `reimportSpillClique=true`.  (#48152)

* add asserts that we don't create void asg and lclVars.

* Fix the issue.

* Add test repro.

* update the comments.

3 years agoBackport docs for System.Numerics.Vectors (#47725)
Carlos Sanchez [Fri, 12 Feb 2021 05:30:27 +0000 (21:30 -0800)]
Backport docs for System.Numerics.Vectors (#47725)

* Unavoidable refresh by Visual Studio of the csproj file.

* Backport Matrix3x2

* Backport Matrix4x4

* Backport Plane

* Backport Quaternion

* Backport Vector

* Backport Vector2

* Backport Vector3

* Backport Vector4

* Manually fix Plane &lt; and &gt;

* Manually fix Vector wrong param names

* Manually fix Vector2 &lt; and &gt;

* Manually fix Vector3 &lt; and &gt;

* Manually fix Vector4 &lt; and &gt;

* Add GenerateDocumentationFile to csproj

* Revert csproj GenerateDocumentationFile change

* Revert file fully

* Fix typo "Multiples" => "Multiplies"

* Use <typeparamref name="T" /> instead of <c>T</c>

* Matrix3x2 adjust remarks.

* Quaternion address remarks.

* Plane adjust remarks.

* Vector4 adjust remarks.

* Matrix4x4 adjust remarks.

* Vector2 adjust remarks.

* Vector3 adjust remarks.

* Address tannergooding and gewarren suggestions.

* Matrix4x4 tries to invert.

* Bring back GenerateDocumentationFile in csproj

* Revert sln change

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
3 years agoflush CachedDirectoryStoreProvider on X509Store changes (#48149)
Tomas Weinfurt [Fri, 12 Feb 2021 04:38:30 +0000 (20:38 -0800)]
flush CachedDirectoryStoreProvider on X509Store changes (#48149)

* flush CachedDirectoryStoreProvider on X509Store changes

* reset _forceRefresh

3 years agoRevert "Support marshalling of null SafeHandle. (#47944)" (#48193)
Aaron Robinson [Fri, 12 Feb 2021 04:02:06 +0000 (20:02 -0800)]
Revert "Support marshalling of null SafeHandle. (#47944)" (#48193)

This reverts commit c3ae456615040b1e826a7d817de47b1dd214c3fd.

3 years agoTurn off PGO builds until I can get a proper fix in (#48170)
Andy Gocke [Fri, 12 Feb 2021 00:44:00 +0000 (16:44 -0800)]
Turn off PGO builds until I can get a proper fix in (#48170)

3 years agoAdd Activity Trace Id Custom Generation Support (#48138)
Tarek Mahmoud Sayed [Fri, 12 Feb 2021 00:17:00 +0000 (16:17 -0800)]
Add Activity Trace Id Custom Generation Support (#48138)

* Add Activity Trace Id Custom Generation Support

* Address the feedback

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoplatform version (#48175)
Anirudh Agnihotry [Thu, 11 Feb 2021 22:21:52 +0000 (14:21 -0800)]
platform version (#48175)

3 years agoRemove helix xunit reporter from test runs (#48132)
Santiago Fernandez Madero [Thu, 11 Feb 2021 22:21:23 +0000 (14:21 -0800)]
Remove helix xunit reporter from test runs (#48132)

3 years agoSmall pgo cleanup (#48145)
Andy Ayers [Thu, 11 Feb 2021 20:01:27 +0000 (12:01 -0800)]
Small pgo cleanup (#48145)

On the runtime side, intitialize the schema field so that the jit does not
internally think all optimized builds have pgo data with mismatched IL.

Quiet down some of the jit dumping when doing edge instrumentation.

Remove a few unused COMPlus vars from the jit.

3 years agoRefactored INTRINS_OVR to include type infomration, and use it to generate add_intrin...
Nathan Ricci [Thu, 11 Feb 2021 18:20:32 +0000 (13:20 -0500)]
Refactored INTRINS_OVR to include type infomration, and use it to generate add_intrinsic (#47731)

Co-authored-by: Nathan Ricci <naricc@xam-emag-01.redmond.corp.microsoft.com>
3 years agoUpdate dependencies from https://github.com/mono/linker build 20210211.1 (#48164)
dotnet-maestro[bot] [Thu, 11 Feb 2021 18:18:21 +0000 (18:18 +0000)]
Update dependencies from https://github.com/mono/linker build 20210211.1 (#48164)

[master] Update dependencies from mono/linker

3 years agoReduce the number of C literal strings emitted for icalls etc. a bit. (#48150)
Zoltan Varga [Thu, 11 Feb 2021 17:11:37 +0000 (12:11 -0500)]
Reduce the number of C literal strings emitted for icalls etc. a bit. (#48150)

3 years agoRemove the parsing of .config files from get_runtimes_from_exe (). (#48147)
Zoltan Varga [Thu, 11 Feb 2021 16:00:43 +0000 (11:00 -0500)]
Remove the parsing of .config files from get_runtimes_from_exe (). (#48147)

3 years agoXCode.cs: Statically link libraries when forcing AOT (#48156)
Alexander Köplinger [Thu, 11 Feb 2021 14:35:36 +0000 (15:35 +0100)]
XCode.cs: Statically link libraries when forcing AOT (#48156)

The fix in https://github.com/dotnet/runtime/pull/48135 wasn't fully correct since it just fixed the problem for libSystem.Native but not the other libraries.

The real problem is that we're setting `preferDylib` to true via `!isDevice` but still generate the pinvoke mapping to `__Internal` for all files where an `.a` file is found.

The reason why this works in the simulator on non-AOT cases is because we only call the `register_dllmap` function when we're actually forcing AOT on the simulator: https://github.com/dotnet/runtime/blob/42009d1f33b52e40e5471d5c0d3ff4a8d5b2b83a/src/tasks/AppleAppBuilder/Templates/runtime.m#L239-L240

The better fix is to extend the check to always apply when forceAOT is true.

3 years agoDo not use /dev/zero to mmap anonymous memory (#48140)
Vladimir Sadov [Thu, 11 Feb 2021 13:47:35 +0000 (05:47 -0800)]
Do not use /dev/zero to mmap anonymous memory (#48140)

* return void

* Always use MAP_ANON

* remove HAVE_MMAP_DEV_ZERO config

3 years ago[browser][websockets] Support for CloseOutputAsync (#47906)
Kenneth Pouncey [Thu, 11 Feb 2021 11:48:23 +0000 (12:48 +0100)]
[browser][websockets] Support for CloseOutputAsync (#47906)

* Set the WebSocketException to Faulted to fix tests

* Fix the exceptions that are being thrown to coincide with test expectations

* Fix Dispose we are not processing it multiple times.

* Fix Abort code so the messages align correctly with the tests.

example from tests:

```
Assert.Equal() Failure
  info: Expected: Aborted
  info: Actual:   Closed
```

* Set the WebSocketException to Faulted to fix test expectations

* Close the connections correctly.

* Fix Abort test Abort_CloseAndAbort_Success

- This was causing a never ending Task when aborted after a Close already executed.
- Never ended which was a cause of memory errors after left running.
- See also https://github.com/dotnet/runtime/issues/45586

* - Fixes for ReceiveAsyncTest

- Exception text not sent correctly.  This test was expecting 'Aborted'.
- Mismatched expected exception messages
- Make sure the connection is torn down.
- Multiple GC calls that end in running out of memory fixed.  https://github.com/dotnet/runtime/issues/45586

```
//  [FAIL] System.Net.WebSockets.Client.Tests.CancelTest.ReceiveAsync_AfterCancellationDoReceiveAsync_ThrowsWebSocketException(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)
//   info: Assert.Equal() Failure
//   info:                                  ↓ (pos 39)
//   info: Expected: ··· an invalid state ('Aborted') for this operation. Valid state···
//   info: Actual:   ··· an invalid state ('Open') for this operation. Valid states a···
//   info:                                  ↑ (pos 39)

```

* Remove ActiveIssue attributes that should be fixed

* Add back code after merge conflict

- Update tests that are resolved.

* Fix tests that were failing when expecting CloseSent as a valid state.

```
// fail: [FAIL] System.Net.WebSockets.Client.Tests(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)
//   info: Assert.Throws() Failure
//   info: Expected: typeof(System.OperationCanceledException)
//   info: Actual:   typeof(System.Net.WebSockets.WebSocketException): The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseSent'
```

* Fix the Abort and Cancel never ending tests.

- Fix the clean up of the task and set or cancel the task cleanly.

* Add ActiveIssue to websocket client SendRecieve tests

* Add ActiveIssue to websocket client SendRecieve tests

- intermittently failing with System.OperationCanceledException : The operation was canceled.

* Add extra time to timeout for a couple of tests that were intermittently failing with System.OperationCanceledException : The operation was canceled.

- This was an ActiveIssue https://github.com/dotnet/runtime/issues/46909 but extending the time seems to do the job.

* Add ActiveIssue to websocket client SendRecieve tests

- [browser][websocket] Hang with responses without ever signaling "end of message"
- [ActiveIssue("https://github.com/dotnet/runtime/issues/46983", TestPlatforms.Browser)]  // JS Fetch does not support see issue

* Remove `Interlocked` code as per review comment.

* Fix comment

* Fix Abort tests on non chrome browsers.

- Fix for those browsers that do not set Close and send an onClose event in certain instances i.e. firefox and safari.
- Chrome will send an onClose event and we tear down the websocket there.  Other browsers need to be handled differently.

* We should not throw here.

- Closing an already-closed ClientWebSocket should be a no-op.

* Add `CloseOutputAsync` implementation

- The browser websocket implementation does not support this so we fake it the best we can.

* Remove `ActiveIssue` and add more tests

- Remove `[ActiveIssue("https://github.com/dotnet/runtime/issues/45468", TestPlatforms.Browser)]`
- Add more tests

* Address timeout implementation review

* Add code as per SignalR comments to prevent long wait times in some cases

As per comments
- We clear all events on the websocket (including onClose),
- call websocket.close()
- then call the user provided onClose method manually.

* Update src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Address review comments for using `TrySet*` variants

* Address review about using PascalCasing

* Change test to be a platform check and not an ActiveIssue as per review

Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoDo not align cloned loops (#48090)
Kunal Pathak [Thu, 11 Feb 2021 07:43:32 +0000 (23:43 -0800)]
Do not align cloned loops (#48090)

* Do not align cloned loops

3 years ago[wasm] Silence more warnings in the wasm runtime build (#48141)
Larry Ewing [Thu, 11 Feb 2021 07:08:33 +0000 (01:08 -0600)]
[wasm] Silence more warnings in the wasm runtime build (#48141)

3 years ago[mono] Remove verifier (#48142)
Aleksey Kliger (λgeek) [Thu, 11 Feb 2021 05:30:21 +0000 (00:30 -0500)]
[mono] Remove verifier (#48142)

* remove DISABLE_VERIFIER

* Remove metadata-verify and calls to verifier-disabled functions

* Chase down callers of mini_method_verify and remove

3 years agoRe-enable iOS AOT functional test (#48096)
Maxim Lipnin [Thu, 11 Feb 2021 04:00:17 +0000 (07:00 +0300)]
Re-enable iOS AOT functional test (#48096)