platform/upstream/dotnet/runtime.git
3 years agoFix mark overflow for regions (#53929)
Peter Sollich [Thu, 10 Jun 2021 16:07:32 +0000 (18:07 +0200)]
Fix mark overflow for regions (#53929)

Test GC\Scenarios\Boxing\variantlinklist\variantlinklist encountered a mark stack overflow that we didn't handle correctly in the regions case.

The problem was that this was a gen 2 GC, and we didn't iterate over the gen 0 and gen 1 regions, so the objects causing the mark stack overflow were in fact not revisited.

The fix is to iterate starting from gen 0 rather than the condemned generation.

I added an assert to make sure process_mark_overflow_internal has found at least one marked object to process - unfortunately, we can check this only for WKS GC.

3 years agoDisable STRESS_REGIONS (#53996)
Peter Sollich [Thu, 10 Jun 2021 16:06:12 +0000 (18:06 +0200)]
Disable STRESS_REGIONS (#53996)

There are several tests (most of them under GC\Scenarios\DoublinkList) that fail because STRESS_REGIONS pins arbitrary objects and thus keeps them alive, and thus these objects are not finalized.

Let's disable STRESS_REGIONS in the checked-in source code, but investigate whether there are any failures with STRESS_REGIONS that are real issues.

3 years agoAdd SupportedOSPlatform to Hosting.WindowsService HostBuilder extensions (#53941)
Hugo Woodiwiss [Thu, 10 Jun 2021 15:52:03 +0000 (16:52 +0100)]
Add SupportedOSPlatform to Hosting.WindowsService HostBuilder extensions (#53941)

* Set SupportedOSPlatforms at assembly level

Update build props to set SupportedOSPlatforms to windows assembly wide

3 years agokeep MsQuicConnection alive when streams are pending (#52800)
Tomas Weinfurt [Thu, 10 Jun 2021 15:49:47 +0000 (17:49 +0200)]
keep MsQuicConnection alive when streams are pending (#52800)

* keep MsQuicConnection alive when streams are pending

* remove extra file

* fix gchandle

* feedback from review

* feedback from review

* feedback from review

3 years agoDisable SynchronizationContextCurrent_NotUsedForAsyncOperations on Mono (#53997)
Alexander Köplinger [Thu, 10 Jun 2021 15:44:07 +0000 (17:44 +0200)]
Disable SynchronizationContextCurrent_NotUsedForAsyncOperations on Mono (#53997)

It seems to hang for some reason.

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

3 years agoUpdate buildtools for linux arm64 lane (#53975)
Fan Yang [Thu, 10 Jun 2021 15:38:21 +0000 (11:38 -0400)]
Update buildtools for linux arm64 lane (#53975)

3 years agoAdd writeable holders for executable memory (#53934)
Jan Vorlicek [Thu, 10 Jun 2021 13:26:40 +0000 (15:26 +0200)]
Add writeable holders for executable memory (#53934)

* Add writeable holders for executable memory

This change adds holders for writeable mappings for executable memory.
It is the largest part of the W^X support. The ExecutableWriterHolder
implementation is dummy in this change, but it was fully tested with
coreclr / libraries tests on Windows arm, arm64, x64 and x86 with the
real double memory mapping.
There are few concepts / conventions used:
* When the writeable pointer isn't known at a place where it is needed
  and also not at the caller, the ExecutableWriterHolder instance is
  created.
* When a callee needs writeable pointer to executable memory and caller
  knows RW and RX, the argument is doubled with RX and RW suffixes. For
  constructors and member methods when "this" is the RW one, we pass just
  extra RX argument.
* Locals holding RW  pointer use RW suffix.
* Locals holding RX pointer usually have no suffix to minimize number of
  changes, but in some cases they have a RX suffix
  where I felt like it was better to make things clear.

3 years agoFixes race condition on captive scoped services (#53325)
Maryam Ariyan [Thu, 10 Jun 2021 12:59:09 +0000 (08:59 -0400)]
Fixes race condition on captive scoped services (#53325)

3 years agoReturn false for SocketsHttpHandler.IsSupported on Browser (#53926)
Alexander Köplinger [Thu, 10 Jun 2021 12:39:22 +0000 (14:39 +0200)]
Return false for SocketsHttpHandler.IsSupported on Browser (#53926)

We were returning true even though sockets don't work on Browser.

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
3 years agoAdd Mono diagnostics-tracing design document. (#53302)
Johan Lorensson [Thu, 10 Jun 2021 11:39:25 +0000 (13:39 +0200)]
Add Mono diagnostics-tracing design document. (#53302)

3 years ago[tests] Fix CRLF issues in M.E.Http (#52707)
Radek Doulik [Thu, 10 Jun 2021 11:35:27 +0000 (13:35 +0200)]
[tests] Fix CRLF issues in M.E.Http (#52707)

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

When running `Microsoft.Extensions.Http` tests on windows and
targeting `Browser`, the line ending differs between host and target
systems. Use helper `LineEndingsHelper.Normalize` method to update
expected strings.

The `Browser` Environment.NewLine is `\n`, while windows use `\r\n`.
https://github.com/dotnet/runtime/blob/5bd0edfe860e41bdfd690d3743e730594307292e/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs#L51

3 years agoposix_fallocate should work on WASM now (#53985)
Adam Sitnik [Thu, 10 Jun 2021 11:32:13 +0000 (13:32 +0200)]
posix_fallocate should work on WASM now (#53985)

3 years agoFix missing ClearStateUponCompletion call in AsyncTaskMethodBuilder (#53962)
Stephen Toub [Thu, 10 Jun 2021 11:11:20 +0000 (07:11 -0400)]
Fix missing ClearStateUponCompletion call in AsyncTaskMethodBuilder (#53962)

This was accidentally removed as part of a previous refactoring.  The lack of it means primarily that we're not always removing async method tasks from the s_currentActiveTasks dictionary when the debugger is attached (we didn't notice it because awaiting the resulting task also causes it to be removed).  It also means we're not clearing out some state we intended to in order to minimize extending lifetime of objects referenced by the state machine if the task is held onto for a prolonged period.

3 years agoFix2 for Trim HW (#53928)
Lakshan Fernando [Thu, 10 Jun 2021 10:55:23 +0000 (03:55 -0700)]
Fix2 for Trim HW (#53928)

* Fix for Trim HW

* FB

3 years agoRemove obsolete Versions.props extensibility point (#53986)
Viktor Hofer [Thu, 10 Jun 2021 10:22:35 +0000 (12:22 +0200)]
Remove obsolete Versions.props extensibility point (#53986)

See discussion here: https://github.com/dotnet/runtime/pull/53294#discussion_r648815525. That block isn't necessary anymore for source build.

3 years agoReplace Values with KeyValuePair enumerator in MemoryCache (#53762)
ezgambac [Thu, 10 Jun 2021 05:40:05 +0000 (22:40 -0700)]
Replace Values with KeyValuePair enumerator in MemoryCache (#53762)

fixes #53761

3 years agoAdd FileStreamOptions overloads (#52720)
Emmanuel André [Thu, 10 Jun 2021 04:57:09 +0000 (06:57 +0200)]
Add FileStreamOptions overloads (#52720)

3 years agoUse target OS strip tool, not host OS strip tool (#53961)
Jo Shields [Thu, 10 Jun 2021 03:56:19 +0000 (23:56 -0400)]
Use target OS strip tool, not host OS strip tool (#53961)

* Use target OS strip tool, not host OS strip tool. Fixes Android on Mac build.

* Try running objcopy when targeting Android, so we don't override it to "objcopy"

3 years agoRemove crossgen from superpmi tools (#53958)
Kunal Pathak [Thu, 10 Jun 2021 00:42:14 +0000 (17:42 -0700)]
Remove crossgen from superpmi tools (#53958)

* Remove crossgen SPMI collection

* Remove reference of crossgen from superpmi.py

* some misc crossgen references

* put back deleted things

3 years agoRemove AOT exclusion for full PGO runs (#53943)
Drew Scoggins [Thu, 10 Jun 2021 00:32:13 +0000 (17:32 -0700)]
Remove AOT exclusion for full PGO runs (#53943)

3 years agoApple Silicon reenable 49568 (#52202)
Steve MacLean [Thu, 10 Jun 2021 00:27:31 +0000 (20:27 -0400)]
Apple Silicon reenable 49568 (#52202)

3 years agoFix gcc armel/arm64 build (#53220)
Gleb Balykov [Wed, 9 Jun 2021 23:28:45 +0000 (02:28 +0300)]
Fix gcc armel/arm64 build (#53220)

* Fix gcc armel build

Mostly signed/unsigned comparisons, etc.

* Fix gcc arm64 build

3 years agoApple Silicon reenable 49110 failures (#52195)
Steve MacLean [Wed, 9 Jun 2021 23:28:21 +0000 (19:28 -0400)]
Apple Silicon reenable 49110 failures (#52195)

* Apple Silicon reenable 49110 failures

* Restore test disables

System.Numerics.Vectors & System.Runtime both failed
for both runs.  Restore disables of these tests.

3 years agoAvoid internal BitOperations in XxHash for .NET 6 build
Stephen Toub [Wed, 9 Jun 2021 23:19:53 +0000 (19:19 -0400)]
Avoid internal BitOperations in XxHash for .NET 6 build

3 years agofix spmi perfomance. (#53953)
Sergey Andreenko [Wed, 9 Jun 2021 22:53:19 +0000 (15:53 -0700)]
fix spmi perfomance. (#53953)

3 years agoHttpHeaders: remove StoreLocation and AddValue (#53918)
Geoff Kizer [Wed, 9 Jun 2021 22:53:03 +0000 (15:53 -0700)]
HttpHeaders: remove StoreLocation and AddValue (#53918)

* remove StoreLocation and AddValue

* make info.ParsedValue etc fields

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years ago[mono][wasm] Add additional icall signatures. (#53927)
Zoltan Varga [Wed, 9 Jun 2021 21:50:22 +0000 (17:50 -0400)]
[mono][wasm] Add additional icall signatures. (#53927)

3 years agoFix memory corruption after free in EventPipe streaming thread. (#53886)
Johan Lorensson [Wed, 9 Jun 2021 21:26:57 +0000 (23:26 +0200)]
Fix memory corruption after free in EventPipe streaming thread. (#53886)

If streaming thread was aborted with an error it will disable the session.
This is not the normal scenario, since most tools will explicit ask to
close session, but if there is a network connectivity causing failures
to write to stream, session will first be disabled and then it will write
NULL into freed memory, causing heap corruption.

Fix makes sure we reset streaming_thread before we eventually disable
session, making sure it won't write into freed memory.

3 years agoRevert "Do byref liveness updates for same register GPR moves (#53684)" (#53942)
Tanner Gooding [Wed, 9 Jun 2021 20:58:18 +0000 (13:58 -0700)]
Revert "Do byref liveness updates for same register GPR moves (#53684)" (#53942)

This reverts commit 7df92fd478aef22d4d98693e64d93730bc513e29.

3 years agoFix serializer check to permit fast-path serialization logic to run (#53916)
Layomi Akinrinade [Wed, 9 Jun 2021 20:57:39 +0000 (13:57 -0700)]
Fix serializer check to permit fast-path serialization logic to run (#53916)

* Fix serializer check to permit fast-path serialization logic to run

* Address feedback

* Add more tests

* Address feedback

3 years agoRun libraries package testing on build agent (#53905)
Viktor Hofer [Wed, 9 Jun 2021 20:55:07 +0000 (22:55 +0200)]
Run libraries package testing on build agent (#53905)

* Run libraries package testing on build agent

instead of on Helix as with recent changes the entire package testing
doesn't take more than 2 minutes. Helix created a work item per package
test even though it only took seconds and the average wait time for
a client was 10-15min.

Also cleaning up how the generated package test projects are restored
and incorporating a fix from Eric St John to not hard code the package
feeds.

* Expose useHelix argument

3 years agoProcessInfo2 Diagnostics IPC Command (#52258)
John Salem [Wed, 9 Jun 2021 19:52:29 +0000 (12:52 -0700)]
ProcessInfo2 Diagnostics IPC Command (#52258)

* Stash the entrypoint assembly path

* Add ep funcs for accessing entrypoint and version
 * TODO: get Mono's entrypoint asm

* Add ProcessInfo2 command
 * command includes everything the first one did + product ver
   and entrypoint asm path
* Add a test too

* Mono build fixes

* fix Mono build

* PR feedback
* fetch mono info from main assembly
* remove ref naming
* remove lazy method

* handle bundled host
* need to test still

* Use assembly name
* simplify access patterns
* change API to utf8
* updated test

* update comment

* PR feedback

* save before I commit this time...

* fix merge conflict

* Update ds-process-protocol.c

add missing break statement from merge conflict fix

* Update src/native/eventpipe/ds-process-protocol.h

* Update ds-process-protocol.c

add missing frees

* PR feedback

3 years agoRemove manual netfx targeting pack reference (#53936)
Viktor Hofer [Wed, 9 Jun 2021 19:46:48 +0000 (21:46 +0200)]
Remove manual netfx targeting pack reference (#53936)

The .NET Framework reference assemblies are referenced by default by the SDK these days so the PackageReference isn't necessary anymore.

3 years agoRemove unused usings (#53938)
David Fowler [Wed, 9 Jun 2021 19:46:34 +0000 (12:46 -0700)]
Remove unused usings (#53938)

3 years agocleanup cancellation handling in SocketAsyncContext (#53479)
Geoff Kizer [Wed, 9 Jun 2021 19:00:42 +0000 (12:00 -0700)]
cleanup cancellation handling in SocketAsyncContext (#53479)

* cleanup cancellation handling in SocketAsyncContext

* fix MacOS failback

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs

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

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoReenable resolved Apple Silicon intermittent test failures (#50889)
Steve MacLean [Wed, 9 Jun 2021 18:17:46 +0000 (14:17 -0400)]
Reenable resolved Apple Silicon intermittent test failures (#50889)

3 years agoImprove the rate of thread injection for blocking due to sync-over-async (#53471)
Koundinya Veluri [Wed, 9 Jun 2021 18:13:32 +0000 (11:13 -0700)]
Improve the rate of thread injection for blocking due to sync-over-async (#53471)

* Improve the rate of thread injection for blocking due to sync-over-async

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

3 years agoDon't try to strip .a files (#53915)
Jo Shields [Wed, 9 Jun 2021 17:00:29 +0000 (13:00 -0400)]
Don't try to strip .a files (#53915)

3 years agoAdd SupportedOSPlatform to X509Certificate2 members.
Kevin Jones [Wed, 9 Jun 2021 16:58:05 +0000 (12:58 -0400)]
Add SupportedOSPlatform to X509Certificate2 members.

Archived and FriendlyName's setters are only supported on Windows.

3 years agoexclude crossgen from build. (#53458)
Manish Godse [Wed, 9 Jun 2021 16:49:05 +0000 (09:49 -0700)]
exclude crossgen from build. (#53458)

* excluding crossgen from build.

* Fix cross-component build break

* Fix tests to not use crossgen

* more test fixes.

* switching R2R jobs to use cg2 by default

* switch helix runs to use crossgen2

3 years agoFix failing SetCookies_Success test (#53932)
Viktor Hofer [Wed, 9 Jun 2021 15:46:44 +0000 (17:46 +0200)]
Fix failing SetCookies_Success test (#53932)

* Fix failing SetCookies_Success test

3 years ago[wasm][testing] hosting echo server in xharness process (#52923)
Pavel Savara [Wed, 9 Jun 2021 15:32:58 +0000 (17:32 +0200)]
[wasm][testing] hosting echo server in xharness process (#52923)

- move tests to inner loop
- include echo middleware in xharness server
- improve doc
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53592 for lack of TRACE
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53591 for content on GET/HEAD
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53874 for HttpRequestMessage.Headers.Host
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53872 for NPE on System.Net.Http.BrowserHttpHandler
- more granular ActiveIssue https://github.com/dotnet/runtime/issues/53876
- include middleware in Helix correlation payload

3 years agomove the validaiton logic to FileStreamOptions (#53869)
Adam Sitnik [Wed, 9 Jun 2021 13:49:14 +0000 (15:49 +0200)]
move the validaiton logic to FileStreamOptions (#53869)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFixes Trim HelloWorld (#53912)
Lakshan Fernando [Wed, 9 Jun 2021 11:01:26 +0000 (04:01 -0700)]
Fixes Trim HelloWorld (#53912)

3 years agoRelease configuration resource. (#53857)
so [Wed, 9 Jun 2021 11:01:05 +0000 (19:01 +0800)]
Release configuration resource. (#53857)

Co-authored-by: shuxinqin <shuxinqin@outlook.com>
3 years agoFix process background segment end (#53879)
Peter Sollich [Wed, 9 Jun 2021 09:03:40 +0000 (11:03 +0200)]
Fix process background segment end (#53879)

Fix issue found in GetAllocatedBytesForCurrentThread with regions enabled.

The issue was traced to a region that had become empty in a background GC, but was still considered valid in the next ephemeral GC, so because there were cards set, we marked objects referenced from dead objects in the segment.

When a segment becomes completely empty in background GC, but is the start segment for the generation, we don't delete it, so we still need to reset heap_segment_allocated and decommit pages.

3 years agoInliner: new observations (don't impact inlining for now) (#53670)
Egor Bogatov [Wed, 9 Jun 2021 08:36:24 +0000 (11:36 +0300)]
Inliner: new observations (don't impact inlining for now) (#53670)

Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoDisable RegisterFromSTAThreadThatGoesAway_MessageStillDelivered test on Mono on Windo...
Alexander Köplinger [Wed, 9 Jun 2021 05:59:06 +0000 (07:59 +0200)]
Disable RegisterFromSTAThreadThatGoesAway_MessageStillDelivered test on Mono on Windows (#53893)

It started failing after https://github.com/dotnet/runtime/pull/53700 because the missing Dispose() caused the failure to not be reported.

3 years agoImprove clrjit.natvis (#53910)
Bruce Forstall [Wed, 9 Jun 2021 05:48:46 +0000 (22:48 -0700)]
Improve clrjit.natvis (#53910)

1. Add LclFld output: same as LclVar plus offset
2. Remove extra trailing GenTree brace

3 years agoAdd non-cryptographic hash algorithms library
Jeremy Barton [Wed, 9 Jun 2021 05:30:32 +0000 (22:30 -0700)]
Add non-cryptographic hash algorithms library

* Adds a new package, System.IO.Hashing (netstandard2.0, net461 to reduce netfx restore graph sizes, and net6.0)
* Provides implementations for four hash algorithms
  * CRC-32 (the variation used by IEEE 802.3 (Ethernet))
  * CRC-64 (the variation used by ECMA-182)
  * XxHash32, with optional seed
  * XxHash64, with optional seed
* The tests are structured so that algorithm tests just need to provide their test vectors and do some boilerplate overrides to get variation testing across the instance methods and static methods.

3 years agoJIT: fix OSR reporting for special stack slots (#53897)
Andy Ayers [Wed, 9 Jun 2021 00:59:13 +0000 (17:59 -0700)]
JIT: fix OSR reporting for special stack slots (#53897)

Revise the reporting of the special stack slots for OSR to be more uniform.
* Always record the original method FP-relative offset.
* Always apply the same adjustment for original method slosts i the OSR frame
* Handle caller-SP relative adjustment in `lvaToCallerSPRelativeOffset`

In particular, this fixes #43534 where we were reporting the wrong caller SP
for the profiler exit hook.

3 years agoMake sure EnsureInitialize() loads the GcInfo if it is there (#53896)
Andrew Au [Wed, 9 Jun 2021 00:50:18 +0000 (17:50 -0700)]
Make sure EnsureInitialize() loads the GcInfo if it is there (#53896)

3 years agoDisplay LSRA stats in method summary (#53901)
Kunal Pathak [Wed, 9 Jun 2021 00:42:24 +0000 (17:42 -0700)]
Display LSRA stats in method summary (#53901)

* Lsrstats

* jit format

* use blocks iterator

3 years agoDo byref liveness updates for same register GPR moves (#53684)
Tanner Gooding [Wed, 9 Jun 2021 00:37:36 +0000 (17:37 -0700)]
Do byref liveness updates for same register GPR moves (#53684)

* Do byref liveness updates for same register GPR moves on x86/x64

* Change where emitLastEmittedIns is tracked

* Ensure emitLastEmittedIns isn't tracked across instruction groups

3 years agoAdd unsigned variants for BitConverter float bit APIs (#53784)
MichalPetryka [Tue, 8 Jun 2021 23:46:57 +0000 (01:46 +0200)]
Add unsigned variants for BitConverter float bit APIs (#53784)

* Add unsigned variants for BitConverter bit APIs

Adds DoubleToUInt64Bits, UInt64BitsToDouble, SingleToUInt32Bits,
UInt32BitsToSingle, HalfToUInt16Bits and UInt16BitsToHalf.

Implementations were based on existing signed integer variants.

Convert usages of existing APIs to unsigned variants when appropriate.

Fix #36469

* Revert comment change

Reverted a comment change made in the existing code by mistake.

* Use existing code for implementations

Use the existing signed methods with a cast, less code with the same codegen.

* Cast correction

Corrected the type used in a cast.

3 years ago Fix InvariantGlobalization=false in a trimmed app (#53453)
Eric Erhardt [Tue, 8 Jun 2021 22:25:11 +0000 (17:25 -0500)]
 Fix InvariantGlobalization=false in a trimmed app (#53453)

* Fix InvariantGlobalization=false in a trimmed app.

Move the LoadICU logic into a static ctor, so it runs early in the process, but not as part of querying the GlobalizationMode.Invariant property. This allows for LoadICU to still be invoked, even when the app is trimmed and GlobalizationMode.Invariant is hard-coded by the linker.

While I was changing this code, I also removed the workaround in Browser builds for swallowing errors being returned from LoadICU.

Fix #49073
Fix #49391

* Add trimming tests for InvariantGlobalization

* Update the LoadICU message for mobile workloads.

* Respond to PR feedback.

- Split the substitutions of GlobalizationMode.Invariant between true and false
- Add a trimming test that ensures Invariant=true trims everything it is supposed to

* Add checks for all mobile platforms

3 years agoInclude NetCoreAppCurrent configs in packages (#53439)
Viktor Hofer [Tue, 8 Jun 2021 21:36:01 +0000 (23:36 +0200)]
Include NetCoreAppCurrent configs in packages (#53439)

* Include NetCoreAppCurrent configs in packages

The NetCoreAppCurrent configurations were omitted from packages to avoid
ever growing packages. Now that we adhere to the support policy for
packages we don't need to exclude them anymore as the policy defines a
baseline for .NETCoreApp configurations.

This will remove an artificial difference when source building the
repository and also make it so that partner repositories which don't
depend on a transport package like windowsdesktop (winforms) receive
the very latest assets that are included in the shared framework as
well.

* Fix package validation for non exposed inbox libs

3 years agoRemove an erroneous check (#53889)
Andrew Au [Tue, 8 Jun 2021 21:32:45 +0000 (14:32 -0700)]
Remove an erroneous check (#53889)

3 years agoImprove GC stress log instrumentation (#53547)
Andrew Au [Tue, 8 Jun 2021 21:32:14 +0000 (14:32 -0700)]
Improve GC stress log instrumentation (#53547)

3 years agoBuild support for s390x: clr.iltools and clr.paltests (#53289)
Ulrich Weigand [Tue, 8 Jun 2021 21:24:52 +0000 (23:24 +0200)]
Build support for s390x: clr.iltools and clr.paltests (#53289)

* Add dummy support for s390x in vm, jit, debug, and unwinder

* This suffices to make clr.iltools and clr.paltests buildable

3 years agoBuild support for s390x: libunwind (#53286)
Ulrich Weigand [Tue, 8 Jun 2021 21:23:31 +0000 (23:23 +0200)]
Build support for s390x: libunwind (#53286)

* Merge https://github.com/libunwind/libunwind/pull/245

* Add s390x support to local CMake files

3 years agoBuild support for s390x: PAL layer (#53287)
Ulrich Weigand [Tue, 8 Jun 2021 21:21:46 +0000 (23:21 +0200)]
Build support for s390x: PAL layer (#53287)

* Add PAL implementation for Linux on s390x

* Define BIGENDIAN on s390x when compiling coreclr

* Provide a default HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE
  value in eng/native/tryrun.cmake

3 years agoModernize DiagnosticsHandler tests (#53870)
Miha Zupan [Tue, 8 Jun 2021 20:47:09 +0000 (22:47 +0200)]
Modernize DiagnosticsHandler tests (#53870)

* Modernize DiagnosticsHandler tests

* Address PR feedback

SemaphoreSlim => TCS, Guid => nosuchhost.invalid, Http20 => Http2

3 years agoApple Silicon reenable 49365 (#52197)
Steve MacLean [Tue, 8 Jun 2021 20:05:25 +0000 (16:05 -0400)]
Apple Silicon reenable 49365 (#52197)

3 years agoUpdate instruction table to capture the correct state of EFlags (#53806)
Kunal Pathak [Tue, 8 Jun 2021 19:03:34 +0000 (12:03 -0700)]
Update instruction table to capture the correct state of EFlags (#53806)

* Update instruction table with accurate EFlags information

* Revert "Add issues.targets entry for the GitHub_13822 test to make CI green (#53789)"

This reverts commit bd9ba598a0a3417510d318472d3c0f6641cdba93.

* minor fixup

* Fix some more instructions

* review comments

3 years agoFix Apple Silicon shuffle thunks (#53250)
Steve MacLean [Tue, 8 Jun 2021 18:49:25 +0000 (14:49 -0400)]
Fix Apple Silicon shuffle thunks (#53250)

* Fix Apple Silicon shuffle thunks

Fixes 47294

* Set and use m_hfaFieldSize for stack arguments

m_hfaFieldSize is needed to calculate correct shuffle size.

3 years agoStrip libmonosgen linked library (#53240)
Jo Shields [Tue, 8 Jun 2021 18:29:16 +0000 (14:29 -0400)]
Strip libmonosgen linked library (#53240)

It seems in the .symbols.nupkg package, instead of a stripped .dylib/so and companion .dwarf/.dbg, we've just been shipping unstripped libs. This commit largely duplicates the functions from eng/native/functions.cmake into an MSbuild proj, as our entire logic is already in MSbuild not CMake.

3 years agoFix compilation errors if host does not support AVX2 (#50316)
Andrii Kurdiumov [Tue, 8 Jun 2021 18:12:07 +0000 (00:12 +0600)]
Fix compilation errors if host does not support AVX2 (#50316)

* Fix compilation errors if host does not support AVX2

* Add comments to empty preprocessor branches

* Explicitly ask for architecture support

* Apply -march-native only on GCC

* Make sure if clang on x64 would be used
it actually pass -march=native, otherwise AVX2 would not be enabled.

* Ask test use AVX2 when run on Windows.

3 years agoCheck if the marshalling of a field is possible across all platforms. (#53194)
Aaron Robinson [Tue, 8 Jun 2021 17:44:02 +0000 (10:44 -0700)]
Check if the marshalling of a field is possible across all platforms. (#53194)

* Check if the marshalling of a field is possible across all platforms.

* Add test for the generic field generation for IClassX.

3 years ago[mono][llvm] Access mono_polling_required directly instead of loading its value from...
Zoltan Varga [Tue, 8 Jun 2021 17:22:12 +0000 (13:22 -0400)]
[mono][llvm] Access mono_polling_required directly instead of loading its value from a GOT slot in static mode. (#53776)

This will potentially avoid one load in the GC safe point code.

3 years agoDistinguish Debug and Checked builds in version resource (#53847)
Bruce Forstall [Tue, 8 Jun 2021 17:05:29 +0000 (10:05 -0700)]
Distinguish Debug and Checked builds in version resource (#53847)

In the Win32 version resource, this changes the "Comment" field
from:
```
  Flavor=Checked
```
to:
```
  Flavor=Debug
```

It also properly sets `BUILDENV_DEBUG=1` for debug builds (only used in
exactly one place: gc.cpp).

3 years agoFire diagnostic source events from IHostBuilder.Build (#53757)
David Fowler [Tue, 8 Jun 2021 15:47:49 +0000 (08:47 -0700)]
Fire diagnostic source events from IHostBuilder.Build (#53757)

* Fire diagnostic source events from IHostBuilder.Build
- We want to enable getting access to the IHostBuilder and IHost during the call to IHostBuilder.Build so that we can access the application's IServiceProvider from various tools. Usually, this is enabled by exposing a different entry point from the application but this technique allows us to let the application execute normally and hook important events via a diagnostic source.
- Add support for the new pattern in HostFactoryResolver
- Added support for resolving an IServiceProvider using the new diagnostics source pattern (which doesn't require a different entrypoint)
- Detect the version of Microsoft.Extensions.Hosting before waiting for events to fire
- We want to fail fast if we know this version of hosting will never fire events of if the hosting assembly fails to load. Added a version check.
- Allow the caller to specify a wait timeout.
-  Added a flag to allow running the application to completion

3 years agoMulti-target RuntimeConfigParser Task (#53827)
Steve Pfister [Tue, 8 Jun 2021 14:48:52 +0000 (10:48 -0400)]
Multi-target RuntimeConfigParser Task (#53827)

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

The props were not taking into account the right paths.

3 years agoSockets.tests: TcpReceiveSendGetsCanceledByDispose: remove Timeout. (#52599)
Tom Deseyn [Tue, 8 Jun 2021 14:47:16 +0000 (16:47 +0200)]
Sockets.tests: TcpReceiveSendGetsCanceledByDispose: remove Timeout. (#52599)

* Sockets.tests: TcpReceiveSendGetsCanceledByDispose: remove Timeout.

This timeout is not needed and masks a more useful exception thrown
by the test.

* Add WaitAsync to timeout on all async operations

* Add missing timeout

3 years agoadd support for unwinding function fragments in the dac (#53765)
David Mason [Tue, 8 Jun 2021 09:55:52 +0000 (02:55 -0700)]
add support for unwinding function fragments in the dac (#53765)

3 years ago[libraries] Fix metadata name following arcade change to stop supporting multiple...
Mitchell Hwang [Tue, 8 Jun 2021 07:23:54 +0000 (03:23 -0400)]
[libraries] Fix metadata name following arcade change to stop supporting multiple targets in helix sdk (#53828)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years ago[main] Update dependencies from dotnet/runtime dotnet/hotreload-utils dotnet/xharness...
dotnet-maestro[bot] [Tue, 8 Jun 2021 02:53:35 +0000 (02:53 +0000)]
[main] Update dependencies from dotnet/runtime dotnet/hotreload-utils dotnet/xharness (#53787)

[main] Update dependencies from dotnet/runtime dotnet/hotreload-utils dotnet/xharness

3 years agoAdd more iterators to JIT (#52515)
Bruce Forstall [Mon, 7 Jun 2021 23:16:51 +0000 (16:16 -0700)]
Add more iterators to JIT (#52515)

Add more iterators compatible with range-based `for` syntax for various data structures. These iterators all assume (and some check) that the underlying data structures determining the iteration are not changed during the iteration. For example, don't use these to iterate over the predecessor edges if you are changing the order or contents of the predecessor edge list.

- BasicBlock: iterate over all blocks in the function, a subset starting not at the first block, or a specified range of blocks. Removed uses of the `foreach_block` macro. E.g.:
```
for (BasicBlock* const block : Blocks()) // all blocks in function
for (BasicBlock* const block : BasicBlockSimpleList(fgFirstBB->bbNext)) // all blocks starting at fgFirstBB->bbNext
for (BasicBlock* const testBlock : BasicBlockRangeList(firstNonLoopBlock, lastNonLoopBlock)) // all blocks in range (inclusive)
```

- block predecessors: iterate over all predecessor edges, or all predecessor blocks, e.g.:
```
for (flowList* const edge : block->PredEdges())
for (BasicBlock* const predBlock : block->PredBlocks())
```

- block successors: iterate over all block successors using the `NumSucc()/GetSucc()`, or `NumSucc(Compiler*)/GetSucc(Compiler*)` pairs, e.g.:
```
for (BasicBlock* const succ : Succs())
for (BasicBlock* const succ : Succs(compiler))
```
Note that there already exists the "AllSuccessorsIter" which iterates over block successors including possible EH successors, e.g.:
```
for (BasicBlock* succ : block->GetAllSuccs(m_pCompiler))
```

- switch targets, (namely, the successors of `BBJ_SWITCH` blocks), e.g.:
```
for (BasicBlock* const bTarget : block->SwitchTargets())
```

- loops blocks: iterate over all the blocks in a loop, e.g.:
```
for (BasicBlock* const blk : optLoopTable[loopInd].LoopBlocks())
```

- Statements: added an iterator shortcut for the non-phi statements, e.g.:
```
for (Statement* const stmt : block->NonPhiStatements())
```
Note that there already exists an iterator over all statements, e.g.:
```
for (Statement* const stmt : block->Statements())
```

- EH clauses, e.g.:
```
for (EHblkDsc* const HBtab : EHClauses(this))
```

- GenTree in linear order (but not LIR, which already has an iterator), namely, using the `gtNext` links, e.g.:
```
for (GenTree* const call : stmt->TreeList())
```

This is a no-diff change.

3 years ago[mono][wasm] Avoid AOTing methods with clauses, use the interpreter instead. (#52883)
Zoltan Varga [Mon, 7 Jun 2021 23:02:04 +0000 (19:02 -0400)]
[mono][wasm] Avoid AOTing methods with clauses, use the interpreter instead. (#52883)

3 years agoResolving ILLink warnings on Microsoft.Extensions.Options.ConfigurationManager (...
Jose Perez Rodriguez [Mon, 7 Jun 2021 22:25:38 +0000 (15:25 -0700)]
Resolving ILLink warnings on Microsoft.Extensions.Options.ConfigurationManager (#53552)

* Resolving ILLink warnings on Microsoft.Extensions.Options.ConfigurationManager

* Fix message

* Addressing messages feedback

* Update src/libraries/Microsoft.Extensions.Logging.Configuration/ref/Microsoft.Extensions.Logging.Configuration.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update remaining messages with suggestion.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoFix superpmi.py/jitrollingbuild.py to handle large REST results (#53750)
Bruce Forstall [Mon, 7 Jun 2021 22:00:52 +0000 (15:00 -0700)]
Fix superpmi.py/jitrollingbuild.py to handle large REST results (#53750)

The Azure Storage REST API returns a maximum of 5000 results in
a single query. We have more results in the JIT rolling build set,
so we weren't finding queried git_hash values.

Generalize the query to loop using the "marker" continuation functionality.

We currently have about 800 superpmi collections results, but update
the superpmi.py script similarly for future proofing.

I also changed the query used by jitrollingbuild.py to specify a prefix,
to avoid requiring so many results. Probably should do the same thing for
SuperPMI collections. The downside is the REST api doesn't have a facility
for the prefix to be case-insensitive. I think it's ok to be case-sensitive,
but we'd need to verify that.

3 years agoThrow ArgumentNull instead of NullReference for null requests (#53742)
Miha Zupan [Mon, 7 Jun 2021 21:54:00 +0000 (23:54 +0200)]
Throw ArgumentNull instead of NullReference for null requests (#53742)

* Throw ArgumentNull instead of NullReference for null requests

* Don't use Send on browser

3 years agoAdd PlatformNeutralAssembly property for targeted builds of cross platform assembly...
Buyaa Namnan [Mon, 7 Jun 2021 21:48:17 +0000 (14:48 -0700)]
Add PlatformNeutralAssembly property for targeted builds of cross platform assembly (#53626)

3 years ago[main] Update dependencies from dnceng/internal/dotnet-optimization (#53672)
dotnet-maestro[bot] [Mon, 7 Jun 2021 21:12:38 +0000 (21:12 +0000)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#53672)

[main] Update dependencies from dnceng/internal/dotnet-optimization

3 years agoCreate Sdk.props in AOT compilers with a template (#53685)
Jo Shields [Mon, 7 Jun 2021 21:09:38 +0000 (17:09 -0400)]
Create Sdk.props in AOT compilers with a template (#53685)

* Create Sdk.props in AOT compilers with a template

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

Example:

```
sudo cat Sdk/Sdk.props
<Project>
  <ItemGroup>
    <MonoAotCrossCompilerPath Include="$(MSBuildThisFileDirectory)..\tools\mono-aot-cross" RuntimeIdentifier="iossimulator-arm64" />
  </ItemGroup>
</Project>
```

3 years agoImplement descr_generations_to_profiler for regions (#53706)
Andrew Au [Mon, 7 Jun 2021 21:03:16 +0000 (14:03 -0700)]
Implement descr_generations_to_profiler for regions (#53706)

3 years agoAdd string.ReplaceLineEndings and MemoryExtensions.EnumerateLines (#53115)
Levi Broderick [Mon, 7 Jun 2021 20:29:51 +0000 (13:29 -0700)]
Add string.ReplaceLineEndings and MemoryExtensions.EnumerateLines (#53115)

3 years agoRemove HarvestVersionValidation from pkg testing (#53818)
Viktor Hofer [Mon, 7 Jun 2021 20:26:48 +0000 (22:26 +0200)]
Remove HarvestVersionValidation from pkg testing (#53818)

* Remove HarvestVersionValidation from pkg testing

As packages assets aren't redistributed anymore, harvesting doesn't need to rely on exact versions and thus the task isn't necessary anymore.

3 years agoChange package testing to use RuntimeTargets rather than RID-specific restore (#53575)
Eric StJohn [Mon, 7 Jun 2021 20:11:29 +0000 (13:11 -0700)]
Change package testing to use RuntimeTargets rather than RID-specific restore (#53575)

* Change package testing to use RuntimeTargets rather than RID-specific restore

* Upload binlogs for package testing

* Address feedback

Simplify outer build of package tests to just use InnerTargets extension point.

Use Helix's work-item isolated packages folder

Give a better name to binlogs

* Cleanup old suppressions

* Use ReferenceCopyLocalPaths for runtime testing

This item will be conflict-resolved whereas RuntimeCopyLocalItems was not.

Also fix the case where a package intentionally provides no assets (yet installs)

* Don't include runtime dependencies when reference was excluded by conflict resolution

* Fix import conventions in outer build

* Workaround conflict resolution on .NETStandard runtime

.NETStandard doesn't conflict resolve runtime assets.
Workaround by feeding .NETStandard references as runtime for purposes of conflict resolution.

3 years ago[mono] Avoid some unnecessary null checks in wrappers using the .no opcode prefix...
Zoltan Varga [Mon, 7 Jun 2021 18:53:01 +0000 (14:53 -0400)]
[mono] Avoid some unnecessary null checks in wrappers using the .no opcode prefix. (#53817)

3 years agoUpdate the Compatibility package for Cng (#53816)
Viktor Hofer [Mon, 7 Jun 2021 18:31:50 +0000 (20:31 +0200)]
Update the Compatibility package for Cng (#53816)

The `System.Security.Cryptography.Cng` package doesn't built live anymore.

3 years agoAdd runtime test logs to HELIX_WORKITEM_UPLOAD_ROOT (#53798)
Fan Yang [Mon, 7 Jun 2021 18:14:16 +0000 (14:14 -0400)]
Add runtime test logs to HELIX_WORKITEM_UPLOAD_ROOT (#53798)

3 years agoAdd ChannelReader<T>.CanPeek/TryPeek (#53436)
Stephen Toub [Mon, 7 Jun 2021 16:52:49 +0000 (12:52 -0400)]
Add ChannelReader<T>.CanPeek/TryPeek (#53436)

3 years agoUse HMAC one-shot where appropriate
Kevin Jones [Mon, 7 Jun 2021 16:51:44 +0000 (12:51 -0400)]
Use HMAC one-shot where appropriate

3 years agoAlt-Svc tests enabled and fixed for H/3 (#53786)
Marie Píchová [Mon, 7 Jun 2021 16:40:11 +0000 (18:40 +0200)]
Alt-Svc tests enabled and fixed for H/3 (#53786)

* Alt-Svc tests enabled and fixed for H/3

* Addressed feedback.

3 years agoAdded some logic to include rcwrefcache references required by feature_comwrappers...
alesomas [Mon, 7 Jun 2021 16:17:36 +0000 (18:17 +0200)]
Added some logic to include rcwrefcache references required by feature_comwrappers (#53503)

* Set rcwrefcache related references only for feature_comwrappers

Co-authored-by: Ubuntu <creditsuisse@BuildVM.hqykqmymov3ebcqudt35mscinc.ax.internal.cloudapp.net>
3 years agoRevert "Reenable a disabled test. (#53779)" (#53791)
Sergey Andreenko [Mon, 7 Jun 2021 15:39:13 +0000 (08:39 -0700)]
Revert "Reenable a disabled test. (#53779)" (#53791)

This reverts commit 2e7e66d3be35861e39c2043f8be921622bc05ec8.

3 years agoFixed copy-paste error. (#53801)
Marie Píchová [Mon, 7 Jun 2021 12:36:04 +0000 (14:36 +0200)]
Fixed copy-paste error. (#53801)

3 years agoallow late certificate with disabled renegotiation (#53719)
Tomas Weinfurt [Mon, 7 Jun 2021 09:54:30 +0000 (11:54 +0200)]
allow late certificate with disabled renegotiation (#53719)

3 years ago[mono] Disable null checks in ghsaredvt wrappers, they are not needed, (#53775)
Zoltan Varga [Mon, 7 Jun 2021 08:23:05 +0000 (04:23 -0400)]
[mono] Disable null checks in ghsaredvt wrappers, they are not needed, (#53775)

and they take up a lot of space since these wrappers are very common.