platform/upstream/dotnet/runtime.git
4 years agoMore HTTP/2 performance (and a few functional) improvements (#36246)
Stephen Toub [Fri, 15 May 2020 21:30:17 +0000 (17:30 -0400)]
More HTTP/2 performance (and a few functional) improvements (#36246)

* Use span instead of array for StatusHeaderName

* Fix potential leak into CancellationToken

We need to dispose of the linked token source we create.

Also cleaned up some unnecessarily complicated code nearby.

* Fix HttpConnectionBase.LogExceptions

My previous changes here were flawed for the sync-completing case, and also accidentally introduced a closure.

* Clean up protocol state if/else cascades into switches

* Consolidate a bunch of exception throws into helpers

* Fix cancellation handling of WaitFor100ContinueAsync

* Change AsyncMutex's linked list to be circular

* Remove linked token sources

Rather than creating temporary linked token sources with the request body source and the supplied cancellation token, we can instead just register with the supplied token to cancel the request body source.  This is valid because canceling any part of sending a request cancels any further sending of that request, not just that one constituent operation.

* Avoid registering for linked cancellation until absolutely necessary

We can avoid registering with the cancellation token until after we know that our send is completing asynchronously.

* Remove closure/delegate allocation from WaitForDataAsync

`this` was being closed over accidentally.  I can't wait for static lambdas.

* Avoid a temporary list for storing trailers

Since it only exists to be defensive but we don't expect response.TrailingHeaders to be accessed until after the whole response has been received, we can store the headers into an HttpResponseHeaders instance and swap that instance in at the end.  Best and common case, we avoid the list. Worst and uncommon case, we pay the overhead of the extra HttpResponseHeaders instead of the List.

* Delete dead AcquireWriteLockAsync method

* Reduce header frame overhead

Minor optimizations to improve the asm

* Remove unnecessary throws with GetShutdownException

* Avoid extra lock in SendHeadersAsync

* Move Http2Stream construction out of lock

Makes a significant impact on reducing lock contention.

* Streamline RemoveStream

Including moving credit adjustment out of the lock

* Move response message allocation to ctor

Remove it from within the lock

* Reorder interfaces on Http2Stream

IHttpTrace doesn't need to be prioritized.

* Address PR feedback

4 years agoMerge pull request #36153 from krwq/sp_rem_sysnative_dep
Krzysztof Wicher [Fri, 15 May 2020 21:21:20 +0000 (14:21 -0700)]
Merge pull request #36153 from krwq/sp_rem_sysnative_dep

Remove dependency on System.Native from System.IO.Ports

4 years agoFix argument exception warnings on runtime (#35717)
buyaa-n [Fri, 15 May 2020 20:55:30 +0000 (13:55 -0700)]
Fix argument exception warnings on runtime (#35717)

* Fix argument exception warnings on runtime

* Apply feedback

* Addressing feedback and test fix

* Fix test failures

* Fix tests for NetFx run

* Fix suppressed warning for socket.SendAsyn(e) and fix corresponding tests

* Applied feedback

4 years agoNext round of multireg preliminary changes (#36155)
Carol Eidt [Fri, 15 May 2020 20:04:26 +0000 (13:04 -0700)]
Next round of multireg preliminary changes (#36155)

This is a zero-diff set of mostly refactoring changes in preparation for supporting multireg locals:
- Move `genRegCopy()` and `genStructReturn()` to codegencommon.cpp, making a new method for `genSIMDSplitReturn` which is target-specific.
- Factor out a new `genUnspillLocal` method from `genUnspillRegIfNeeded()`.
- Similarly factor out `genSpillLocal()`
- Rename `genMultiRegCallStoreToLocal()` and more generally support multireg local stores.
- Fix a bug in the order and shift amount for last-use bits on `GenTreeLclVar`
- Some additional cleanup and preparatory changes

4 years agoEnable basic generation of ngen pdb from composite image (#36311)
David Wrighton [Fri, 15 May 2020 19:31:27 +0000 (12:31 -0700)]
Enable basic generation of ngen pdb from composite image (#36311)

* Enable basic generation of ngen pdb from composite image
- Port non-line number handling portion of ngen pdb from crossgen to r2rdump
  - This pdb generation logic may be used for both composite and non-composite R2R images
  - Only pdb generation is supported. Perfmap generation for unix is not supported
  - pdb generation is only supported on Windows x86 and amd64 platforms. Diasymreader is not supported on other systems
  - Pdb generation does not generation symbols with the same names as crossgen. Instead it uses the name generator from r2rdump. For current needs this should be sufficient
- Update composite file format so that pdb generation process will work. Major difference is that a CorHeader is always produced for composite images now. This CorHeader is not used by the runtime, but is required for DiaSymReader to generate an ngen pdb.

4 years agoDisable MemoryCacheTest.Trim in arm64 and enable Runtime.Caching tests on Unix (...
Santiago Fernandez Madero [Fri, 15 May 2020 19:26:51 +0000 (12:26 -0700)]
Disable MemoryCacheTest.Trim in arm64 and enable Runtime.Caching tests on Unix (#36494)

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest dotnet/xharness (...
dotnet-maestro[bot] [Fri, 15 May 2020 19:12:55 +0000 (19:12 +0000)]
[master] Update dependencies from mono/linker Microsoft/vstest dotnet/xharness (#36525)

* Update dependencies from https://github.com/mono/linker build 20200515.1

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20264.1 -> To Version 5.0.0-preview.3.20265.1

* Update dependencies from https://github.com/microsoft/vstest build 20200515-01

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200429-01 -> To Version 16.7.0-preview-20200515-01

* Update dependencies from https://github.com/dotnet/xharness build 20200515.1

Microsoft.DotNet.XHarness.Tests.Runners
 From Version 1.0.0-prerelease.20264.9 -> To Version 1.0.0-prerelease.20265.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
4 years agoAdd comment to NetworkStream's ctor about socket.Blocking check (#36539)
Stephen Toub [Fri, 15 May 2020 19:06:34 +0000 (15:06 -0400)]
Add comment to NetworkStream's ctor about socket.Blocking check (#36539)

4 years agoMove mobile AppBuilder & AOTCompiler projects into tools-local (#36478)
Steve Pfister [Fri, 15 May 2020 17:36:11 +0000 (13:36 -0400)]
Move mobile AppBuilder & AOTCompiler projects into tools-local (#36478)

Moving the projects will make sure their artifacts are always available to the different CI legs.

4 years agoMerge pull request #36347 from NikolaMilosavljevic/burn.ui
Nikola Milosavljevic [Fri, 15 May 2020 15:55:28 +0000 (08:55 -0700)]
Merge pull request #36347 from NikolaMilosavljevic/burn.ui

UI changes for .NET 5

4 years agoConvert Extract(0) to ToScalar() (#36474)
Kunal Pathak [Fri, 15 May 2020 15:48:59 +0000 (08:48 -0700)]
Convert Extract(0) to ToScalar() (#36474)

* Convert Extract(0) to ToScalar()
* Update the shim

4 years agoClean up text in config.yml issue template (#36529)
Stephen Toub [Fri, 15 May 2020 14:48:15 +0000 (10:48 -0400)]
Clean up text in config.yml issue template (#36529)

4 years agoIgnore .github folder changes in CI (#36530)
Viktor Hofer [Fri, 15 May 2020 14:45:36 +0000 (16:45 +0200)]
Ignore .github folder changes in CI (#36530)

4 years agoRename 'Blank' issue template to 'Blank issue' (#36533)
Eirik Tsarpalis [Fri, 15 May 2020 14:29:56 +0000 (15:29 +0100)]
Rename 'Blank' issue template to 'Blank issue' (#36533)

* Update and rename 04_blank.md to 04_blank_issue.md

* Use consistent casing

4 years agoConsolidate NetCoreAppCurrent properties (#35953)
Viktor Hofer [Fri, 15 May 2020 14:03:20 +0000 (16:03 +0200)]
Consolidate NetCoreAppCurrent properties (#35953)

4 years agoUpdate 02_api_proposal.md
Stephen Toub [Fri, 15 May 2020 13:56:50 +0000 (09:56 -0400)]
Update 02_api_proposal.md

4 years agoUpdate 02_api_proposal.md
Stephen Toub [Fri, 15 May 2020 13:55:59 +0000 (09:55 -0400)]
Update 02_api_proposal.md

4 years agoorder issue template files (#36524)
Eirik Tsarpalis [Fri, 15 May 2020 13:51:05 +0000 (14:51 +0100)]
order issue template files (#36524)

4 years agoUpdate XHarness for latest fixes (#36484)
Santiago Fernandez Madero [Fri, 15 May 2020 13:00:19 +0000 (06:00 -0700)]
Update XHarness for latest fixes (#36484)

This includes a couple of fixes in xharness.

4 years ago[docs] How to run tests on iOS and Android (#36297)
Egor Bogatov [Fri, 15 May 2020 12:02:05 +0000 (15:02 +0300)]
[docs] How to run tests on iOS and Android (#36297)

4 years ago[mono] Improve Android OpenSSL temp hack (#36463)
Egor Bogatov [Fri, 15 May 2020 11:48:11 +0000 (14:48 +0300)]
[mono] Improve Android OpenSSL temp hack (#36463)

4 years agoImplement get_own_executable_path for SunOS (#36514)
Adeel Mujahid [Fri, 15 May 2020 09:11:39 +0000 (12:11 +0300)]
Implement get_own_executable_path for SunOS (#36514)

4 years agoRefactor `HasMultiRegRetVal` and `impFixupCallStructReturn`. (#36465)
Sergey Andreenko [Fri, 15 May 2020 09:10:56 +0000 (02:10 -0700)]
Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`. (#36465)

* Fix target definitions.

They were used in asserts only, no changes.

* Fix failures after a recent HW changes.

* Add a const getter for `ReturnTypeDesc` from a call.

Used to make some new methods const as well.

* Refactor `HasMultiRegRetVal` and `impFixupCallStructReturn`.

Delete an unnecessary nested condition and make checks more straightforward.

* Delete an extra `.` in some dumps.

* Add an additional check that `ReturnTypeDesc` is initialized.

* Remove old `const_cast` around `GetReturnTypeDesc`.

* Replace non-const `GetReturnTypeDesc` with other methods.

* Fix uninitialized `gtSpillFlags, gtOtherRegs, gtReturnTypeDesc` in `fgMorphIntoHelperCall`.

4 years agoImprove Uri.Equals by removing unsafe code (#36444)
Miha Zupan [Fri, 15 May 2020 05:22:09 +0000 (07:22 +0200)]
Improve Uri.Equals by removing unsafe code (#36444)

* Improve Uri.Equals

* Remove not useful and duplicated comments

4 years agoMerge pull request #36424 from layomia/kvp_policy
Layomi Akinrinade [Fri, 15 May 2020 04:12:23 +0000 (00:12 -0400)]
Merge pull request #36424 from layomia/kvp_policy

Honor PropertyNamingPolicy, PropertyNameCaseInsensitive, & Encoder options when (de)serializing KeyValuePair instances

4 years agoFix DAC layout in checked builds (#35542)
Steve MacLean [Fri, 15 May 2020 02:00:10 +0000 (22:00 -0400)]
Fix DAC layout in checked builds (#35542)

4 years agoAdd dotnet cli to runtime test Helix jobs (#35426)
Simon Nattress [Fri, 15 May 2020 01:39:37 +0000 (18:39 -0700)]
Add dotnet cli to runtime test Helix jobs (#35426)

* Currently managed tools such as crossgen2 and XUnit are run against the built runtime which is slow on Debug builds, and can obscure errors when the XUnit test harness fails due to an introduced runtime bug.
* Add `xunit.console.runtimeconfig.dev.json` which allows `xunit.console` to use the repo-local dotnet.cmd on dev boxes and the same version installed on the path in Helix.
* When running crossgen2 during test execution, support both local dev and Helix scenario when deciding which dotnet to run. On Helix, simply use `dotnet` which assumes a compatible dotnet runtime is in the path. Locally, tests are run with `runtest.cmd|sh` which sets `__TestDotNetCmd` to the repo-local dotnet script. This preserves the characteristic that no machine-wide 5.0 dotnet runtime must be installed for the runtime tests.
* Update batch scripting to also use `dotnet.cmd|sh` when running Crossgen2 replacing corerun.exe.
* crossgen2's `runtimes` folder is not getting copied to `CORE_ROOT` which causes the runtime host to abort the launch on the Unix CI VMs since crossgen.deps.json refers to files in that subfolder. Adjust the `CORE_ROOT` pruning in `Directory.Build.targets` to include subfolders for the two tools that need it.
* Improve XUnit test boilerplate. Printing `Exception.Message` doesn't include stack trace. Use `ToString()` instead.
* Import notargets sdk in `helixpublicwitharcade.proj`. It doesn't use the official sdk so `BundledNETCoreAppPackageVersion` wasn't set. Import the `Microsoft.Build.NoTargets` sdk so we can find the bundled runtime package version.

4 years agoAdding the support of reusing machine-wide credentials in the case where the machine...
Jose Perez Rodriguez [Fri, 15 May 2020 01:02:11 +0000 (18:02 -0700)]
Adding the support of reusing machine-wide credentials in the case where the machine is already domain-joined to the LDAP Server. (#36405)

* Adding the support of reusing machine-wide credentials in the case where
the machine is already domain-joined to the LDAP Server.

Co-authored-by: Alexander Chermyanin <flamencist@mail.ru>
* Addressing feedback and adding ldap4net to TPN

Co-authored-by: Alexander Chermyanin <flamencist@mail.ru>
4 years agoMerge remote-tracking branch 'upstream/master' into kvp_policy
Layomi Akinrinade [Fri, 15 May 2020 00:45:19 +0000 (17:45 -0700)]
Merge remote-tracking branch 'upstream/master' into kvp_policy

4 years agoAdd options to ignore default values during serialization (#36322)
Layomi Akinrinade [Fri, 15 May 2020 00:39:08 +0000 (20:39 -0400)]
Add options to ignore default values during serialization (#36322)

* Add options to ignore default values during serialization

* Address review feedback

* Fix typo in test

4 years agoMove mobile test runners to libs.pretest instead of P2P (#36473)
Santiago Fernandez Madero [Thu, 14 May 2020 23:51:48 +0000 (16:51 -0700)]
Move mobile test runners to libs.pretest instead of P2P (#36473)

4 years agoImplement unwrapping a ComWrappers CCW when dumping a stowed exception. (#36360)
Jeremy Koritzinsky [Thu, 14 May 2020 23:27:35 +0000 (16:27 -0700)]
Implement unwrapping a ComWrappers CCW when dumping a stowed exception. (#36360)

4 years agoAdd issue templates (#36431)
Dan Moseley [Thu, 14 May 2020 23:19:16 +0000 (16:19 -0700)]
Add issue templates (#36431)

* more

* commented

* yml

* Add an issue template for API proposals

* Update .github/ISSUE_TEMPLATE/api-proposal.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update .github/ISSUE_TEMPLATE/api-proposal.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update .github/ISSUE_TEMPLATE/api-proposal.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* comment out template instructions

* apply consistent naming

* feedback

* add blank

* H2 and H3

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoR2RTest - Partial composite images (#36471)
Simon Nattress [Thu, 14 May 2020 23:18:55 +0000 (16:18 -0700)]
R2RTest - Partial composite images (#36471)

Allow compiling composite R2R images which reference assemblies not in the composite. For example, this would allow compiling a set of application assemblies with references to ASP.NET / Framework. Currently R2RTest treats all references as unrooted inputs for the composite image.

4 years agoRemove unnessary guard against switched property names
Layomi Akinrinade [Thu, 14 May 2020 22:31:53 +0000 (15:31 -0700)]
Remove unnessary guard against switched property names

4 years agoIssue 36212: Remove space in parameter name (#36439)
Shimmy [Thu, 14 May 2020 21:53:25 +0000 (00:53 +0300)]
Issue 36212: Remove space in parameter name (#36439)

* Issue 36212: Remove space in parameter name

* Update src/coreclr/src/vm/comutilnative.cpp

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoNext round of Struct Improvements (#36146)
Carol Eidt [Thu, 14 May 2020 21:49:33 +0000 (14:49 -0700)]
Next round of Struct Improvements (#36146)

- Allow accessing a SIMD12 as 16 bytes if it's the single field of a parent struct of 16 bytes.
- On x64/ux don't copy an argument just because it is promoted; the copy would force it to memory anyway.
- Use block init for a promoted struct that's been marked lvDoNotEnregister.
- Allow field-by-field copy of structs with the same fields

4 years agoOptimize ToScalar() and GetElement() to use arm64 intrinsic (#36156)
Kunal Pathak [Thu, 14 May 2020 21:06:45 +0000 (14:06 -0700)]
Optimize ToScalar() and GetElement() to use arm64 intrinsic (#36156)

* ARM64 intrisic for ToScalar() and GetElement()

* Fixed GetElement to just operate on constants

* Fix bug in rationalize for Vector64<long>

* fix NotSupported issue for GetElement and ToScalar

* Reuse the baseType/retType in impSpecialIntrinsic and impBaseIntrinsic

* Update comment

* fix breaks

* add comments

* ran jit-format

* Refactored to move common logic inside isSupportedBaseType

* review comments

* reuse simdSize

* formatting

* one missing formatting

4 years agoReplace System.Native call in Interop.Errors.cs
Krzysztof Wicher [Thu, 14 May 2020 21:00:32 +0000 (14:00 -0700)]
Replace System.Native call in Interop.Errors.cs

4 years agoStartup optimization w.r.t. manifest access in composite mode (#36446)
Tomáš Rylek [Thu, 14 May 2020 20:19:08 +0000 (22:19 +0200)]
Startup optimization w.r.t. manifest access in composite mode (#36446)

During my work on fixing runtime crashes in composite build
with large version bubble enabled I noticed room for startup
perf improvement and a very slight working set optimization:

For component assemblies of a composite image, we can basically
share the cache of those manifest assembly references that
have already been resolved (GetNativeMetadataAssemblyRefFromCache)
within the native image because that is the logical owner
of the manifest metadata.

In the "asymptotic" case of composite images with many
components, the pre-existing behavior was basically
a quadratic O(n^2) algorithm in the number of component
assemblies. This change reduces it to linear in the sense
that all assembly references from the composite image get
resolved only once.

Thanks

Tomas

4 years ago[Mono] Don't set thread name of main thread on Linux (#36116)
Aleksey Kliger (λgeek) [Thu, 14 May 2020 19:57:32 +0000 (15:57 -0400)]
[Mono] Don't set thread name of main thread on Linux (#36116)

* [mono] Record MonoNativeThreadId of the main thread

We would like to know the MonoNativeThreadId (pthread_t on Linux) of the main
thread of the application.  We can identify the main thread (on linux) because
it is the one for which `gettid () == getpid ()`.  (`gettid()` returns a
`pid_t` which is not the same thing as a `pthread_t`, hence this roundabout way
of detecting it.)

A complication arises in embedding scenarios: the main thread is not
necessarily the one that calls `mono_jit_init` or otherwise interacts with the
runtime.  Therefore we do the `gettid() == getpid ()` test at `MonoThreadInfo`
creation time when we call `register_thread`.

If the main thread never interacts with Mono, the main thread is not known to
us.

* [mono] Don't set name of main thread on Linux

Setting the name of the main thread also changes the name of the process.

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

The corresponding fix for CoreCLR is https://github.com/dotnet/runtime/pull/34064

* Re-enable test from https://github.com/dotnet/runtime/pull/34064

4 years agoMake depproj intermediate output paths unique again (#36451)
Viktor Hofer [Thu, 14 May 2020 18:50:17 +0000 (20:50 +0200)]
Make depproj intermediate output paths unique again (#36451)

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

Depprojs depend on IntermediateOutputPath being set in a props file early enough as restore is happening per configuration. Even though it isn't recommended that the TargetFramework property is read before the project is loaded, we currently encode the TargetFramework in the IntermediateOutputPath for depproj files. The long-term fix is to get rid of per configuration restores by getting rid of our depproj files.

4 years agoUpdate Linux docker instructions (#36370)
Simon Nattress [Thu, 14 May 2020 18:12:30 +0000 (11:12 -0700)]
Update Linux docker instructions (#36370)

* Update linux-instructions.md to use root build.sh

4 years ago[mono] Shrink Android APK size (#36437)
Egor Bogatov [Thu, 14 May 2020 16:56:11 +0000 (19:56 +0300)]
[mono] Shrink Android APK size (#36437)

* Shrink Android apk size

* bump xharness cli, use cmake config

4 years agoAdd an atexit handler to bypass calls into ERR_ string routines.
Jeremy Barton [Thu, 14 May 2020 15:29:32 +0000 (08:29 -0700)]
Add an atexit handler to bypass calls into ERR_ string routines.

This works around Ubuntu's apparent lack of NO_ATEXIT support in their
build of OpenSSL.

4 years agoSupport additional friendly names on ECC OIDs
Kevin Jones [Thu, 14 May 2020 15:28:44 +0000 (11:28 -0400)]
Support additional friendly names on ECC OIDs

Expand the name/OID table to support a m:m relationship (secp256r1 and nistP256 are both 1.2.840.10045.3.1.7; 1.3.14.7.2.3.1 and 1.2.840.113549.1.1.4 are both md5RSA) and add in the alternative names for the secp{size}r1 curves (size in 256, 384, 521).

4 years ago[master] Update dependencies from dotnet/arcade mono/linker dotnet/xharness (#36445)
dotnet-maestro[bot] [Thu, 14 May 2020 14:24:31 +0000 (16:24 +0200)]
[master] Update dependencies from dotnet/arcade mono/linker dotnet/xharness (#36445)

* Update dependencies from https://github.com/dotnet/arcade build 20200511.9

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk , 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.XUnitConsoleRunner , Microsoft.DotNet.GenAPI , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.GenFacades
 From Version 5.0.0-beta.20258.8 -> To Version 5.0.0-beta.20261.9

* Update dependencies from https://github.com/mono/linker build 20200514.1

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20262.1 -> To Version 5.0.0-preview.3.20264.1

* Update dependencies from https://github.com/dotnet/xharness build 20200514.1

Microsoft.DotNet.XHarness.Tests.Runners
 From Version 1.0.0-prerelease.20263.4 -> To Version 1.0.0-prerelease.20264.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoConsolidate subset projects into ProjectToBuild (#36441)
Viktor Hofer [Thu, 14 May 2020 14:05:38 +0000 (16:05 +0200)]
Consolidate subset projects into ProjectToBuild (#36441)

Consolidating subset projects into a single ProjectToBuild item type to
allow specifying projects to build from different subsets after the
subset was already built.

4 years agoUpdate message for generic type. (#36434)
Aaron Robinson [Thu, 14 May 2020 13:54:10 +0000 (06:54 -0700)]
Update message for generic type. (#36434)

4 years agoRemove duplicate configuration properties (#36442)
Viktor Hofer [Thu, 14 May 2020 13:42:18 +0000 (15:42 +0200)]
Remove duplicate configuration properties (#36442)

4 years agoWork around -no_weak_imports issue with recent Xcode (#36436)
Alexander Köplinger [Thu, 14 May 2020 12:48:51 +0000 (14:48 +0200)]
Work around -no_weak_imports issue with recent Xcode (#36436)

See https://github.com/mono/mono/issues/19393.

We can use the `-Werror=partial-availability` as a good alternative until the Xcode bug is fixed.

4 years ago[debugger] Removing some asserts (#36234)
monojenkins [Thu, 14 May 2020 12:16:41 +0000 (08:16 -0400)]
[debugger] Removing some asserts (#36234)

Removing some asserts and returning err_invalid_argument with an error message when it's possible.

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

Co-authored-by: thaystg <thaystg@users.noreply.github.com>
4 years agoUpdate windows prerequisites to be more specific about SDK (#36438)
Ganbarukamo41 [Thu, 14 May 2020 10:21:02 +0000 (19:21 +0900)]
Update windows prerequisites to be more specific about SDK (#36438)

* Update windows prerequisites to be more specific about SDK

* Global installation of nightly SDK is required to normally browse the solution files in VS, as there is no way to supply SDKs when the solution files are opened through VS.

* Update windows prerequisites

* allow newer versions of VS workloads

4 years agoFix mono runtime build warnings when building iOS config (#36435)
Alexander Köplinger [Thu, 14 May 2020 10:12:56 +0000 (12:12 +0200)]
Fix mono runtime build warnings when building iOS config (#36435)

```
  /Users/alexander/dev/runtime/src/mono/mono/mini/aot-runtime.c:5647:13: warning: unused variable 'image' [-Wunused-variable]

  /Users/alexander/dev/runtime/src/mono/mono/mini/simd-intrinsics-netcore.c:11:1: warning: no previous prototype for function 'mono_simd_intrinsics_init' [-Wmissing-prototypes]

  /Users/alexander/dev/runtime/src/mono/mono/utils/mono-state.c:1230:1: warning: no previous prototype for function 'mono_crash_save_failfast_msg' [-Wmissing-prototypes]
  /Users/alexander/dev/runtime/src/mono/mono/utils/mono-state.c:1236:1: warning: no previous prototype for function 'mono_crash_get_failfast_msg' [-Wmissing-prototypes]
```

4 years agoImplement GetEntrypointExecutableAbsPath on SunOS (#36430)
Adeel Mujahid [Thu, 14 May 2020 09:44:50 +0000 (12:44 +0300)]
Implement GetEntrypointExecutableAbsPath on SunOS (#36430)

* Implement `GetEntrypointExecutableAbsolutePath`.
* Fix a warning from newer gawk (v5.0.1 from 2019):
  > ```sh
  > awk: /runtime/src/coreclr/src/nativeresources/processrc.awk:54:
  > warning: regexp escape sequence `\"' is not a known regexp operator
  > ```

4 years agoRework rejit test to ensure subprocess environment is suitable (#36420)
Andy Ayers [Thu, 14 May 2020 08:09:25 +0000 (01:09 -0700)]
Rework rejit test to ensure subprocess environment is suitable (#36420)

This test is optimization sensitive, but it invokes a subprocess that
will inherit environment variables like `COMPlus_JITMinOpts` that can impact
optimization of code jitted in the subprocess and cause the test to fail.

So, update the parent process code to override `COMPlus_JITMinOpts` and
`COMPlus_JitStress` for the child process.

Closes #35742.

4 years ago[master] Update dependencies from mono/linker dotnet/llvm-project dotnet/xharness...
dotnet-maestro[bot] [Thu, 14 May 2020 08:03:12 +0000 (08:03 +0000)]
[master] Update dependencies from mono/linker dotnet/llvm-project dotnet/xharness (#36336)

* Update dependencies from https://github.com/mono/linker build 20200512.1

- Microsoft.NET.ILLink.Tasks: 5.0.0-preview.3.20261.2 -> 5.0.0-preview.3.20262.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20200512.1

- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20261.3 -> 9.0.1-alpha.1.20262.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20261.3 -> 9.0.1-alpha.1.20262.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20261.3 -> 9.0.1-alpha.1.20262.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: 6.0.1-alpha.1.20261.3 -> 9.0.1-alpha.1.20262.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20261.3 -> 9.0.1-alpha.1.20262.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: 6.0.1-alpha.1.20261.3 -> 9.0.1-alpha.1.20262.1

* Update dependencies from https://github.com/dotnet/xharness build 20200513.4

- Microsoft.DotNet.XHarness.Tests.Runners: 1.0.0-prerelease.20261.4 -> 1.0.0-prerelease.20263.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoRemove Microsoft.NETCore.Platforms.Future project (#36407)
Alexander Köplinger [Thu, 14 May 2020 07:20:14 +0000 (09:20 +0200)]
Remove Microsoft.NETCore.Platforms.Future project (#36407)

It's no longer used.

4 years agoFix execution of large version bubble composite images (#36373)
Tomáš Rylek [Thu, 14 May 2020 06:24:22 +0000 (08:24 +0200)]
Fix execution of large version bubble composite images (#36373)

Large-bubble composite images are special in having more entries
in the manifest metadata than in the component assembly table:
When the build starts, all component assemblies get hard-injected
into the manifest metadata and subsequently we lazily add those
additional reference assemblies (within the same version bubble)
as we need for encoding signatures.

Thanks

Tomas

4 years agoMove Mobile test runners to libraries/common and use P2P references (#36411)
Santiago Fernandez Madero [Thu, 14 May 2020 03:25:40 +0000 (20:25 -0700)]
Move Mobile test runners to libraries/common and use P2P references (#36411)

* Move Mobile test runners to libraries/common and use P2P references

* PR Feedback

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoImprove Sse41.Multiply compatibility with LLVM 9. (#36369)
imhameed [Thu, 14 May 2020 03:17:07 +0000 (20:17 -0700)]
Improve Sse41.Multiply compatibility with LLVM 9. (#36369)

The llvm.x86.sse41.pmuldq intrinsic is no longer available as of
https://github.com/dotnet/llvm-project/commit/254ed028a4bd4fa81d0049d90e6ab23d704dd366.

This also adds a convenience wrapper for creating constant LLVM IR
vectors, up to 16 elements long, of arbitrary integral type.

Finally, fix a latent bug in init_function_pass_manager;
llvm::StringRef::size returns a value of type size_t, but the printf
precision specifier requires a value of type int.

4 years agoDisable test GitHub_35821 (#36419)
Kunal Pathak [Thu, 14 May 2020 02:18:18 +0000 (19:18 -0700)]
Disable test GitHub_35821 (#36419)

4 years agoFix cross-compiling argument validation for Linux (#36368)
Viktor Hofer [Thu, 14 May 2020 02:17:13 +0000 (04:17 +0200)]
Fix cross-compiling argument validation for Linux (#36368)

* Fix cross-compiling argument validation for Linux

https://github.com/dotnet/runtime/commit/7c66b6fb6fb00dd86d969ec622a9bb2830016375 added a ValidateSet for Windows_NT and Unix even though we don't support building for just "Unix" but for the more concrete OS which is "Linux".

* Update build.ps1

4 years agoHonor PropertyNamingPolicy, PropertyNameCaseInsensitive, & Encoder options when ...
Layomi Akinrinade [Wed, 13 May 2020 23:20:04 +0000 (16:20 -0700)]
Honor PropertyNamingPolicy, PropertyNameCaseInsensitive, & Encoder options when (de)serializing KeyValuePair instances

4 years agoOptimize Vector64 and Vector128.Create methods (#36267)
Tanner Gooding [Wed, 13 May 2020 23:51:20 +0000 (16:51 -0700)]
Optimize Vector64 and Vector128.Create methods  (#36267)

* Updating the Vector64 and Vector128 Create methods to be marked Intrinsic on ARM64

* Updating the JIT to emit constants for Vector64 and Vector128.Create

* Fixing lookupNamedIntrinsic and impIntrinsic to throw PNSE for unsupported mustExpand intrinsics

* Fixing impIntrinsic to directly use gtNewMustThrowException

* Move gtNewMustThrowException to not depend on FEATURE_HW_INTRINSICS

* Applying formatting patch

* Add basic support for GT_CLS_VAR_ADDR to the ARM64 JIT

* Update lookupNamedIntrinsic to handle System.Runtime.Intrinsics for unsupported platforms

* Fixing INS_ldr in emitIns_R_C to use isValidVectorLSDatasize

* Elaborate on why we specially recognize the HWIntrinsics even on platforms that don't support them

4 years agoIncorrect CALLSITE macro usage. (#36357)
Aaron Robinson [Wed, 13 May 2020 23:16:53 +0000 (16:16 -0700)]
Incorrect CALLSITE macro usage. (#36357)

4 years agoAdding sdlConfig file to move policheck out of the build (#36142)
Anirudh Agnihotry [Wed, 13 May 2020 22:37:34 +0000 (15:37 -0700)]
Adding sdlConfig file to move policheck out of the build (#36142)

* sdlfile

* add the variable names

4 years agoAdd configurations for SunOS in installer (#36316)
Adeel Mujahid [Wed, 13 May 2020 21:46:33 +0000 (00:46 +0300)]
Add configurations for SunOS in installer (#36316)

4 years agoDisable System.Diagnostics.Tests.EventLogSourceCreationTests (#36138)
Santiago Fernandez Madero [Wed, 13 May 2020 21:28:55 +0000 (14:28 -0700)]
Disable System.Diagnostics.Tests.EventLogSourceCreationTests (#36138)

* Disable System.Diagnostics.Tests.EventLogSourceCreationTests.CheckSourceExistenceAndDeletion

* Fix trait to skip tests in CI

* Use ActiveIssue instead

4 years agoBundleProbeTest: Enable disabled tests (#36327)
Swaroop Sridhar [Wed, 13 May 2020 21:09:18 +0000 (14:09 -0700)]
BundleProbeTest: Enable disabled tests (#36327)

A few of the bundle probe tests were failing on Linux-musl-x64-release.
This change adjusts the test to circumvent the failure.

Fixes #35755

4 years agoUpdate to v3.0.0 of Microsoft.CodeAnalysis.FxCopAnalyzers (#36318)
Stephen Toub [Wed, 13 May 2020 21:07:11 +0000 (17:07 -0400)]
Update to v3.0.0 of Microsoft.CodeAnalysis.FxCopAnalyzers (#36318)

4 years agoMove serializer KeyValuePair tests to dedicated file
Layomi Akinrinade [Wed, 13 May 2020 20:07:30 +0000 (13:07 -0700)]
Move serializer KeyValuePair tests to dedicated file

4 years agoFix Path.GetPathRoot wrong check in Unix (#35734)
Carlos Sanchez Lopez [Wed, 13 May 2020 19:24:01 +0000 (12:24 -0700)]
Fix Path.GetPathRoot wrong check in Unix (#35734)

* Fix Path.GetPathRoot wrong check in Unix

* Return .Empty instead of null

* Update src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Address unit test comments

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years ago[CBOR] Implement a proof of concept for ECDsa COSE key serialization (#36002)
Eirik Tsarpalis [Wed, 13 May 2020 19:16:03 +0000 (20:16 +0100)]
[CBOR] Implement a proof of concept for ECDsa COSE key serialization (#36002)

* Implement a proof of concept for ECDSA cose key serialization

* roundtrip COSE all the way to the ECDsa instance

* remove comment out code

* fix tests failing on Linux

* address feedback

* fix tests for linux

* address feedback

* add missing using statement

* refactor CoseKey deserializer implementation so that optional fields are supported.

4 years agoThrottle allocations in BinaryReader (#36348)
Levi Broderick [Wed, 13 May 2020 18:02:13 +0000 (11:02 -0700)]
Throttle allocations in BinaryReader (#36348)

4 years agoAdd a WasmAppBuilder task and a sample. (#36338)
Zoltan Varga [Wed, 13 May 2020 17:10:57 +0000 (13:10 -0400)]
Add a WasmAppBuilder task and a sample. (#36338)

4 years agoUpdate -vs removal switch documentation (#36353)
Viktor Hofer [Wed, 13 May 2020 16:57:17 +0000 (18:57 +0200)]
Update -vs removal switch documentation (#36353)

4 years agoSet TargetsMobile=true on Browser TargetOS and build the wasm runtimes earlier during...
Alexander Köplinger [Wed, 13 May 2020 16:39:17 +0000 (18:39 +0200)]
Set TargetsMobile=true on Browser TargetOS and build the wasm runtimes earlier during the libs build (#36337)

* Set TargetsMobile=true on Browser TargetOS

* Build the wasm runtimes earlier during the libs build so they end up in lib-runtime-packs.

* Add emsdk_env.sh into .gitignore

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
4 years agoMerge pull request #36268 from kouvel/NamedMutexFix
Koundinya Veluri [Wed, 13 May 2020 16:37:16 +0000 (12:37 -0400)]
Merge pull request #36268 from kouvel/NamedMutexFix

Fix Unix named mutex crash during some race conditions

Below when I refer to "mutex" I'm referring to the underlying mutex object, not an instance of the `Mutex` class.
- When the last reference to a mutex is closed while the lock is held by some thread and a pthread mutex is used, the mutex was attempted to be destroyed but that has undefined behavior
- There doesn't seem to be a way to behave exactly like on Windows for this corner case, where the mutex is destroyed when the last reference to it is released, regardless of which process has the mutex locked and which process releases the last reference to it (they could be two different processes), including in cases of abrupt shutdown
- For this corner case I settled on what seems like a decent solution and compatible with older runtimes:
  - When a process releases its last reference to the mutex
    - If that mutex is locked by the same thread, the lock is abandoned and the process no longer references the mutex
    - If that mutex is locked by a different thread, the lifetime of the mutex is extended with an implicit ref. The implicit ref prevents this or other processes from attempting to destroy the mutex while it is locked. The implicit ref is removed in either of these cases:
      - The mutex gets another reference from within the same process
      - The thread that owns the lock exits and abandons the mutex, at which point that would be the last reference to the mutex and the process would not reference the mutex anymore
  - The implementation based on file locks is less restricted, but for consistency that implementation also follows the same behavior
- There was also a race between an exiting thread abandoning one of its locked named mutexes and another thread releasing the last reference to it, fixed by using the creation/deletion process lock to synchronize

Fix for https://github.com/dotnet/runtime/issues/34271 in master
Closes https://github.com/dotnet/runtime/issues/28449 - probably doesn't fix the issue, but trying to enable it to see if it continues to fail

4 years agoReturn exit code 1 in android test runner if a test failed (#36319)
Santiago Fernandez Madero [Wed, 13 May 2020 16:00:23 +0000 (09:00 -0700)]
Return exit code 1 in android test runner if a test failed (#36319)

* Return exit code 1 in android test runner if a test failed

* Exit instrumentation with runner exit code

4 years agoUI changes for .NET 5
Nikola Milosavljevic (CLR) [Wed, 13 May 2020 13:42:07 +0000 (06:42 -0700)]
UI changes for .NET 5

4 years agoRemove some `= null!`s from corelib (#36175)
Stephen Toub [Wed, 13 May 2020 13:13:14 +0000 (09:13 -0400)]
Remove some `= null!`s from corelib (#36175)

* Remove some `= null!`s from corelib

In some cases, this was achieved by:
- Using [MemberNotNull] when it could be used to enable the compiler to appropriately follow the initialization
- Making the field nullable and using `!`s at usage sites in cases where the `= null!` wasn't appropriate because the field could actually be null
- Making the field nullable and adding null checks sparingly
- Suppressing warnings in cases where fields weren't accessed in managed code
- Removing stale cases where it wasn't necessary anymore anyway
- Removing unnecessary empty internal/private ctors

* Address PR feedback

* Disable test on mono

4 years agoEmit DWARF debug_abbrev offset for compile units as a label instead of 0 (#36320)
monojenkins [Wed, 13 May 2020 12:23:28 +0000 (08:23 -0400)]
Emit DWARF debug_abbrev offset for compile units as a label instead of 0 (#36320)

When outputting DWARF code to start a compilation unit in .debug_info, the standard expect a 4-byte offset from the .debug_abbrev code. Mono has always output an offset of 0.

However, this doesn't work in every cases. When we have linux+fullaot, we link two object files (one from Mono, one from LLVM). Both have their .debug_abbrev section. If we use 0 as an offset, it seems possible that the linker will keep thinking that our offset is 0, no matter the circumstances. Since the offset is always 0, it can be using the wrong abbreviation table (i.e. the one from the LLVM assembly instead of the one from the Mono assembly). The consequence of this is that the linked file is not valid DWARF (dwarfdump and objdump will complain about invalid offsets). At best, some tools will be able to work with a part of what we have, but any program requiring entirely valid DWARF will fail.

To fix this, we generate a label for the start of our debug_abbrev section and we instead generate it by generating a long with that label. This matches existing behavior seen in the LLVM generated code, and makes dwarfdump and objdump react properly to the linked product.

Fixes mono/mono#8806

Co-authored-by: mathieubourgeois <mathieubourgeois@users.noreply.github.com>
4 years ago[runtime] Move delegate_bound_static_invoke_cache to MonoWrapperCaches. (#36309)
monojenkins [Wed, 13 May 2020 12:01:30 +0000 (08:01 -0400)]
[runtime] Move delegate_bound_static_invoke_cache to MonoWrapperCaches. (#36309)

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoAdd MonoAOTCompiler msbuild task (#35961)
Alexander Köplinger [Wed, 13 May 2020 10:50:39 +0000 (12:50 +0200)]
Add MonoAOTCompiler msbuild task (#35961)

4 years agoRemove several unnecessary arrays used with Split (#36304)
Stephen Toub [Wed, 13 May 2020 03:35:53 +0000 (23:35 -0400)]
Remove several unnecessary arrays used with Split (#36304)

Now that we have a Split overload that takes a single char, the previous optimization to cache an array and reuse that array with the array-based overload isn't needed.

4 years agoAdd POH size counter (#36150)
Sung Yoon Whang [Wed, 13 May 2020 03:16:00 +0000 (20:16 -0700)]
Add POH size counter (#36150)

* Add POH size counter

* Add 'Pinned Object Heap' to DisplayName

4 years agoFlow exit code from RunTests.sh in iOS (#36315)
Santiago Fernandez Madero [Wed, 13 May 2020 02:55:48 +0000 (19:55 -0700)]
Flow exit code from RunTests.sh in iOS (#36315)

4 years agoRemove unsed variable in MsQuicApi (#36302)
Eric Erhardt [Wed, 13 May 2020 02:39:49 +0000 (21:39 -0500)]
Remove unsed variable in MsQuicApi (#36302)

4 years agoPrevent build scripts from letting random values through (#35642)
Ivan Diaz Sanchez [Wed, 13 May 2020 01:58:51 +0000 (18:58 -0700)]
Prevent build scripts from letting random values through (#35642)

* Arch, OS, and Config no longer let random values through when building the repo. Also, removed the casing restrictions on the bash version.

* Fixed the bash build script! Also, casing restrictions are gone!

* Added safeguards for bogus values on -rc and -lc on the sh build script.

* Fixed the merge conflict on build.sh

* Used awk instead of declare for increased compatibility on build.sh

* Restored execute permissions to build.sh

4 years agoFix Microsoft.Extensions.DependencyModel AssemblyVersionInPackageVersion (#36301)
Eric Erhardt [Wed, 13 May 2020 01:07:59 +0000 (20:07 -0500)]
Fix Microsoft.Extensions.DependencyModel AssemblyVersionInPackageVersion (#36301)

4 years agoSet ExactSpelling=true on P/Invokes in System.Private.CoreLib that already specify...
Elinor Fung [Wed, 13 May 2020 01:04:14 +0000 (18:04 -0700)]
Set ExactSpelling=true on P/Invokes in System.Private.CoreLib that already specify the unicode W suffix (#36257)

* Set ExactSpelling=true on P/Invokes in System.Private.CoreLib that
already specify the unicode W suffix

* PR feedback: refactor NDirectMethodDesc::FindEntryPoint

4 years agoFix HttpClient SSL3.0 test on newer Windows OS (#36308)
David Shulman [Wed, 13 May 2020 00:36:08 +0000 (17:36 -0700)]
Fix HttpClient SSL3.0 test on newer Windows OS (#36308)

When I upgraded my dev machine to Windows 10 Version 2004 Preview, I noticed that the
HttpClient GetAsync_SupportedSSLVersion_Succeeds test was failing when using SSL 3.0.

This new version of Windows changes the default setting of SSL 3.0. So, by default,
SSL 3.0 is no longer enabled.

The problem was that this specific test wasn't using our PlatformDetection.SupportsSsl30
logic. Fixed the test so that it will properly detect whether SSL 3.0 is enabled on
the machine.

4 years agoAdd ctor to JsonSerializerOptions that takes serializer defaults (#36073)
Nikiforov Alexey [Wed, 13 May 2020 00:13:16 +0000 (03:13 +0300)]
Add ctor to JsonSerializerOptions that takes serializer defaults (#36073)

* add ctor to JsonSerializerOptions that takes serializer defaults

* add out of range handling; enhance xml documentation

* test serializer option construction via serializer defaults

* adjust PredefinedSerializerOptions tests

4 years agoAdd QCALL_CONTRACT_NO_GC_TRANSITION (#36294)
Aaron Robinson [Tue, 12 May 2020 23:10:36 +0000 (16:10 -0700)]
Add QCALL_CONTRACT_NO_GC_TRANSITION (#36294)

New QCall macro for APIs that use SuppressGCTransitionAttribute.

4 years agoFix nullable annotations on DangerousAcceptAnyServerCertificateValidator (#36305)
Stephen Toub [Tue, 12 May 2020 22:48:53 +0000 (18:48 -0400)]
Fix nullable annotations on DangerousAcceptAnyServerCertificateValidator (#36305)

It should match ServerCertificateCustomValidationCallback.

4 years agomake Poll enums shared
Krzysztof Wicher [Tue, 12 May 2020 17:25:43 +0000 (10:25 -0700)]
make Poll enums shared

4 years agoComment typos (#36296)
Aaron Hudon [Tue, 12 May 2020 21:29:36 +0000 (14:29 -0700)]
Comment typos (#36296)

4 years agoUse Publish target for self contained test apps (#36290)
Santiago Fernandez Madero [Tue, 12 May 2020 20:43:24 +0000 (13:43 -0700)]
Use Publish target for self contained test apps (#36290)

4 years agoAddress feedback, disable a test on Mono, slightly simplify same test (avoid two...
Koundinya Veluri [Tue, 12 May 2020 20:14:37 +0000 (13:14 -0700)]
Address feedback, disable a test on Mono, slightly simplify same test (avoid two guids in name)