platform/upstream/dotnet/runtime.git
3 years agoSuppress linker analysis warnings on GetImmutableDictionaryCreateRangeMethod (#42905)
Layomi Akinrinade [Wed, 30 Sep 2020 17:46:24 +0000 (13:46 -0400)]
Suppress linker analysis warnings on GetImmutableDictionaryCreateRangeMethod (#42905)

3 years agoFix xml doc comment for SimpleConsoleFormatterOptions.SingleLine (#42896)
Alexander Köplinger [Wed, 30 Sep 2020 17:07:08 +0000 (19:07 +0200)]
Fix xml doc comment for SimpleConsoleFormatterOptions.SingleLine (#42896)

Setting it to `true` forces the single line, not `false` :)

3 years agoOptimize Type.IsPrimitive (#42891)
Egor Bogatov [Wed, 30 Sep 2020 15:09:46 +0000 (18:09 +0300)]
Optimize Type.IsPrimitive (#42891)

3 years agoFix test framework crossgening (#42874)
Jan Vorlicek [Wed, 30 Sep 2020 14:36:25 +0000 (16:36 +0200)]
Fix test framework crossgening (#42874)

The recent change that replaced direct invocation of crossgen and
crossgen2 for crossgening framework assemblies for coreclr tests by
r2rtest tool usage has ommited the --release and --large-bubble
arguments. These correspond to the former -O and --inputbubble crossgen2
commands and should be present.

This also fixes failures in running tests with the crossgened runtime.
Many tests were failing with the error `Could not execute the method
because either the method itself or the containing type is not fully
instantiated.`

So while there is a problem to investigate related to debug flavor of
crossgening, this PR fixes the options.

3 years agoAdd granular suppressions for linker warnings (#40691)
Layomi Akinrinade [Wed, 30 Sep 2020 14:06:25 +0000 (10:06 -0400)]
Add granular suppressions for linker warnings (#40691)

* Add granular suppressions for linker warnings

* Add suppressions for mono SPC

* Misc additions

* Add suppressions for Debug config

* Fix Android xml file

* Include System.ComponentModel.Annotations suppressions

* Add suppressions for System.Security.Cryptography.X509Certificates on Linux

* Fix TargetOs exists check

* Add IL2077 to System.Security.Cryptography.X509Certificates on Android

* Generalize some System.Security.Cryptography.X509Certificates suppressions to 'NonWindows'

* Remove ref to catch-all System.Security.Cryptography.X509Certificates file

* Misc clean up and some feedback

* Use ILLinkDirectory in CreateRuntimeRootILLinkDescriptorFile.targets

* Update paths for directories

* Set TargetPath as part of include

* Delete bin-placing TODO

* Include more xml files during per-library run

* Include more xml files during per-library run, pt 2

* Include more xml files during per-library run, pt 3

* Try including System.ComponentModel.Annotations based on BuildingNETCoreAppVertical

* Switch to BuildAllConfigurations

* Include xml extension in file paths

* Remove version number from assembly suppression files

* Delete ILLink.Suppressions.xml

* Try removing IL2035 nowarn

* Remove version from Microsoft.VisualBasic.Core assemly name

3 years agoFlow rid in yml jobs (#37652)
Viktor Hofer [Wed, 30 Sep 2020 12:21:53 +0000 (14:21 +0200)]
Flow rid in yml jobs (#37652)

3 years ago[mono] Retarget HelloWorld sample to in-tree runtime pack (it used to use ".dotnet...
Egor Bogatov [Wed, 30 Sep 2020 10:53:40 +0000 (13:53 +0300)]
[mono] Retarget HelloWorld sample to in-tree runtime pack (it used to use ".dotnet-mono" hack) (#42851)

3 years agofix android sample (#42859)
Egor Bogatov [Wed, 30 Sep 2020 09:44:55 +0000 (12:44 +0300)]
fix android sample (#42859)

3 years agomake sure we process PhysicalAddress on Linux (#42878)
Tomas Weinfurt [Wed, 30 Sep 2020 04:55:37 +0000 (21:55 -0700)]
make sure we process PhysicalAddress on Linux (#42878)

3 years agoFix InvalidCastException when deserializing some dictionary types (#42835)
Layomi Akinrinade [Wed, 30 Sep 2020 03:42:36 +0000 (23:42 -0400)]
Fix InvalidCastException when deserializing some dictionary types (#42835)

3 years ago[RyuJIT] Add "rorx" instruction (BMI2) and emit it instead of "rol" when possible...
Egor Bogatov [Tue, 29 Sep 2020 23:35:44 +0000 (02:35 +0300)]
[RyuJIT] Add "rorx" instruction (BMI2) and emit it instead of "rol" when possible (#41772)

* Use rorx instead of rol when possible

3 years agoCheck for null in OptionsFactory (#41047)
Taylor Southwick [Tue, 29 Sep 2020 20:59:26 +0000 (13:59 -0700)]
Check for null in OptionsFactory (#41047)

If an IValidateOptions<TOptions> returns null, then an error occurs that can be difficult to track down. This change checks for null before checking if it failed.

3 years agoAdd additional ALC assertions and test (#42765)
Ryan Lucia [Tue, 29 Sep 2020 20:27:01 +0000 (16:27 -0400)]
Add additional ALC assertions and test (#42765)

3 years agoAdd Wasm testing in Chromium, not just command-line `v8` (#40786)
Jo Shields [Tue, 29 Sep 2020 19:34:39 +0000 (15:34 -0400)]
Add Wasm testing in Chromium, not just command-line `v8` (#40786)

This should give us a better idea of any cases where browser and JS engine behaviour diverge.

* Uses WebSockets to write pipe console messages to the test runner.

* Skip System.Net.Http FunctionalTests depending on X509 certificates, tests discovery fails on `System.Net.Http.Functional.Tests.HttpClientEKUTest..cctor()` which ends up throwing PNSE

* Added environment variable to help platform detect when we're running in the browser vs v8

* System.Net.Http LoopbackServer: fix NullReferenceException because we were trying to dispose a Socket instance that threw PNSE in the constructor

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoFix DefaultContext test on wasm (#42764)
Ryan Lucia [Tue, 29 Sep 2020 19:27:15 +0000 (15:27 -0400)]
Fix DefaultContext test on wasm (#42764)

3 years ago[runtime] sync parameter name in tramp-s390x.c (#42804)
monojenkins [Tue, 29 Sep 2020 18:29:09 +0000 (14:29 -0400)]
[runtime] sync parameter name in tramp-s390x.c (#42804)

s390x uses 'method' as parameter name in mono_arch_get_unbox_trampoline()
in mono/mini/tramp-s390x.c, rename to 'm' to be in sync with other arches.

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

Co-authored-by: sharkcz <sharkcz@users.noreply.github.com>
3 years ago[browser][http] Set HttpResponseMessage.RequestMessage (#42822)
campersau [Tue, 29 Sep 2020 18:00:40 +0000 (20:00 +0200)]
[browser][http] Set HttpResponseMessage.RequestMessage (#42822)

3 years ago[Android] Make AndroidAppBuilder "dotnet build" friendly (#42597)
Egor Bogatov [Tue, 29 Sep 2020 16:00:16 +0000 (19:00 +0300)]
[Android] Make AndroidAppBuilder "dotnet build" friendly (#42597)

3 years agoReplace VerifyWithRevocation test with DynamicRevocationTests
Kevin Jones [Tue, 29 Sep 2020 15:35:03 +0000 (11:35 -0400)]
Replace VerifyWithRevocation test with DynamicRevocationTests

* Test offline revocation checking as a DynamicRevocationTest, shutting down the responder between the cache populate and the offline build.

* Remove flaky VerifyWithRevocation test, as it no longer provides unique value.

3 years agoEnable Unsafe.As NotNullIfNotNull on .NET Std. 2.0 (#42827)
Sergio Pedri [Tue, 29 Sep 2020 14:33:31 +0000 (16:33 +0200)]
Enable Unsafe.As NotNullIfNotNull on .NET Std. 2.0 (#42827)

3 years agoPhysically remove the folder src/coreclr/tests (#42828)
Tomáš Rylek [Tue, 29 Sep 2020 13:57:45 +0000 (15:57 +0200)]
Physically remove the folder src/coreclr/tests (#42828)

This change removes the last few files from src/coreclr/tests
under src/tests and finally depletes the folder. One change of note
is rename of src/coreclr/tests/runtest.py to src/tests/run.py
in accordance with the previous renames.

I have put the runparallel.sh script to src/tests as it seems
to have general usability, I moved the rest of the scripts to
src/tests/Common/scripts. I haven't actually tried to make it
work. I managed to catch one reference from arm32_ci_script /
arm_ci_test.sh to bringup_runtest.sh that I fixed but again
without actually testing them.

I am not too familiar with these scripts, I haven't found
references to them anywhere in the infra, some of them seem
related to the JIT team, adding Bruce to the PR to confirm.
I have no idea whether they are used at all, any insights into
what obsolete scripts we can get rid of is more than welcome.

Thanks

Tomas

3 years agoMake ContentType(string) constructor throw FormatException instead of IndexOutOfRange...
Avani Gupta [Tue, 29 Sep 2020 11:30:55 +0000 (04:30 -0700)]
Make ContentType(string) constructor throw FormatException instead of IndexOutOfRangeException (#39529)

3 years agoFix bad configure tests (#42756)
Jan Vorlicek [Tue, 29 Sep 2020 10:31:44 +0000 (12:31 +0200)]
Fix bad configure tests (#42756)

There was an extra -c in the CMAKE_REQUIRED_FLAGS set for testing
HAVE_UNW_GET_ACCESSORS and HAVE_UNW_GET_SAVE_LOC that was breaking
build of coreclr under homebrew. The option was somehow making
these checks behave on ARM Linux, eveb though it is not clear to
me why, as it was just causing this option to be passed to the
compiler twice at different positions of the command line of
the cmake tests.
This change fixes it by using check_symbol_exists instead of
check_c_source_compiles, since just removing the duplicite -c
was resulting in the check failing on ARM / ARM64 Linux due
to a missing symbol from libunwind during linking.

3 years agoRename references of protononjit to clrjit_ (#42133)
Kunal Pathak [Tue, 29 Sep 2020 06:49:06 +0000 (23:49 -0700)]
Rename references of protononjit to clrjit_ (#42133)

* wip: rename protononjit

* Rename protononjit to clrjit_

* revert changes in run-pmi-diffs.py

* revert superpmi.py changes

* fix variable name

3 years ago[master] Update dependencies from Microsoft/vstest dotnet/runtime-assets dotnet/llvm...
dotnet-maestro[bot] [Tue, 29 Sep 2020 01:23:14 +0000 (01:23 +0000)]
[master] Update dependencies from Microsoft/vstest dotnet/runtime-assets dotnet/llvm-project dotnet/xharness dotnet/icu dotnet/arcade mono/linker (#42619)

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

3 years agoThe test was already working on master. (#42818)
Thays Grazia [Mon, 28 Sep 2020 23:35:28 +0000 (20:35 -0300)]
The test was already working on master. (#42818)

3 years agoAdd a switch to compile dotnet.js as ES6 module (#41964)
Adeel Mujahid [Mon, 28 Sep 2020 20:51:02 +0000 (23:51 +0300)]
Add a switch to compile dotnet.js as ES6 module (#41964)

* Add a switch to compile dotnet.js as ES6 module

With `./build.sh -os Browser /p:WasmEnableES6=True`, we can now compile
`dotnet.js` as an ES6 module, which can be easily be loaded in
environments like Deno. e.g.:

```js
// myApp.js

import jsdom from "https://dev.jspm.io/jsdom";
window.document = new jsdom.JSDOM(null, {url:'http://localhost'}).window.document;

const dotnetModule = await import('./artifacts//bin/native/net5.0-Browser-Debug-wasm/dotnet.js');
// this is needed since we cannot pass scriptDirectory to upstream module (yet: https://github.com/emscripten-core/emscripten/pull/12120)
const bytes = Deno.readFileSync('./artifacts//bin/native/net5.0-Browser-Debug-wasm/dotnet.wasm', 'utf8');
const dotnet = await dotnetModule.default({wasmBinary: bytes}); // currently it calls run() on load

// dotnet.run(); // we can _additionally_ invoke run() on demand
```

Also waiting on Deno PR to merge with utf-16le suppot, workaround is:
```sh
$ ./build.sh -os Browser /p:WasmEnableES6=True
$ sed -i '' 's/utf-16le/utf8/' artifacts/bin/native/net5.0-Browser-Debug-wasm/dotnet.js
```
and then
```sh
$ deno run --allow-read myApp.js
```

* Set default value to False explicitly

* Use lower-case false for check

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoHandle general SuperPMI fatal errors better (#42821)
Bruce Forstall [Mon, 28 Sep 2020 20:39:55 +0000 (13:39 -0700)]
Handle general SuperPMI fatal errors better (#42821)

Before, we weren't printing out an error message for fatal
errors, and the summary message indicated there were no problems.

3 years agoTraceSourceLogger now takes exception into account(adds it to the log… (#42571)
rizi [Mon, 28 Sep 2020 17:54:42 +0000 (19:54 +0200)]
TraceSourceLogger now takes exception into account(adds it to the log… (#42571)

* TraceSourceLogger now takes exception into account(adds it to the log message) even if formatter is not null

* Fixed a logical error, that would have added the exception twice to the log message when the formatter would have been null.

* Added tests for TraceSourceLogger.

* Removed unnecessary white-spaces.

* Make the TraceLogger output more "natural" (one line message)  and similar to SystemdConsoleFormatter.

* Update TraceSourceLoggerTest.cs

* Update TraceSourceLoggerTest.cs

Co-authored-by: Maryam Ariyan <maryam.ariyan@microsoft.com>
3 years agoMake Process.WaitForExitAsync wait for redirected output reads (#42585)
Eirik Tsarpalis [Mon, 28 Sep 2020 16:22:44 +0000 (17:22 +0100)]
Make Process.WaitForExitAsync wait for redirected output reads (#42585)

* Make Process.WaitForExitAsync wait for output reads

Addresses an issue where Process.WaitForExitAsync
doesn't wait for background redirected output reads,
a behaviour which diverges from the sync method
equivalent. Fixes #42556.

* address feedback

* pass cancellation token to AsyncStreamReader waiter

* address feedback

* use tcs.TrySetResult

* Update src/libraries/Common/src/System/Threading/Tasks/TaskTimeoutExtensions.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoAdd CompileDesignTime target to IL.Sdk (#42794)
Viktor Hofer [Mon, 28 Sep 2020 16:15:17 +0000 (18:15 +0200)]
Add CompileDesignTime target to IL.Sdk (#42794)

Visual Studio requires the CompileDesignTime target to be present as it is called by the language service. This fixed building ilproj projects inside Visual Studio.

3 years ago[docs] Clarify that mixed configuration doesn't work in wasm (#42682)
Aleksey Kliger (λgeek) [Mon, 28 Sep 2020 16:13:13 +0000 (12:13 -0400)]
[docs] Clarify that mixed configuration doesn't work in wasm (#42682)

3 years agoSupport ECDiffieHellman on X509Certificate2
Kevin Jones [Mon, 28 Sep 2020 15:48:39 +0000 (11:48 -0400)]
Support ECDiffieHellman on X509Certificate2

* Adds support for getting ECDH public/private key objects from an X509Certificate2.
* Makes it easier to build PublicKey objects, and makes them more useful.

3 years ago[interp] Throw an InvalidProgramException instead of asserting when trying to transfo...
monojenkins [Mon, 28 Sep 2020 08:44:05 +0000 (04:44 -0400)]
[interp] Throw an InvalidProgramException instead of asserting when trying to transform a method with too many locals. (#42797)

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

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoGet builds working when paths contain whitespaces and utf8 chars (#42671)
Manish Godse [Mon, 28 Sep 2020 04:22:59 +0000 (21:22 -0700)]
Get builds working when paths contain whitespaces and utf8 chars (#42671)

* Fix to get builds working for paths with whitespaces

Currently builds clr+libs when space exists in repo folder. non-ascii should also be supported.
Validated only of windows
mono is still failing.

* fix midl to not emit full path in generated headers

* avoid full filenames in python source generator

* Fix ilasm target to support folders with spaces.

* update targets for ILDASM

3 years agoUse CryptographicallySecureRandomBytes for Guid generation (#42770)
Jan Kotas [Mon, 28 Sep 2020 01:52:38 +0000 (18:52 -0700)]
Use CryptographicallySecureRandomBytes for Guid generation (#42770)

Fixes #42752

3 years agoMove most of src/coreclr/tests under src/tests and related cleanups (#42386)
Tomáš Rylek [Sun, 27 Sep 2020 22:37:45 +0000 (00:37 +0200)]
Move most of src/coreclr/tests under src/tests and related cleanups (#42386)

* Move stress_dependencies, external and scripts under src/tests/Common;
* Fix build scripts to download nuget packages under artifacts, not into the source tree;
* Replace src/tests/Directory.Build.props with src/coreclr/tests/Directory.Build.props;
* Inject src/coreclr/tests/Directory.Build.targets into src/tests/Directory.Build.targets.

Thanks

Tomas

3 years agoSupport deserialization for Struct properties that implements IList<T> (#41223)
RaymondHuy [Sun, 27 Sep 2020 22:16:58 +0000 (05:16 +0700)]
Support deserialization for Struct properties that implements IList<T> (#41223)

* Support deserialization for Struct properties that implements IList<T>

Add a new field into IListOfTConverter class to store the values to prevent unboxing when the TCollection is ValueType.

* Support deserialization for struct that implements IList<T>, ICollection<T>, IList

Use constraint type instead of TCollection to avoid unboxing when TCollection is ValueType.

* Add testcase Support deserialization for Struct that implements ISet<T>, IDictionary<TKey, TValue>, IDictionary

Use constraint type to cast to avoid unboxing when the target type is ValueType

* Add testcase for reading nullable struct and null json.
Modify the 'Add' method to use actual type casting.

* Add test cases for struct collection:
- Serializing a default instance.
- Deserializing a null json string.

Co-authored-by: HuyLuong <huy.luong@orientsoftware.com>
3 years agoDelete dead C/C++ code files (#42782)
Adeel Mujahid [Sun, 27 Sep 2020 16:44:50 +0000 (19:44 +0300)]
Delete dead C/C++ code files (#42782)

Cleaned up some dead files, most of which are either not referenced
anywhere or referencing each other but not part of the overall build
plan.

The search heuristic used is not leveraging build system, but instead
lookup with multiple passes followed by manually excluding the files
which are either part of third-party libraries (libunwind, rapidjson),
a few shims cross-referencing libraries and coreclr or files that are
included in CMakeLists via globbing patterns:

* `src/coreclr/src/pal/prebuilt/idl/*.cpp`
* `src/coreclr/src/unwinder/{ARCH}/unwinder_{ARCH}.cpp`

3 years agoRemove dead DnsEndPoint allocation in HttpConnectionPool (#42778)
Stephen Toub [Sun, 27 Sep 2020 12:35:47 +0000 (08:35 -0400)]
Remove dead DnsEndPoint allocation in HttpConnectionPool (#42778)

3 years agoRemove unnecessary byte[] allocation from CertificateRequest.CreateSelfSigned (#42776)
Stephen Toub [Sun, 27 Sep 2020 12:35:24 +0000 (08:35 -0400)]
Remove unnecessary byte[] allocation from CertificateRequest.CreateSelfSigned (#42776)

3 years agoRemove p/invoke to RtlMoveMemory, cleanup caller (#42749)
Levi Broderick [Sun, 27 Sep 2020 00:31:28 +0000 (17:31 -0700)]
Remove p/invoke to RtlMoveMemory, cleanup caller (#42749)

3 years agosuperpmi.py script improvements (#42773)
Bruce Forstall [Sat, 26 Sep 2020 20:10:39 +0000 (13:10 -0700)]
superpmi.py script improvements (#42773)

1. Make the script pylint and pycodestyle clean (with exclusions).
Add pylint/pycodestyle configuration files.

2. Simplify and remove duplication in asm diffs code for generating
asm and JIT dump files.

3. Add cases to automatically upload and download associated .MCT files
if one or more specific .MCH files are specified.

4. Fix a few bugs related to using VS Code to view diffs. (I'm inclined
to remove this complication entirely unless someone actually uses it.)

3 years agoDelete empty WarningControl.h (#42771)
Jan Kotas [Sat, 26 Sep 2020 18:09:27 +0000 (11:09 -0700)]
Delete empty WarningControl.h (#42771)

3 years agoUpdate the build script to support opening S.P.Corelib (#42700)
Tanner Gooding [Sat, 26 Sep 2020 14:43:03 +0000 (07:43 -0700)]
Update the build script to support opening S.P.Corelib (#42700)

* Update the build script to support opening S.P.Corelib

* Adding a RuntimeFlavor switch to the build scripts

3 years agoFix DAC thread context flags (#42744)
Mike McLaughlin [Sat, 26 Sep 2020 02:20:55 +0000 (19:20 -0700)]
Fix DAC thread context flags (#42744)

Fix DAC thread context flags

The CONTEXT_* flags doesn't have the proper architecture specific bit set for the cross-OS/cross-arch DAC/DBI.  This causes the thread contexts not to be copied correctly because of the way CORDbgCopyThreadContext (in coreclr\src\debug\shared\arm64\ primitives.cpp) masks/checks the context flags.

Fix x86 build: missing DT_CONTEXT_ALL

3 years ago[aot] Prepend the assembly name to the names of gsharedvt wrappers to avoid duplicate...
monojenkins [Sat, 26 Sep 2020 01:50:59 +0000 (21:50 -0400)]
[aot] Prepend the assembly name to the names of gsharedvt wrappers to avoid duplicate symbol errors during static linking. (#42667)

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

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoFix additional warnings introduced after fixing inconsistencty (#42750)
Buyaa [Sat, 26 Sep 2020 00:42:24 +0000 (17:42 -0700)]
Fix additional warnings introduced after fixing inconsistencty (#42750)

3 years agoSIngle-pass `CopyValueClassUnchecked` (#42654)
Vladimir Sadov [Fri, 25 Sep 2020 23:42:54 +0000 (16:42 -0700)]
SIngle-pass `CopyValueClassUnchecked` (#42654)

* use memmoveGCRefs when copying structs with GC references

* no need for a full fence when copying struct without GC references

3 years agothe other part of suspension fix (#42721)
Maoni Stephens [Fri, 25 Sep 2020 22:07:26 +0000 (15:07 -0700)]
the other part of suspension fix (#42721)

3 years ago[runtime] Transition the trampoline code to use memory managers for memory allocation...
monojenkins [Fri, 25 Sep 2020 21:41:50 +0000 (17:41 -0400)]
[runtime] Transition the trampoline code to use memory managers for memory allocation. (#42462)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoChange TARGETS_BROWSER define to TARGET_BROWSER (#42635)
Ryan Lucia [Fri, 25 Sep 2020 21:36:34 +0000 (17:36 -0400)]
Change TARGETS_BROWSER define to TARGET_BROWSER (#42635)

This makes our define name consistent across the test suite. I noticed this while making unrelated wasm-specific changes to our tests.

3 years agoAdd Type.Namespace tests with array types, disable on Mono (#42634)
Ryan Lucia [Fri, 25 Sep 2020 21:35:45 +0000 (17:35 -0400)]
Add Type.Namespace tests with array types, disable on Mono (#42634)

We probably have more issues lurking in here since a lot of these reflection APIs don't seem to test array types, but this particular one was in response to a customer bug report.

3 years agoAdd wildcard to release branch trigger (#42644)
Drew Scoggins [Fri, 25 Sep 2020 20:46:32 +0000 (13:46 -0700)]
Add wildcard to release branch trigger (#42644)

* Add wildcard to release branch trigger

* Change wildcard to cover all release branches

3 years agoEnable clang 10,11 and gcc 10 detection (#42583)
Adeel Mujahid [Fri, 25 Sep 2020 19:28:24 +0000 (22:28 +0300)]
Enable clang 10,11 and gcc 10 detection (#42583)

3 years agoImprove superpmi.py script output (#42715)
Bruce Forstall [Fri, 25 Sep 2020 18:59:33 +0000 (11:59 -0700)]
Improve superpmi.py script output (#42715)

Create a log file that contains all output, and restrict
console output to a more concise subset, to avoid overwhelming
the user.

The `-log_level` option allows changing the level of console output.
The `-log_file` option allows changing the location of the generated
log file.

Also, create a better asm diffs summary at the end of the asm diffs run,
and similar for replay.

3 years agoRetry entire test for X.509 TimeoutTests instead of just X509Chain.Build
Kevin Jones [Fri, 25 Sep 2020 16:51:38 +0000 (12:51 -0400)]
Retry entire test for X.509 TimeoutTests instead of just X509Chain.Build

The TimeoutTests had functionality to retry the X509Chain.Build call if
it failed to improve the reliability of the tests. However, retrying
only the Build portion broke some assumptions about how long a chain
build would take.

If Build is invoked for a second time per the retry, however the
previous call to Build primed some of the AIA or CRL/OCSP caches, this
broke the assumption of how long a delayed fetch would take.

Instead, retry the entire test with a new chain every time so that
nothing is in the cache and the timing assumptions remain valid.

3 years agoDisable ArrayBufferWriterTests.Advance with JitStress. (#42674)
Sergey Andreenko [Fri, 25 Sep 2020 16:10:35 +0000 (09:10 -0700)]
Disable ArrayBufferWriterTests.Advance with JitStress. (#42674)

* Disable ArrayBufferWriterTests.Advance with JitStress.

Issue #42517

* Try to disable broader.

3 years agoAdjust for roslyn change on ref parameters and NotNullIfNotNull (#42707)
Julien Couvreur [Fri, 25 Sep 2020 15:27:10 +0000 (08:27 -0700)]
Adjust for roslyn change on ref parameters and NotNullIfNotNull (#42707)

* Adjust for roslyn change on ref parameters

* Adjust for roslyn change on NotNullIfNotNull

3 years agoFix mono_aot_plt_trampoline GC unsafe assumption. (#42685)
monojenkins [Fri, 25 Sep 2020 14:46:32 +0000 (10:46 -0400)]
Fix mono_aot_plt_trampoline GC unsafe assumption. (#42685)

managed->native wrapper does the following under coop:

enter gc safe
native call
exit gc safe

since enter/exit gc safe are icalls they will be called through PLT on AOT builds. First call through a PLT slot will resolve the function using mono_aot_plt_trampoline and it currently assumes GC safe mode, so when hit as part of resolving exit gc safe, it is called under GC safe mode.

This has not showed up to be an issue under coop AOT, but asserts when running under checked build.

Fix will make sure thread is in GC unsafe mode making sure assumption of GC unsafe mode holds.

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
3 years agoUpdate docs and comments to reflect the renames around build-test and runtest scripts...
Tomáš Rylek [Fri, 25 Sep 2020 12:28:59 +0000 (14:28 +0200)]
Update docs and comments to reflect the renames around build-test and runtest scripts (#42708)

* Move the script runtesttilstable.sh under src/tests

* Update most references to build-test / runtest in the runtime repo

With this change I can't find any remaining orphaned references to
the old script names except for a few superpmi-related scripts
I need to follow up on separately as I'm not too familiar with
their functionality.

Thanks

Tomas

3 years agoEnable several more IDE analyzer warnings (#42692)
Stephen Toub [Fri, 25 Sep 2020 10:33:07 +0000 (06:33 -0400)]
Enable several more IDE analyzer warnings (#42692)

* Enable IDE0062: Make local functions static

* Enable IDE0079: Remove unnecessary suppression

* Enable IDE0082: Convert typeof to nameof

* Enable IDE0043: Validate format string

* Enable IDE0041: Use is null check

3 years agoFix System.Net.Sockets telemetry (#42188)
Miha Zupan [Fri, 25 Sep 2020 08:16:18 +0000 (10:16 +0200)]
Fix System.Net.Sockets telemetry (#42188)

* Correct NameResolutionTelemetry logic

Taken from c4c9a2f99b7e339388199086d3014041abccc21e

* Enable listening to multiple sources with TestEventListener

* Workaround EventWrittenEventArgs bug when the EventArgs are stored

Workaround https://github.com/dotnet/runtime/issues/42128

* Correct System.Net.Sockets Telemetry

* Avoid using value tuple in TestEventListener

* Remove unnecessary argument to OnCompletedInternal

* Remove redundant Telemetry.IsEnabled check

* Log Connect/Accept start before the initial context capture

* Use SocketHelperBase in Accept tests

* Avoid duplicate events for BeginConnect without ConnextEx support

* Enable Sync Socket tests

* Revert unrelated SocketPal change

* Log the correct ErrorCode in case of socket disposal

* Add more info on TelemetryTest timeout

* Add PlatformSpecific attribute to ConnectFailure test

* Add missing BeginConnect AfterConnect call on sync failure

* Add comment around GetHelperBase

* Correct WaitForEventCountersAsync helper

* Assert against SocketError.TimedOut in ConnectFailed test

* Add EndConnect comment

* Log Failure around sync SocketPal exceptions

* Don't assert that the exception message is empty

* Dispose socket in a different Thread

* Disable Telemetry failure tests for Sync on RedHat7

* Use more descriptive names in MemberData generation

* Avoid using reflection for #42128 workaround

* Remove ConnectCanceled event

3 years agoRe-enable support for using the system libunwind (#42689)
Omair Majid [Fri, 25 Sep 2020 03:05:45 +0000 (23:05 -0400)]
Re-enable support for using the system libunwind (#42689)

We can now build runtime against the system libunwind using:

    ./build.sh -cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND

This allows Linux distributions that already ship a compatible version
of libunwind library to use that instead of carrying a duplicate in
.NET. This provides some benefits to them, including smaller build
sizes, slightly faster builds and fewer places to fix any
vulnerabilities

This functionality was already supported in .NET Core 3.1 and has
regressed since.

CoreCLR already handles `-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND`, so no
changes are needed there.

The libraries build doesn't care about this cmake varibale, but cmake
itself fails if the variable is not used:

    EXEC : CMake error : [runtime/src/libraries/Native/build-native.proj]
        Manually-specified variables were not used by the project:

          CLR_CMAKE_USE_SYSTEM_LIBUNWIND

So libraries just needs to check and ignore this variable.

The singlefilehost needs to link against libunwind too. Otherwise the
linker fails to resolve symbols, making the build fail:

    /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): in function `UnwindContextToWinContext(unw_cursor*, _CONTEXT*)':
      dotnet/runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:176: undefined reference to `_ULx86_64_get_reg'
    /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:177: undefined reference to `_ULx86_64_get_reg'
    /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:178: undefined reference to `_ULx86_64_get_reg'
    /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:179: undefined reference to `_ULx86_64_get_reg'
    /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:180: undefined reference to `_ULx86_64_get_reg'
    /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:181: more undefined references to `_ULx86_64_get_reg' follow
    /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): in function `GetContextPointer(unw_cursor*, ucontext_t*, int, unsigned long**)':
      runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:227: undefined reference to `_ULx86_64_get_save_loc'
    /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): in function `PAL_VirtualUnwind':
      runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:340: undefined reference to `_ULx86_64_init_local'
    /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:351: undefined reference to `_ULx86_64_step'
    /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:360: undefined reference to `_ULx86_64_is_signal_frame'
    clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes: #42661

3 years agoExtend IDynamicInterfaceCastable test to cover public default-implemented methods...
Jeremy Koritzinsky [Fri, 25 Sep 2020 03:05:32 +0000 (20:05 -0700)]
Extend IDynamicInterfaceCastable test to cover public default-implemented methods on interface impl types. (#42544)

* Extend IDynamicInterfaceCastable test suite to validate current behavior around calling a default-implemented public method defined on the interface impl type.

* Change implementation to use Assert.Fail to describe failure.

* Add public modifier.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Fix failures.

3 years agoAdd logging test for SocketsHttpHandler.PlaintextStreamFilter (#42690)
Stephen Toub [Fri, 25 Sep 2020 02:46:57 +0000 (22:46 -0400)]
Add logging test for SocketsHttpHandler.PlaintextStreamFilter (#42690)

* Add logging test for SocketsHttpHandler.PlaintextStreamFilter

* Make ByteLoggingStream more efficient

3 years agoRemove code for GC Poll marking and insertion. (#42664)
Eugene Rozenfeld [Fri, 25 Sep 2020 01:35:01 +0000 (18:35 -0700)]
Remove code for GC Poll marking and insertion. (#42664)

This is a follow-up to
https://github.com/dotnet/runtime/issues/13582#issuecomment-542386711
and
https://github.com/dotnet/runtime/issues/13582#issuecomment-653235564

The code to insert gc polls was added in desktop for gc suspension not based
on hijaking. All platforms we target support hijaking so this code is not exercised
or tested. It also clutters other code and adds a bit of runtime overhead.
This change removes all that code.

There are minimal asm diffs because of a removed call to `fgRenumberBlocks`.

3 years ago[wasm][debugger][tests] Add tests related to hidden sequence points (#42705)
Ankit Jain [Fri, 25 Sep 2020 01:29:45 +0000 (21:29 -0400)]
[wasm][debugger][tests] Add tests related to hidden sequence points (#42705)

- this includes two tests that are not working, with files issues

3 years agoRemove unused file. (#42697)
Kevin Jones [Fri, 25 Sep 2020 00:58:21 +0000 (20:58 -0400)]
Remove unused file. (#42697)

3 years ago[aot] Add support for references to GENERIC_ARRAY_HELPER wrappers. (#42580)
monojenkins [Fri, 25 Sep 2020 00:42:13 +0000 (20:42 -0400)]
[aot] Add support for references to GENERIC_ARRAY_HELPER wrappers. (#42580)

The testcase only fails when AOTed using --aot=soft-debug.

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

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoAdd executeable bit to tizen sh files (#42533)
Eric StJohn [Fri, 25 Sep 2020 00:26:35 +0000 (17:26 -0700)]
Add executeable bit to tizen sh files (#42533)

3 years agoFix Activity.Baggage items Order (#42659)
Tarek Mahmoud Sayed [Thu, 24 Sep 2020 23:34:56 +0000 (16:34 -0700)]
Fix Activity.Baggage items Order (#42659)

3 years agoJIT: Remove double-{negation,not} in during morph phase (#32000)
damageboy [Thu, 24 Sep 2020 23:20:09 +0000 (02:20 +0300)]
JIT: Remove double-{negation,not} in during morph phase (#32000)

- fixes #13647
- Deals with arithmetic negation as well as bitwise-not
- Co-authored with @EgorBo holding my hand :)

3 years agoAdd merge-mch command for CI scripting (#42696)
Bruce Forstall [Thu, 24 Sep 2020 23:03:40 +0000 (16:03 -0700)]
Add merge-mch command for CI scripting (#42696)

3 years agoFix illink invocation inside VS (#42678)
Viktor Hofer [Thu, 24 Sep 2020 22:21:13 +0000 (00:21 +0200)]
Fix illink invocation inside VS (#42678)

* Fix illink invocation inside VS

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

* Update illink-sharedframework.targets

3 years agoFix assigning of config as it got swapped somehow (#42695)
Drew Scoggins [Thu, 24 Sep 2020 21:05:17 +0000 (14:05 -0700)]
Fix assigning of config as it got swapped somehow (#42695)

Co-authored-by: Drew Scoggins <andrew.g.scoggins@gmail>
3 years ago[wasm][debugger] Fix line number = 16777215 (#42640)
Thays Grazia [Thu, 24 Sep 2020 19:50:34 +0000 (16:50 -0300)]
[wasm][debugger] Fix line number = 16777215 (#42640)

* Fix line number = 16777215.

* Trying to get the line number before the hidden offset.

* Adding comments.

* Adding test case

* Removing extra new line

* Fixing line number

3 years ago[interp] Refactor finally block invocation (#42208)
monojenkins [Thu, 24 Sep 2020 18:39:47 +0000 (14:39 -0400)]
[interp] Refactor finally block invocation (#42208)

Stop managing a finally_ips list at runtime. It is cumbersome, redundant and has a performance penalty (since we malloc/free for every single finally block invocation).

For every EH clause we were allocating a local slot (exvar_offsets). This was used to store thrown exception for catch blocks, but wasted for finally blocks. Following this commit, we reuse that slot to store the endfinally return ip. When we execute the endfinally instruction we check this local slot and branch to that ip. If it is null, then we know we were called from EH and should bail out of interpreter execution loop. In normal execution, this return ip is set by MINT_CALL_HANDLER. For every leave IL instruction we explicitly generate a MINT_CALL_HANDLER for every finally block.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
3 years agosuperpmi.py script improvements (#42668)
Bruce Forstall [Thu, 24 Sep 2020 18:10:22 +0000 (11:10 -0700)]
superpmi.py script improvements (#42668)

* superpmi.py script improvements

1. Simplify and regularize superpmi and mcs tool finding: they are both looked
for first in Core_Root, then in the built product directory, then on the PATH.
2. Improve JIT-EE version determination: first, search for the GUID by parsing
corinfo.h, if found. Otherwise, use "mcs -printJITEEVersion" as before.
3. Improve JIT dll finding: search first in Core_Root, then in the built
product directory.
4. When downloading coredistools, create the Core_Root if it doesn't exist.

With these changes, you can build the "clr.runtime" subset then immediately run
a replay or asmdiffs, without first generating a Core_Root directory. The script
will automatically create the Core_Root directory simply to put coredistools in
it (and also use it as the "current directory" when running superpmi commands).

* Fix bug in altjit processing for 'collect', and 3 code review nits fixed

3 years agoFix SingleFile regression in client configuration (#42176)
Adeel Mujahid [Thu, 24 Sep 2020 17:53:00 +0000 (20:53 +0300)]
Fix SingleFile regression in client configuration (#42176)

* Fix SingleFile regression in client configuration

* Simplify condition

* Pass isSingleFile to GetTypeAndHashSuffix

3 years ago[wasm][debugger] Fixing step over in an async method (#42639)
Thays Grazia [Thu, 24 Sep 2020 17:09:43 +0000 (14:09 -0300)]
[wasm][debugger] Fixing step over in an async method (#42639)

* Fixing step over in an async method.

* Removing debugstore change.

3 years agoAddress additional feedback from number-handling PRs (#42505)
Layomi Akinrinade [Thu, 24 Sep 2020 16:30:29 +0000 (09:30 -0700)]
Address additional feedback from number-handling PRs (#42505)

* Address further feedback from number-handling PRs

* Address review feedback

3 years agoGuard against (de)serializing SerializationInfo instances (#42605)
Layomi Akinrinade [Thu, 24 Sep 2020 16:24:01 +0000 (09:24 -0700)]
Guard against (de)serializing SerializationInfo instances (#42605)

* Guard against (de)serializing SerializationInfo instances

* Address feedback

3 years agoOngoing work on the cmake build. (#42647)
Zoltan Varga [Thu, 24 Sep 2020 16:17:17 +0000 (12:17 -0400)]
Ongoing work on the cmake build. (#42647)

* Fix some warnings.
* Avoid creating netcore/config.make.
* Fix CPU_COUNT test.
* Add missing source file.

3 years ago [Mono] [GC] Fix TotalBytesAllocated and reenable test (#42388)
Nathan Ricci [Thu, 24 Sep 2020 16:15:08 +0000 (12:15 -0400)]
 [Mono] [GC] Fix TotalBytesAllocated and reenable test (#42388)

* Account for bytes in tlab when a thread detaches.

3 years agoExpose StackTraceHiddenAttribute publicly (#42632)
Stephen Toub [Thu, 24 Sep 2020 15:46:09 +0000 (11:46 -0400)]
Expose StackTraceHiddenAttribute publicly (#42632)

* Expose StackTraceHiddenAttribute publicly

* Add hiding tests

3 years agoadd SocketsHttpHandler.PlaintextStreamFilter (#42660)
Geoff Kizer [Thu, 24 Sep 2020 15:37:00 +0000 (08:37 -0700)]
add SocketsHttpHandler.PlaintextStreamFilter (#42660)

3 years agoInterleave GC Info with assembly (#42552)
Carol Eidt [Thu, 24 Sep 2020 15:16:32 +0000 (08:16 -0700)]
Interleave GC Info with assembly (#42552)

* Interleave GC Info with assembly

Output GC info deltas *after* the instruction (or label) that changes it.
Add `COMPlus_JitDisasmWithGC` option to turn on the interleaving with assembly.

Fix #41647

3 years agoUpdate intellisense package version to RC2 (#42220)
Santiago Fernandez Madero [Thu, 24 Sep 2020 13:54:00 +0000 (08:54 -0500)]
Update intellisense package version to RC2 (#42220)

* Update intellisense package version to RC2

* Update intellisense package.

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
3 years agoFix spelling errors in SslStream (#42662)
Tomas Weinfurt [Thu, 24 Sep 2020 13:13:04 +0000 (06:13 -0700)]
Fix spelling errors in SslStream (#42662)

3 years agoPrint help for -? and /? cross-plat (#42396)
Viktor Hofer [Thu, 24 Sep 2020 12:27:24 +0000 (14:27 +0200)]
Print help for -? and /? cross-plat (#42396)

* Print help for -? and /? cross-plat

3 years agoUse function pointers in crossgen2 (#42655)
Jan Kotas [Thu, 24 Sep 2020 09:38:23 +0000 (02:38 -0700)]
Use function pointers in crossgen2 (#42655)

Co-authored-by: Adeel Mujahid <adeelbm@outlook.com>
3 years agoCompile test framework using R2RTest (#42617)
Jan Vorlicek [Thu, 24 Sep 2020 08:31:54 +0000 (10:31 +0200)]
Compile test framework using R2RTest (#42617)

This change switches crossgening of framework when building coreclr
tests to using R2RTest instead of explicitly invoking crossgen /
crossgen2.
To support that, the R2RTest was slightly updated to support specifying
target architecture, full path to crossgen2 and overriding the output
directory.

3 years ago[mono] Fix LLVM IR emission for Ssse3.AlignRight and Sse2/Sse41.Extract (#42648)
imhameed [Thu, 24 Sep 2020 08:07:13 +0000 (01:07 -0700)]
[mono] Fix LLVM IR emission for Ssse3.AlignRight and Sse2/Sse41.Extract (#42648)

The `mask` parameter to `shufflevector` must be a vector of `i32`s; we
were mistakenly using a vector of `i8`s previously.

`extractelement` requires that supplied index is smaller than the source
vector's length. The underlying instructions only pay attention to the
lower bits of the index, so replicate this behavior manually with
masking at the LLVM IR level.

This change makes JIT/HardwareIntrinsics/X86/Sse2/Sse2_{r,ro} pass with
LLVM JIT. LLVM AOT still makes this test fail for unrelated reasons.

This change makes more subtests in
JIT/HardwareIntrinsics/X86/Ssse3/Ssse3_{r,ro} pass with LLVM JIT. But
there are still other unrelated failures.

3 years ago[wasm][bindings] Fix an api regression introduced in #42486 (#42658)
Larry Ewing [Thu, 24 Sep 2020 04:35:51 +0000 (23:35 -0500)]
[wasm][bindings] Fix an api regression introduced in #42486 (#42658)

* Fix an api regression introduced in #42486

* Update src/mono/wasm/runtime/binding_support.js

a number it is

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
3 years ago[runtime] Throw a MarshalDirectiveException when returning an array from a pinvoke...
monojenkins [Thu, 24 Sep 2020 03:19:22 +0000 (23:19 -0400)]
[runtime] Throw a MarshalDirectiveException when returning an array from a pinvoke method. (#42631)

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

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoAdd IDE warnings to code analysis ruleset (#42566)
Stephen Toub [Thu, 24 Sep 2020 02:26:31 +0000 (22:26 -0400)]
Add IDE warnings to code analysis ruleset (#42566)

- Add all IDEXXXX warnings to ruleset, but as hidden for now
- Enable IDE0073: file header mismatch

3 years agoSupport cp1252 codepage alias (#42599)
Tarek Mahmoud Sayed [Thu, 24 Sep 2020 01:34:33 +0000 (18:34 -0700)]
Support cp1252 codepage alias (#42599)

* Support cp1252 codepage alias

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix teh License comment in the file headers

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix use of uninitialized 'altjit' attribute (#42656)
Bruce Forstall [Thu, 24 Sep 2020 00:58:40 +0000 (17:58 -0700)]
Fix use of uninitialized 'altjit' attribute (#42656)

Change the `-altjit` flag to require passing a JIT filename. There are
too many altjits (cross-compile JITs) available now to be able to pick
a good default, so force the user to pick.

3 years agoEnsure Enumerable methods are preserved by System.Linq.Querable (#42603)
Eric Erhardt [Wed, 23 Sep 2020 22:22:05 +0000 (17:22 -0500)]
Ensure Enumerable methods are preserved by System.Linq.Querable (#42603)

* Ensure Enumerable methods are preserved by System.Linq.Querable

When using System.Linq.Queryable against an in-memory collection, and trimming the application, the underlying Enumerable methods need to be preserved by the linker.

Annotating each Queryable method with a DynamicDependency to the corresponding Enumerable method will fix this scenario.

Fix #42536