platform/upstream/dotnet/runtime.git
2 years ago[LoongArch64] add crossgen2 for LoongArch64. (#72017)
Qiao Pengcheng [Fri, 15 Jul 2022 23:48:48 +0000 (07:48 +0800)]
[LoongArch64] add crossgen2 for LoongArch64. (#72017)

* [LoongArch64] add crossgen2 for LoongArch64.

* add `aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_LoongArch64`

* amend the code format.

* delete unused comments.

2 years agoFix finalized SafeHandles in System.Security.Cryptography on Linux (#72279)
Stephen Toub [Fri, 15 Jul 2022 23:41:04 +0000 (19:41 -0400)]
Fix finalized SafeHandles in System.Security.Cryptography on Linux (#72279)

* Fix finalized SafeHandles in System.Security.Cryptography on Linux

* Make Jeremy happy and Stephen sad

2 years agoPermit repeating WaitHandle of infinite timeout (#72267)
Aaron Robinson [Fri, 15 Jul 2022 22:58:28 +0000 (15:58 -0700)]
Permit repeating WaitHandle of infinite timeout (#72267)

* Permit repeating WaitHandle of infinite timeout

* Add test for repeating waithandle with infinite timeout

2 years agoAdd the ability to iterate the RDNs in an X500DN
Jeremy Barton [Fri, 15 Jul 2022 22:50:51 +0000 (15:50 -0700)]
Add the ability to iterate the RDNs in an X500DN

Adds X500DistinguishedName.EnumerateRelativeDistinguishedNames and the X500RelativeDistinguishedName type.

It currently identifies multi-valued RDNs without fully supporting them.  Support could be added in the future if there's high demand.

This change also introduces looking up an OID by its encoded pattern without going through the work of decoding it into BigInteger values and a StringBuilder then String.

2 years agoUpdate Newtonsoft.Json reference in host tests to new version (#72286)
Vitek Karas [Fri, 15 Jul 2022 21:36:05 +0000 (14:36 -0700)]
Update Newtonsoft.Json reference in host tests to new version (#72286)

2 years agoUpdate dependencies from https://github.com/dotnet/llvm-project build 20220714.1...
dotnet-maestro[bot] [Fri, 15 Jul 2022 21:35:15 +0000 (21:35 +0000)]
Update dependencies from https://github.com/dotnet/llvm-project build 20220714.1 (#72259)

[main] Update dependencies from dotnet/llvm-project

2 years agoDelete unused remnants of V1 marshaller shape support (#72281)
Elinor Fung [Fri, 15 Jul 2022 21:31:17 +0000 (14:31 -0700)]
Delete unused remnants of V1 marshaller shape support (#72281)

- Remove `PinnableManagedValueMarshaller` and `NativeMarshallingAttributeInfo.IsPinnableManagedType`
- Rename `CustomNativeTypeMarshallingGenerator` -> `CustomTypeMarshallingGenerator`

2 years agoFix IndexOutOfRangeException when serializing/deserializing 4+ level deep nested...
Krzysztof Wicher [Fri, 15 Jul 2022 20:51:19 +0000 (22:51 +0200)]
Fix IndexOutOfRangeException when serializing/deserializing 4+ level deep nested types with polymorphism (#72261)

* Fix IndexOutOfRangeException when serializing/deserializing few level deep nested types with polymorphism

* move test to *.CustomTypeHierarchies.cs and add Peano roundtrip with up to 150 nesting

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.CustomTypeHierarchies.cs

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.CustomTypeHierarchies.cs

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.CustomTypeHierarchies.cs

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.CustomTypeHierarchies.cs

* Revert "Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/PolymorphicTests.CustomTypeHierarchies.cs"

This reverts commit d7fbd896506f2f4b990025ebdfb90a3adacf7cd6.

* Fix JsonSerializerOptions mappings in JsonSerializerWrapper abstractions

* Additional testing

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2 years agoFix some SafeHandle finalization in System.Net.Security (#72189)
Stephen Toub [Fri, 15 Jul 2022 19:20:55 +0000 (15:20 -0400)]
Fix some SafeHandle finalization in System.Net.Security (#72189)

There's still a lot more, but most of it appears to be inevitable given the current design and public APIs in the library, e.g. SslStreamCertificateContext creating resources it internally stores and not providing any way to explicitly clean them up.

2 years agoFix CompressionLevel.Optimal for Brotli (#72266)
Stephen Toub [Fri, 15 Jul 2022 19:14:32 +0000 (15:14 -0400)]
Fix CompressionLevel.Optimal for Brotli (#72266)

The intent of Optimal is to be a balanced trade-off between compression ratio and speed, but whereas DeflateStream, GZipStream, and ZLibStream all treat Optimal as such (using zlib's default setting for such a balanced tradeoff), Brotli treats Optimal the same as maximum compression, which is very slow.  Especially now that maximum compression is expressible as CompressionLevel.SmallestSize, it's even more valuable for Optimal to represent that balanced tradeoff.  Based on a variety of sources around the net and some local testing, I've changed the Optimal value from 11 to 4.  This is also more important now that we've fixed the argument validation bug that allowed arbitrary numerical values to be passed through unvalidated (DeflateStream, GZipStream, and ZLibStream all properly validate).

2 years agoFix loop scaling when removing a block (#72134)
Bruce Forstall [Fri, 15 Jul 2022 18:57:25 +0000 (11:57 -0700)]
Fix loop scaling when removing a block (#72134)

Due to very odd, stress-induced flow graph, on x86, the fall-through
predecessor block to an empty (but not unreachable) block was a
"catch" handler that was not reachable from the block's target (since
"catch" blocks don't have predecessors).

However, the code in fgRemoveBlock that was calling optScaleLoopBlocks
didn't make any sense, and removing it causes no diffs. So get rid of it.

Fixes #64764

2 years agoDisabling Linux Bionic tests that fail on staging. (#72256)
Ilona Tomkowicz [Fri, 15 Jul 2022 18:49:42 +0000 (20:49 +0200)]
Disabling Linux Bionic tests that fail on staging. (#72256)

* Disabling LinuxBionic tests that fail on staging.

* Attempt 2.

* Fix 3 - partial, w/o SpecialFile_Unelevated_Throws

2 years agoFix unsigned indexing with negative value on EnC (#72255)
Jakob Botsch Nielsen [Fri, 15 Jul 2022 18:46:26 +0000 (20:46 +0200)]
Fix unsigned indexing with negative value on EnC (#72255)

FixContextForEnC was treating an index that may be negative as an
unsigned value. This would crash the runtime during EnC when running as
64-bit.

Fix #70834

2 years agoDifferentiate BF disabled error messages (#72248)
Levi Broderick [Fri, 15 Jul 2022 18:44:31 +0000 (11:44 -0700)]
Differentiate BF disabled error messages (#72248)

2 years agoFixes for NonBacktracking NFA mode (#72199)
Olli Saarikivi [Fri, 15 Jul 2022 18:39:32 +0000 (11:39 -0700)]
Fixes for NonBacktracking NFA mode (#72199)

* Fix NFA mode backtracking simulation

* Refactor to StateFlags

* Fix bug in timeout check

* Changes from review

2 years agoReview error messages in JSON (#72254)
Krzysztof Wicher [Fri, 15 Jul 2022 18:38:26 +0000 (20:38 +0200)]
Review error messages in JSON (#72254)

* Review error messages in JSON

* Clarify SerializerContextOptionsImmutable

* Update src/libraries/System.Text.Json/src/Resources/Strings.resx

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.Json/src/Resources/Strings.resx

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2 years agoAdd diagnostic suppressor for the MarkMethodsAsStatic diagnostics on custom marshalle...
Jeremy Koritzinsky [Fri, 15 Jul 2022 17:00:56 +0000 (10:00 -0700)]
Add diagnostic suppressor for the MarkMethodsAsStatic diagnostics on custom marshallers (#72129)

2 years ago[RateLimiting] Rename resourceID in PartitionedRateLimiter (#72214)
Brennan [Fri, 15 Jul 2022 15:30:27 +0000 (08:30 -0700)]
[RateLimiting] Rename resourceID in PartitionedRateLimiter (#72214)

2 years agoFix most SafeHandle finalization occurrence in System.Net.Quic (#72221)
Stephen Toub [Fri, 15 Jul 2022 15:17:02 +0000 (11:17 -0400)]
Fix most SafeHandle finalization occurrence in System.Net.Quic (#72221)

* Fix most SafeHandle finalization occurrence in System.Net.Quic

All of the remaining ones are coming from SslStreamCertificateContext.

* Apply suggestions from code review

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
* Update src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
2 years agoUse a stackalloc for short SHA1 hashes
Kevin Jones [Fri, 15 Jul 2022 14:41:07 +0000 (10:41 -0400)]
Use a stackalloc for short SHA1 hashes

2 years agoDisable caching in find_program (#72250)
Adeel Mujahid [Fri, 15 Jul 2022 14:19:08 +0000 (17:19 +0300)]
Disable caching in find_program (#72250)

Unblocks #71725.
Followup: #71742

Prior to #71742, we were calling `locate_toolchain_exec` once per tool. Calling it twice with different prefix gives us the old result, which is something we don't want (we only call this local function a few times in this file, and each time for intention to "lookup" the executable).

2 years agoAdd test for receiving H3_REQUEST_REJECTED from server (#72253)
Radek Zikmund [Fri, 15 Jul 2022 13:34:27 +0000 (15:34 +0200)]
Add test for receiving H3_REQUEST_REJECTED from server (#72253)

2 years agoAnnotating libraries with small number of warnings to be AOT safe (#72108)
Lakshan Fernando [Fri, 15 Jul 2022 11:01:25 +0000 (04:01 -0700)]
Annotating libraries with small number of warnings to be AOT safe (#72108)

* Annotating librries with small number of warnings to be AOT safe

* FB

* Fix RR linux arm64 failure and remove ComponentModel annotation

2 years agoTweak SafeHandle finalization logging to include a count (#72223)
Stephen Toub [Fri, 15 Jul 2022 09:58:56 +0000 (05:58 -0400)]
Tweak SafeHandle finalization logging to include a count (#72223)

Helps to understand the impact a certain change makes and also to more easily refer to a given log entry.

2 years agolink ignored test back to filed issue (#72188)
Eirik Tsarpalis [Fri, 15 Jul 2022 09:39:26 +0000 (10:39 +0100)]
link ignored test back to filed issue (#72188)

2 years agoEnabling 9 new libraries tests for NativeAOT (#72167)
Michal Strehovský [Fri, 15 Jul 2022 08:36:26 +0000 (17:36 +0900)]
Enabling 9 new libraries tests for NativeAOT (#72167)

2 years ago[wasm] Add interop code to the browser template (#72172)
Radek Doulik [Fri, 15 Jul 2022 08:34:41 +0000 (10:34 +0200)]
[wasm] Add interop code to the browser template (#72172)

* [wasm] Add interop code to the browser template

* Try to use AnalyzerReference instead of ProjectReference

* Try to make the analyzer reference unconditional

* fix

* no namespace fix

* InstallWorkloadFromArtifacts: Update the targeting pack from the local

.. nugets.

* Wasm.Build.Tests: remove the app.ref fixup from the targets

* workload-testing.targets: Ensure that app.ref nuget is available

Co-authored-by: pavelsavara <pavel.savara@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoRecognize TrimMode=partial in ILCompiler targets (#71117)
Michal Strehovský [Fri, 15 Jul 2022 08:09:42 +0000 (17:09 +0900)]
Recognize TrimMode=partial in ILCompiler targets (#71117)

This should root all non-trimmable assemblies, same as TrimmerDefaultAction=copy.

We still support consuming ILCompiler through NuGet when targeting .NET 6, so recognize the old thing too. We might want to cut the .NET 6 support close to RC and at that time TrimmerDefaultAction handling can go away.

Related: https://github.com/dotnet/linker/pull/2856.

2 years agoUpdate UserTypeMarshallingV2.md to match approved design (#72230)
Elinor Fung [Fri, 15 Jul 2022 06:02:05 +0000 (23:02 -0700)]
Update UserTypeMarshallingV2.md to match approved design (#72230)

2 years ago[wasm] Set TrimMode=partial by default, which is equivalent to the older (#72234)
Ankit Jain [Fri, 15 Jul 2022 04:56:51 +0000 (00:56 -0400)]
[wasm] Set TrimMode=partial by default, which is equivalent to the older (#72234)

.. `TrimMode=link`.

The `TrimMode` values changed in https://github.com/dotnet/sdk/pull/26246 .

2 years agoFix chain cleanup in SslStream.SelectClientCertificate (#72222)
Stephen Toub [Fri, 15 Jul 2022 02:39:44 +0000 (22:39 -0400)]
Fix chain cleanup in SslStream.SelectClientCertificate (#72222)

The chain's elements are being disposed of _after_ the chain itself is being disposed of, which means none of the elements are actually being disposed (chain.Dispose nulls out the collection such that accessing the property again lazily initializes it to an empty one).

2 years agowasm, js interop ownership (#72215)
Pavel Savara [Fri, 15 Jul 2022 01:29:03 +0000 (03:29 +0200)]
wasm, js interop ownership (#72215)

2 years agoRemove hardcoded non trimmable assemblies in oob.proj (#72171)
Viktor Hofer [Thu, 14 Jul 2022 23:03:46 +0000 (01:03 +0200)]
Remove hardcoded non trimmable assemblies in oob.proj (#72171)

* Remove hardcoded non trimmable assemblies in oob.proj

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

Use the `TargetPathWithTargetPlatformMoniker` to flow through the IsTrimmable property that is set by projects and use that for illink validation assembly selection.

* Update oob.proj

* Update illink.targets

2 years agoRemove IsPreRelease msbuild property (#72169)
Viktor Hofer [Thu, 14 Jul 2022 23:03:26 +0000 (01:03 +0200)]
Remove IsPreRelease msbuild property (#72169)

* Remove IsPreRelease msbuild property

The property was added in https://github.com/dotnet/coreclr/commit/809b8f792923c95b9d5fee824c60dde21079cca1 years ago and isn't used anymore. Remove it to ease branding.

* Update configureplatform.cmake

2 years agoMake llvm-objcopy preferred; no required (#72208)
Adeel Mujahid [Thu, 14 Jul 2022 22:59:43 +0000 (01:59 +0300)]
Make llvm-objcopy preferred; no required (#72208)

2 years agoFix tar checksum calculation bug (#72139)
Carlos Sanchez [Thu, 14 Jul 2022 22:43:16 +0000 (15:43 -0700)]
Fix tar checksum calculation bug (#72139)

* Merge await using declarations with usages.

* Rename TarEntry test files.

* Fix tar checksum calculation bug

* Revert argument rename

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoUse open images in HTTP/SSL pools (#72218)
Juan Hoyos [Thu, 14 Jul 2022 22:42:07 +0000 (15:42 -0700)]
Use open images in HTTP/SSL pools (#72218)

* Use open image in http.yml

* Use open image in ssl.yml

2 years agoAllow marshaller entry-point type to be a struct (#72207)
Elinor Fung [Thu, 14 Jul 2022 22:07:18 +0000 (15:07 -0700)]
Allow marshaller entry-point type to be a struct (#72207)

2 years agoUse u8 in a few more places (#71992)
Stephen Toub [Thu, 14 Jul 2022 21:43:07 +0000 (17:43 -0400)]
Use u8 in a few more places (#71992)

2 years agoFix more success path finalization in System.Security.Cryptography (#72203)
Stephen Toub [Thu, 14 Jul 2022 21:40:40 +0000 (17:40 -0400)]
Fix more success path finalization in System.Security.Cryptography (#72203)

Finalizable objects being left for finalization on success paths

2 years agoFix a broken dprintf (#72198)
Andrew Au [Thu, 14 Jul 2022 21:35:16 +0000 (14:35 -0700)]
Fix a broken dprintf (#72198)

2 years agoFix stackoverflow issue when creating recursive contracts using JsonIgnoreCondition...
Eirik Tsarpalis [Thu, 14 Jul 2022 21:17:18 +0000 (22:17 +0100)]
Fix stackoverflow issue when creating recursive contracts using JsonIgnoreCondition (#72186)

* Fix stackoverflow issue when creating recursive contracts using JsonIgnoreCondition

* fix formatting

2 years agoRe-enable releaseondetach profiler test (#72144)
David Mason [Thu, 14 Jul 2022 20:11:01 +0000 (13:11 -0700)]
Re-enable releaseondetach profiler test (#72144)

2 years agoRefactor segment size computation (#71178)
Andrew Au [Thu, 14 Jul 2022 19:59:41 +0000 (12:59 -0700)]
Refactor segment size computation (#71178)

Co-authored-by: Maoni0 <maoni@microsoft.com>
2 years agoFix error handling for generic arguments constrained as Enums (#72141)
Jan Kotas [Thu, 14 Jul 2022 19:50:37 +0000 (12:50 -0700)]
Fix error handling for generic arguments constrained as Enums (#72141)

Fixes #71884

2 years agoUpdate dependencies from https://github.com/dotnet/llvm-project build 20220711.1...
dotnet-maestro[bot] [Thu, 14 Jul 2022 19:32:49 +0000 (12:32 -0700)]
Update dependencies from https://github.com/dotnet/llvm-project build 20220711.1 (#72162)

runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
 From Version 1.0.0-alpha.1.22252.1 -> To Version 1.0.0-alpha.1.22361.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoImplement HttpProtocolException for HTTP/3 (#72095)
Radek Zikmund [Thu, 14 Jul 2022 18:45:31 +0000 (20:45 +0200)]
Implement HttpProtocolException for HTTP/3 (#72095)

* Replace Http3ProtocolException with HttpProtocolException

* Correctly process incoming protocol errors

* Fix HTTP3 stress

* Add some tests

* Remove formating changes

* Code review feedback

* Fix build

* Throw HttpProtocolException from content stream as well

* Add test for throwing when reading the content stream

2 years agoGeneralize init block morphing a little (#70899)
SingleAccretion [Thu, 14 Jul 2022 18:27:16 +0000 (21:27 +0300)]
Generalize init block morphing a little (#70899)

* Generalize init block morphing a little

Make it handle arbitrary local destinations.

* Add a test

2 years agoFix incorrect buffer reallocation in AcceptSecurityContext (#72184)
Filip Navara [Thu, 14 Jul 2022 17:47:41 +0000 (19:47 +0200)]
Fix incorrect buffer reallocation in AcceptSecurityContext (#72184)

2 years ago[wasm] JSImport feedback (#72174)
Pavel Savara [Thu, 14 Jul 2022 17:31:21 +0000 (19:31 +0200)]
[wasm] JSImport feedback (#72174)

- fix exception marshaling on JSExport
- fix export class with no namespace on JSExport
- bind thisArg of function to closest scope in JSImport
Co-authored-by: Katelyn Gadd <kg@luminance.org>
2 years agoUtilize new APIs more in System.Formats.Asn1
Paulus Pärssinen [Thu, 14 Jul 2022 16:09:15 +0000 (19:09 +0300)]
Utilize new APIs more in System.Formats.Asn1

* Replace AsnWriter.Reverse with MemoryExtensions.Reverse
* Split BigInteger parsing and formatting between .NET Standard and Core where possible
* Use BinaryPrimitives in a few more places

2 years agoVector.Shuffle should use SSE2 for double overload when AVX is not availablee (#72168)
Egor Bogatov [Thu, 14 Jul 2022 15:40:53 +0000 (17:40 +0200)]
Vector.Shuffle should use SSE2 for double overload when AVX is not availablee (#72168)

2 years agoDon't explicitly link ICU into Mono (#70088)
Jo Shields [Thu, 14 Jul 2022 15:34:01 +0000 (11:34 -0400)]
Don't explicitly link ICU into Mono (#70088)

We build against FreeBSD 12, with ICU 69. By adding an explicit dynamic link against the system ICU at build time, it means we can't execute on FreeBSD 13.1, with ICU 70. Removing the linkage doesn't seem to break anything (it should be pulled in via the ICU shim in System.Globalization), but it does allow the runtime to execute okay on FreeBSD 13.1.

2 years ago[mono] Refactor UnmanagedCallersOnly_MonoAot tests (#71535)
Ivan Povazan [Thu, 14 Jul 2022 15:27:30 +0000 (17:27 +0200)]
[mono] Refactor UnmanagedCallersOnly_MonoAot tests (#71535)

* Removing UnmanagedCallersOnly_MonoAot due to duplication

* Reverting removal of UnmanagedCallersOnly_MonoAotTest

* Renaming the test to *Basic and reusing the native component

* Moving basic tests from the general test project into the basic one

* Utilizing source generator for test methods

2 years agoAdd missing inlining attribute (#72058)
Joe [Thu, 14 Jul 2022 15:24:31 +0000 (16:24 +0100)]
Add missing inlining attribute (#72058)

2 years agoConfigurationBinder should support binding private properties from ba… (#71039)
LateApexEarlySpeed [Thu, 14 Jul 2022 14:40:17 +0000 (22:40 +0800)]
ConfigurationBinder should support binding private properties from ba… (#71039)

* ConfigurationBinder should support binding private properties from base classes.

* Fix comment: consider binding 'Object' instance directly.

* Fix comment: directly use base-most methodInfo for properties; Add test cases for more get set combinations.

2 years agoRemove an assert from impHWIntrinsic (#72084)
Egor Bogatov [Thu, 14 Jul 2022 14:24:36 +0000 (16:24 +0200)]
Remove an assert from impHWIntrinsic (#72084)

2 years agoGet rid of hardcoded sleep in tracing/runtimeeventsource/nativeruntimeeventsource...
David Mason [Thu, 14 Jul 2022 10:25:32 +0000 (03:25 -0700)]
Get rid of hardcoded sleep in tracing/runtimeeventsource/nativeruntimeeventsource (#72010)

2 years agoFix WritePGOData (#72083)
Jakob Botsch Nielsen [Thu, 14 Jul 2022 08:56:55 +0000 (10:56 +0200)]
Fix WritePGOData (#72083)

We were constructing the TypeHandle before validating that the handle
did not represent an unknown handle. This crashes in the constructor in
debug builds due to some debug-only validation running there.

2 years ago[wasm][debugger][firefox] Added exception handling for Firefox onEval (#72011)
Ilona Tomkowicz [Thu, 14 Jul 2022 06:33:40 +0000 (08:33 +0200)]
[wasm][debugger][firefox] Added exception handling for Firefox onEval (#72011)

* Enabled tests for Firefox.

* Add exception catching for Firefox.

2 years agoSupport caller-allocated buffer for stateless collection marshalling (#72122)
Elinor Fung [Thu, 14 Jul 2022 05:58:42 +0000 (22:58 -0700)]
Support caller-allocated buffer for stateless collection marshalling (#72122)

- Refactor blittable element handling into a base helper for shared functionality between stateless and stateful
- Enable using a caller-allocated buffer for stateless collection marshalling

2 years ago[wasm][aot] Avoid making the 'this' variable volatile. (#71799)
Zoltan Varga [Thu, 14 Jul 2022 05:57:07 +0000 (01:57 -0400)]
[wasm][aot] Avoid making the 'this' variable volatile. (#71799)

This is only needed in non-llvmonly mode for computing stack traces in gshared methods.

2 years agoSpeed up ThreadLocalStatics_Test in DEBUG builds (#72151)
Michal Strehovský [Thu, 14 Jul 2022 04:34:28 +0000 (13:34 +0900)]
Speed up ThreadLocalStatics_Test in DEBUG builds (#72151)

Saw this test timeout in https://github.com/dotnet/runtime/pull/72077. This should decrease the amount of work done by the test by 25%. It is the longest test in DynamicGenerics. It was only recently enabled.

```
Running Test: ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test

cmdLine:D:\a\_work\1\s\artifacts\tests\coreclr\windows.x64.Debug\nativeaot\SmokeTests\DynamicGenerics\DynamicGenerics\DynamicGenerics.cmd Timed Out (timeout in milliseconds: 1800000 from variable __TestTimeout, start: 7/13/2022 7:46:11 AM, end: 7/13/2022 8:16:11 AM)
Test Harness Exitcode is : -100
```

2 years agoUse `-unicode` instead of `/unicode` for linux ildasm roundtrip tests (#71958)
Will Smith [Thu, 14 Jul 2022 01:35:19 +0000 (18:35 -0700)]
Use `-unicode` instead of `/unicode` for linux ildasm roundtrip tests (#71958)

Use `-unicode` instead of `/unicode` for linux ildasm roundtrip tests

2 years agoFix more SafeHandle cleanup in Windows crypto PAL (#72116)
Stephen Toub [Thu, 14 Jul 2022 01:33:30 +0000 (21:33 -0400)]
Fix more SafeHandle cleanup in Windows crypto PAL (#72116)

* Fix more SafeHandle cleanup in Windows crypto PAL

Most of these are actually on the success path.  These were highlighted via the System.Net.WebSockets.Client tests with the new checked SafeHandle finalization flag.

* Apply suggestions from code review

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
2 years agoFix Tar stream seeking, flushing, and argument validation (#72045)
Stephen Toub [Thu, 14 Jul 2022 00:56:34 +0000 (20:56 -0400)]
Fix Tar stream seeking, flushing, and argument validation (#72045)

2 years agoFix all outstanding S.Linq.Expressions failures (#72077)
Michal Strehovský [Thu, 14 Jul 2022 00:53:58 +0000 (09:53 +0900)]
Fix all outstanding S.Linq.Expressions failures (#72077)

Product fixes:

* Don't try to be helpful in the exception when `MakeGeneric*` constraint validation fails. CoreCLR is not helpful and S.Linq.Expressions is testing for it.
* We need to inject delegate `Invoke` method dependencies elsewhere. A test looking to reflection-invoke the `Invoke` method was failing with `MissingMetadataException` but we have no right to be failing on that per policy.

Test fixes:

* Consider NativeAOT always trimmed. We could potentially do what Mono is doing, but we currently don't support substitution files (only embedded substitutions), and NativeAOT will always be trimmed.
* Mark a test that is fundamentally incompatible (and pointless) with trimming as such.
* Add a bunch of RD.XML.

Fixes #69944. Fixes #69928. Fixes #69943.

2 years agoMix newer kernel versions into library test matrix (#71740)
Dan Moseley [Thu, 14 Jul 2022 00:34:22 +0000 (18:34 -0600)]
Mix newer kernel versions into library test matrix (#71740)

* Mix newer kernel versions into library test matrix
* Update eng/pipelines/libraries/helix-queues-setup.yml

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
2 years agoUpdate DependencyGraphViewer to allow for DGML reading (#70690)
Isabel Serrato [Thu, 14 Jul 2022 00:03:09 +0000 (17:03 -0700)]
Update DependencyGraphViewer to allow for DGML reading (#70690)

* Implement capability for users to upload .dgml files in addition to ETW events. Allows program to be run without admin permissions if the user has a .dgml file representing the dependencies in their program.

* Update UI to allow users to upload .dgml files from the file browser or the command line

* Update GUI to allow resizing of pages, clean up layout of pages

* Add test cases to ensure that graph is correctly replicated from sample .dgml files

* Restructure graph class to allow multiple edges and update GUI to show all reasons that two nodes are connected on one line

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years agoClean up runtime pack versioning logic (#72073)
Larry Ewing [Wed, 13 Jul 2022 23:53:18 +0000 (18:53 -0500)]
Clean up runtime pack versioning logic (#72073)

2 years agoILASM - Disable `fileversionpreservation` test (#71972)
Will Smith [Wed, 13 Jul 2022 23:32:46 +0000 (16:32 -0700)]
ILASM - Disable `fileversionpreservation` test (#71972)

* Disable fileversionpreservation test

* Using <IlasmRoundTripIncompatible>true</IlasmRoundTripIncompatible> to disable roundtrip test for fileversionpreservation

* Update issues.targets

2 years agoPolyfill the incremental generator ForAttributeWithMetadataName from roslyn (for...
CyrusNajmabadi [Wed, 13 Jul 2022 22:50:21 +0000 (15:50 -0700)]
Polyfill the incremental generator ForAttributeWithMetadataName from roslyn (for LibraryImportGenerator). (#71652)

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
2 years agoAvoid unnecessary duplication of XxCng instances (#72120)
Stephen Toub [Wed, 13 Jul 2022 22:41:22 +0000 (18:41 -0400)]
Avoid unnecessary duplication of XxCng instances (#72120)

And also leaving some of the originals for finalization.

2 years agoFix handling of non-bidirectional MarshalMode.Default with collection marshalling...
Elinor Fung [Wed, 13 Jul 2022 22:27:58 +0000 (15:27 -0700)]
Fix handling of non-bidirectional MarshalMode.Default with collection marshalling (#72075)

2 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20220712.1 (#72093)
dotnet-maestro[bot] [Wed, 13 Jul 2022 22:12:45 +0000 (17:12 -0500)]
Update dependencies from https://github.com/dotnet/arcade build 20220712.1 (#72093)

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22358.3 -> To Version 7.0.0-beta.22362.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoPort perf improvement changes in new API back to runtime. (#72109)
CyrusNajmabadi [Wed, 13 Jul 2022 22:01:05 +0000 (15:01 -0700)]
Port perf improvement changes in new API back to runtime. (#72109)

* Port perf improvement changes in new API back to runtime.

* Use normal type

2 years agoIf the base type is a sequential zero-sized type, treat a derived auto-layout type...
Jeremy Koritzinsky [Wed, 13 Jul 2022 21:29:46 +0000 (14:29 -0700)]
If the base type is a sequential zero-sized type, treat a derived auto-layout type as starting from field offset 0. (#72065)

2 years agoMake 'RC' lowercase in versions.props (#72110)
Carlos Sanchez [Wed, 13 Jul 2022 21:19:11 +0000 (14:19 -0700)]
Make 'RC' lowercase in versions.props (#72110)

2 years agoFix style issue in X509ChainPolicy.Clone and add some tests
Jeremy Barton [Wed, 13 Jul 2022 21:13:09 +0000 (14:13 -0700)]
Fix style issue in X509ChainPolicy.Clone and add some tests

2 years agoAdd support for building WASM variants alongside single-threaded to the build system...
Jo Shields [Wed, 13 Jul 2022 21:08:01 +0000 (17:08 -0400)]
Add support for building WASM variants alongside single-threaded to the build system (#71054)

This change adds 2 additional wasm runtime packs: multithreaded and perftrace.

2 years agoJIT: Ensure object derefs do not remove previous conditions in loop cloning (#72098)
Jakob Botsch Nielsen [Wed, 13 Jul 2022 20:23:22 +0000 (22:23 +0200)]
JIT: Ensure object derefs do not remove previous conditions in loop cloning (#72098)

Adding object dereferences was calling EnsureBlockConditions which would
reallocate all the lists, removing previous array dereferences. This
resulted in missing array null checks in some cases.

Fix #71611

2 years agoFix issue where the code fixer is not preserving the leading and trailing trivia...
Jose Perez Rodriguez [Wed, 13 Jul 2022 20:20:35 +0000 (15:20 -0500)]
Fix issue where the code fixer is not preserving the leading and trailing trivia for the regex generator (#72042)

2 years agoFix typeloader error messages for invalid byref fields (#72102)
Jan Kotas [Wed, 13 Jul 2022 19:42:14 +0000 (12:42 -0700)]
Fix typeloader error messages for invalid byref fields (#72102)

Fixes #72090

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoJIT: Disqualify delegate calls to instance methods on value classes from GDV explicit...
Jakob Botsch Nielsen [Wed, 13 Jul 2022 19:23:58 +0000 (21:23 +0200)]
JIT: Disqualify delegate calls to instance methods on value classes from GDV explicitly (#72089)

This was relying on the profile data containing the unboxing stub before.
That really only works out for dynamic PGO. Static profiles or textual
PGO data will end up with the exact method and hit a JIT assert passing
a TYP_REF this arg to a TYP_BYREF this param.

2 years ago[main] Update dependencies from dotnet/icu dotnet/emsdk (#72094)
dotnet-maestro[bot] [Wed, 13 Jul 2022 19:11:24 +0000 (14:11 -0500)]
[main] Update dependencies from dotnet/icu dotnet/emsdk (#72094)

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.7.22361.2 -> To Version 7.0.0-rc.1.22362.2

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

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.7.22361.2 -> To Version 7.0.0-rc.1.22362.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[wasm][aot] Make the gc pin area smaller. (#71807)
Zoltan Varga [Wed, 13 Jul 2022 18:40:44 +0000 (14:40 -0400)]
[wasm][aot] Make the gc pin area smaller. (#71807)

2 years ago[main] Update dependencies from dotnet/hotreload-utils (#72014)
dotnet-maestro[bot] [Wed, 13 Jul 2022 18:14:56 +0000 (13:14 -0500)]
[main] Update dependencies from dotnet/hotreload-utils (#72014)

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22354.2 -> To Version 1.1.0-alpha.0.22361.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22354.2 -> To Version 1.1.0-alpha.0.22362.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[QUIC] System.Net.Quic API made public (#72031)
Marie Píchová [Wed, 13 Jul 2022 18:02:52 +0000 (20:02 +0200)]
[QUIC] System.Net.Quic API made public (#72031)

* System.Net.Quic removed from ASP transport package and made part of SDK ref

* Removed manual references to System.Net.Quic.csproj

2 years ago[QUIC] API QuicStream (#71969)
Marie Píchová [Wed, 13 Jul 2022 18:01:56 +0000 (20:01 +0200)]
[QUIC] API QuicStream (#71969)

* Quic stream API surface

* Fixed test compilation

* Fixed http test compilation

* HttpLoopbackConnection Dispose -> DisposeAsync

* QuicStream implementation

* Fixed some tests

* Fixed all QUIC and HTTP tests

* Fixed exception type for stream closed by connection close

* Feedback

* Fixed WebSocket.Client test build

* Feedback, test fixes

* Fixed build on framework and windows

* Fixed winhandler test

* Swap variable based on order in defining class

* Post merge fixes

* Feedback and build

* Reverted connection state to pass around abort error code

* Fixed exception type.

2 years agoSupport top-level statements in regex analyzer (#72046)
Youssef Victor [Wed, 13 Jul 2022 16:49:41 +0000 (18:49 +0200)]
Support top-level statements in regex analyzer (#72046)

* Support top-level statements in regex analyzer

* Apply test suggestion

* Address feedback

2 years agoBackport action: fix link to set org membership visibility (#72005)
Alexander Köplinger [Wed, 13 Jul 2022 13:49:45 +0000 (15:49 +0200)]
Backport action: fix link to set org membership visibility (#72005)

We need to target the GitHub org that owns the repo, otherwise the collaborator check API doesn't work (i.e. check for dotnet instead of the Microsoft org).

2 years agoFix solution files via slngen (#72059)
Pavel Savara [Wed, 13 Jul 2022 13:29:33 +0000 (15:29 +0200)]
Fix solution files via slngen (#72059)

* Remove System.Private.Runtime.InteropServices.JavaScript from solutions

* slngen

2 years ago[wasm] Re-enable `System.Text.RegularExpressions.Tests.csproj` (#72076)
Ankit Jain [Wed, 13 Jul 2022 13:29:20 +0000 (09:29 -0400)]
[wasm] Re-enable `System.Text.RegularExpressions.Tests.csproj` (#72076)

The linker bump in https://github.com/dotnet/linker/pull/2889 should
have fixed the issue.

Closes https://github.com/dotnet/runtime/issues/71848 .

2 years agoMore reliably clean up more SafeHandle instances (#71991)
Stephen Toub [Wed, 13 Jul 2022 11:09:36 +0000 (07:09 -0400)]
More reliably clean up more SafeHandle instances (#71991)

* More reliably clean up more SafeHandle instances

This calls Dispose on SafeHandles (or things wrapping SafeHandles) that were otherwise being left for finalization:
1. Some of these are fixing finalization happening even on success paths (typically where the implementation isn't disposing of something that directly or indirectly wraps a SafeHandle).
2. Some of these are fixing finalization happening for invalid SafeHandles.
3. Some of these are fixing tests to finalize less.  My goal with fixing the tests was to eliminate the noise in order to find instances of the other two cases.

These were found primarily via two means:
- Debug-instrumentation in SafeHandle to log when one is finalized.  This instrumentation is built into debug/checked builds of SafeHandle and requires setting the DEBUG_SAFEHANDLE_FINALIZATION environment variable to "1".
- Auditing use of SafeHandle.IsInvalid

There's a lot more that can be cleaned up using the SafeHandle instrumentation, but I'm pausing here for now.  The System.IO.Pipes, System.IO.FileSystem, and System.Security.Cryptography tests are clean on Windows.

2 years agoFix ConsoleStream.Flush to not throw for stdin (#72035)
Stephen Toub [Wed, 13 Jul 2022 10:07:02 +0000 (06:07 -0400)]
Fix ConsoleStream.Flush to not throw for stdin (#72035)

* Fix ConsoleStream.Flush to not throw for stdin

Stream.Flush{Async} is supposed be a nop on a read-only stream.

* Disable new test on unsupported platforms

2 years agoMark JsonSerializerOptions.TypeInfoResolver as nullable and linker-safe (#72044)
Eirik Tsarpalis [Wed, 13 Jul 2022 10:03:23 +0000 (11:03 +0100)]
Mark JsonSerializerOptions.TypeInfoResolver as nullable and linker-safe (#72044)

* Mark JsonSerializerOptions.TypeInfoResolver as nullable and linker-safe

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs

* Ensure TypeInfoResolver value is always populated in JsonSerializerOptions.Default

2 years ago[QUIC] API QuicConnection (#71783)
Marie Píchová [Wed, 13 Jul 2022 07:22:00 +0000 (09:22 +0200)]
[QUIC] API QuicConnection (#71783)

* Listener comment; PreviewFeature attribute

* Feedback

* QuicConnection new API including compilable implementation

* Fixed logging

* Fixed S.N.Quic and S.N.Http tests

* Options now correspond to the issue

* Feedback

* Comments, PreviewFeature attribute and RemoteCertificate disposal.

* Preview feature attribute is assembly wide

* Some typos

* Fixed test with certificate

* Default values as constants

* Event handlers split into methods called via switch expression.

* Some more comments

* Unified unsafe usage

* Fixed some more tests

* Cleaned up some exceptions and resource strings.

* Feedback

* Latest greatest API proposal.

* Fixed Http solution

* Feedback

2 years agoBump main version to RC1 (#72068)
Carlos Sanchez [Wed, 13 Jul 2022 06:46:40 +0000 (23:46 -0700)]
Bump main version to RC1 (#72068)

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years ago[wasm][debugger] Show correct and complete function names on callstack (#72048)
Thays Grazia [Wed, 13 Jul 2022 06:42:52 +0000 (03:42 -0300)]
[wasm][debugger] Show correct and complete function names on callstack (#72048)

* Fixing 71553

* Fixing merge.

* Addressing @radical comments.

* Addressing @radical comments

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* addressing @radical comments.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Remove console.writeline

* Fix compilation error

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoILASM - Allow EntryPoint methods to be on interfaces (#71975)
Will Smith [Wed, 13 Jul 2022 05:51:45 +0000 (22:51 -0700)]
ILASM - Allow EntryPoint methods to be on interfaces (#71975)