platform/upstream/dotnet/runtime.git
13 months agoFix FailedRequests_ConnectionClosedWhileReceivingHeaders_Recorded (#89047)
Anton Firszov [Tue, 18 Jul 2023 17:10:00 +0000 (19:10 +0200)]
Fix FailedRequests_ConnectionClosedWhileReceivingHeaders_Recorded (#89047)

13 months agoFix treating dotnet.wasm or dotnet.native.wasm as native asset (#89079)
Marek Fišera [Tue, 18 Jul 2023 17:02:16 +0000 (19:02 +0200)]
Fix treating dotnet.wasm or dotnet.native.wasm as native asset (#89079)

13 months agounroll byref struct copies (#86820)
Mark Plesko [Tue, 18 Jul 2023 16:57:26 +0000 (09:57 -0700)]
unroll byref struct copies (#86820)

If a struct contains a byref, then it is known to be on the stack/regs (not in the heap), so GC write barriers are not required.  This adds that case to lower*.cpp and attempts to make the code more similar.  I didn't actually factor them (especially with a few subtle differences such as the call to `getUnrollThreshold`).

This partially handles #80086.  It improves the code for common cases, but since the strategy is not always used, the correctness issue in it is not completely handled.  Next step is to apply the fix for that and see how bad the regressions are; this change will reduce the impact.

Example:

``` C#
static Span<int> Copy1(Span<int> s) => s;
```
``` asm
G_M44162_IG01:  ;; offset=0000H
       vzeroupper
;; size=3 bbWeight=1 PerfScore 1.00
G_M44162_IG02:  ;; offset=0003H
       vmovdqu  xmm0, xmmword ptr [rdx]
       vmovdqu  xmmword ptr [rcx], xmm0
;; size=8 bbWeight=1 PerfScore 6.00
G_M44162_IG03:  ;; offset=000BH
       mov      rax, rcx
;; size=3 bbWeight=1 PerfScore 0.25
G_M44162_IG04:  ;; offset=000EH
       ret
;; size=1 bbWeight=1 PerfScore 1.00

; Total bytes of code 15, prolog size 3, PerfScore 9.75, instruction count 5, allocated bytes for code 15 (MethodHash=4d5b537d) for method
```

Platform      | Overall | MinOpts | FullOpts
--------------|---------|---------|---------
linux arm64   |  -5,232 |  -3,260 |   -1,972
linux x64     |  -1,142 |    -750 |     -392
osx arm64     |  -5,732 |  -3,276 |   -2,456
windows arm64 |  -4,416 |  -2,580 |   -1,836
windows x64   |  -8,993 |  -5,772 |   -3,221
linux arm     | -13,518 |  -9,530 |   -3,988
windows x86   |       0 |       0 |        0

13 months agoUpdate script to replace the BDN version being used in the PerfBDN app to the same...
Parker Bibus [Tue, 18 Jul 2023 16:51:03 +0000 (09:51 -0700)]
Update script to replace the BDN version being used in the PerfBDN app to the same version we use for all BDN tests and in BDN extensions. (#89057)

13 months agoUpdate dependencies from https://github.com/dotnet/roslyn build 20230716.1 (#89077)
dotnet-maestro[bot] [Tue, 18 Jul 2023 16:12:30 +0000 (11:12 -0500)]
Update dependencies from https://github.com/dotnet/roslyn build 20230716.1 (#89077)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
13 months agoBump semver from 7.3.7 to 7.5.4 in /src/mono/sample/wasm/node-webpack (#88833)
dependabot[bot] [Tue, 18 Jul 2023 16:00:44 +0000 (12:00 -0400)]
Bump semver from 7.3.7 to 7.5.4 in /src/mono/sample/wasm/node-webpack (#88833)

Bumps [semver](https://github.com/npm/node-semver) from 7.3.7 to 7.5.4.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.7...v7.5.4)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
13 months ago[wasm] Fix perf pipeline (#89091)
Ankit Jain [Tue, 18 Jul 2023 15:47:12 +0000 (11:47 -0400)]
[wasm] Fix perf pipeline (#89091)

Passing arguments to bdn as `"--wasmArgs=--expose_wasm --module"` broke
with the latest update. Now this gets incorrectly parsed. Instead, what
works is: `--wasmArgs "--expose_wasm --module"`.

13 months agoBuild the shim assemblies as part of libs.sfx (#89005)
Viktor Hofer [Tue, 18 Jul 2023 15:24:35 +0000 (17:24 +0200)]
Build the shim assemblies as part of libs.sfx (#89005)

* Build the shim assemblies as part of libs.sfx

The shims build was intentionally kept out of the libs.sfx subset as
some shims reference out-of-band assemblies that also need to be built.

Since that change was made, the shim assemblies now don't reference all out-of-band
assemblies by default anymore and instead use fine grained dependencies.
Because of that, the number of out-of-band projects referenced and built
as part of the shims build is much smaller (~10 projects).

This fixes issues with ouf-of-band source generators not being able to
target the live targeting pack. These source generators need the shims
(more precisely the netstandard.dll shims) as some of the referenced
Microsoft.CodeAnalysis packages don't provide a .NETCoreApp assembly.

* Add fake assemblies for out-of-band type forward destinations

* Fix issues with nested classes and wrong type destinations

* Disable binplacing

* Make stubs private

* Disable symbols for stubs

* Add build protection to validate API compatibility of shims

13 months ago[workloads] Add linux-arm64 support for wasm and wasi (#89068)
Steve Pfister [Tue, 18 Jul 2023 15:06:19 +0000 (08:06 -0700)]
[workloads] Add linux-arm64 support for wasm and wasi (#89068)

Since https://github.com/dotnet/emsdk/pull/343, we are now able to support native linux-arm64 on wasm. This change adds linux-arm64 to wasm-tools and wasi-experimental workloads.

13 months agoRestructure NegotiateAuthentication implementation (#87930)
Filip Navara [Tue, 18 Jul 2023 14:02:49 +0000 (16:02 +0200)]
Restructure NegotiateAuthentication implementation (#87930)

* Change NegotiateAuthentication implementation to use indirection through NegotiateAuthenticationPal to the actual implementation.

The PAL implementation are merged from different sources to follow the same structure:
- NTAuthentication.Managed.cs -> NegotiateAuthenticationPal.Managed.cs
- NTAuthentication.Common.cs + NegotiateStreamPal.Windows.cs -> NegotiateAuthenticationPal.Windows.cs
- NTAuthentication.Common.cs + NegotiateStreamPal.Unix.cs -> NegotiateAuthenticationPal.Unix.cs

This split allows to delete ContextFlagsPal, SafeDeleteNegoContext, and SafeFreeNegoCredentials abstractions that were used in NegotiateStreamPal.

* Unify impersonation level validation between Windows and Unix pllatforms

* Split managed NTLM and managed SPNEGO implementations; add UseManagedNtlm switch on Unix platforms

* Remove debug cruft

* Fix couple of errors in managed SPNEGO

* Remove debug print

* Fix message sequence in managed NTLM; remove unused method

* Fix fallbacks on macOS GSSAPI

* Cleanup and fallbacks for missing NTLM, GSSAPI

* Adjust tests to assume that NTLM is always available on Unix

* Don't claim NTLM support on Browser

* Revert "Don't claim NTLM support on Browser"

This reverts commit 87d0c56f67a5269d9b334ab17887338ac4cfe49b.

* Attempt to fix the browser tests

* Revert "Attempt to fix the browser tests"

This reverts commit 91d7ce289a7274b682803b1d5dfdf418a5c2120c.

* Browser test suppression

* Respect UseManagedNtlm=false on platforms without NTLM GSSAPI provider

* Update src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.Unix.cs

* Revert all the fallback code paths, System.Net.Security.UseManagedNtlm has to be enabled explicitly; NativeAOT on Linux Bionic does that by default because it doesn't have GSSAPI and native shim

13 months agoDisable GCStress for Deserialize due to 88618 (#89072)
Mark Plesko [Tue, 18 Jul 2023 13:43:24 +0000 (06:43 -0700)]
Disable GCStress for Deserialize due to 88618 (#89072)

13 months agoAnnotate Trace.Assert/Fail with [DoesNotReturn{If}] (#89066)
Stephen Toub [Tue, 18 Jul 2023 13:38:21 +0000 (09:38 -0400)]
Annotate Trace.Assert/Fail with [DoesNotReturn{If}] (#89066)

As with Debug.Assert/Fail, by default failures result in fail fasts.  It's possible for other trace listeners to be plugged in instead, but there's no way to model that with nullable reference types.  There's no reason Trace should be on a different plan from Debug, so this moves it to having the same annotations Debug has had for years.

13 months agoImplement HttpRequestError (#88974)
Anton Firszov [Tue, 18 Jul 2023 13:30:47 +0000 (15:30 +0200)]
Implement HttpRequestError (#88974)

Fixes #76644, fixes #82168.

13 months ago[aot] Build cross compilers targeting x64/x86 hosted on arm64 (#89027)
Aleksey Kliger (λgeek) [Tue, 18 Jul 2023 13:22:12 +0000 (09:22 -0400)]
[aot] Build cross compilers targeting x64/x86 hosted on arm64 (#89027)

This PR allows an `osx-arm64` or `osx-x64` machine to produce a `mono-aot-cross` compiler that will run on the following host and create AOT images for the following targets:

| Host | Target | Test App runs |
|--------|--------|--------|
| osx-arm64 | iossimulator-x64 | ✅  |
| osx-arm64 | android-x64 | ✅   |
| osx-arm64 | android-x86 | ✅  - depends on a hack for https://github.com/dotnet/runtime/issues/89039 |

Additionally a `linux-x64` or `linux-arm64` machine can build a `mono-aot-cross` compiler for these host/target pairs:

| Host | Target | Test App runs |
|--------|--------|--------|
| linux-arm64 | android-x64 | :question: |
| linux-arm64 | linux_musl-x64 | :question: |
| linux-arm64 | android-x86 | :question: |

Related to https://github.com/dotnet/runtime/issues/82495

* [aot][ios] Build cross-compilers targeting x64 hosted on arm64

* Use MONO_CROSS_COMPILE instead of host checks

* [android][x86] Build mono-aot-cross hosted on osx-arm64 targeting android-x86

* fix build of mono-aot-cross hosted on linux-arm64 targeting android-x64

* runtime pipeline changes to build arm64 artifacts on x64 hardware

* Fix linux_musl-arm64 builds

---------

Co-authored-by: Jo Shields <directhex@apebox.org>
13 months agoDedup OnWriteResume between {ReadOnly}Memory converters (#89049)
Stephen Toub [Tue, 18 Jul 2023 11:24:19 +0000 (07:24 -0400)]
Dedup OnWriteResume between {ReadOnly}Memory converters (#89049)

13 months agoExtend SocketsHttpHandler Connection and Request telemetry (#88853)
Anton Firszov [Tue, 18 Jul 2023 11:03:39 +0000 (13:03 +0200)]
Extend SocketsHttpHandler Connection and Request telemetry (#88853)

Fixes #63159, fixes #85729.

13 months agoAdd NativeAOT runtime pack builds for osx x64/arm64 (#89018)
Alexander Köplinger [Tue, 18 Jul 2023 10:59:36 +0000 (12:59 +0200)]
Add NativeAOT runtime pack builds for osx x64/arm64 (#89018)

13 months ago[RISC-V][JIT] Fix DevDiv_718151 test (#88404)
Dong-Heon Jung [Tue, 18 Jul 2023 09:59:03 +0000 (18:59 +0900)]
[RISC-V][JIT] Fix DevDiv_718151 test (#88404)

* [RISC-V][JIT] Fix DevDiv_718151 test

* Remove HFA check on RISC-V

* [RISC-V][JIT] Update

- Update PUTARG_SPLIT
- Remove converting in PUTARG_STK

13 months agoRevert "Fix binding logic for dictionaries with complex elements (#89045)" (#89071)
Viktor Hofer [Tue, 18 Jul 2023 09:54:30 +0000 (11:54 +0200)]
Revert "Fix binding logic for dictionaries with complex elements (#89045)" (#89071)

This reverts commit 9fedcc558e8496424ee6af9fd3062c27ea3fd6e7.

13 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>
13 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>
13 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.

13 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

13 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).

13 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

13 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

13 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)

13 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

13 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

13 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)

13 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

13 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)

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

13 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>
13 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.

13 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

13 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

13 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.

13 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)

13 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.

13 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

13 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

13 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]`.

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

13 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.

13 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

13 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>
13 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>
13 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)

13 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)

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

13 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

13 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

13 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

13 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.

13 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>
13 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)

13 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

13 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

13 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)

13 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>
13 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.

13 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)

13 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)

13 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

13 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)

13 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)

13 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

13 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>
13 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.

13 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

13 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.

13 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)

13 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)

13 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>
13 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>
13 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>
13 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

13 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)

13 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

13 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)

13 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)

13 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)

13 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>
13 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.

13 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)

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

13 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

13 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)

13 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)

13 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

13 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)

13 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>
13 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

13 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)

13 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.

13 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.

13 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>
13 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>
13 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>