Levi Broderick [Fri, 30 Oct 2020 04:30:07 +0000 (21:30 -0700)]
Use BinaryPrimitives where possible (#43474)
Stephen Toub [Thu, 29 Oct 2020 22:10:58 +0000 (18:10 -0400)]
Remove some unnecessary List-related allocation from EventSource (#44026)
David Wrighton [Thu, 29 Oct 2020 21:26:44 +0000 (14:26 -0700)]
Use jitstd::sort instead of qsort in jit and gcinfo (#43923)
Current use of qsort interferes with cross compilation.
The qsort algorithm is quite different between Windows and Linux, thus causing cross compilation comparison failures while testing.
This replaces qsort with the use of jitstd::sort which provides a sort which is consistent between all platforms. (Particularly in Windows where CFG has costs for function pointer usage.) With a homegrown sort performance test, there is about 15-30% performance win with this sort over qsort. (However as these tests do not resemble the behavior of these sorts in the JIT I do not believe they are spectacularly relevant.)
There is a size cost of about 4KB-6KB for the templatized routines. I was unable to measure a performance difference for the JIT itself. (Crossgen is very slightly faster in my testing with the change, but I do not believe the difference is statistically meaningful.)
Jackson Miller [Thu, 29 Oct 2020 21:11:04 +0000 (17:11 -0400)]
remove unnecessary bound check (#42431)
now that all primitive types are supported (thanks to #29000), we can
remove custom bound checks.
Stephen Toub [Thu, 29 Oct 2020 20:25:32 +0000 (16:25 -0400)]
Update coding-style.md
Kevin Jones [Thu, 29 Oct 2020 18:43:57 +0000 (14:43 -0400)]
Support loading public-only PEM X.509 certificates
Create an overload of CreateFromFile that accepts just the PEM-encoded
X.509 certificate that does not contain a private key.
Elinor Fung [Thu, 29 Oct 2020 18:29:51 +0000 (11:29 -0700)]
Fix loading component when application was started with `dotnet` instead of apphost (#43962)
* Don't parse arguments in hostpolicy until necessary
* Explicit error on invalid startup info in hostfxr
* Update tests
Zoltan Varga [Thu, 29 Oct 2020 18:10:40 +0000 (14:10 -0400)]
Disable the 'problematic assembly' code on .net core. (#44022)
Zoltan Varga [Thu, 29 Oct 2020 18:08:44 +0000 (14:08 -0400)]
Fix #44004, disable assertion messages in release mode instead of debug. (#44023)
* Fix #44004, disable assertion messages in release mode instead of debug.
* Remove obsolete 'full_messages' enable-minimal option.
Fan Yang [Thu, 29 Oct 2020 14:12:57 +0000 (10:12 -0400)]
Remove redundant lower function (#44010)
David Pine [Thu, 29 Oct 2020 13:41:41 +0000 (08:41 -0500)]
Update ServiceProviderServiceExtensions.cs (#43974)
Use pattern matching, rather than `as` cast and `null` check.
Zoltan Varga [Thu, 29 Oct 2020 05:20:18 +0000 (01:20 -0400)]
Avoid disabling assert messages in debug configuration on wasm to help debugging. (#44004)
Levi Broderick [Thu, 29 Oct 2020 03:52:39 +0000 (20:52 -0700)]
Clarify string.IndexOf rules in code comments (#43999)
Alexander Köplinger [Thu, 29 Oct 2020 02:21:29 +0000 (03:21 +0100)]
Bump xharness (#43996)
Includes a potential fix for https://github.com/dotnet/runtime/issues/43983
Alexander Köplinger [Thu, 29 Oct 2020 01:29:26 +0000 (02:29 +0100)]
Add back passing of --build-id option to Mono runtime build (#43993)
This got lost as part of CMake cleanup in https://github.com/dotnet/runtime/pull/43678 but it is actually important for some publishing infrastructure: https://github.com/dotnet/arcade/issues/6464
Egor Bogatov [Thu, 29 Oct 2020 01:27:12 +0000 (04:27 +0300)]
[interp] return false for IsLittleEndian on BE (#43946)
To help those who maintain Mono for BE.
Also, it allows interpreter to fold branches since now IsLittleEndian is converted into `LDC.I4.1` always on LE.
Example:
```csharp
static void Validate()
{
if (!BitConverter.IsLittleEndian)
throw new PlatformNotSupportedException();
}
```
Current output for `MONO_VERBOSE_METHOD=Validate` on both LE/BE:
```
IR_0000: ldsfld.u1 0
IR_0003: brtrue.i4.s IR_000b
IR_0005: newobj_fast 3
IR_000a: throw
IR_000b: ret.void
```
New output on LE:
```
IR_0000: ret.void
```
Alexander Köplinger [Wed, 28 Oct 2020 23:38:07 +0000 (00:38 +0100)]
Add static libraries for System.Native back to mobile runtime packs (#43987)
We need it for various scenarios there. It was removed in https://github.com/dotnet/runtime/pull/41966.
Fixes https://github.com/dotnet/runtime/issues/43949
dotnet-maestro[bot] [Wed, 28 Oct 2020 23:34:18 +0000 (00:34 +0100)]
[master] Update dependencies from mono/linker dotnet/arcade dotnet/xharness dotnet/llvm-project dotnet/runtime-assets dotnet/icu (#43822)
* Update dependencies from https://github.com/mono/linker build
20201026.1
Microsoft.NET.ILLink.Tasks
From Version 6.0.0-alpha.1.20525.1 -> To Version 6.0.0-alpha.1.20526.1
* Update dependencies from https://github.com/dotnet/arcade build
20201022.2
Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.ApiCompat
From Version 6.0.0-beta.20520.8 -> To Version 6.0.0-beta.20522.2
* Update dependencies from https://github.com/dotnet/icu build
20201026.1
Microsoft.NETCore.Runtime.ICU.Transport
From Version 6.0.0-alpha.1.20512.1 -> To Version 6.0.0-alpha.1.20526.1
* Update dependencies from https://github.com/mono/linker build
20201026.2
Microsoft.NET.ILLink.Tasks
From Version 6.0.0-alpha.1.20525.1 -> To Version 6.0.0-alpha.1.20526.2
* Update dependencies from https://github.com/mono/linker build
20201027.1
Microsoft.NET.ILLink.Tasks
From Version 6.0.0-alpha.1.20525.1 -> To Version 6.0.0-alpha.1.20527.1
* Update dependencies from https://github.com/dotnet/arcade build
20201025.1
Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.ApiCompat
From Version 6.0.0-beta.20520.8 -> To Version 6.0.0-beta.20525.1
* Update dependencies from https://github.com/dotnet/xharness build
20201027.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.20519.2 -> To Version 1.0.0-prerelease.20527.1
* Update dependencies from https://github.com/dotnet/llvm-project build
20201026.1
runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk
From Version 9.0.1-alpha.1.20523.1 -> To Version 9.0.1-alpha.1.20526.1
* Update dependencies from https://github.com/dotnet/runtime-assets build
20201026.1
System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
From Version 5.0.0-beta.20522.4 -> To Version 5.0.0-beta.20526.1
* Update dependencies from https://github.com/mono/linker build
20201027.2
Microsoft.NET.ILLink.Tasks
From Version 6.0.0-alpha.1.20525.1 -> To Version 6.0.0-alpha.1.20527.2
* Update dependencies from https://github.com/dotnet/arcade build
20201026.10
Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.ApiCompat
From Version 6.0.0-beta.20520.8 -> To Version 6.0.0-beta.20526.10
* Update dependencies from https://github.com/dotnet/runtime-assets build
20201027.1
System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
From Version 5.0.0-beta.20522.4 -> To Version 5.0.0-beta.20527.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Wei Zheng [Wed, 28 Oct 2020 23:31:26 +0000 (07:31 +0800)]
Fix DI DisposeAsync being called twice (#43803)
* Fix DI DisposeAsync being called twice
Koundinya Veluri [Wed, 28 Oct 2020 20:58:03 +0000 (16:58 -0400)]
Enable the portable thread pool by default in coreclr (#43841)
Anirudh Agnihotry [Wed, 28 Oct 2020 18:09:40 +0000 (11:09 -0700)]
Replace net6.0 TargetFramework Equality Conditions with msbuild intrinsic functions (#43857)
* using msbuild intrinsic functions to get tfm identifier and tfv version
* Update src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
* Update build-native.proj
* Update build-native.proj
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Vadim Galaktionov [Wed, 28 Oct 2020 16:22:53 +0000 (19:22 +0300)]
Respect reloadOnChange in UserSecrets in DefaultBuilder (#43807)
* Respect reloadOnChange in UserSecrets in DefaultBuilder
Ryan Lucia [Wed, 28 Oct 2020 15:44:49 +0000 (11:44 -0400)]
[mono] Fix LoadAssemblyRaw to not pin or copy (#43830)
* [mono] Fix LoadAssemblyRaw to not pin or copy
Copying of the assembly and symbols happens later, in `mono_alc_load_raw_bytes`, and the pinning is no longer necessary so long as we have the handle.
* Handle null symbol store
Alexander Köplinger [Wed, 28 Oct 2020 14:10:45 +0000 (15:10 +0100)]
Add interpreter libraries to iOS device runtime pack (#43944)
Fixes https://github.com/dotnet/runtime/issues/43943
Stephen Toub [Wed, 28 Oct 2020 13:36:23 +0000 (09:36 -0400)]
Add initial set of conformance tests for Stream (#43834)
* Fix invalid assert in StreamBuffer
This can be hit by calling code and thus shouldn't be an assert. As an assert it prevents testing.
* Add ConnectedStreams.CreateUnidirectional
* Add initial set of Stream conformance tests
These primarily focus on "connected streams", ones that can be arranged to communicate with each other in a producer/consumer pattern or as a bidirectional communication mechanism, e.g. NetworkStream, PipeStream, SslStream wrapped around a NetworkStream, FileStream created around pipes, etc. Later we can add more tests focused on standalone streams, e.g. FileStream created for an on-disk file, MemoryStream, etc.
* Add ConnectedStreams tests
These are currently helpers used by many other tests. At some point they could become public API as well.
* Fix NetworkStream argument names
Technically a breaking change, but the current divergence from the base Stream class is a bug, and bringing them into sync means argument exceptions that emerge from the derived type make sense when used via the base type, as well as then being able to use shared validation logic across all streams (subsequent to these changes).
* Add stream conformance tests for NetworkStream
* Add stream conformance tests for QuicStream
* Fix several CryptoStream behaviors
1. Flushing a stream that wraps another stream for writing should always flush that underlying stream, even if no additional data was written as part of the flush.
2. Argument validation should validate buffers are not null rather than null ref'ing on a null buffer.
3. Checks for the CryptoStream mode should come after argument validation.
* Add stream conformance tests for CryptoStream
* Fix FileStream argument names
Technically a breaking change, but the current divergence from the base Stream class is a bug, and bringing them into sync means argument exceptions that emerge from the derived type make sense when used via the base type, as well as then being able to use shared validation logic across all streams (subsequent to these changes).
* Fix BufferedStream argument names
Technically a breaking change, but the current divergence from the base Stream class is a bug, and bringing them into sync means argument exceptions that emerge from the derived type make sense when used via the base type, as well as then being able to use shared validation logic across all streams (subsequent to these changes).
* Add stream conformance tests for FileStream
Specifically when used in a connected fashion, wrapped around an anonymous or named pipe.
* Add stream conformance tests for BufferedStream
Specifically when used in a connected fashion, wrapped around some other connected stream.
* Add stream conformance tests for SslStream and NegotiateStream
* Fix PipeStream.Flush to not fail on readable streams
Consumers may expect Stream.Flush to be a nop if the stream is readable only, but PipeStream.Flush is throwing in that case. Stop doing that.
* Add stream conformance tests for PipeStream
* Fix several BrotliStream behaviors
1. When passed a null buffer, it's throwing an exception with the argument name "array", even though the parameter's name is "buffer".
2. Even if there's no data written as part of the Flush{Async} call on a writeable stream, it should be calling flush on the wrapped stream.
* Fix several DeflateStream (and friends) issues
1. DeflateStream.Flush{Async} when writing needs to always flush the underlying stream, even if there's no data written as part of the flush call itself.
2. Several byte[] array arguments should be byte[] buffer. Technically a breaking change, but the current divergence from the base Stream class is a bug, and bringing them into sync means argument exceptions that emerge from the derived type make sense when used via the base type, as well as then being able to use shared validation logic across all streams (subsequent to these changes).
3. DeflateStream.EndRead/Write needs to do additional state validation.
4. Not a bug, but simplify ReadAsync to match the sync Read implementation flow.
* Add stream conformance tests for Deflate/ZLib/GZip/BrotliStream
* Fix PipeReader/WriterStream argument validation
* Add stream conformance tests for PipeReader/WriterStream
* Remove erroneous asserts from Stream.ReadWriteTask
* Address PR feedback
* Fix a few tests in CI
Stephen Toub [Wed, 28 Oct 2020 10:50:00 +0000 (06:50 -0400)]
Change Task.FromResult to use same task cache as async methods (#43894)
* Change Task.FromResult to use same task cache as async methods
Task.FromResult today always creates a new task. This leads developers that are aware of this to then create their own caches for common values, typically 0, true, and false, to avoid task allocations for those common values. But we already have such values cached internally, used for async method return values. We can just use the same cache for Task.FromResult.
* Address PR feedback
Zoltan Varga [Wed, 28 Oct 2020 01:11:23 +0000 (21:11 -0400)]
Disable qcalls on wasm. Treat them as normal pinvokes. (#43798)
* Disable qcalls on wasm. Treat them as normal pinvokes.
This is needed because they are stored in a separate table, so they cannot be linked out the same
way as pinvokes/icalls.
* Update tools-local/tasks/mobile.tasks/WasmAppBuilder/PInvokeTableGenerator.cs
Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Update tools-local/tasks/mobile.tasks/WasmAppBuilder/PInvokeTableGenerator.cs
Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
Brennan [Wed, 28 Oct 2020 00:09:58 +0000 (17:09 -0700)]
Throw when reader is completed with an exception (#43776)
Alexander Köplinger [Wed, 28 Oct 2020 00:00:03 +0000 (01:00 +0100)]
Add link to Discord server to README.md (#43926)
Vladimir Sadov [Tue, 27 Oct 2020 22:56:31 +0000 (15:56 -0700)]
Some refactoring of thread suspension. (#34666)
* m_dwForbidSuspendThread
* Remove some fibers stuff
* g_TrapReturningThreads
* g_pGCSuspendEvent
* m_pThreadAttemptingSuspendForGC
* refactor SuspendRuntime into just one loop
* Suspend iteration after updating hijacks should "observeOnly" - no point to update hijacks again right away.
* avoid retrying to suspend threads that are already in redirected state.
* PR feedback
* "premptive" - common typo apparently
* missing profiler notification on suspend end and `DisableStressHeap` stuff
* indentation and infinite loop style
* Removed GTF_DONT_CSE flag on `g_TrapReturningThreads` load in GCPoll and added comment explaining why.
* reverted an accidentally removed assert
* removed SWITCHOUT_HANDLE_VALUE entirely - not different from INVALID_HANDLE_VALUE now
* some cleanups and more comments when non-GC suspension yields to GC
* Few tweaks for the concerns discussed in the PR
* On Server GC `pCurThread` is NULL.
Need to fix an ASSERT to account for the possibility of NULL.
Tammy Qiu [Tue, 27 Oct 2020 22:55:44 +0000 (18:55 -0400)]
[wasm] Add backward compatibility file to timezone data compilation (#43786)
* Add backward file from iana to handle backward compatibility in tz data
* add tests to check for backwards compatibility
Fan Yang [Tue, 27 Oct 2020 22:41:21 +0000 (18:41 -0400)]
Make runtime tests run with Android (#42683)
* Prototype for runtime tests running with Android
* Conditionally collect app dependencies
* Switch android sample from publish to build
* Switch Android sample from publish to build
* Modify AndroidTestRunner
* Only build and test one test
* Clean up some changes
* Update new run test script path and update AndroidTestRunner to use files under CoreRoot
* Add Helix configuration for Android_x64
* Disable test which replies on coreclr System.Private.CoreLib.dll
* Fixed format and removed irrelevant parameters
* Rmoved unused parameters and fixed comment
* Revert my AndroidAppBuilder related changes to prepare for getting Egor's AndroidAppBuilder change
* Fixed rebase and merge error
* Update AndroidTestRunner
* Use the AndroidAppBuilder in the publish folder
* Update runtime test Android App creation command
* Temporarily disable all jobs except for the Android one
* Fix up job running config
* Fixed AndroidTestRunner
* Get Main function return code after running android app
* Fix for skipping building native tests
* Fix helix project path, due to recent coreclr test related files relocation.
* Fix android app running commands
* Add missing helixType
* Update HelixRuntimeRid
* Fix inconsistency
* Create Android app during build preiod.
* Adjust the way to run tests
* Temporary hack before AndroidAppBuilder could accept multiple assemblies
* Use xharness instead of adb to run tests on Androids and disable cmake for Android.
* Cleanup unnecessary changes
* Include xharness Cli
* Use the right xharness command
* Copy runtime assemblies, since the copy logic got removed from AndroidAppBuilder
* Save Android apps in CORE_ROOT dir and adjust BuildAndroidApp target due to rebase from master
* Minor cleanup
* Enable all runtime tests and disable tests caused build failure
* Copy over test helper assemblies and add failing tests to issues.targets
* Remove redundant comment
* Revert previous commit
* Only sending apk files to helix machine
* Delete OutputDir after finishing building the app
* Copy whole Core_Root dir to helix machine.
* Extend timeout threshold
* Extend timeout threshold for each test and each test collection
* Display Android app running logs when tests fail
* Android tests are required to run in sequential
* Check if log file exists before using it.
* Exclude two out-of-memory tests
* Fixed merge error
* Shorten the timeout threshold
* Enable all the lanes
* Fix indentation
* Fixed a few issues from review feedback
* Update src/tests/run.proj
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
* Only bail out from the bash script when erroring out for andriod
* Extend timeout threshold, since the run could take a long time or a short time on CI.
* Fixed merge error
* Filter out tests using more memory than allowed by helix machine
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Koundinya Veluri [Tue, 27 Oct 2020 22:26:44 +0000 (18:26 -0400)]
Fix test for 32-bit platforms (#43888)
- Fixed an assertion failure. `WorkerCounter` shouldn't be used in the native thread pool implementation when the portable thread pool is enabled (all the counts will be zero), fixed a missed case in `GetAvailableThreads`.
- The native implementation uses a smaller max default worker thread count by default on 32-bit platforms, allowing configured values to go beyond that. Fixed the portable thread pool implementation to do similar, instead of limiting the max including for configured values.
Koundinya Veluri [Tue, 27 Oct 2020 20:32:13 +0000 (16:32 -0400)]
Add info about how named mutexes work on Unix into code from the orginal PR (#43161)
* Add exception case xml comment for ExecutionContext.Restore
* Add some info about how named mutexes work on Unixes into code from the PR
Stephen Toub [Tue, 27 Oct 2020 18:35:56 +0000 (14:35 -0400)]
Remove a volatile access from Task.Id (#43891)
Stephen Toub [Tue, 27 Oct 2020 17:57:01 +0000 (13:57 -0400)]
Reimplement Socket.Begin/EndSend/Receive on Send/ReceiveAsync (#43886)
Jan Vorlicek [Tue, 27 Oct 2020 16:06:42 +0000 (17:06 +0100)]
Fix covariant return type validation for canon parents (#43843)
The return type validation was rejecting cases when the method being
overriden had canon type in its generic arguments.
This change fixes the problem by using parent method type instantiation
for constructing the SigTypeContext in such case.
It also adds a regression test.
Egor Bogatov [Tue, 27 Oct 2020 15:47:07 +0000 (18:47 +0300)]
[RyuJIT] Fold "(X op C1) op C2" to "X op (C1 op C2)" for commutative operators (#43567)
Fold "(X op C1) op C2" to "X op (C1 op C2)"
Egor Bogatov [Tue, 27 Oct 2020 15:31:59 +0000 (18:31 +0300)]
RyuJIT: Fold Popcnt.PopCount with constant argument (#37836)
Intrinsify BitOperations.PopCount for constant input
Eirik Tsarpalis [Tue, 27 Oct 2020 13:19:08 +0000 (13:19 +0000)]
add missing CBOR xmldocs (#43882)
Stephen Toub [Tue, 27 Oct 2020 09:49:30 +0000 (05:49 -0400)]
Rewrite Socket.ConnectAsync for DNS with async/await (#43661)
* Avoid several WildcardBindForConnectIfNecessary allocations on each connect
* Rewrite Socket.ConnectAsync for DNS with async/await
Rips out all of the APM code that was previously used to implement this and replaces it with {Value}Task-based async/await implementations.
Zoltan Varga [Tue, 27 Oct 2020 04:55:55 +0000 (00:55 -0400)]
Set TARGET_SIZEOF_VOID_P and SIZEOF_REGISTER correctly when cross compiling. (#43851)
Stephen Toub [Tue, 27 Oct 2020 02:24:54 +0000 (22:24 -0400)]
Add IDictionary_Generic_Tests test for multiple values with hash collisions (#43836)
* Add IDictionary_Generic_Tests test for multiple values with hash collisions
* Update src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Update src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Koundinya Veluri [Tue, 27 Oct 2020 01:52:45 +0000 (21:52 -0400)]
[Portable thread pool] Don't spin-wait on semaphore when hill climbing stops a thread from processing work (#43840)
Egor Bogatov [Tue, 27 Oct 2020 01:14:15 +0000 (04:14 +0300)]
[RyuJIT] Propagate gtFlags in Vector.Create (#43578)
Propagate GTF_CALL if needed in GT_LIST. Use gtNewListNode. Ignore test for Mono
Krzysztof Wicher [Tue, 27 Oct 2020 00:48:14 +0000 (01:48 +0100)]
Improve annotations for XLinq methods taking params object[] (#43717)
* Improve annotations for XLinq classes taking params object[]
* annotate ref
* address Jozkee's feedback
* Fix XStreamingElement ctor to take nullable content
Tomas Weinfurt [Tue, 27 Oct 2020 00:45:18 +0000 (17:45 -0700)]
simplify SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail test (#43625)
* simplify SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail test
* feedback from review
Vladimir Sadov [Mon, 26 Oct 2020 22:52:10 +0000 (15:52 -0700)]
Statically linking coreclr and clrjit in single file host (#43556)
* Statically linking coreclr and clrjit in single file host.
* setting g_hmodCoreCLR on Unix
* System.Globalization.Native.lib must build with coreclr to be linkable with it
* Always use system unwind libs on FREEBSD
* no DllMain when coreclr is statically linked
* Handle cases when coreclr configuration is different from libraries
* Adding and using PAL_GetPalHostModule
Jeremy Koritzinsky [Mon, 26 Oct 2020 22:49:49 +0000 (15:49 -0700)]
Revert "Try re-enabling IBC on macOS. (#39801)" (#43839)
This reverts commit
3a4298cf15379678c4d437a6554a1453706cc3b3.
monojenkins [Mon, 26 Oct 2020 19:55:59 +0000 (15:55 -0400)]
[WIP][interp] Unify execution and valuetype stacks (#43681)
Before this change, an InterpFrame contained 3 regions of data : args + locals, valuetype stack, execution stack. Each entry on the execution stack was a stackval structure. The space for valuetypes, was allocated separately, since they have various sizes. When pushing a valuetype on the stack, we allocated first the space for it on the vtstack and then pushed the address of the region on the execution stack. This change merges the execution stack with the valuetype stack, meaning we push now variable sized data on the execution stack. In order to keep track of the current stack location, whenever we push a type on stack, during transform phase, we also keep track of the offset where this value will reside on stack, as well as the size it occupies. All callsites need to be informed how much they need to pop the stack for the arguments. While called code can access this space normally (the args are special locals belonging to the frame and are accessed directly as such), external code needs a new mechanism to detect each argument for a given frame. This is achieved with the lazily initialized arg_offsets array on an InterpMethod. The method doesn't need to be compiled for this array to be correctly initialized.
Why :
- this simplifies handling of valuetypes, their storage follows the same rules as a normal objref/primitive type
- removes the common use of the vt_sp variable. The compiler no longer needs to reserve it in a register during the switch loop, we no longer need to save it with each call. The sp and ip become now the only variables describing the execution state in a method.
- the flow of the data on the execution stack is well behaved now (with the exception of a few opcodes that update directly based on the stack offset). We were using the vtstack for some magic storage (MINT_VTRESULT for example)
- this makes it such that the stack offset of every value is easily known at compile time, making it possible to completely drop the execution stack approach, and have every opcode have a unique dreg and a list of sregs (which are mapped to a certain stack offset). This will enable more advanced optimizations during compile stage.
Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
Adeel Mujahid [Mon, 26 Oct 2020 19:31:35 +0000 (21:31 +0200)]
Merge PAL's _wcslwr into _wcslwr_s (#43265)
In (non-palsuite) product code, `_wcslwr` is only used within PAL
inside `_wcslwr_unsafe()` method, which is exposed as `_wcslwr_s` for
PAL consumers. PR inlines the usage of `_wcslwr` in `_wcslwr_unsafe`
and fixes up PAL tests.
David Wrighton [Mon, 26 Oct 2020 18:41:25 +0000 (11:41 -0700)]
Setting value of enums didn't properly widen the value when setting (#43779)
Use VerifierCorElementType instead of SignatureCorElementType to specify the element type of the target field
- This will send the runtime down the path which can perform primitive widening
Cory Nelson [Mon, 26 Oct 2020 18:06:10 +0000 (11:06 -0700)]
Add cancellable and AddressFamily-specific name resolution. (#33420)
Add AddressFamily-specific name resolution and cancellation support for Windows. Resolves #939
Steven [Mon, 26 Oct 2020 17:53:39 +0000 (18:53 +0100)]
Fixed bug in ReadOnlyDictionary's IDictionary.this[object] implementation. This method didn't adhere to IDictionary's contract to return null on a missing key. (#36926)
Zoltan Varga [Mon, 26 Oct 2020 17:23:37 +0000 (13:23 -0400)]
Bump emscripten to 2.0.6. (#43800)
* Bump emscripten to 2.0.6.
* Define HAVE_SYS_RANDOM_H on wasm, its not detected correctly.
Eugene Shcherbo [Mon, 26 Oct 2020 16:48:26 +0000 (19:48 +0300)]
Enhance #43238 so that it covers DefineScope method group with the tests to reflect the behavior added in the PR. (#43790)
Shreyas Jejurkar [Mon, 26 Oct 2020 16:41:47 +0000 (22:11 +0530)]
ServiceProcess Controller Refactor (#43797)
1. Simplified if checks.
2. Use expression property syntax.
3. Used using declaration.
4. Inlined out declaration.
5. Removed unwated unsafe modifier.
6. Removed redundant casting.
imhameed [Mon, 26 Oct 2020 16:38:25 +0000 (09:38 -0700)]
CoreCLR runtime tests + Mono LLVM AOT on arm64 Linux (#41751)
This change:
- Adds new options to mono.proj:
- MonoAOTEnableLLVM, which enables (or disables) building a Mono AOT
cross compiler with LLVM;
- MonoAOTLLVMDir, which specifies the path to a copy of LLVM suitable for
building a Mono AOT cross compiler, and is optional; and
- BuildMonoAOTCrossCompilerOnly, which allows building a Mono AOT
cross compiler without building an associated full Mono runtime.
- Changes offsets-tool.py's user interface slightly; '--include-prefix' is
renamed to '--prefix' and may be specified multiple times. While this latter
feature isn't necessary to build a Mono cross compiler today, because we don't
use distribution-supplied cross-compilation headers on CI, it does make it
easier to experiment with the offsets tool using arbitrary header layouts. For
example, Debian's arm64 cross-compilation packages scatter useful header files
across `/usr/lib/gcc-cross/aarch64-linux-gnu` and `/usr/aarch64-linux-gnu`.
- Updates the docker image used for arm64 cross-compilation to a newer revision
that includes libclang (see also
https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/375).
- Adds some tests that currently fail to compile with Mono LLVM AOT to
issues.targets.
- Adds a Linux_arm64 LLVM AOT job to CI. Nothing particularly fancy is done to
build the Mono LLVM AOT cross compiler; it is built as a step in the same job
that also sends Linux_arm64 tests to Helix.
Aleksey Kliger (λgeek) [Mon, 26 Oct 2020 15:42:36 +0000 (11:42 -0400)]
[docs] Add area-System.Reflection-mono area owners (#43825)
Eric StJohn [Mon, 26 Oct 2020 15:02:17 +0000 (08:02 -0700)]
Ensure IBC data is copied to the expected location (#43644)
monojenkins [Mon, 26 Oct 2020 14:54:58 +0000 (10:54 -0400)]
[w32process-win32] Implement System.Diagnostics.Process::MainWindowHandle. (#43724)
L.A.Noire splash screen calls it to check if the game has opened its window, and stays forever visible if this is not implemented.
Co-authored-by: rbernon <rbernon@users.noreply.github.com>
Lakshan Fernando [Mon, 26 Oct 2020 12:49:59 +0000 (05:49 -0700)]
Fix to set the inner exception for ALC event (#43667)
* Fix to set the inner exception for ALC event
Removes the exception handling at
CLRPrivBinderCoreCLR::BindAssemblyByName so that
the inner exceptioncan be set when the default
AssemblyLoadContext.Resolving handler throws
* Fixing the test for alc.default
* Enhanced the tests by customizing the exception type that
will be thrown by the handlers
Anton Firszov [Mon, 26 Oct 2020 12:18:31 +0000 (13:18 +0100)]
Fix RHEL7 socket dispose hang, and extend coverage (#43409)
Fix #42686 by doing a graceful close in case if the abortive connect(AF_UNSPEC) call fails on Linux, and improve couple of related tests:
- Extend RetryHelper with an exception filter
- Connect, Accept, Send, Receive, SendFile cancellation tests: make sure cancellation failures are not masked by RetryHelper (use exception filter)
- Connect, Accept, Send, Receive cancellation tests: also test IPV6 and DualMode sockets
Zoltan Varga [Mon, 26 Oct 2020 00:46:52 +0000 (20:46 -0400)]
Disable JIT counters if the JIT is disabled. (#43808)
dotnet-maestro[bot] [Sun, 25 Oct 2020 22:44:01 +0000 (22:44 +0000)]
[master] Update dependencies from dotnet/arcade Microsoft/vstest dotnet/llvm-project dotnet/runtime-assets mono/linker (#43768)
[master] Update dependencies from dotnet/arcade Microsoft/vstest dotnet/llvm-project dotnet/runtime-assets mono/linker
Jan Kotas [Sun, 25 Oct 2020 18:56:53 +0000 (11:56 -0700)]
Use function pointers for interop (Unix) (#43793)
Alexander Köplinger [Fri, 23 Oct 2020 23:30:16 +0000 (01:30 +0200)]
Update Android instrumentation runner to be closer to upstream (#43775)
The upstream instrumentation runners don't use runOnMainSync() in the onStart() method, update our runner to do the same and add a bit more logging.
Also fixed a small typo in configure.cmake that I happened to notice.
Egor Chesakov [Fri, 23 Oct 2020 22:40:28 +0000 (15:40 -0700)]
Pass -target arm or -target arm64 to superpmi.exe when replaying in superpmi.py (#43784)
* Pass -target (arm|arm64) argument to superpmi.exe when replaying for arm/arm64 in superpmi.py
* Add the -target argument only in altjit in superpmi.py
Ankit Jain [Fri, 23 Oct 2020 19:21:16 +0000 (15:21 -0400)]
[wasm][debugger] Fix check for already loaded assemblies (#43747)
We send assembly loaded events to the proxy based off events from the
debugger engine. And we check that it isn't an assembly that was already
loaded. This check has a bug in computing the assembly name, from the
filename, which caused these events to be sent even for already loaded
assemblies.
Aleksey Kliger (λgeek) [Fri, 23 Oct 2020 18:53:35 +0000 (14:53 -0400)]
[mono] Use lax Roslyn and analyzers settings for samples (#43769)
* [mono] Use lax Roslyn and analyzers settings for samples
The samples are often used for debugging runtime problems by modifying the code
to reproduce issues. The code analyzers and warnings-as-errors add a papercut before a modified
sample can run.
* [mono] Make HelloWorld sample Makefile settings overridable
allow MONO_CONFIG and MONO_ENV_OPTIONS to be set from the outside
Stephen Toub [Fri, 23 Oct 2020 18:50:07 +0000 (14:50 -0400)]
Fix inconsistency of the 'CanRead' property after disposing an HTTP content stream (#43766)
* Fix inconsistency of the 'CanRead' property after disposing an HTTP content stream
* Update src/libraries/System.Net.Http/tests/FunctionalTests/RawConnectionStreamTest.cs
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Co-authored-by: Angelo Breuer <46497296+angelobreuer@users.noreply.github.com>
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Tomas Weinfurt [Fri, 23 Oct 2020 17:01:25 +0000 (10:01 -0700)]
improve link detection for WIFI on macOS (#43737)
* improve link detection for WIFI on macOS
* enable test back
* correct condition
* improve type detection for WIFI
* Update src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
monojenkins [Fri, 23 Oct 2020 16:59:36 +0000 (12:59 -0400)]
[w32socket] Turn WireGuard ENOKEY errno to WASANETUNREACH (#43734)
When the destination IP on the packet doesn't match any WireGuard peer (such as
if the peer is disconnected while the app is running), the sender may get an ENOKEY errno.
This is mentioned in Section 3 "Send/Receive" of
https://www.wireguard.com/papers/wireguard.pdf
Fixes https://github.com/mono/mono/issues/20503
Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
RaymondHuy [Fri, 23 Oct 2020 16:31:56 +0000 (23:31 +0700)]
Fix issue: ConventionsBuilder and open generic export with constructor dependencies (#43003)
* Add new function to scan the open generic's constructors when the type is generic
Co-authored-by: HuyLuong <huy.luong@orientsoftware.com>
Larry Ewing [Fri, 23 Oct 2020 16:02:53 +0000 (11:02 -0500)]
Block the runtime on ready to early bind breakpoints (#43260)
* Block in ready
* Remove hideWebDriver option and always do it
* Rename attach method
monojenkins [Fri, 23 Oct 2020 15:39:20 +0000 (11:39 -0400)]
Mono: Clang bin path not added to PATH for VS2019 builds. (#43505)
Building full AOT using CI scripts won't work when VS2019 IDE is present (not falling back to VS2019 build tools).
This happens due to a typo in setup-vs-msvcbuild-env.bat. Since CI doesn't install VS IDE, but using buildtools (where clan bin
path is added to PATH) problem only shows up on local development environment using VS2019 IDE.
Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
Bekir Ozturk [Fri, 23 Oct 2020 15:38:01 +0000 (17:38 +0200)]
Setting `WebProxy.BypassList` to null throws (#40656)
* Argument validation in WebProxy BypassList setter
* Updated a failing test
* Added tests for new BypassList behavior
* Updated the tests for new BypassList behavior
* Added AllowNull attribute on BypassList property
* Update src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Wei Zheng [Fri, 23 Oct 2020 15:13:15 +0000 (23:13 +0800)]
Fix null reload token for ConfigurationProvider (#43306)
* Fix null reload token for ConfigurationProvider
* Add not null assert
Kevin Wittmer [Fri, 23 Oct 2020 15:10:53 +0000 (11:10 -0400)]
Improve error message thrown by Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser when the root element of a JSON config file is not an object. (#42780)
JSON configuration files must have an object as the root element. Previously, the exception message produced by Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser when a non-object root element was parsed was Error: Unsupported JSON token 'TOKEN_TYPE' was found. This error message was vague and caused confusion. This commit updates the error message to specifically mention that the root element must be an object.
Fix dotnet/extensions#3543.
Nikolay-parhimovich [Fri, 23 Oct 2020 15:01:26 +0000 (18:01 +0300)]
Fix issue #36999 (#43723)
* Created two resources string for exceptions.
Replaced static strings with resource.
* Fixed formatting.
Co-authored-by: Nikolay-parhimovich <>
Vitek Karas [Fri, 23 Oct 2020 14:52:38 +0000 (07:52 -0700)]
Suppress trim analysis warnings inside reflection implementation (#43594)
See the Justification for each of the added suppressions.
Also annotate GetMethodBody as potentially dangerous with trimming.
Trimming can change IL of a method (can remove branches, remove local variables, change some isntructions, ...) - as such accessing the actual body of a method is potentially dangerous.
Marek Safar [Fri, 23 Oct 2020 14:49:27 +0000 (16:49 +0200)]
Add link to Discord server (#43765)
* Add link to Discord server
* Update README.md
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Eric Erhardt [Fri, 23 Oct 2020 14:34:24 +0000 (09:34 -0500)]
Remove Common Extensions HashCodeCombiner (#43454)
* Remove Common Extensions HashCodeCombiner
Fix #33259
* Add unit tests for FilePatternMatch.GetHashCode.
Daniel Marbach [Fri, 23 Oct 2020 13:41:47 +0000 (15:41 +0200)]
Use non-generic TaskCompletionSource where possible in System.Threading.Channels (#40953)
* Use non-generic TaskCompletionSource where possible
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
dotnet-maestro[bot] [Fri, 23 Oct 2020 13:41:13 +0000 (13:41 +0000)]
[master] Update dependencies from mono/linker (#43698)
[master] Update dependencies from mono/linker
Adeel Mujahid [Fri, 23 Oct 2020 13:34:50 +0000 (16:34 +0300)]
Free allocated buffer after UTF8 encode on FreeBSD (#43431)
* Free allocated buffer after UTF8 encode on FreeBSD
* Address PR feedback
Stephen Toub [Fri, 23 Oct 2020 13:10:15 +0000 (09:10 -0400)]
Fix NegotiateStream handling of EOF (#43739)
In my refactoring of NegotiateStream to use async/await, I broke its handling of EOF, with it throwing an exception instead of returning 0. This fixes it to correctly handle EOF.
Zoltan Varga [Fri, 23 Oct 2020 11:53:57 +0000 (07:53 -0400)]
Allow WasmAppBuilder to run after the publish step. Change the (#43742)
wasm sample to use publish.
imhameed [Fri, 23 Oct 2020 10:42:48 +0000 (03:42 -0700)]
[mono] Use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR (#43715)
CLion creates a directory named ".idea" as a sibling to the top-level
CMakeLists.txt that describes the project; with src/mono, git clean -dXf
will delete src/mono/.idea because ".idea/" is an ignored pattern in
.gitignore.
One workaround is to create an out-of-tree CMakeLists.txt that contains
nothing but add_directory(relative/path/to/src/mono), but this changes
the value of CMAKE_SOURCE_DIR to something other than what our CMake
build files expect.
Kevin Gosse [Fri, 23 Oct 2020 09:42:37 +0000 (11:42 +0200)]
Add missing opcodes to k_rgnStackPushes (#42246)
The rewriter defined two extra opcodes, CEE_COUNT and CEE_SWITCH_ARG, but does not define them in the k_rgnStackPushes array. This can cause out-of-bounds reads when computing the value of maxstack.
Zoltan Varga [Fri, 23 Oct 2020 08:37:12 +0000 (04:37 -0400)]
Fix the signature of Interop.Sys.Log () to match the native signature. (#43744)
Signature mismatches cause errors on some platforms like wasm.
Jan Kotas [Fri, 23 Oct 2020 08:33:28 +0000 (01:33 -0700)]
Disable test against https://github.com/dotnet/runtime/issues/43754 (#43755)
Marek Safar [Fri, 23 Oct 2020 07:45:44 +0000 (09:45 +0200)]
Move Thread PNSE check to managed to cut more dependencies (#43730)
Jan Kotas [Fri, 23 Oct 2020 06:42:27 +0000 (23:42 -0700)]
Fixes to allow using OS-provided threadpool (#43726)
Backport from dotnet/runtimelab:NativeAOT
Anton Lapounov [Fri, 23 Oct 2020 06:26:31 +0000 (23:26 -0700)]
Trim quoted file names passed to Crossgen2 (#43746)
hrrrrustic [Fri, 23 Oct 2020 04:27:00 +0000 (00:27 -0400)]
Make DebugDirectoryBuilder.AddCodeViewEntry public (#43267)
Eric Erhardt [Fri, 23 Oct 2020 03:06:04 +0000 (22:06 -0500)]
Increase Hosting tests timeout (#43695)
* Increase Hosting tests timeout
There are some environments (checked CoreCLR, no tiered compilation) where the current timeout is insufficient. Increasing the timeout so the tests don't fail in these environments.
Fix #43389
SUN Guoyun [Fri, 23 Oct 2020 01:15:44 +0000 (09:15 +0800)]
Change list-processed to ps (#42293) (#42297)
Co-authored-by: Sunguoyun <sunguoyun@loongson.cn>
Zoltan Varga [Thu, 22 Oct 2020 23:11:19 +0000 (19:11 -0400)]
[jit] Fix gsharedvt constrained calls to Object.GetType () under netcore. (#43729)
* [jit] Fix gsharedvt constrained calls to Object.GetType () under netcore.
Fixes https://github.com/dotnet/runtime/issues/35674.
* Update src/mono/mono/mini/jit-icalls.c
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Steve Harter [Thu, 22 Oct 2020 21:41:14 +0000 (16:41 -0500)]
Allow dynamic code sample to compile on v3.0-5.0 (#43703)