platform/upstream/dotnet/runtime.git
3 years agoFixup ArgumentOutOfRangeException (#54161)
Pranav K [Mon, 14 Jun 2021 19:44:38 +0000 (12:44 -0700)]
Fixup ArgumentOutOfRangeException (#54161)

3 years agoFix NTLM authentication from macOS to Windows machines (#54101)
Filip Navara [Mon, 14 Jun 2021 15:41:55 +0000 (17:41 +0200)]
Fix NTLM authentication from macOS to Windows machines (#54101)

* Fix NTLM authentication from macOS to Windows machines

The GSSAPI implementation on macOS has partially broken NTLM implementation. It only supports NTLMv2 with the message integrity code (MIC) as specified by the MS-NLMP specification. The MIC is calculated using HMAC-MD5 authentication code over the exchanged NTLM messages with a key named ExportedSessionKey. The proper generation of ExportedSessionKey requires the implementation to negotiate correct capabilities, namely NTLMSSP_NEGOTIATE_KEY_EXCH and at least one of NTLMSSP_NEGOTIATE_SIGN or NTLMSSP_NEGOTIATE_SEAL flags. By default the macOS implementation negotiates NTLMSSP_NEGOTIATE_KEY_EXCH and sends MIC but fails to set one of the additional flags that would make the key exchange valid. This results in violation of the following part of the NTLM specification:

"A session key MUST always exist to generate the MIC (section 3.1.5.1.2) in the authenticate message. NTLMSSP_NEGOTIATE_ALWAYS_SIGN MUST be set in the NEGOTIATE_MESSAGE to the server and the CHALLENGE_MESSAGE to the client."

Adding the GSS_C_INTEG_FLAG flag forces macOS to properly negitiate all the necessary flags (NTLMSSP_NEGOTIATE_ALWAYS_SIGN and NTLMSSP_NEGOTIATE_SIGN) to make the MIC exchange valid. This in turn enables the whole NTLM exchange to be recognized as valid by Windows server side.

The gss-ntlmssp package on Linux interprets the GSS_C_INTEG_FLAG flag as additional negotiation of NTLMSSP_NEGOTIATE_SIGN and NTLMSSP_NEGOTIATE_KEY_EXCH. That should not hurt anything and in fact it may improve security depending on specific configuration. The flag was already specified when NTLM was used by System.Net.Mail.SmtpClient.

* Add temporary test to verify NTLM and Negotiate connections from all platforms

Notably this is expected to fail on Android and tvOS where GSSAPI is not available.

The test machine is single purpose virtual machine running in Azure with clean Windows Server 2019 installation and all the patches. It hosts IIS with single static page behind an NT authentication. The test account and the machine itself is disposable and does NOT contain any sensitive data. Nevertheless I don't expect this test to be merged.

* Use full domain name in test credentials

* Revert "Use full domain name in test credentials"

This reverts commit ea4dc615824c207845628143addc7d8c774ce702.

* Revert "Add temporary test to verify NTLM and Negotiate connections from all platforms"

This reverts commit abf44ce1430edf631fe74b15d354eca9073b4c83.

3 years agoSet the async local just before execution (#54133)
David Fowler [Mon, 14 Jun 2021 15:18:45 +0000 (08:18 -0700)]
Set the async local just before execution (#54133)

* Set the async local just before execution.
- Subscribing to DiagnosticListener.AllListeners replays all created DiagnosticListener instances. Because of this, we need to set the async local just before the execution of the entry point so that we only collect the events that are relevant to the call. Right now, it's also firing with the async local set pre-maturely.
- Wrote a concurrency test to make sure it's safe to instantiate the factory in parallel.

3 years agoMake JsonSerializer work when IsDynamicCodeSupported is false. (#54027)
Eric Erhardt [Mon, 14 Jun 2021 15:03:41 +0000 (10:03 -0500)]
Make JsonSerializer work when IsDynamicCodeSupported is false. (#54027)

Use the non-Emit codepath if IsDynamicCodeSupported is false.

3 years agoLogging Generator: messaging fix (#54080)
Jeff Layton [Mon, 14 Jun 2021 14:48:32 +0000 (10:48 -0400)]
Logging Generator: messaging fix (#54080)

3 years agoCleanup BitVector32 (#54097)
Huo Yaoyuan [Mon, 14 Jun 2021 13:15:06 +0000 (21:15 +0800)]
Cleanup BitVector32 (#54097)

* Cleanup BitVector32

* Cleanup Section.ToString

3 years ago[main] Update dependencies from mono/linker dotnet/runtime dotnet/arcade dnceng/inter...
dotnet-maestro[bot] [Mon, 14 Jun 2021 13:02:05 +0000 (13:02 +0000)]
[main] Update dependencies from mono/linker dotnet/runtime dotnet/arcade dnceng/internal/dotnet-optimization dotnet/xharness dotnet/hotreload-utils (#54060)

[main] Update dependencies from mono/linker dotnet/runtime dotnet/arcade dnceng/internal/dotnet-optimization dotnet/xharness dotnet/hotreload-utils

3 years agoChange `pThisRef->GetMethodTable()` to `pThisMT`. (#54138)
Takym (たかやま) [Mon, 14 Jun 2021 11:46:13 +0000 (20:46 +0900)]
Change `pThisRef->GetMethodTable()` to `pThisMT`. (#54138)

3 years ago[wasm] Clarify which parts are for mac users (#54135)
Radek Doulik [Mon, 14 Jun 2021 11:07:08 +0000 (13:07 +0200)]
[wasm] Clarify which parts are for mac users (#54135)

3 years ago[MacCatalyst][libraries] Skip Crashing test suites (#53625)
Mitchell Hwang [Mon, 14 Jun 2021 09:03:30 +0000 (05:03 -0400)]
[MacCatalyst][libraries] Skip Crashing test suites (#53625)

* [MacCatalyst][libraries] Skip Crashing test suites

* Fix typos

* Add System.Linq.Parallel skip AppCrash

* Add Amore arm64 flakes

* Add additional App Launch Failure skip

* Add System.IO.UnmanagedMemoryStream.Tests skip

* Add more tests failing to app launch failures

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoUpdate dependencies from https://github.com/mono/linker build 20210610.3 (#54061)
dotnet-maestro[bot] [Mon, 14 Jun 2021 08:57:38 +0000 (10:57 +0200)]
Update dependencies from https://github.com/mono/linker build 20210610.3 (#54061)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21308.1 -> To Version 6.0.100-preview.6.21310.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoAlways build with hot reload support (in a component) (#54124)
Aleksey Kliger (λgeek) [Mon, 14 Jun 2021 08:50:00 +0000 (04:50 -0400)]
Always build with hot reload support (in a component) (#54124)

Get rid of the ENABLE_METADATA_UPDATE ifdef.  To disable hot reload,
don't include the component in the runtime

3 years agoRemove allocation from MsQuicAddressHelpers.IPEndPointToINet (#54095)
Austin Wise [Mon, 14 Jun 2021 08:10:24 +0000 (01:10 -0700)]
Remove allocation from MsQuicAddressHelpers.IPEndPointToINet (#54095)

Assuming that GetAddressBytes() does not have side effects, this call
should not be needed.

Clean up from dotnet/runtime#53461

3 years agoFix ILVerify dependencies (#54112)
Jan Kotas [Mon, 14 Jun 2021 05:37:21 +0000 (22:37 -0700)]
Fix ILVerify dependencies (#54112)

- Update ILVerify to build for NetCoreAppToolCurrent

3 years ago[mono] Reenable some amd64 intrinsic tests, enable amd64 ISA extensions when AOTing...
imhameed [Sun, 13 Jun 2021 22:49:59 +0000 (15:49 -0700)]
[mono] Reenable some amd64 intrinsic tests, enable amd64 ISA extensions when AOTing, several intrinsics fixes (#53752)

Changes:

* Consolidate SSE shuffle constant unrolling

  Remove `OP_SSE2_SHUFFLE`, which is unused.

  Rename `OP_SSE_SHUFFLE` to `OP_SSE_SHUFPS`, to make this more consistent with
  the naming convention used for other SSE shuffles.

  Use `immediate_unroll_*` instead of hand-writing branch emission. These
  branch tables are huge (in the simplest case, with 256 different constant
  values, we can spend over 1KB of code on nothing but `shufps` and `jmp`s, and
  the cost gets worse if any tail duplication happens), and are currently
  emitted inline.  Future work ought to:

  1. use a sequence of extractelement/insertelement instructions, which can be
  optimized into a constant shuffle when the shuffle control parameter is
  constant, and otherwise generates a high-latency but low-code-size fallback
  (note that this only works for shuffles); or

  2. emit the fallback branch tables out of line and use `llvm.is.constant` to
  generate either a constant shuffle or a call to a fallback shuffle branch
  table function (the cost isn't too bad: a direct-call/ret pair would add ~4-5
  cycles and eat an RSB slot on top of the cost of the branch table).

  Fixes `JIT/HardwareIntrinsics/X86/Regression/GitHub_21855/GitHub_21855_r`.

* Fix intrinsification for MathF.Round

  `OP_SSE41_ROUNDS` takes two source registers, not one.

  TODO: Investigate what happens with `llvm.round` and
  `llvm.experimental.constrained.round`.

  Fixes `JIT/Intrinsics/MathRoundSingle_r`,
  `JIT/Math/Functions/Functions_r`, and
  `JIT/Performance/CodeQuality/Math/Functions/Functions`.

* Clean up intrinsic group lookup

  Use a dummy never-supported intrinsic group as a default fallback, instead of
  adding a special-case "intrinsic group not present" branch

  Correctly intrinsify get_IsSupported even when not using LLVM

  Fixes spurious `System.PlatformNotSupportedException`s when calling
  `get_IsSupported` when the LLVM backend isn't being used.

* The "not" SSE comparions are unordered, so use the appropriate unordered LLVM
  IR comparisons

  Add labeled constants for the immediate parameter we pass to CMPSS/CMPSD.

  Fixes `Regressions.coreclr/GitHub_34094/Test34094`.

* Fix `LoadAndDuplicateToVector128`

  `LoadAndDuplicateToVector128` should load exactly one 8-byte value from memory
  before broadcasting it into both lanes in a 128-bit result vector.

  Fixes `JIT/HardwareIntrinsics/X86/Sse3/LoadAndDuplicateToVector128_r`.

* Implement constant unrolling for `Sse41.DotProduct`

  As with shuffles, the fallback jump table should probably be kept out of line
  someday; `vdpps` uses 6 bytes of space, so any fallback jump table for the
  selection control mask will be at least 1.5kb large.

  Fixes `JIT/HardwareIntrinsics/X86/Sse41/DotProduct_r`.

* Implement constant unrolling for `Sse41.Blend`

  The usual: big jump blobs should be out of line, possible to use
  extract/insertelement.

* Zero is part of the domain of `lzcnt` and shouldn't yield an undef.

  Use fully-defined `llvm.ctlz` when implementing `OP_LZCNT32/64`.

  Fixes `JIT/HardwareIntrinsics/X86/Regression/GitHub_21666/GitHub_21666_r`

* Unify amd64/arm64 vector extraction handling

  Removes `OP_EXTRACT_U1` and `OP_EXTRACT_U2`. Instead, sign/zero extension is
  determined via `inst_c1` for `OP_EXTRACT_*` and `OP_XEXTRACT_*` (and
  `OP_EXTRACTX_U2`, which doesn't seem to be generated as part of intrinsic
  translation), which must be set to a MonoTypeEnum.

  Replaces `OP_EXTRACT_VAR_*` with `OP_XEXTRACT_*`.

  Fixes `JIT/Regression/JitBlue/GitHub_23159/GitHub_23159` and
  `JIT/Regression/JitBlue/GitHub_13568/GitHub_13568`.

* Remove `OP_DPPS`; it is unused

* Disable `JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840` when running with mono LLVM AOT

* Disable finalizearray when running with mono LLVM AOT

* Disable Vector256_1/Vector128_1 tests on wasm

* Enable sse4.2, popcnt, lzcnt, bmi, and bmi2 when AOT compiling the runtime
  tests.

* Pass the runtime variant to `helixpublishwitharcade.proj`, and forward this
  runtime variant to testenvironment.proj.

  This is used to selectively enable LLVM JIT on the LLVM AOT lanes. Removes
  the hack added to CLRTest.Execute.Bash.targets that did this for arm64 (which
  happens to only have an LLVM AOT lane for runtime tests right now).

* Enable `JIT/HardwareIntrinsics/General/Vector128_1/**`,
  `JIT/HardwareIntrinsics/General/Vector256/**`,
  `JIT/HardwareIntrinsics/General/Vector256_1/**`, and
  `JIT/HardwareIntrinsics/X86/General/IsSupported*/**` for LLVM AOT on amd64.

3 years agoInfrastructure: correct dependencies and clean helix agent from stray corerun procs...
Juan Hoyos [Sun, 13 Jun 2021 20:54:05 +0000 (13:54 -0700)]
Infrastructure: correct dependencies and clean helix agent from stray corerun procs (#54094)

* Add dependency on coreclr in monojit/monointerpreter jobs explicitly to solve pipeline issue #53842
* Use Helix Pre/Post hooks to kill linkering corerun instances to work around ARM64 agent issues

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
3 years agoFix profiler\gc\gcbasic test to work with SVR GC on many cores. (#54057)
Peter Sollich [Sun, 13 Jun 2021 15:25:30 +0000 (17:25 +0200)]
Fix profiler\gc\gcbasic test to work with SVR GC on many cores. (#54057)

Problem was that we had a fixed size buffer (32 entries), and we may have way more generation bounds than that, especially with regions.

Fix is to heap allocate the buffer if the size of the buffer on the stack is exceeded.

3 years agoPort IsRedundantMov to xarch (#54075)
Tanner Gooding [Sun, 13 Jun 2021 05:25:47 +0000 (22:25 -0700)]
Port IsRedundantMov to xarch (#54075)

* Port IsRedundantMov to xarch

* Applying formatting patch

* Responding to PR feedback

3 years agofix ConnectWithCertificateChain quic test (#54026)
Tomas Weinfurt [Sat, 12 Jun 2021 14:26:08 +0000 (16:26 +0200)]
fix ConnectWithCertificateChain quic test (#54026)

3 years agoUnify macOS ARM64 write protection holders with W^X ones (#54067)
Jan Vorlicek [Sat, 12 Jun 2021 07:54:58 +0000 (09:54 +0200)]
Unify macOS ARM64 write protection holders with W^X ones (#54067)

* Unify macOS ARM64 write protection holders with W^X ones

This change removes the original holders that were added for changing
memory protection for executable code and moves the actual switching to
the recently added W^X holders.

The unixexports files don't support target specific symbols. So I needed
to export a dummy version of the PAL_JitWriteProtect for macOS x64.

3 years agoScope events to the execution of the entry point (#54090)
David Fowler [Sat, 12 Jun 2021 06:09:46 +0000 (23:09 -0700)]
Scope events to the execution of the entry point (#54090)

* Scope events to the execution of the entry point
- Today we're using the global event source and events that fire in the app domain get captured and this can result in capturing the wrong instances. This fix uses an async local to scope the events for the HostingEventListener to the execution of the application's entry point.
- Removed the RemoteExecutor as a result of this change
- Remove RequirementsMet property

3 years ago[mono] Componentize hot reload (#52866)
Aleksey Kliger (λgeek) [Sat, 12 Jun 2021 04:32:57 +0000 (00:32 -0400)]
[mono] Componentize hot reload (#52866)

* Move most of the code to hot_reload.c

For the fast path data, we will leave a struct in the runtime with the values
and pass its address to the component to fill in.

* Mark functions used by hot reload with MONO_COMPONENT_API

* Drop the metadata_update_init EE and runtime callbacks

They're unused now

* remove mono_ prefix from some static methods in hot reload

* Always define metadata_update_published runtime callback

* Move metadata update data out of MonoImage, into hot_reload component

Use separate baseline and delta structs for tracking updates

* move slowpath metadata lookup, and cleanup to hot_reload component

Move the delta_image and method_table_update data into BaselineInfo
and DeltaInfo.  Keep a single `MonoImage:has_updates` flag to switch
over to the slow path through the component.

* fixup: set has_updates on first update, too

Also setup the BaselineInfo and DeltaInfo earlier before the first
string heap lookup

* fixup after rebase

* ConsoleDelta sample: build on osx-arm64, use hotreload buildtool

instead of hotreload-delta-gen CLI tool

* fix whitespace

* bugfix - get the value of MonoImage:has_updates not its address

* Dynamically query runtime for GetApplyUpdateCapabilities

if the hot reload component is stubbed out, return empty capabilities.

This is a step toward removing FEATURE_METADATA_UPDATE and
ENABLE_METADATA_UPDATE defines and solely using component
infrastrucutre for controlling behavior

* Mark some runtime functions with MONO_COMPONENT_API

* fixup icall declaration

* fix whitespace and indentation

* Return capabilities if hot reload component is available, even if env var isn't set.

Match CoreCLR behavior.  Also makes our testsuite actually run the
tests (we check for capabilities before running setting
DOTNET_MODIFIABLE_ASSEMBLIES using the remote executor)

3 years agosimplify gh53564 test (#54081)
John Salem [Sat, 12 Jun 2021 00:23:58 +0000 (17:23 -0700)]
simplify gh53564 test (#54081)

3 years agoAdd support for IServiceProviderIsService (#54047)
David Fowler [Fri, 11 Jun 2021 22:11:50 +0000 (15:11 -0700)]
Add support for IServiceProviderIsService (#54047)

* Add support for IServiceProviderIsService
- This optional service lets consumers query to see if a service is resolvable without side effects (not having to explicitly resolve the service).
- Added new spec tests to verify the baseline behavior based on IServiceCollection features.
- Handle built in services as part of IsServce
- Special case built in services as part of the IsService check
- Make the tests part of the core DI tests and enable skipping via a property

Co-authored-by: Travis Illig <tillig@paraesthesia.com>
3 years ago[wasm][aot][tests] Disable tests causing crash - System.Text.Encoding… (#53971)
Ankit Jain [Fri, 11 Jun 2021 22:10:55 +0000 (18:10 -0400)]
[wasm][aot][tests] Disable tests causing crash - System.Text.Encoding… (#53971)

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoFix 54025 (#54070)
Steve MacLean [Fri, 11 Jun 2021 21:49:49 +0000 (17:49 -0400)]
Fix 54025 (#54070)

3 years agoFix Deflate/Brotli/CryptoStream handling of partial and zero-byte reads (#53644)
Stephen Toub [Fri, 11 Jun 2021 21:31:15 +0000 (17:31 -0400)]
Fix Deflate/Brotli/CryptoStream handling of partial and zero-byte reads (#53644)

Stream.Read{Async} is supposed to return once at least a byte of data is available, and in particular, if there's any data already available, it shouldn't block.  But Read{Async} on DeflateStream (and thus also GZipStream and ZLibStream), BrotliStream, and CryptoStream won't return until either it hits the end of the stream or the caller's buffer is filled.  This makes it behave very unexpectedly when used in a context where the app is using a large read buffer but expects to be able to process data as it's available, e.g. in networked streaming scenarios where messages are being sent as part of bidirectional communication.

This fixes that by stopping looping once any data is consumed.  Just doing that, though, caused problems for zero-byte reads.  Zero-byte reads are typically used by code that's trying to delay-allocate a buffer for the read data until data will be available to read.  At present, however, zero-byte reads return immediately regardless of whether data is available to be consumed.  I've changed the flow to make it so that zero-byte reads don't return until there's at least some data available as input to the inflater/transform (this, though, doesn't 100% guarantee the inflater/transform will be able to produce output data).

Note that both of these changes have the potential to introduce breaks into an app that erroneously depended on these implementation details:
- If an app passing in a buffer of size N to Read{Async} depended on that call always producing the requested number of bytes (rather than what the Stream contract defines), they might experience behavioral changes.
- If an app passing in a zero-byte buffer expected it to return immediately, it might instead end up waiting until data was actually available.

3 years agoExpose RoundUpToPowerOf2 (#53992)
Huo Yaoyuan [Fri, 11 Jun 2021 21:17:50 +0000 (05:17 +0800)]
Expose RoundUpToPowerOf2 (#53992)

* 32bit

* 64bit

* Expose in public api

* Unit test

* Add more tests

* Use in test

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoImprove dotnet-pgo output and fix null type handles (#53494)
Jakob Botsch Nielsen [Fri, 11 Jun 2021 21:00:20 +0000 (23:00 +0200)]
Improve dotnet-pgo output and fix null type handles (#53494)

* Improve dotnet-pgo output and fix null type handles

* When comparing .mibc files, find a unique name to print for both files
  by repeatedly appending another parent directory on it.

* When comparing .mibc files, print a comparison of type handle
  histogram data

* Fix a potential division by zero

* Print some info when producing .mibc that are based on samples/LBR
  data

* Fix .mibc read type handles with value 0 to actually return IsNull

* Use different devirt threshold for interfaces and classes

* Add ClassProfileFlags to PgoFormat.cs

3 years ago[mono][llvm] Remove some dead code. (#53920)
Zoltan Varga [Fri, 11 Jun 2021 20:33:32 +0000 (16:33 -0400)]
[mono][llvm] Remove some dead code. (#53920)

3 years agoFix mismatch between morph and lower (#53911)
Bruce Forstall [Fri, 11 Jun 2021 18:42:33 +0000 (11:42 -0700)]
Fix mismatch between morph and lower (#53911)

For x86 delegate invoke tailcall via helper calls,
Lower expects the `this` pointer in a LCL_VAR. Morph
(`fgMorphTailCallViaJitHelper`) was letting a LCL_FLD go through
instead of inserting a copy of the field to a temp local.

Simply change the condition in morph to match the condition in Lower.

Fixes #53568

3 years agoReenable 48786 (#54028)
Steve MacLean [Fri, 11 Jun 2021 18:11:28 +0000 (14:11 -0400)]
Reenable 48786 (#54028)

Reenable tests disabled for issue 48786

This should be fixed now that we have moved to crossgen2

3 years agomake MsQuicStatusCodes platform specific (#54031)
Tomas Weinfurt [Fri, 11 Jun 2021 18:02:54 +0000 (20:02 +0200)]
make MsQuicStatusCodes platform specific (#54031)

* make MsQuicStatusCodes platform specific

* add missing StreamLimit

3 years agoRe-enabled mock tests for H/3. (#53802)
Marie Píchová [Fri, 11 Jun 2021 17:57:51 +0000 (19:57 +0200)]
Re-enabled mock tests for H/3. (#53802)

* Re-enabled mock tests for H/3.

* Used IsMockQuicSupported to run the mock tests only on supported platforms.

* Disabling mock test completely.

* Hanging test fix experiment.

* Disabled some mock tests failing in CI.

3 years agoFix assertion on debugger-engine (#54041)
Thays Grazia [Fri, 11 Jun 2021 16:58:33 +0000 (13:58 -0300)]
Fix assertion on debugger-engine (#54041)

Sync to mono/mono #21100

3 years agoUpdate dotnet SDK to 6.0 Preview 4 (#53808)
Viktor Hofer [Fri, 11 Jun 2021 16:55:09 +0000 (18:55 +0200)]
Update dotnet SDK to 6.0 Preview 4 (#53808)

* Update dotnet SDK to 6.0 Preview 4

Update the minimum and target version of the SDK to 6.0 Preview 4.

Part of https://github.com/dotnet/runtime/issues/53411

* Switch to using eng/targetingpacks.targets for redirecting runtime pack location in src/mono/sample

* Fix binder tracing tests

* Set UseMonoRuntime property so the dotnet SDK can pull the mono runtime packs

This is necessary after the changes from https://github.com/dotnet/sdk/pull/16909.

* Move UseMonoRuntimeProperty and set it to false in coreclr

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
3 years agoVector.Sum(Vector<T>) API implementation for horizontal add. (#53527)
Ivan Zlatanov [Fri, 11 Jun 2021 16:50:09 +0000 (19:50 +0300)]
Vector.Sum(Vector<T>) API implementation for horizontal add. (#53527)

* Vector.Sum(Vector<T>) API implementation for horizontal add.

* Fixed inccorrect referece to Arm64 AddAccross intrinsic function.

* Added implementation for hardware accelerated Vector<T>.Sum for long, ulong, float, double on ARM64.

* Fixed formatting issue.

* Correctness.

* Fixed compiler error for ARM64.

* Formatting issue.

* More explicit switch statement. Fixed wrong simd size for NI_Vector64_ToScalar.

* Fixed auto formatting issue.

* Use AddPairwiseScalar for double, long and ulong on ARM64 for VectorT128_Sum.

* Forgot ToScalar call after AddPairwiseScalar.

* Fixed wrong return type.

3 years agoAllow UsingBrowserRuntimeWorkload to be disabled from the project file (#52728)
Pranav K [Fri, 11 Jun 2021 16:40:50 +0000 (09:40 -0700)]
Allow UsingBrowserRuntimeWorkload to be disabled from the project file (#52728)

3 years agoIncrease timeouts for PGO tests (#54030)
Andy Ayers [Fri, 11 Jun 2021 16:15:43 +0000 (09:15 -0700)]
Increase timeouts for PGO tests (#54030)

3 years agoRemoved extraneous closing parentheses causing compile errors. (#54064)
Peter Sollich [Fri, 11 Jun 2021 15:57:05 +0000 (17:57 +0200)]
Removed extraneous closing parentheses causing compile errors. (#54064)

3 years agoFollow up on HostFactoryResolver changes (#54052)
David Fowler [Fri, 11 Jun 2021 15:29:39 +0000 (08:29 -0700)]
Follow up on HostFactoryResolver changes (#54052)

- Cleaned up the comments to explain what ResolveHostFactory does.
- Added entry point completed callback to let callers know when the entry point code is done running.
- Added tests for the various callbacks.

3 years ago[HTTP/3] Fix #53632 by using original host when omitted (#53648)
TimTim [Fri, 11 Jun 2021 14:08:57 +0000 (22:08 +0800)]
[HTTP/3] Fix #53632 by using original host when omitted (#53648)

* Fix #53632

* Annotate non-nullable _originAuthority

* Test inheriting original host for HTTP/3 Alt-Svc

3 years agoMake some Brotli p/invokes blittable (#54029)
Elinor Fung [Fri, 11 Jun 2021 13:51:11 +0000 (06:51 -0700)]
Make some Brotli p/invokes blittable (#54029)

* Make some Brotli p/invokes blittable

* Use Interop.BOOL

3 years agoComActivator tests with built-in COM disabled (#53733)
Lakshan Fernando [Fri, 11 Jun 2021 11:03:14 +0000 (04:03 -0700)]
ComActivator tests with built-in COM disabled (#53733)

* ComActivator tests with built-in COM disabled

* Added negative scnearios with built-in com disabled

* FB

* FB

* FB

* Update src/tests/Interop/COM/Activator/Program.cs

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
3 years ago[interp] Fix loading of ThreadStatic value types (#53391)
Vlad Brezae [Fri, 11 Jun 2021 08:10:27 +0000 (11:10 +0300)]
[interp] Fix loading of ThreadStatic value types (#53391)

* [interp] Fix loading of ThreadStatic value types

* Add runtime test for ThreadStatic valuetype access

3 years ago[interp] Fix IL offset tracking of inlined bblocks (#53989)
Vlad Brezae [Fri, 11 Jun 2021 08:09:36 +0000 (11:09 +0300)]
[interp] Fix IL offset tracking of inlined bblocks  (#53989)

* [interp] Fix il offset tracking of inlined bblocks

During method compilation we maintain the `td->offset_to_bb` array that maps an IL offset to the bblock that contains generated code for those IL instructions. When a bblock is removed, we update this mapping so it no longer points to the removed bblock (even if those IL offsets are unreachable, we might still query them to get ranges for EH clauses). For bblocks that were added during inlining, their `bb->ip` didn't point to code inside the original transformed method, so we failed to remove them from `offset_to_bb` array. Once we finish inlining a method, we update the il_offsets of all newly added basic blocks.

* [interp] Correctly update il offset mapping for merged bblocks

If il_offset1 belongs to BB2 and BB2 is merged into BB1 (BB1->next_bb == BB2), then, once BB2 is removed, il_offset1 should belong to BB1 and not to BB2->next_bb. While it's unclear if this leads to bugs, the previous behavior was conceptually wrong.

3 years agoIn gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if...
Peter Sollich [Fri, 11 Jun 2021 07:58:10 +0000 (09:58 +0200)]
In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled. (#53995)

In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled - otherwise the lower SOH generations may be skipped.

3 years agoAdd trimmer annotations to System.Data.Common (#52046)
Krzysztof Wicher [Fri, 11 Jun 2021 06:47:48 +0000 (08:47 +0200)]
Add trimmer annotations to System.Data.Common (#52046)

Add trimmer annotations to System.Data.Common

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoConsider reloadWeight while evaluating spill cost (#53853)
Kunal Pathak [Fri, 11 Jun 2021 06:32:17 +0000 (23:32 -0700)]
Consider reloadWeight while evaluating spill cost (#53853)

* Consider reloadWeight while evaluating spill cost

* fix linux arm issue

* jit format

3 years ago[wasm][aot] Enable tests that are passing now (#53977)
Ankit Jain [Fri, 11 Jun 2021 03:31:35 +0000 (23:31 -0400)]
[wasm][aot] Enable tests that are passing now (#53977)

* [wasm][aot] Enable tests that are passing now

These don't reproduce on `main` anymore, after the exceptions fix.

`System.Transactions.Locals.Tests` Fixes https://github.com/dotnet/runtime/issues/50969
`System.Threading.Tasks.Parallel.Tests` Fixes https://github.com/dotnet/runtime/issues/51677

* [wasm][aot][tests] Enable `System.Xml.Xsl.XslCompiledTransformApi.Tests`

This hasn't been crashing for quite some time.
The individual test failures are already disabled with
https://github.com/dotnet/runtime/issues/51244, and
https://github.com/dotnet/runtime/issues/51911 .

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

3 years agoEnable devirtualization in more scenarios on crossgen2 (#53567)
David Wrighton [Fri, 11 Jun 2021 00:43:26 +0000 (17:43 -0700)]
Enable devirtualization in more scenarios on crossgen2 (#53567)

Address deficiencies in current devirtualization infrastructure

- Remove the responsibility of creating a CORINFO_RESOLVED_TOKEN structure from the JIT and make it a responsibility of the VM side of the jit interface.
  - This enables the component (crossgen2) which has deeper understanding of the requirements here to correctly handle scenarios that would otherwise require expressing crossgen2 specific details across the jit interface.
- Add a new set of fixups (`READYTORUN_FIXUP_Check_VirtualFunctionOverride` and `READYTORUN_FIXUP_Verify_VirtualFunctionOverride`) these are used to validate that the behavior of the runtime and crossgen2 compiler is equivalent for a virtual resolution event
  - `READYTORUN_FIXUP_Check_VirtualFunctionOverride` will ensure that the virtual resolution decision is the same at crossgen2 time and runtime, and if the decision differs, any generated code affected by the decision will not be used.
  - `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` will perform the same checks as `READYTORUN_FIXUP_Check_VirtualFunctionOverride`, but if it fails the check, the process will be terminated with a fail-fast. It is intended for use under the `--verify-type-and-field-layout` stress mode.
  - Currently only the `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` is actually generated, and it is only generated when using the `--verify-type-and-field-layout` switch to crossgen2. Future work will identify if there are scenarios where we need to generate the `READYTORUN_FIXUP_Check_VirtualFunctionOverride` flag. One area of possible concern is around covariant returns, another is around handling of type equivalence.
- In order to express the fixup signature for the VirtualFunctionOverride fixups, a new flag has been added to `ReadyToRunMethodSigFlags`. `READYTORUN_METHOD_SIG_UpdateContext` will allow the method signature to internally specify the assembly which is associated with the method token, instead of relying on the ambient context.
- R2RDump and the ReadyToRun format documentation have been updated with the details of the new fixups/flags.
- Update the rules for handling unboxing stubs
  - See #51918 for details. This adds a new test, as well as proper handling for unboxing stubs to match the JIT behavior
  - Also revert #52605, which avoided the problem by simply disabling devirtualization in the presence of structs
- Adjust the rules for when it is legal to devirtualize and maintain version resiliency
  - The VersionsWithCode and VersionsWithType rules are unnecessarily restrictive.
  - Instead Validate that the metadata is safely checkable, and rely on the canInline logic to ensure that no IL that can't be handled is inlined.
  - This also involved adding a check that the chain of types from the implementation type to the declaration method table type is within the version bubble.
  - And changing the `VersionsWithType` check on the implementation type, to a new `VersionsWithTypeReference` check which can be used to validate that the type can be referred to, in combination with using `VersionsWithType` on the type definition.
  - By adjusting the way that the declMethod is referred to, it becomes possible to use the declMethod without checking the full method is `VersionsWithCode`, and it just needs a relationship to version matching code.
- In `resolveVirtualMethod` generate the `CORINFO_RESOLVED_TOKEN` structures for the jit
  - In particular we are now able to resolve to methods where the decl method is the resolution result but is not within the version bubble itself. This can happen if we can prove that the decl method is the only method which can possibly implement a virtual.
- Add support for devirtualization reasons to crossgen2
- Port all devirtualization abort conditions to crossgen2 from runtime that were not already present
- Fix devirtualization from a canonical virtual method when the actual implementation is more exact
- Fix variant interface override scenario where there is an interface that requires implementation of the variant interface as well as the variant interface itself.

3 years agoUse custom mobile testing API (#53871)
Fan Yang [Thu, 10 Jun 2021 23:22:56 +0000 (19:22 -0400)]
Use custom mobile testing API (#53871)

* Use custom Android testing API

* Fix for non-mobile cases

* Use Collection Fixtures for mobile only

* Update src/tests/Common/Coreclr.TestWrapper/MobileAppHandler.cs

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Update src/tests/Common/Coreclr.TestWrapper/MobileAppHandler.cs

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Update src/tests/run.proj

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Fix the ios app extension

* Add back Path and remove redundant namespace string

* Add missing class name Path

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
3 years ago[main] Update dependencies from dnceng/internal/dotnet-optimization (#53864)
dotnet-maestro[bot] [Thu, 10 Jun 2021 23:15:07 +0000 (23:15 +0000)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#53864)

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

3 years agosmall improvements to HTTP Cancellation Tests and rename (#54018)
Geoff Kizer [Thu, 10 Jun 2021 22:58:27 +0000 (15:58 -0700)]
small improvements to HTTP Cancellation Tests and rename (#54018)

* improve HttpClientHandler_Http11_Cancellation_Test and rename to SocketsHttpHandler_Http11_Cancellation_Test

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years ago[main] Update dependencies from dotnet/icu dotnet/llvm-project dotnet/runtime-assets...
dotnet-maestro[bot] [Thu, 10 Jun 2021 22:35:54 +0000 (00:35 +0200)]
[main] Update dependencies from dotnet/icu dotnet/llvm-project dotnet/runtime-assets dotnet/hotreload-utils (#53865)

* Update dependencies from https://github.com/dotnet/icu build 20210607.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-preview.6.21281.1 -> To Version 6.0.0-preview.6.21307.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 9.0.1-alpha.1.21281.1 -> To Version 11.1.0-alpha.1.21307.2

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20210607.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21305.2 -> To Version 1.0.1-alpha.0.21307.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20210607.1

System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21301.1 -> To Version 6.0.0-beta.21307.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 9.0.1-alpha.1.21281.1 -> To Version 11.1.0-alpha.1.21308.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoDon't reference the netstandard shim inside the shared framework (#53023)
Viktor Hofer [Thu, 10 Jun 2021 22:32:53 +0000 (00:32 +0200)]
Don't reference the netstandard shim inside the shared framework (#53023)

* Don't reference ns.dll inside shared framework

The netstandard.dll shim shouldn't be referenced inside the shared
framework as it's a compat shim that shouldn't be required to compose
the shared framework.

This removes the necessity of a separate RefPath build and improves
incremental build times as only the few OOB projects that require the
shim would need to rebuild.

* Reference netstandard shim in OOBs that require it

There are a few OOB projects that require the netstandard.dll shim as
they intentionally reference projects that only expose a netstandard
configuration.

Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
3 years agoHandle Counter Polling Interval of 0 (#53836)
John Salem [Thu, 10 Jun 2021 22:21:30 +0000 (15:21 -0700)]
Handle Counter Polling Interval of 0 (#53836)

3 years ago[main] Update dependencies from mono/linker (#53866)
dotnet-maestro[bot] [Thu, 10 Jun 2021 22:04:42 +0000 (22:04 +0000)]
[main] Update dependencies from mono/linker (#53866)

[main] Update dependencies from mono/linker

3 years agoMake the ZLib P/Invokes all blittable (#53968)
Aaron Robinson [Thu, 10 Jun 2021 21:58:39 +0000 (14:58 -0700)]
Make the ZLib P/Invokes all blittable (#53968)

* Make the ZLib P/Invokes all blittable

3 years ago[mono] Reenable the empty finally optimization. (#53965)
Zoltan Varga [Thu, 10 Jun 2021 21:27:42 +0000 (17:27 -0400)]
[mono] Reenable the empty finally optimization. (#53965)

3 years agoUse InvariantCulture when parsing with NumberStyles.None (#54004)
Stephen Toub [Thu, 10 Jun 2021 20:59:25 +0000 (16:59 -0400)]
Use InvariantCulture when parsing with NumberStyles.None (#54004)

The only time {U}Int{32/64}.TryParse needs to consult a culture is if it needs to look up the negative symbol from it, and if NumberStyles.None or NumberStyles.HexNumber are passed, it won't ever do that.  All such call sites benefit from using CultureInfo.InvariantCulture explicitly, as it's just a static field read, whereas passing in null causes the implementation to access CultureInfo.CurrentCulture, which incurs a thread-static read.  Most of our usage already does this, but a few sites don't; this fixes those.

3 years agoFix value number of a partial definition via IND. (#53753)
Sergey Andreenko [Thu, 10 Jun 2021 20:35:48 +0000 (13:35 -0700)]
Fix value number of a partial definition via IND. (#53753)

* Add a repro.

* small ref of `VNApplySelectorsAssignTypeCoerce`.

* Fix the bug.

* fix comment

* Update src/coreclr/jit/valuenum.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
* Update src/coreclr/jit/valuenum.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoFix Sysctl() in buffer size autodetection mode (#52824)
Vadim Zhukov [Thu, 10 Jun 2021 19:45:37 +0000 (22:45 +0300)]
Fix Sysctl() in buffer size autodetection mode (#52824)

* Fix Sysctl() in buffer size autodetection mode

The code private static unsafe void Sysct() in the
Interop/BSD/System.Native/Interop.Sysctl.cs has two flaws in the case
value == null && len == 0.

First, in case of failure, this code doesn't call FreeHGlobal() on the memory it
allocated right before. I.e., we have pure memory leak.

Second, the "I don't know how much memory is needed, please allocated it by
yourself" idea standing behind value == null && len == 0 assumes the Sysctl()
itself being responsible to avoid ENOMEM condition. It could happen when, for
example, we ask to list all processes in the system: this list could be expanded
between first and second actual sysctl() calls, making the second call fail. So
instead of a single try, we should try to allocate a bit more memory and try
again; not force all our callers to do this themselves, by catching
InvalidOperationException and analyzing it.

Fixes #52823

* add missing IntPtr <-> int casts

3 years ago[wasm][testing] Avoid using crypto in WASM HTTP unit tests (#53925)
Pavel Savara [Thu, 10 Jun 2021 18:05:24 +0000 (20:05 +0200)]
[wasm][testing] Avoid using crypto in WASM HTTP unit tests (#53925)

avoid using crypto in WASM unit tests so that we could cover more scenarios

3 years agoSimplify how CheckGCMode gets the Marshal type (#54000)
Michal Strehovský [Thu, 10 Jun 2021 17:25:33 +0000 (19:25 +0200)]
Simplify how CheckGCMode gets the Marshal type (#54000)

Unless I'm missing something, this is equivalent. The previous version was incomprehensible to static analysis.

3 years agoUpdate SuppressGCTransition test to work in single file (#54001)
Michal Strehovský [Thu, 10 Jun 2021 17:25:22 +0000 (19:25 +0200)]
Update SuppressGCTransition test to work in single file (#54001)

Assembly.Location is an empty string when published as a single file.

3 years agomoving arm excludes to crossgen2 (#53976)
Manish Godse [Thu, 10 Jun 2021 17:22:14 +0000 (10:22 -0700)]
moving arm excludes to crossgen2 (#53976)

3 years agoAdd JsonPropertyDictionary and associated refactoring (#53206)
Steve Harter [Thu, 10 Jun 2021 16:23:17 +0000 (11:23 -0500)]
Add JsonPropertyDictionary and associated refactoring (#53206)

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