platform/upstream/dotnet/runtime.git
12 months agoImprove text for OpenSsl primitives when OpenSSL is not available (#89046)
Kevin Jones [Tue, 18 Jul 2023 09:23:54 +0000 (05:23 -0400)]
Improve text for OpenSsl primitives when OpenSSL is not available (#89046)

* Improve text for OpenSsl primitives when OpenSSL is not available

* Update src/libraries/System.Security.Cryptography/src/Resources/Strings.resx

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

Co-authored-by: Stephen Toub <stoub@microsoft.com>
12 months agoAdd switch: Do not resolve URLs by defaults for XML (#84169)
Krzysztof Wicher [Tue, 18 Jul 2023 09:13:18 +0000 (11:13 +0200)]
Add switch: Do not resolve URLs by defaults for XML (#84169)

* Add switch: Do not resolve URLs by defaults for XML

* feedback, test

* rename switch per API review

* Apply missed feedback, fix test failure

* Fix typo in IgnoreEmptyKeySequences

Co-authored-by: David Cantú <dacantu@microsoft.com>
* Update src/libraries/System.Private.Xml/tests/TrimmingTests/XmlUrlResolverDefaults.IsNetworkingEnabledByDefault.cs

Co-authored-by: David Cantú <dacantu@microsoft.com>
---------

Co-authored-by: David Cantú <dacantu@microsoft.com>
12 months agoImplement support for `UnsafeAccessor` in the trimmer (#88268)
Vitek Karas [Tue, 18 Jul 2023 07:33:40 +0000 (00:33 -0700)]
Implement support for `UnsafeAccessor` in the trimmer (#88268)

The core of the change is that `UnsafeAccessor` creates a code dependency from the accessor method to the target specified by the attribute. The trimmer needs to follow this dependency and preserve the target. Additionally, because the trimmer operates at the IL level, it needs to make sure that the target will keep its name and some other properties intact (so that the runtime implementation of the `UnsafeAccessor` can still work).

Implementation choices:
* The trimmer will mark the target as "accessed via reflection", this is a simple way to make sure that name and other properties about the target are preserved. This could be optimized in the future, but the savings are probably not that interesting.
* The implementation ran into a problem when trying to precisely match the signature overload resolution. Due to Cecil issues and the fact that Cecil's resolution algorithm is not extensible, it was not possible to match the runtime's behavior without adding lot more complexity (currently it seems we would have to reimplement method resolution in the trimmer). So, to simplify the implementation, trimmer will mark all methods of a given name. This means it will mark more than necessary. This is fixable by adding more complexity to the code base if we think there's a good reason for it.
* Due to the above choices, there are some behavioral differences:
  * Trimmer will warn if the target has data flow annotations, always. There's no way to "fix" this in the code without a suppression.
  * Trimmer will produce different warning codes even if there is a true data flow mismatch - this is because it treats the access as "reflection access" which produces different warning codes from direct access.
  * These differences are fixable, but it was not deemed necessary right now.
* We decided that analyzer will not react to the attribute at all, and thus will not produce any diagnostics around it.

The guiding reason to keep the implementation simple is that we don't expect the unsafe accessor to be used by developers directly, instead we assume that vast majority of its usages will be from source generators. So, developer UX is not as important.

Test changes:
* Adds directed tests for the marking behavior
* Adds tests to verify that `Requires*` attributes behave correctly
* Adds tests to verify that data flow annotations behave as expected (described above)
* The tests are effectively a second validation of the NativeAOT implementation as they cover NativeAOT as well.

Fixes in CoreCLR/NativeAOT:
This change fixes one bug in the CoreCLR/NativeAOT implementation, unsafe accessor on a instance method of a value type must use "by-ref" parameter for the `this` parameter. Without the "by-ref" the accessor is considered invalid and will throw.
This change also adds some tests to the CoreCLR/NativeAOT test suite.

Part of https://github.com/dotnet/runtime/issues/86161.
Related to https://github.com/dotnet/runtime/issues/86438.
Feature design in https://github.com/dotnet/runtime/issues/81741.

12 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 222410...
dotnet bot [Tue, 18 Jul 2023 06:39:28 +0000 (08:39 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2224107 (#89058)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2223937

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2223937

12 months agoAddress Sanitizer support in CoreCLR (#74623)
Jeremy Koritzinsky [Tue, 18 Jul 2023 03:32:03 +0000 (20:32 -0700)]
Address Sanitizer support in CoreCLR (#74623)

* Enable AddressSanitizer in CoreCLR, Libs, and Host and update runtime-sanitized to run tests with ASAN on Linux and Mac

* Unify on HAS_ADDRESS_SANITIZER define name

Centralize setting up sanitizer flags.

Remove last usage of CLR_CMAKE_ENABLE_ASAN outside of eng/native

Remove unnecessary diffs

Use the cpuid intrinsic and enable ASAN on InitJitHelpers1.

Add comments for the places where we have ASAN disabled

Undo changes to src/coreclr/jit/CMakeLists.txt

Add docs and fix the docs in the build script.

Add docs for the SkipVCEnvInit hook

* Remove CRT runtime changes. We won't need this when we finally onboard to Windows with some changes they have coming down the pipeline, so remove them for now to reduce the diff of this PR.

* Remove suppression now that we've fixed the underlying issue.

* Remove some Windows-only sanitizer CMake that we won't need when ASAN is ready for us to consume on Windows.

* Set schedule for runtime-sanitized pipeline

* Remove workaround in JIT memory set/copy helpers now that the JIT bug has been fixed.

* Add missing helix queues setup template.

* Fix missing command to build nativeaot runtime tests as nativeaot.

* Add a scenario name to trigger the extended timeout in the libraries test helix configuration.

* Remove extraneous whitespace.

* Fix using the cross-targetting ILC when sanitizers are enabled. Also pass through our TargetOS and TargetArchitecture variables to the publish command for our native sanitizers targets to correctly do their extra logic.

* Disable LSAN on the CustomMain test.

* Disable some tests on sanitized runtimes.

* Copy the sanitizer runtime for OSX NativeAOT runtime tests.

* A little cleanup to try to get the build right now that we are always doing cross-builds on Linux.

* Fix crossgen-corelib.proj syntax.

* Fix cross-os dac builds to not include the host architecture in the output path.

* Split the debugger components into a separate component and make the "unsanitized cross components" build into an "unsanitized debugger components" build as it can't be part of the regular cross-components build

* Always write out the host-arch path on Windows and update the cross-dac build script to expect that.

* Change to use the dynamic runtime on Windows, as ASAN in VS is moving to a dynamic-only model.

* Update docker images to include the sanitizer runtimes in the crossrootfs images.

* Fix explicit image tags

* The unsanitized build should be of the target architecture, not the host architecture. As a result, we still need a cross-arch build for the cross-arch use cases when sanitized, as well as an unsanitized target arch build for the debugger tools.

* Turn off using the sigaltstack for NativeAOT tests that don't use the asansupport.cpp default options

* Make sure the shared ASAN runtime is present for the nativeaot/SmokeTests/SharedLibrary test.

* Disable crossgen2 tests with sanitizers as they don't get us interesting coverage.

* Fix custom default options and disable some more crossgen2-based tests.

* Simplify lookup of asan runtime on mac and fix copying the shared runtime for the SharedLibrary NativeAOT test.

* Disable test that's failing for weird reasons.

* Fix one more alloc-dealloc mismatch that only started to show up after test merging increased allocations in the runtime

* Disable the System.Text.Json test suite on sanitized builds as it causes SO failures on Mac

* Fix test exclusion

* PR feedback.

* Fix mac build

* Do review changes

* Add libbootstrapper object files to the platform manifest now that NativeAOT has

* Disable tests that check size on sanitized builds

* Use the built-in `include_guard` option

* Disable use-after-return checking in ASAN. CoreCLR doesn't do well with parallel stacks.

* Only pass the no UAR flag on C and CXX with Clang (not AppleClang).

12 months ago[mini] Enter GC Unsafe mode in handle_signal_exception (#88436)
Aleksey Kliger (λgeek) [Tue, 18 Jul 2023 03:16:21 +0000 (23:16 -0400)]
[mini] Enter GC Unsafe mode in handle_signal_exception (#88436)

When the runtime needs to turn some kinds of signals into managed
exceptions (for example: SIGINT turns into
`new ExecutionEngineException ("Interrupted (SIGINT)")`, and some
SIGFPE turn into `DivideByZeroException`, and some SIGSEGV turn into a
`NullReferenceException`) instead of unwinding the stack from inside a
signal handler it instead adjusts the normal stack so that when the
signal handler returns, execution will resume in
`handle_signal_exception`.

That means that if the runtime was in GC Safe mode when the signal
was raised, even if the signal handler code transitions to GC Unsafe
mode, by the time the `handle_signal_exception` runs, we will have
undone the GC Unsafe transition and will be back in GC Safe.

That means if the code in `handle_signal_exception` (notably
`mono_handle_exception`) calls anything that tries to do a transition
to GC Safe, we may get an assertion.

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

12 months agoRemove `#if NETCOREAPP` There is nothing net core specific about the assertions...
Mike Voorhees [Tue, 18 Jul 2023 03:07:41 +0000 (23:07 -0400)]
Remove `#if NETCOREAPP`   There is nothing net core specific about the assertions in this test.  No other tests in the `PreserveDependencies` folder have kept attributes inside of `#if NETCOREAPP` (#89041)

`DynamicDependencyOnUnusedMethodInNonReferencedAssemblyWithCopyUsedAction` is the same scenario and doesn't need the #ifs either

12 months agoFix binding logic for dictionaries with complex elements (#89045)
Layomi Akinrinade [Tue, 18 Jul 2023 02:54:52 +0000 (19:54 -0700)]
Fix binding logic for dictionaries with complex elements (#89045)

12 months agoDisable stackoverflowtester test for win-x86 (#89062)
Bruce Forstall [Tue, 18 Jul 2023 02:53:18 +0000 (19:53 -0700)]
Disable stackoverflowtester test for win-x86 (#89062)

Tracking: https://github.com/dotnet/runtime/issues/84911

12 months agofix pooled array leak (#88810)
Dan Moseley [Tue, 18 Jul 2023 02:52:06 +0000 (21:52 -0500)]
fix pooled array leak (#88810)

* ntlm

* test base

* qpack

* FileSys

* JSON

* interp tests

* fix NTAuthentication leak

* More in JSON

* more tests

* ntlmserver disposable

* more tests

* more tests

* tar tests

* feedback

12 months agoFeedback on regex parser PR (#89060)
Dan Moseley [Tue, 18 Jul 2023 02:27:04 +0000 (21:27 -0500)]
Feedback on regex parser PR (#89060)

12 months agoRemove createdump's DAC dependency for the PAL for NativeAOT (#88802)
Mike McLaughlin [Tue, 18 Jul 2023 02:05:53 +0000 (19:05 -0700)]
Remove createdump's DAC dependency for the PAL for NativeAOT (#88802)

* Remove createdump's DAC dependency for the PAL for NativeAOT

* Code review feedback - use utf16 mini pal functions

* Fix OSX build break

* Code review feedback

12 months agoAvoid unnecessary string allocations in Get/SetMsQuicParameter (#89050)
Stephen Toub [Tue, 18 Jul 2023 01:13:00 +0000 (21:13 -0400)]
Avoid unnecessary string allocations in Get/SetMsQuicParameter (#89050)

12 months agoFix Globalization Tests (#88969)
Tarek Mahmoud Sayed [Mon, 17 Jul 2023 23:28:07 +0000 (16:28 -0700)]
Fix Globalization Tests (#88969)

12 months agoLight up core ASCII.Utility methods with Vector256/Vector512 code paths. (#88532)
anthonycanino [Mon, 17 Jul 2023 22:23:26 +0000 (15:23 -0700)]
Light up core ASCII.Utility methods with Vector256/Vector512 code paths. (#88532)

* Lib upgrade for ToUtf16

* Upgrade NarrowUtf16ToAscii with Vector512

* Complete the upgrade in NarrowUtf16ToAscii method
with Vector512 and Vector256 APIs.

* Adding VectorXX paths to `GetIndexOfFirstNonAscii` functions.

* Adding optimization to Vecto256 VectorContainsNonAsciiChar method.

* Code path refactoring and cleanup.

* Code changes based on the review:
1. turn some variables into explicitly specified const.
2. removed some helper functions and inlined them.

* Resolve comments

* revert the changes at GetIndexOfFirstNonAsciiByte

---------

Co-authored-by: Ruihan-Yin <ruihan.yin@intel.com>
12 months agoTar: Fix PAX regression when handling the size of really long unseekable data streams...
Carlos Sánchez López [Mon, 17 Jul 2023 22:19:08 +0000 (15:19 -0700)]
Tar: Fix PAX regression when handling the size of really long unseekable data streams (#88280)

* Fix regression introduced by https://github.com/dotnet/runtime/pull/84279 preventing PAX entries with really long data streams to get its size correctly stored in the extended attributes when the data stream is unseekable.

* Move tests for large files to a new manual tests project.

12 months agowrap exceptions from callbacks in QuicError.CallbackError (#88614)
Tomas Weinfurt [Mon, 17 Jul 2023 22:08:01 +0000 (16:08 -0600)]
wrap exceptions from callbacks in QuicError.CallbackError (#88614)

* wrap exceptions from callbacks in QuicError.CallbackError

* feedback

12 months agoRegister a callback that tries to load other versions Open LDAP library if the defaul...
Buyaa Namnan [Mon, 17 Jul 2023 21:03:43 +0000 (14:03 -0700)]
Register a callback that tries to load other versions Open LDAP library if the default is failed (#88851)

* Register a callback to AssemblyLoadContext.Default.ResolvingUnmanagedDll event that tries to load other libraries

* Do not throw when library not found

* Check version 2.6 first

12 months agoEnable CA1863 (Use 'CompositeFormat') as suggestion (#89029)
Stephen Toub [Mon, 17 Jul 2023 20:52:57 +0000 (16:52 -0400)]
Enable CA1863 (Use 'CompositeFormat') as suggestion (#89029)

I ran it over runtime, and the only things flagged were for exceptional cases where it's not worth using.  Rather than a bunch of suppressions, I'm just enabling it as info-level.

12 months agoUse a HashSet instead of Dictionary in XNodeValidator (#89030)
Stephen Toub [Mon, 17 Jul 2023 20:52:24 +0000 (16:52 -0400)]
Use a HashSet instead of Dictionary in XNodeValidator (#89030)

12 months agoPrevent Arm64 CrossDac builds running on Arm64. (#88467)
C272 [Mon, 17 Jul 2023 20:43:20 +0000 (20:43 +0000)]
Prevent Arm64 CrossDac builds running on Arm64. (#88467)

* Prevent Arm64 CrossDac builds running on Arm64.

Currently, when building the CLR on win-arm64, CrossDac builds for
Linux with an (incorrect) host arch of x64 are attempted, failing
the build. This patch prevents those builds running on systems with
an identical host architecture to the cross target.

* Revert to simpler strategy of simply ignoring when arch != x86|x64.

12 months agoAdd collection literal support for immutable collections (#88470)
Stephen Toub [Mon, 17 Jul 2023 20:31:17 +0000 (16:31 -0400)]
Add collection literal support for immutable collections (#88470)

* Add collection literal support for immutable collections

Add the CollectionBuilderAttribute and use it on the supported immutable collections

* Address feedback

12 months ago[wasm][debugger] Check client version to send debugger message (#89025)
Thays Grazia [Mon, 17 Jul 2023 19:51:50 +0000 (16:51 -0300)]
[wasm][debugger] Check client version to send debugger message (#89025)

* Checking that BrowserDebugProxy is waiting for this new format to avoid incompatibility

* Fix compilation error

* fix message format

* Fix indentation

12 months agoDelete `VerifyExpectModifiedAttributesWork`. This test has bit rotted since being...
Mike Voorhees [Mon, 17 Jul 2023 19:41:20 +0000 (15:41 -0400)]
Delete `VerifyExpectModifiedAttributesWork`.  This test has bit rotted since being made netfx only and now fails due to etw feature removal logic no longer existing. (#89017)

This test dates back to earlier days when the linker had few mechanisms that modified bodies and UnityLinker had many.  I added this test to make sure that test framework support for this attribute didn't break since we depended on it.  Now days, the linker has many mechanisms that modify bodies and `[ExpectBodyModified]` is heavily used in tests.  I don't think there is any value in updating this test to use a different code pattern that results in needing `[ExpectBodyModified]`.

12 months agoDelete com removal tests (#89012)
Mike Voorhees [Mon, 17 Jul 2023 19:40:33 +0000 (15:40 -0400)]
Delete com removal tests (#89012)

12 months agoRemove the ignore from `CustomStepCanResolveTypesAfterSweep` (#89016)
Mike Voorhees [Mon, 17 Jul 2023 19:39:53 +0000 (15:39 -0400)]
Remove the ignore from `CustomStepCanResolveTypesAfterSweep` (#89016)

This ignore is pointless. `#if` cannot be used to ignore a test. Tests are collected from whatever version of `Mono.Linker.Tests.Cases` is handy.  It could be a net7 build.  It could be net471.

12 months agoAdd JsonSourceGenerationOptions.UseStringEnumConverter (#88984)
Eirik Tsarpalis [Mon, 17 Jul 2023 19:27:48 +0000 (20:27 +0100)]
Add JsonSourceGenerationOptions.UseStringEnumConverter (#88984)

* Add JsonSourceGenerationOptions.UseStringEnumConverter.

* Fix failing tests in browser-wasm

12 months ago[Mono] Add coreclr_shutdown to mono (#88594)
Giridhar Trivedi [Mon, 17 Jul 2023 19:21:40 +0000 (00:51 +0530)]
[Mono] Add coreclr_shutdown to mono  (#88594)

* [Mono] Add coreclr_shutdown to mono

   There was a crash seen in netcordbg due to unavailability of coreclr_shutdown in mono. Implemented it for mono.

---------

Co-authored-by: Giridhar Trivedi <giridhar.trivedi@ibm.com>
12 months agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20230714...
dotnet-maestro[bot] [Mon, 17 Jul 2023 18:26:12 +0000 (13:26 -0500)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230714.2 (#88948)

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.11.0-beta1.23363.2 -> To Version 3.11.0-beta1.23364.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months agoUpdate host RID in missing runtime/framework URL (#88359)
Elinor Fung [Mon, 17 Jul 2023 18:22:01 +0000 (11:22 -0700)]
Update host RID in missing runtime/framework URL (#88359)

12 months agoIntrinsify Array GetArrayDataReference for SZ arrays (#87374)
Michał Petryka [Mon, 17 Jul 2023 18:06:43 +0000 (20:06 +0200)]
Intrinsify Array GetArrayDataReference for SZ arrays (#87374)

12 months agoStandardize `AddBodySubstituterStep` (#89013)
Mike Voorhees [Mon, 17 Jul 2023 17:51:07 +0000 (13:51 -0400)]
Standardize `AddBodySubstituterStep` (#89013)

12 months agoRelaxing IsConnected Check for Datagram Sockets (#87916)
Ahmet Ibrahim Aksoy [Mon, 17 Jul 2023 17:38:25 +0000 (20:38 +0300)]
Relaxing IsConnected Check for Datagram Sockets (#87916)

* Relaxing IsConnected Check for Datagram Sockets

* Adding Listener inside Test

* Add relaxing to every Connect Path and invert condition to SocketType.Stream

* Make test theory and pass ipv4 ipv6 data

* Add LoopbacksAndAny

* Fix forgotten usage of parameter

* Handle OSX case

* Review feedback

12 months agoAdd SocketsHttpHandler requests-queue-duration metrics (#88981)
Miha Zupan [Mon, 17 Jul 2023 17:21:26 +0000 (19:21 +0200)]
Add SocketsHttpHandler requests-queue-duration metrics (#88981)

* Add SocketsHttpHandler requests-queue-duration metrics

* Use the IsDefaultPort helper in more places

* PR feedback

* Simplify queueStartingTimestamp logic in Http3Connection

12 months agoEnable ExtendedProtectionPolicy in generic System.Net.Security build (#88871)
Filip Navara [Mon, 17 Jul 2023 17:18:28 +0000 (19:18 +0200)]
Enable ExtendedProtectionPolicy in generic System.Net.Security build (#88871)

* Enable ExtendedProtectionPolicy in generic System.Net.Security build (used on browser)

* Update tests

12 months agoRevert "[wasm][debugger] Remove usage of GeneratedRegex (#86911)" (#89022)
Thays Grazia [Mon, 17 Jul 2023 17:09:57 +0000 (14:09 -0300)]
Revert "[wasm][debugger] Remove usage of GeneratedRegex (#86911)" (#89022)

This reverts commit 3fc0f5fd610f73f0397cf40f68bf6e13787a8f2c.

12 months agoUpdate dependencies from https://github.com/dotnet/runtime build 20230714.11 (#88997)
dotnet-maestro[bot] [Mon, 17 Jul 2023 16:34:00 +0000 (11:34 -0500)]
Update dependencies from https://github.com/dotnet/runtime build 20230714.11 (#88997)

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.7.23359.3 -> To Version 8.0.0-preview.7.23364.11

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months agoFix naming conflict resolution algorithm for linear interface hierarchies. (#88916)
Eirik Tsarpalis [Mon, 17 Jul 2023 16:12:07 +0000 (17:12 +0100)]
Fix naming conflict resolution algorithm for linear interface hierarchies. (#88916)

12 months agoAscii.Equals: remove redundant OR (#88993)
Adam Sitnik [Mon, 17 Jul 2023 16:07:27 +0000 (18:07 +0200)]
Ascii.Equals: remove redundant OR (#88993)

both inputs are equal here so if one of them is non ASCII, then the other one is too

12 months agoSimplify KeyAnalyzer (#88709)
Marc Brooks [Mon, 17 Jul 2023 15:14:13 +0000 (10:14 -0500)]
Simplify KeyAnalyzer (#88709)

The assignment `bool canSwitchIgnoreCaseToCaseSensitive = ignoreCase;` can just be `bool canSwitchIgnoreCaseToCaseSensitive = true;` since we're just tested that value a couple lines up

12 months agoRemove runtime-ioslike-mono and runtime-ioslike-coreclr pipelines (#88999)
Milos Kotlar [Mon, 17 Jul 2023 14:36:48 +0000 (16:36 +0200)]
Remove runtime-ioslike-mono and runtime-ioslike-coreclr pipelines (#88999)

12 months agoAdded QuicException.TransportErrorCode (#88550)
Alexander Radchenko [Mon, 17 Jul 2023 14:21:36 +0000 (20:21 +0600)]
Added QuicException.TransportErrorCode (#88550)

* Added QuicException.TransportErrorCode

* Code review by Tomas Weinfurt @wfurt

* @ManickaP Marie Píchová code review

* @ManickaP Marie Píchová code review

* @ManickaP Marie Píchová code review

* Feedback about error code casts

---------

Co-authored-by: ManickaP <mapichov@microsoft.com>
12 months agoRemove extra checks for known types in log formatter (#89000)
David Fowler [Mon, 17 Jul 2023 14:21:20 +0000 (10:21 -0400)]
Remove extra checks for known types in log formatter (#89000)

Turns out the JIT will not box in tier 1, this was trying to optimize tier 0 code.

12 months agoFix HTTP/1.1 concurrent request content read race condition (#86715)
Miha Zupan [Mon, 17 Jul 2023 14:11:14 +0000 (16:11 +0200)]
Fix HTTP/1.1 concurrent request content read race condition (#86715)

12 months agoAdd support for tvOS in os detection (#88988)
Milos Kotlar [Mon, 17 Jul 2023 14:05:35 +0000 (16:05 +0200)]
Add support for tvOS in os detection (#88988)

12 months agoConfigure SocketsHttpHandler for HttpClientFactory with IConfiguration (#88864)
Natalia Kondratyeva [Mon, 17 Jul 2023 13:33:18 +0000 (15:33 +0200)]
Configure SocketsHttpHandler for HttpClientFactory with IConfiguration (#88864)

Adds UseSocketsHttpHandler extension method for IHttpClientBuilder to set SocketsHttpHandler as a primary handler for a named HttpClient. Adds ISocketsHttpHandlerBuilder to configure the handler from IConfiguration and/or via a callback.

The API is .NET 5.0+ only.

Fixes #84075

12 months agoJIT: Optimize logical right shifts for byte values on XArch (#86841)
Miha Zupan [Mon, 17 Jul 2023 13:22:53 +0000 (15:22 +0200)]
JIT: Optimize logical right shifts for byte values on XArch (#86841)

12 months agousing the same configuration used by BlazorDevServer (#88919)
Thays Grazia [Mon, 17 Jul 2023 13:12:55 +0000 (10:12 -0300)]
using the same configuration used by BlazorDevServer (#88919)

12 months ago[wasm] Move code around in WBT in preparation for fixes, and cleanups (#88980)
Ankit Jain [Mon, 17 Jul 2023 12:29:31 +0000 (08:29 -0400)]
[wasm] Move code around in WBT in preparation for fixes, and cleanups (#88980)

* WBT: Move some common methods to TestUtils.cs

* WBT: Add new project type specific base classes for the tests

.. derived from `BuildTestBase.

* WBT: Move blazor specific code from BuildTestBase into

.. BlazorWasmProjectProvider, and BlazorWasmTestBase. This commit avoids
doing any cleanup, and just moves code around.

* WBT: Move more code from BuildTestBase to the respective provider, and test classes

* WBT: use field for buildenvironment

* Move blazor files to Blazor/

* move WasmTemplateTests.cs

* fix build

* Move StatFiles to provider

* Fix build

* fix build

* Fix wasi build

* WBT: Update list of tests

* Fix UnixFilePermissions test to account for the emscripten cache package

12 months agoPoolable / Resettable CBOR Readers (#88104)
Alexander Radchenko [Mon, 17 Jul 2023 09:09:32 +0000 (15:09 +0600)]
Poolable / Resettable CBOR Readers (#88104)

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
12 months agoDon't crash the trim analyzer if it finds unrecognized nodes in the input (#88836)
Vitek Karas [Mon, 17 Jul 2023 09:06:05 +0000 (02:06 -0700)]
Don't crash the trim analyzer if it finds unrecognized nodes in the input (#88836)

New versions of the compiler will introduce new nodes and values. The analyzer can never be 100% in sycn with the compiler, so it needs to be able to gracefully handle nodes it doesn't know anything about.

Change the several throws to just Debug.Fail. For end-users if we hit unrecognized node, we will effectively ignore that part of the code. So not 100% precise, but the analyzer will never be 100% regardles.

This is in response to #88684, but we can't add tests for it yet because the necessary compiler changes are in Preview 6, the repo is still on Preview 5.

12 months ago[mono][tests] Add support for mobile devices in processinfo3 test (#88655)
Milos Kotlar [Mon, 17 Jul 2023 08:56:35 +0000 (10:56 +0200)]
[mono][tests] Add support for mobile devices in processinfo3 test (#88655)

* Add support for devices in processinfo3 test

* Add support for android portable RID OS

12 months agoRun NativeAOT tests when ILLink changes (#88934)
Vitek Karas [Mon, 17 Jul 2023 08:06:52 +0000 (01:06 -0700)]
Run NativeAOT tests when ILLink changes (#88934)

NativeAOT uses code from ILLinker - specifically we share lot of tests. So if these change we want to make sure it didn't break their usage in NativeAOT.

The comment change in the tests is to trigger this new rule in the CI - but we can keep the comment regardless.

12 months ago[NativeAOT] Fix GCDesc computation (#88927)
SingleAccretion [Mon, 17 Jul 2023 07:04:13 +0000 (10:04 +0300)]
[NativeAOT] Fix GCDesc computation (#88927)

* Fix GCDesc computation

https://github.com/dotnet/runtime/pull/86877 appears to have introduced a bug in the GCDesc computation.

Consider the following structure layout (we are on 32 bit):

 struct {
     int X1;
     int X2;
     Object Obj;
     int X3;
 }

Crucially, the object reference in this struct is placed at a non-zero offset, which means that in an
array GCDesc, sizeof(X1 + X2) aka 8 will be added to the "base size" of the object. Since we have one
and only series (of GC pointers), it will also be the last. Its "skip" was computed as:

 bitfield.Count (4) - last (3) = 1

Which is clearly incorrect, as we need to skip 3 pointers when considering the shifted array layout:

 <Obj, X3][X1, X2, Obj, X3][X1, X2, Obj, X3]...
     |            |
     [Correct skip]

In effect, for the last series, we must consider the skip to include the delta we have included into
the base size, which code before #86877 did, although wrongly - for MD arrays - as well. This change
restores a fixed version of it.

* Add a test

Verified to fail (hit a GC assert) before and pass after.

* (actually make it compile)

12 months agoUse optimized GetOffset in Range GetOffsetAndLength (#87317)
Jesper Meyer [Mon, 17 Jul 2023 03:39:54 +0000 (05:39 +0200)]
Use optimized GetOffset in Range GetOffsetAndLength (#87317)

12 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230714.2 (#88947)
dotnet-maestro[bot] [Mon, 17 Jul 2023 02:41:17 +0000 (21:41 -0500)]
Update dependencies from https://github.com/dotnet/arcade build 20230714.2 (#88947)

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23362.5 -> To Version 8.0.0-beta.23364.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months ago[main] Update dependencies from dotnet/roslyn (#88188)
dotnet-maestro[bot] [Mon, 17 Jul 2023 02:40:24 +0000 (21:40 -0500)]
[main] Update dependencies from dotnet/roslyn (#88188)

* Update dependencies from https://github.com/dotnet/roslyn build 20230629.1

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-2.23319.4 -> To Version 4.7.0-3.23329.1

* Update dependencies from https://github.com/dotnet/roslyn build 20230710.7

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-2.23319.4 -> To Version 4.7.0-3.23360.7

* Update dependencies from https://github.com/dotnet/roslyn build 20230711.9

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-2.23319.4 -> To Version 4.7.0-3.23361.9

* Disable InlineArrayInvalid due to https://github.com/dotnet/runtime/issues/88861

* Disable InlineArrayValid also due to

Issue: https://github.com/dotnet/runtime/issues/88957

```
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(184,28): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(185,28): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(201,20): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(202,20): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(209,36): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(210,40): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(232,40): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(233,44): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(245,20): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(246,20): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(253,36): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(254,40): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(259,20): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(260,20): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(294,29): error CS0306: The type 'Span<object>' may not be used as a type argument [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(294,29): error CS0193: The * or -> operator must be applied to a pointer [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(295,31): error CS0306: The type 'Span<object>' may not be used as a type argument [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(295,30): error CS0193: The * or -> operator must be applied to a pointer [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(309,14): error CS0306: The type 'Span<object>' may not be used as a type argument [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(309,13): error CS0193: The * or -> operator must be applied to a pointer [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(429,43): error CS1061: '(object, short)' does not contain a definition for 'o' and no accessible extension method 'o' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.cs(430,47): error CS1061: '(object, short)' does not contain a definition for 's' and no accessible extension method 's' accepting a first argument of type '(object, short)' could be found (are you missing a using directive or an assembly reference?) [/__w/1/s/src/tests/Loader/classloader/InlineArray/InlineArrayValid.csproj] [/__w/1/s/src/tests/build.proj]
/__w/1/s/src/tests/Common/dir.traversal.targets(25,5): error : (No message specified) [/__w/1/s/src/tests/build.proj] [/__w/1/s/src/tests/build.proj]
```

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
12 months ago[mono] Some UnsafeAccessorAttribute support for methods and constructors (#88925)
Aleksey Kliger (λgeek) [Mon, 17 Jul 2023 00:25:35 +0000 (20:25 -0400)]
[mono] Some UnsafeAccessorAttribute support for methods and constructors (#88925)

* first cut at UnsafeAccessorKind.Constructor

* Implement UnsafeAccessorKind.Method and StaticMethod

* remove debug output

* change some asserts to BadImageFormatException

* enable some tests

* move CallAmbiguousMethod to a separate test case

* Fixup error checking; forbid generics

* match CoreCLR: callvirt for instance methods call for static

* fixups to pass new tests from https://github.com/dotnet/runtime/pull/88268

* Make CallCtorAsMethod tests work

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
12 months agoFix behavior of default interfaces interacting with constraints (#88932)
David Wrighton [Sun, 16 Jul 2023 22:10:55 +0000 (15:10 -0700)]
Fix behavior of default interfaces interacting with constraints (#88932)

* Fix stack overflow caused by incorrect handling of class load levels

* Address code review feedback on the test

12 months agoFix `TimeZoneInfo.Equals` and `TimeZoneInfo.HasSameRules` (#88869)
Michael Render [Sun, 16 Jul 2023 21:42:23 +0000 (17:42 -0400)]
Fix `TimeZoneInfo.Equals` and `TimeZoneInfo.HasSameRules` (#88869)

12 months ago[RISC-V] Fix GitHub_* tests (#88640)
Dong-Heon Jung [Sun, 16 Jul 2023 20:17:24 +0000 (05:17 +0900)]
[RISC-V] Fix GitHub_* tests (#88640)

* [RISC-V] Fix GitHub_17585 test failure

* [RISC-V] Fix GitHub_23147 test failure

* [RISC-V] Remove lvIsHfaRegArg assertion

* [RISC-V] Update

12 months agoImprove StringValues, StringSegment and IChangeToken debugging (#88960)
James Newton-King [Sun, 16 Jul 2023 18:42:08 +0000 (02:42 +0800)]
Improve StringValues, StringSegment and IChangeToken debugging (#88960)

12 months agoImprove Logger<T> debugging (#88959)
James Newton-King [Sun, 16 Jul 2023 18:35:48 +0000 (02:35 +0800)]
Improve Logger<T> debugging (#88959)

12 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 222242...
dotnet bot [Sun, 16 Jul 2023 14:42:13 +0000 (16:42 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2222423 (#88935)

12 months agoOptimize scalar conversions with AVX512 (#84384)
Khushal Modi [Sun, 16 Jul 2023 13:55:27 +0000 (06:55 -0700)]
Optimize scalar conversions with AVX512 (#84384)

* fixing the JITDbl2Ulng helper function. The new AVX512 instruction vcvtsd2usi uses ulong.max_value to show FPE for negative, NAN and ulong_max + 1 values.

* Making changes to the library test case expected output based on the architecture. This is because we have changed the JITDbl2Ulng helper function to mimic the new IEEE compliant AVX512 instruction vcvtsd2usi. In the process, we needed to update the library test case because the default Floating Point Error (FPE) value for the new instruction is different from the default MSVC FPE value i.e. 0.

* Fixing the JITDbl2Ulng helper function. Also making sure that we are not changing the library test case but the API to make sure NaN cases are handled.

* reverting jitformat

* Adding a truncate function to the Dbl2Ulng helper to make sure we avoid handling edge cases (-1,0) separately inside the helper.

* Adding code to handle vectorized conversion for float/double to/from ulong/uint

* reverting changes for float to ulong

* enabling float to ulong conversion

* Making change to set w1 bit for evex

* merging with main. Picking up hwintrinsiclistxarh from main
trying to return EA_4BYTE for INS_vcvttss2usi to make sure that we read dword and not qword for float to ulong

* jit format

* Splitting vcvttss2usi to vcvttss2usi32 and vcvttss2usi64. Also adding a special handling for vcvttss2usi64 to make sure we read only dword instead of qword for float to ulong conversion

* undoing jitformat changes due to merge error

* removing unused code and correcting throughput and latency information for vcvttsd2usi, vcvttusi2sd32/64

* correcting throughput and latency for vcvttss2usi32 and placing it with other similar instructions

* formatting

* formatting

* updating comments

* updating code for github comments. Using compIsaSupportedDebugOnly for nowayasserts and also checking for float and doubel both in lowercast for overflow and conversion to ulong

* reverting to original checks for ISA supported Debug only because they are not available in release mode

* running jitformat

* running jitformat

* combine the 2 nodes GT_CAST(GT_CAST(TYP_ULONG, TYP_DOUBLE), TYP_FLOAT) into a single node i.e. GT_CAST(TYP_ULONG, TYP_FLOAT)

* merging with main and updating hwintrinsiclistxarch to take into consideration 32bit and 64 bit version of vcvttss2usi.

* Changing noway_assert to assert to make sure compOpportunisticallyDependsOn only runs in debug mode.

* running jitformat

* Changing compOpportunisticallyDependsOn to compIsaSupportedDebugOnly in asserts aka code review changes

* Making code review changes. Moving around the comOpportunisticallyDependsOn checks to make sure they are ran only if we need AVX512. These checks being costly, moving them to the innermost checks in nested if checks.

* FCALL_CONTRACT should be only used on FCalls itself

* Making paralle changes to JITHelper in MathHelper for native AOT

* resolving regression issues

* Rolling back changes for double/float -> ulong

* Rolling back changes for double/float -> ulong

* Reverting ouf_or_range_fp_conversion to original version

* Reverting ouf_or_range_fp_conversion to original version

* Reverting jithelpers.cpp to original versino

* Reverting jithelpers.cpp to original version

* Changind comments, reverting asserts, skipping to change node for cast

* addressing review comments

* Update src/coreclr/jit/morph.cpp

---------

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
12 months ago[Mono]: Add dotnet-gcdump support. (#88634)
Johan Lorensson [Sun, 16 Jul 2023 10:50:44 +0000 (12:50 +0200)]
[Mono]: Add dotnet-gcdump support. (#88634)

Add support for dotnet-gcdump on Mono.

New GC events consumed by dotnet-gcdump has been added to the new ep-rt-mono-runtime-provider.c source file.

Disable experimental EventPipe mono profiler provider by default to preserve resources. It is possible to re-enable it by setting the following env variable, MONO_DIAGNOSTICS=--diagnostic-mono-profiler=enable.

12 months agoFix SelectLocalIndirTransform to take offset into account (#88951)
Egor Bogatov [Sun, 16 Jul 2023 09:50:14 +0000 (11:50 +0200)]
Fix SelectLocalIndirTransform to take offset into account (#88951)

12 months agoFix genPutArgStkFieldList for SIMD12 (#88920)
Egor Bogatov [Sat, 15 Jul 2023 19:26:43 +0000 (21:26 +0200)]
Fix genPutArgStkFieldList for SIMD12 (#88920)

12 months agoAdd System.Net.NameResolution metrics (#88773)
Miha Zupan [Sat, 15 Jul 2023 18:37:53 +0000 (20:37 +0200)]
Add System.Net.NameResolution metrics (#88773)

* Add System.Net.NameResolution metrics

* Avoid potential race condition in test

* Fix metrics counter firing twice when called from RunAsync without telemetry

* Add an extra assert

* More RemoteExecutor

12 months ago[browser] mono_exit improvements (#88387)
Pavel Savara [Sat, 15 Jul 2023 05:22:09 +0000 (07:22 +0200)]
[browser] mono_exit improvements (#88387)

12 months agoExclude unnecessary artifacts from the Native AOT sample app bundle (#88931)
Milos Kotlar [Sat, 15 Jul 2023 03:06:38 +0000 (05:06 +0200)]
Exclude unnecessary artifacts from the Native AOT sample app bundle (#88931)

12 months agoFix use-out-of-scope in signature comparison (#88928)
Jeremy Koritzinsky [Sat, 15 Jul 2023 02:05:45 +0000 (19:05 -0700)]
Fix use-out-of-scope in signature comparison (#88928)

* Propagate token list to callers by copying instead of passing an out-of-scope address

* Create a temp token list when we create a temp compare state.

* Update the default constructor of CompareState to set a more useful empty state that won't segfault.

* Revert "Update the default constructor of CompareState to set a more useful empty state that won't segfault."

This reverts commit 28b3fd5dbd66acb9f524d87758fc8efef78cb17d.

* Fix last case of using the default constructor in prestub.cpp

12 months agoAdd public MethodInvoker and ConstructorInvoker classes (#88415)
Steve Harter [Sat, 15 Jul 2023 01:35:47 +0000 (20:35 -0500)]
Add public MethodInvoker and ConstructorInvoker classes (#88415)

12 months agoTotal time in GC counter (#88699)
Andrew Au [Fri, 14 Jul 2023 23:35:08 +0000 (16:35 -0700)]
Total time in GC counter (#88699)

Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
12 months agoAdd SocketsHttpHandler connection metrics (#88893)
Miha Zupan [Fri, 14 Jul 2023 23:14:20 +0000 (01:14 +0200)]
Add SocketsHttpHandler connection metrics (#88893)

* Add SocketsHttpHandler connection metrics

* PR feedback

* Improve assert around _originAuthority

* Typo

12 months agoMake firing of ETW events in nativeaot opt-in via the enabled/disabled lib (#88800)
Elinor Fung [Fri, 14 Jul 2023 20:58:24 +0000 (13:58 -0700)]
Make firing of ETW events in nativeaot opt-in via the enabled/disabled lib (#88800)

12 months ago[wasm] Re-enable JSON tests (#88883)
Katelyn Gadd [Fri, 14 Jul 2023 20:24:21 +0000 (13:24 -0700)]
[wasm] Re-enable JSON tests (#88883)

Should be fine to do this since #88876 was merged.

12 months agoJIT: Enabled embedded broadcast for binary ops (#87946)
Ruihan-Yin [Fri, 14 Jul 2023 20:20:26 +0000 (13:20 -0700)]
JIT: Enabled embedded broadcast for binary ops (#87946)

* Enabled embedded broadcast for the following ops:
and, andn, or, xor,
min, max,
div, mul, mull, sub,
variable shiftleftlogical/rightarithmetic/rightlogical

* Bug fix:
 JIT used to use a uniform intrinsic for bitwise operations with all data
 types, embedded broadcast is sensitive to input size in this case,
 adding a helper to let emitter aware when input size is long/ulong.

* reset the instruction in the later phase
when embedded broadcast is actually enabled

* filter irrelevant data type in embedded broadcast
There are cases when broadcast node are falsely contained by a embedded
broadcast compatible node, while the data type is actually not supported
Adding extra logics to avoid this situation.

* update the condition on instruction reset:
instructions with either long or ulong as basetype should be reset to
qword instructions.

* Apply format patch

* Resolve reviews:
make the typecheck based on broadcast node it self.

* Resolve review:
use `varTypeIsSmall` type check to cover all the unsupported data type
in embedded broadcast.

* Resolve reviews:
1. put the IsBitwiseInstruction to a proper place.
2. nit: restored unnecessary line delete.

12 months agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Fri, 14 Jul 2023 19:13:27 +0000 (14:13 -0500)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230712.5 (#88826)

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23361.5 -> To Version 1.0.0-prerelease.23362.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#88829)
dotnet-maestro[bot] [Fri, 14 Jul 2023 19:07:49 +0000 (14:07 -0500)]
[main] Update dependencies from dotnet/roslyn-analyzers (#88829)

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230712.3

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.11.0-beta1.23360.1 -> To Version 3.11.0-beta1.23362.3

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230713.2

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.11.0-beta1.23360.1 -> To Version 3.11.0-beta1.23363.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months ago[main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/emsdk (#88827)
dotnet-maestro[bot] [Fri, 14 Jul 2023 19:03:28 +0000 (14:03 -0500)]
[main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/emsdk (#88827)

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

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23361.1 -> To Version 8.0.0-beta.23362.5

Dependency coherency updates

Microsoft.SourceLink.GitHub,Microsoft.DotNet.XliffTasks
 From Version 8.0.0-beta.23360.2 -> To Version 8.0.0-beta.23361.2 (parent: Microsoft.DotNet.Arcade.Sdk

* Update dependencies from https://github.com/dotnet/emsdk build 20230712.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.7.23361.2 -> To Version 8.0.0-preview.7.23362.1

* Update Tools.props

* Update Version.Details.xml

* Suppress warning in test

* Workaround for https://github.com/dotnet/sdk/issues/34003

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 8.0.0-prerelease.23360.3 -> To Version 8.0.0-prerelease.23363.3

* Add reference to NETStandard.Library

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
12 months agoEnsure that IsSupported being false disables the tracked hierachy in our tests (...
Tanner Gooding [Fri, 14 Jul 2023 18:10:53 +0000 (11:10 -0700)]
Ensure that IsSupported being false disables the tracked hierachy in our tests (#88848)

12 months ago[wasm] Use latest chrome for testing (#88505)
Ankit Jain [Fri, 14 Jul 2023 17:54:29 +0000 (13:54 -0400)]
[wasm] Use latest chrome for testing (#88505)

This was fixed to a specific version (`113.0.5672.63`) because of
https://github.com/dotnet/runtime/issues/86919 . But trying to use
latest again now.

12 months agoFix missing using statement (#88906)
Vitek Karas [Fri, 14 Jul 2023 17:30:37 +0000 (10:30 -0700)]
Fix missing using statement (#88906)

Add a using which was incorrectly removed because it's only necessary in NativeAOT configuration

12 months agoRemove handwritten binding logic from Logging.Console; use generator instead (#88067)
Layomi Akinrinade [Fri, 14 Jul 2023 17:16:27 +0000 (10:16 -0700)]
Remove handwritten binding logic from Logging.Console; use generator instead (#88067)

* Remove handwritten binding logic from Logging.Console; use generator instead

* Address feedback

* Update test

* Revert "Update test"

This reverts commit fa73b4edcd4a67ad195ab30a405e7f316ae34e5e.

* Remove NoWarn for obsolete members; handled by emitted code

* Address feedback

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
---------

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
12 months agoUTFn->UTF-n (#88913)
Dan Moseley [Fri, 14 Jul 2023 16:57:03 +0000 (11:57 -0500)]
UTFn->UTF-n (#88913)

* resx

* cs comments

* oops

12 months agoExtend JsonSourceGenerationOptionsAttribute to have feature parity with JsonSerialize...
Eirik Tsarpalis [Fri, 14 Jul 2023 16:37:45 +0000 (17:37 +0100)]
Extend JsonSourceGenerationOptionsAttribute to have feature parity with JsonSerializerOptions. (#88753)

12 months agoFix TimeZoneInfoTests.cs on iOS/tvOS (#88909)
Alexander Köplinger [Fri, 14 Jul 2023 15:55:56 +0000 (17:55 +0200)]
Fix TimeZoneInfoTests.cs on iOS/tvOS (#88909)

12 months agoHttpClientFactory logging configuration (#88706)
Natalia Kondratyeva [Fri, 14 Jul 2023 15:30:01 +0000 (17:30 +0200)]
HttpClientFactory logging configuration (#88706)

Add 2 interfaces for custom sync and async HttpClient loggers, and extension methods to add or remove HttpClient loggers in AddHttpClient configuration.

Fixes #77312

12 months agoEventPipe support for ProcessInfo (#87562)
Lakshan Fernando [Fri, 14 Jul 2023 15:24:12 +0000 (08:24 -0700)]
EventPipe support for ProcessInfo (#87562)

* initial changes for process name

* add support to get managedEntrypointAssemblyName

* FB

* FB2

* fix main merge issues

* Using assembly location for coreclr per FB

* FB

* FB

* FB

12 months ago[browser] bump npm packages + fix webpack sample (#88907)
Pavel Savara [Fri, 14 Jul 2023 15:04:13 +0000 (17:04 +0200)]
[browser] bump npm packages + fix webpack sample (#88907)

12 months ago[nativeaot][tests] Add smoke unit runtime tests for Native AOT on iOS platforms ...
Milos Kotlar [Fri, 14 Jul 2023 14:26:40 +0000 (16:26 +0200)]
[nativeaot][tests] Add smoke unit runtime tests for Native AOT on iOS platforms (#87260)

* Initial commit

* Add runtime-ioslike-coreclr and runtime-ioslike-mono azp runs

* Add support for stripping debug symbols and enabling IL stripping during AOT compilation on iOS

* Use the _AppleGenerateAppBundle target from AppleBuild.targets to build the app bundle

* Update the CI to use cross-build

* Update the sample app to use the cross-build

* Disable failing tests with OperatingSystem.Is...().

* Update perf build command for Native AOT

* Update IlcToolsPath to use cross-build ilc path

* Use /p:BuildNativeAOTRuntimePack=true to pick up NativeAOT assets instead of CoreCLR

12 months agoEnable StressLogAnalyzer to read stress logs from old coreclr running with a new...
Jeremy Koritzinsky [Fri, 14 Jul 2023 14:08:56 +0000 (07:08 -0700)]
Enable StressLogAnalyzer to read stress logs from old coreclr running with a new clrgc. (#88852)

12 months ago[NativeAOT] Support variable page size on Linux Arm64 (#88710)
Vladimir Sadov [Fri, 14 Jul 2023 13:54:23 +0000 (06:54 -0700)]
[NativeAOT] Support variable page size on Linux Arm64 (#88710)

* stack probe

* probe size on x86

* OS_PAGE_SIZE

* call sysconf(_SC_PAGESIZE)  unconditionally

* initialize OS page in PalInit

Co-authored-by: Filip Navara <filip.navara@gmail.com>
12 months ago[wasm][debugger] Improve debugger performance based on JMC (#86982)
Thays Grazia [Fri, 14 Jul 2023 13:46:00 +0000 (10:46 -0300)]
[wasm][debugger] Improve debugger performance based on JMC (#86982)

* Improve debugger performance.

* Loading assembly bytes if JMC is disabled after the debugger session is started.

* Fix CI.

* Load symbols on demand if JMC is enabled, we don't need to spend a lot of time loading information from 149 assemblies if we will probably not need all of them.

* Impriving the performance sending only metadata and not the full assembly.

* Fixing compilation error on tvos

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* fix changes from code review

* addressing @radical comments

* addressing @radical and @lewing comments

---------

Co-authored-by: Ankit Jain <radical@gmail.com>
12 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 222189...
dotnet bot [Fri, 14 Jul 2023 13:16:32 +0000 (15:16 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2221896 (#88636)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
12 months ago[browser] detect and assert engine features (#88846)
Pavel Savara [Fri, 14 Jul 2023 13:03:32 +0000 (15:03 +0200)]
[browser] detect and assert engine features (#88846)

12 months agoPresize dictionary in regex interpreter (#88558)
Dan Moseley [Fri, 14 Jul 2023 12:28:12 +0000 (07:28 -0500)]
Presize dictionary in regex interpreter (#88558)

12 months agoAdd AddHttpClientDefaults (#87953)
James Newton-King [Fri, 14 Jul 2023 11:25:09 +0000 (19:25 +0800)]
Add AddHttpClientDefaults (#87953)

The AddHttpClientDefaults method supports adding configuration to all created HttpClients.

The method:

- Creates a builder with a null name. Microsoft.Extensions.Configuration automatically applies configuration with a null name to all named configuration.
- Ensures that default configuration is added before named configuration in the IServiceCollection. This is to make it so the order of AddHttpClientDefaults and AddHttpClient doesn't matter. Default config is always applied first, then named config is applied after. This is done by wrapping the IServiceCollection in an implementation that modifies the order that IConfigureOptions<HttpClientFactoryOptions> values are added.

Fixes #87914

---------

Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
12 months agoSimplify condition to detect recursive inlining (#88849)
Jan Kotas [Fri, 14 Jul 2023 09:57:11 +0000 (11:57 +0200)]
Simplify condition to detect recursive inlining (#88849)

This change simplifies the conditon and also makes it more robust. There
are situation where the IL code pointer can differ for the same method.