Ankit Jain [Thu, 28 Jul 2022 11:30:40 +0000 (07:30 -0400)]
[wasm] Wasm.Build.Tests: Use Chrome on windows, instead of V8 (#72983)
* [wasm] Wasm.Build.Tests: Use Chrome on windows, instead of V8
* Wasm.Build.Tests: Completely disable running tests with V8 on windows
Meri Khamoyan [Thu, 28 Jul 2022 09:13:34 +0000 (13:13 +0400)]
#53624 enable test suites in maccatalyst (#72445)
* #53624 enable test suites in maccatalyst and update ntrampolines
Pavel Savara [Thu, 28 Jul 2022 08:20:58 +0000 (10:20 +0200)]
[wasm] remove support for CommonJS (#72865)
Anton Lapounov [Thu, 28 Jul 2022 06:38:38 +0000 (23:38 -0700)]
Implement ControlledExecution API (#71661)
Marek Safar [Thu, 28 Jul 2022 06:13:35 +0000 (08:13 +0200)]
Add extra Module.ModuleHandle test (#72875)
* Add extra Module.ModuleHandle test
* Update src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix mono implementation
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Juan Hoyos [Thu, 28 Jul 2022 05:22:35 +0000 (22:22 -0700)]
Minor cleanup in MethodDesc::GetPrecompiledCode (#72963)
Michal Strehovský [Thu, 28 Jul 2022 04:34:13 +0000 (13:34 +0900)]
Bump timeout on ARM64 NativeAOT legs (#72974)
Yusuke Yamada [Thu, 28 Jul 2022 03:42:13 +0000 (12:42 +0900)]
[wasm][wbt] Test that `dotnet.js` could be run from any current directory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
Michal Strehovský [Thu, 28 Jul 2022 00:19:57 +0000 (09:19 +0900)]
Add memory fences to ByRefAssignRef on Unix ARM64 (#72919)
Dan Moseley [Thu, 28 Jul 2022 00:17:24 +0000 (18:17 -0600)]
Disable tests that wait for compaction (#72954)
Adeel Mujahid [Thu, 28 Jul 2022 00:14:53 +0000 (03:14 +0300)]
Rename [RegexGenerator] to [GeneratedRegex] (#72434)
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Will Smith [Thu, 28 Jul 2022 00:02:51 +0000 (17:02 -0700)]
Fixed HWIntrinsic reflection bug with `NextCallReturnAddress` intrinsic (#72505)
* Adding more asserts
* Another assert
* Force add a label
* Extra check
* Remove cookie set
* Added check for compHasNextCallRetAddr for hw intrinsics
* Added additional checks
* Conslidate compHasNextCallRetAddr
* Remove extra assert
* Fixing some logic
* Remove opt check
* Reverting back to original nextcallretaddr logic
* Fix formatting
* Fix formatting
Alexander Köplinger [Wed, 27 Jul 2022 22:30:28 +0000 (00:30 +0200)]
Remove a few hardcoded instances of "net7.0" (#72950)
Follow-up to https://github.com/dotnet/runtime/pull/71129.
The xunit runner package defines a property `XunitConsoleNetCore21AppPath` which (despite the name) points to the xunit.console.dll, we can use that instead.
The properties for the workloads/installer tasks aren't needed either since the packages already define them.
Wraith [Wed, 27 Jul 2022 22:03:11 +0000 (23:03 +0100)]
Add SqlTypes apis for SqlClient (#72724)
* SqlMoney changes
* SqlDecimal changes
* SqlBinary changes
* add CLS compliance attributes
Jeremy Barton [Wed, 27 Jul 2022 21:41:39 +0000 (14:41 -0700)]
Make revocation tests use CRLBuilder when it can instead of its own copy
Jeremy Barton [Wed, 27 Jul 2022 21:39:51 +0000 (14:39 -0700)]
Disable CrlBuilderTests.BuildEmptyRsaPss on Android
Huo Yaoyuan [Wed, 27 Jul 2022 21:39:30 +0000 (05:39 +0800)]
CMake support in VS open folder for coreclr (#70285)
* Basic building support
* Add windows platform matrix
* Add open folder debug instructions
Fan Yang [Wed, 27 Jul 2022 17:17:06 +0000 (13:17 -0400)]
[Mono][Arm64] Instrinsify methods for Vector4 on Arm64 (#72124)
* Initial change to enable intrinsics for Vector4 on arm64
* Fix return
* Add test app
* Also the makefile change
* Fix return type handling from vector to struct
* Fix wasm build failure
* Handle volatile argument
* Promote SIMD return to value
* Address review feedback and add intrinsify more methods
* Assign a NULL pointer to retval
* Remove unused local var
* Fix build warning
Giuseppe Marazzi [Wed, 27 Jul 2022 17:03:19 +0000 (19:03 +0200)]
Add support for int keyed dictionaries to configuration binder (#71609)
* Add support for int keyed dictionaries to configuration binder
* PR feedback
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Jeremy Barton [Wed, 27 Jul 2022 16:56:05 +0000 (09:56 -0700)]
Add BuildCrlDistributionPointExtension
Steve Pfister [Wed, 27 Jul 2022 16:08:59 +0000 (09:08 -0700)]
[wasm] Modify workload to pick threading runtime packs (#72412)
* [wasm] Modify workload to pick threading runtime packs
This change adds the 2 wasm threading runtime packs to the wasm workload. In order for a threading runtime pack to be chosen, WorkloadManifest.targets is also modified to override the runtime pack name when the following props are set:
WasmEnableThreads - full threading support and will load Microsoft.NETCore.App.Runtime.multithread.Mono.browser-wasm
WasmEnablePerfTrace - runtime only threading support and will load Microsoft.NETCore.App.Runtime.perftrace.Mono.browser-wasm
* Add error condition when both WasmEnableThreading and WasmEnablePerfTrace are true
* [wasm] Set default value for MonoWasmBuildVariant, for runtime pack nuget
* [wasm] Wasm.Build.Tests: build runtime pack nugets with different names
- The earlier approach of simply making copies of the existing runtime
pack nuget with different names doesn't work, and `dotnet workload
install` rejects it.
```
Installing pack Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm version 7.0.0-ci...
Workload installation failed. Rolling back installed packs...
```
Instead, now we build the missing nugets from the project with different
values for `$(MonoWasmBuildVariant)`.
- this handles local builds, and incremental builds also
- To skip building the missing nugets, for example, when you have all of
them available, then set `WasmSkipMissingRuntimePackBuild=true`.
* fix comment
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Radek Zikmund [Wed, 27 Jul 2022 16:00:59 +0000 (18:00 +0200)]
Disable ReadAsync_CancelPendingValueTask_ThrowsCancellationException for Http1 (#72854)
Tarek Mahmoud Sayed [Wed, 27 Jul 2022 15:58:54 +0000 (15:58 +0000)]
Fix the NJulianRuleTest when running with libc check builds (#72893)
Co-authored-by: Tarek Ghonaim <tarek@Tarek-Family.localdomain>
Eric StJohn [Wed, 27 Jul 2022 15:30:43 +0000 (08:30 -0700)]
Remove InvalidOperationException when reading system properties from EventLogRecords (#72913)
Alexander Köplinger [Wed, 27 Jul 2022 15:13:27 +0000 (17:13 +0200)]
Bump timeout for "CoreCLR Tools Unit Tests Linux x64 checked" (#72928)
We recently saw more instances of this job running into the default 60mins timeout, bump it to 120mins
Kunal Pathak [Wed, 27 Jul 2022 14:51:28 +0000 (07:51 -0700)]
Re-enable throwinnestedtrycatch_il_r test (#72901)
Jakob Botsch Nielsen [Wed, 27 Jul 2022 14:50:11 +0000 (16:50 +0200)]
Fix a couple of issues when using textual PGO input (#72773)
* Ensure non generic method defs when using textual PGO
* Allow static profiles to contain static methods for non-delegate calls
The textual PGO format currently just describes methods by name and does
not include signature information/generic instantiations. This means we
may see various edge cases here. These particular cases would hit asserts.
Jakob Botsch Nielsen [Wed, 27 Jul 2022 14:48:31 +0000 (16:48 +0200)]
JIT: Avoid removing multi-use boxes (#72842)
There was an assumption that the local operand to a GT_BOX node is
single-use which was being violated when GDV clones these as arguments.
We now allow multi-uses of these locals by setting a flag when cloning
and then handle it in gtTryRemoveBoxUpstreamEffects.
There is also GTF_VAR_CLONED that would be set on the local itself, but
given that transformations can affect the operand local node arbitrarily
I went with another of these type of flags on GT_BOX instead.
Fix #72775
Kunal Pathak [Wed, 27 Jul 2022 14:14:42 +0000 (07:14 -0700)]
Enable GitHub_35821 (#72900)
Pavel Savara [Wed, 27 Jul 2022 13:50:37 +0000 (15:50 +0200)]
enable https://github.com/dotnet/runtime/issues/53957 and https://github.com/dotnet/runtime/issues/57519 (#72843)
Stephen Toub [Wed, 27 Jul 2022 13:05:59 +0000 (09:05 -0400)]
Add missing System.Net docs (#72459)
* Add missing System.Net docs
* Address PR feedback
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/MediaTypeHeaderValue.cs
Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
Aleksey Kliger (λgeek) [Wed, 27 Jul 2022 12:09:41 +0000 (08:09 -0400)]
[mini] Emit a null check using MONO_EMIT_NEW_CHECK_THIS for GetArrayDataReference (#72897)
using MONO_EMIT_NULL_CHECK does not emit a null check in the backend
if the pointer is otherwise unused
Fixes https://github.com/dotnet/runtime/issues/72745
dotnet bot [Wed, 27 Jul 2022 11:16:12 +0000 (04:16 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1906193 (#72884)
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1905001
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1905340
dotnet-maestro[bot] [Wed, 27 Jul 2022 10:47:26 +0000 (12:47 +0200)]
[main] Update dependencies from 8 repositories (#72448)
* Update dependencies from https://github.com/dotnet/icu build
20220718.1
Microsoft.NETCore.Runtime.ICU.Transport
From Version 7.0.0-rc.1.22362.2 -> To Version 7.0.0-rc.1.22368.1
* Update dependencies from https://github.com/dotnet/xharness build
20220719.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.22358.1 -> To Version 1.0.0-prerelease.22369.1
* Update dependencies from https://github.com/dotnet/emsdk build
20220718.1
Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
From Version 7.0.0-rc.1.22362.2 -> To Version 7.0.0-rc.1.22368.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20220718.2
Microsoft.CodeAnalysis.NetAnalyzers
From Version 7.0.0-preview1.22365.1 -> To Version 7.0.0-preview1.22368.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20220718.4
runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22259.2 -> To Version 14.0.0-alpha.1.22368.4
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20220719.1
Microsoft.CodeAnalysis.NetAnalyzers
From Version 7.0.0-preview1.22365.1 -> To Version 7.0.0-preview1.22369.1
* Update dependencies from https://github.com/dotnet/msquic build
20220721.1
System.Net.MsQuic.Transport
From Version 7.0.0-alpha.1.22366.1 -> To Version 7.0.0-alpha.1.22371.1
* Update dependencies from https://github.com/dotnet/llvm-project build
20220721.1
runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22259.2 -> To Version 14.0.0-alpha.1.22371.1
* Update dependencies from https://github.com/dotnet/xharness build
20220722.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.22358.1 -> To Version 1.0.0-prerelease.22372.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20220723.2
Microsoft.CodeAnalysis.NetAnalyzers
From Version 7.0.0-preview1.22365.1 -> To Version 7.0.0-preview1.22373.2
* Update dependencies from https://github.com/dotnet/runtime build
20220724.4
Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
From Version 7.0.0-preview.7.22358.7 -> To Version 7.0.0-rc.1.22374.4
* Update dependencies from https://github.com/dotnet/xharness build
20220725.5
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.22358.1 -> To Version 1.0.0-prerelease.22375.5
* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build
20220725.7
optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
From Version 1.0.0-prerelease.22355.3 -> To Version 1.0.0-prerelease.22375.7
* Update dependencies from https://github.com/dotnet/icu build
20220725.1
Microsoft.NETCore.Runtime.ICU.Transport
From Version 7.0.0-rc.1.22362.2 -> To Version 7.0.0-rc.1.22375.1
* Update dependencies from https://github.com/dotnet/llvm-project build
20220725.2
runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22259.2 -> To Version 14.0.0-alpha.1.22375.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20220726.1
runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22259.2 -> To Version 11.1.0-alpha.1.22376.1
* Update dependencies from https://github.com/dotnet/llvm-project build
20220726.2
runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22259.2 -> To Version 11.1.0-alpha.1.22376.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20220726.4
runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
From Version 11.1.0-alpha.1.22259.2 -> To Version 11.1.0-alpha.1.22376.4
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
SingleAccretion [Wed, 27 Jul 2022 09:27:06 +0000 (12:27 +0300)]
Don't create mismatched block copies in `cpblk` import (#71160)
* Don't create questionable IR in "cpblk" import
* Add a test
Dan Moseley [Wed, 27 Jul 2022 09:20:11 +0000 (03:20 -0600)]
Redisable GetAndSet_AreThreadSafe_AndUpdatesNeverLeavesNullValues test (#72882)
Jan Kotas [Wed, 27 Jul 2022 07:07:03 +0000 (00:07 -0700)]
Delete DelegateInvokeThunk (#72903)
- DelegateInvokeThunk used by Delegate.DynamicInvoke was redundant with delegate Invoke method that is always preserved for delegates. The implementation of the DelegateInvokeThunk was even piggy backing on the delegate Invoke method for default parameter values.
- Add generic cache for per-type scenario specific data. Switched over Enum info to use it (same as CoreCLR), and leverage it for caching of the dynamic delegate info.
- nullability annotation fixes
This is prep-work for #72548
Eric Erhardt [Wed, 27 Jul 2022 06:33:05 +0000 (00:33 -0600)]
Add a test that ensures we are using SubtleCrypto in WASM crypto tests (#72892)
* Add a test that ensures we are using SubtleCrypto in WASM crypto tests
Fix #69740
* Update src/libraries/System.Security.Cryptography/tests/wasm.helix.targets
* Update src/libraries/System.Security.Cryptography/tests/wasm.helix.targets
* Update src/libraries/System.Security.Cryptography/tests/wasm.helix.targets
* Update src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj
* Fix typos
Co-authored-by: Ankit Jain <radical@gmail.com>
Adeel Mujahid [Wed, 27 Jul 2022 03:53:46 +0000 (06:53 +0300)]
Update upstream ref for arm fp unwind support (#71857)
Andy Ayers [Wed, 27 Jul 2022 02:59:41 +0000 (19:59 -0700)]
Exclude JIT/opt/ValueNumbering/TypeTestFolding from crossgen2 testing (#72878)
See #72822.
Simon Rozsival [Wed, 27 Jul 2022 02:25:30 +0000 (04:25 +0200)]
Change issue number (#72863)
Stephen Toub [Wed, 27 Jul 2022 02:03:34 +0000 (22:03 -0400)]
Add [Shared] to two CodeFixProviders (#72885)
Steve Pfister [Wed, 27 Jul 2022 01:37:30 +0000 (18:37 -0700)]
[iOS] Skip test suites that take too long to build on helix (#72849)
System.Text.RegularExpressions, Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests, and STJ source generator tests take too long to build on helix and time out before any tests are run. This is due in part to the amount of aot'd code, which ends up ballooning the app size to around 1GB. The solution is to enable aggressive trimming targets that are in tests.mobile.targets as this will shrink the app size considerably.
Skipping these tests for now.
Addresses https://github.com/dotnet/runtime/issues/72834
Addresses https://github.com/dotnet/runtime/issues/72836
Steve Pfister [Wed, 27 Jul 2022 01:36:59 +0000 (18:36 -0700)]
[iOS] Fix ZipPackage_CreateWithFileAccessWrite test (#72850)
On iOS, this test was failing due to not being able to write files in the app root directory. The fix is to write a file in the TestDirectory, which is a subdirectory under the app root and is writeable.
Fixes https://github.com/dotnet/runtime/issues/72837
Stephen Toub [Wed, 27 Jul 2022 01:00:36 +0000 (21:00 -0400)]
Fix Enumerable.Chunk throughput regression (#72811)
* Fix Enumerable.Chunk throughput regression
We previously changed the implementation of Enumerable.Chunk to avoid significantly overallocating in the case of the chunk size being a lot larger than the actual number of elements. We instead switched to a doubling scheme ala `List<T>`, and I pushed for us to just use `List<T>` to keep things simple. However, in doing some perf measurements I noticed that for common cases Chunk is now around 20% slower in throughput than it was previously, which is a bit too much too swallow, and the code that just uses an array directly isn't all that much more complicated; it also affords the ability to avoid further overallocation when doubling the size of the storage, which should ideally be capped at the chunk size. This does so and fixes the throughput regression.
* Address PR feedback
Stephen Toub [Wed, 27 Jul 2022 00:52:40 +0000 (20:52 -0400)]
Avoid a couple theoretical reorderings in ManualResetValueTaskSourceCore (#72657)
In a typical usage sequence, GetStatus is called and then GetResult is called. If the read of _result in GetResult could move to before the read of _continuation in GetStatus, then there could be a race condition where _result is read prior to it being written, then _continuation is set as part of the operation completing, and the implementation ends up returning an erroneous result. Similarly, in SignalCompletion, if the read of _continuationState could moved to before the first read of _continuation, it could be stale.
Stephen Toub [Wed, 27 Jul 2022 00:18:34 +0000 (20:18 -0400)]
Fix undisposed RegistryKeys in Microsoft.Win32.Registry tests (#72117)
Youssef Victor [Tue, 26 Jul 2022 23:31:56 +0000 (01:31 +0200)]
Simplify UpgradeToRegexGenerator (#72538)
* Minor refactoring for UpgradeToRegexGenerator
* Don't use properties bag
* Rename
* Update UpgradeToRegexGeneratorCodeFixer.cs
* Update src/libraries/System.Text.RegularExpressions/gen/UpgradeToRegexGeneratorCodeFixer.cs
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Olli Saarikivi [Tue, 26 Jul 2022 23:31:20 +0000 (16:31 -0700)]
Add missing case in PruneLowerPriorityThanNullability (#72871)
* Add missing case in pruning
* Enable previously failing Rust test
Ankit Jain [Tue, 26 Jul 2022 23:18:51 +0000 (19:18 -0400)]
[wasm] Add `runtime-wasm-perf` pipeline (#72119)
- This adds a new `runtime-wasm-perf` pipeline, which can be run manually with `/azp run runtime-wasm-perf`
- Essentially, splits the perf jobs into `perf-wasm-jobs.yml`, and `perf-non-wasm-jobs.yml`
- It does not change the existing perf pipeline
- this will run all the wasm benchmarks, but it doesn't support comparing results yet
- A follow up PR will add perf jobs to the runtime pipelines, for sanity check, and won't run the full set of benchmarks.
Dan Moseley [Tue, 26 Jul 2022 22:36:01 +0000 (16:36 -0600)]
Fix EncryptDecrypt test (#72874)
* Fix EncryptDecrypt test
* more retries
Josie Bigler [Tue, 26 Jul 2022 22:33:45 +0000 (17:33 -0500)]
Make TypeBuilder.CreateType return non nullable (#72180)
* Make TypeBuilder.CreateType return non nullable
There is no situation when TypeBuilder.CreateType will return null when
being called by user-code.
issue #68840
* Update tests for null check after module.CreateGlobalFunctions()
* Check not null for additional CreateType Unit Tests
* Remove ! from DispatchProxyGenerator CreateType()
* Update Ref for non-null CreateType
* Change CreateTypeInfo to return non-null.
* Refactored CreateTypeInfo().AsType() to be CreateType()
* Annotate failing Mono Assert.Null
Anton Firszov [Tue, 26 Jul 2022 22:11:56 +0000 (00:11 +0200)]
Tear down pending HTTP connection when the originating request completes (#71785)
Resolves #66297
Tarek Mahmoud Sayed [Tue, 26 Jul 2022 21:15:19 +0000 (21:15 +0000)]
Fix Idna Test (#72817)
* Fix Idna Test
* Update src/libraries/System.Globalization.Extensions/tests/IdnMapping/Data/Unicode_9_0/Unicode_9_0_IdnaTest.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Steve Dunn [Tue, 26 Jul 2022 21:12:21 +0000 (22:12 +0100)]
Finds logger field in related types (#71308)
Jeff Handley [Tue, 26 Jul 2022 20:52:16 +0000 (13:52 -0700)]
Add pod names into the area-owners.json file to support querying by pod (#72564)
* Add pod names into the area-owners.json file to support querying by pod
* Keep teams in the list of area owners
* Add Eric Erhardt to System.Globalization
Stephen Toub [Tue, 26 Jul 2022 20:48:46 +0000 (16:48 -0400)]
Change RegexGenerator to produce limited implementation for C# < 11 (#72860)
Today the RegexGenerator fails to produce any code for GeneratedRegex if the LangVersion is 10 or lower. However, that restriction only exists because the code generated for a regex implementation contains use of language features only available in C# 11 and newer. Rather than failing outright for 10 or lower, we can just fall back to the limited support implementation that just caches an instance of the regex. That still provides some value and makes it easier to transition between language versions.
Jose Perez Rodriguez [Tue, 26 Jul 2022 20:45:55 +0000 (15:45 -0500)]
Enabling some tests back onto the Interpreted engine (#72639)
Jeremy Koritzinsky [Tue, 26 Jul 2022 20:24:06 +0000 (13:24 -0700)]
Enable the ConvertToLibraryImport diagnostic by default (#72819)
SingleAccretion [Tue, 26 Jul 2022 19:30:12 +0000 (22:30 +0300)]
Consolidate importer spilling code V2 (#72744)
* Consolidate importer spilling code (#72291)
* Add tests
* Fix losing GLOB_REF on the LHS
The comment states we don't need it, which is incorrect.
Diffs are improvements because we block forward substitution of
calls into "ASG(BLK(ADDR(LCL_VAR<field>, ...)))", which allows
morph to leave the "can be replaced with its field" local alone.
* Prospective fix
Spill "glob refs" on stores to "aliased" locals.
* Delete now-not-necessary code
* Fix up asserts
* Clean out '(unsigned)CHECK_SPILL_ALL/NONE' casts
* Don't manually spill for 'st[s]fld'
* Revert 'Clean out '(unsigned)CHECK_SPILL_ALL/NONE' casts'
* Fix assignments done via return buffers
The mistake in logic was that the only trees which could modify
unaliased locals are assignments, which is not true, calls can
do that as well.
One day we will move the return buffer handling out of importer,
but until then, special handling is required.
An alternative fix would have been to bring back the explicit
"impSpillLclRefs" to "stloc/starg" code, but that would contradict
the overall goal of consolidating the spilling logic.
Marie Píchová [Tue, 26 Jul 2022 18:07:03 +0000 (20:07 +0200)]
[QUIC] Remove connection state from QuicStream (#72599)
* Removed connection state, updated mqsuic and fixed exceptions
* Feedback
* Feedback
Jake Yallop [Tue, 26 Jul 2022 17:54:51 +0000 (18:54 +0100)]
System.Text.Json - Emit XML comments for public source-generated APIs (#72761)
* Emit XML comments for public source-generated APIs
* Rename tildeIndex to backTickIndex for consistency
* Simplify XML comments
* Update JsonTypeInfo<T> XML comment
Carsten Schuette [Tue, 26 Jul 2022 17:40:42 +0000 (19:40 +0200)]
Fix for #70007, fallback to old implementation if optimized way fails (#70073)
* Fallback to old implementation if optimized way to query process name fails (#70007)
* Add helper tool that reads the parent process name and writes it to the console (#70007)
* Add test
* Revert "Add helper tool that reads the parent process name and writes it to the console (#70007)"
This reverts commit
fa3addb0dd6c61b8cc238238e106ad8f3b6da9ae.
* Remove extra newline
Co-authored-by: David Cantú <dacantu@microsoft.com>
Jeremy Koritzinsky [Tue, 26 Jul 2022 17:16:37 +0000 (10:16 -0700)]
Add analyzer support to validate the stateless marshaller shapes (#72643)
Stephen Toub [Tue, 26 Jul 2022 16:40:00 +0000 (12:40 -0400)]
Fix missing shifting of Match._textxx fields (#72728)
This regressed during the work to support spans. The Match._textxx fields were set based on the span positions rather than the input string positions, so if the input string had a non-zero beginning value, these fields would be off by that amount. That then impacts NextMatch, as these values are fed into it.
While fixing this, I noticed that the _textstart field was wholely unnecessary and deleted it. I also noticed we were unnecessarily passing around some values that weren't needed (e.g. a runtextbeg value that would always be 0), and re-storing the _regex object that can't ever change, and addressed those.
Jeremy Barton [Tue, 26 Jul 2022 16:36:53 +0000 (09:36 -0700)]
Add CertificateRevocationListBuilder
The type can create CRLs, and can load the RevocationList aspect of an existing CRL into a new builder,
but there is not support at this time for inspecting a CRL.
Michał Petryka [Tue, 26 Jul 2022 16:31:15 +0000 (18:31 +0200)]
Clarify the purpose of the official discord (#72861)
William Godbe [Tue, 26 Jul 2022 16:28:13 +0000 (09:28 -0700)]
Make RateLimiterOptions follow Options pattern (#72530)
* Update ConcurrencyLimiterOptions.cs
* Update FixedWindowRateLimiterOptions.cs
* Update FixedWindowRateLimiterOptions.cs
* Update FixedWindowRateLimiterOptions.cs
* Update SlidingWindowRateLimiterOptions.cs
* Update TokenBucketRateLimiterOptions.cs
* Update ConcurrencyLimiter.cs
* Update FixedWindowRateLimiter.cs
* Update SlidingWindowRateLimiter.cs
* Update TokenBucketRateLimiter.cs
* Update ChainedLimiterTests.cs
* Update ConcurrencyLimiterOptions.cs
* Update FixedWindowRateLimiterOptions.cs
* Update SlidingWindowRateLimiterOptions.cs
* Update TokenBucketRateLimiterOptions.cs
* Update RateLimitPartition.cs
* Update System.Threading.RateLimiting.cs
* Update ChainedLimiterTests.cs
* Update ConcurrencyLimiter.cs
* Update FixedWindowRateLimiter.cs
* Update SlidingWindowRateLimiter.cs
* Update TokenBucketRateLimiter.cs
* Update ConcurrencyLimiterOptions.cs
* Update FixedWindowRateLimiterOptions.cs
* Update SlidingWindowRateLimiterOptions.cs
* Update ChainedLimiterTests.cs
* Update ChainedLimiterTests.cs
* Fix tests
* Update ConcurrencyLimiter.cs
* Update FixedWindowRateLimiter.cs
* Update SlidingWindowRateLimiter.cs
* Update TokenBucketRateLimiter.cs
* Update FixedWindowRateLimiter.cs
* Update SlidingWindowRateLimiter.cs
* Update TokenBucketRateLimiter.cs
* Update FixedWindowRateLimiterTests.cs
* Update SlidingWindowRateLimiterTests.cs
* Update TokenBucketRateLimiterTests.cs
* Update TokenBucketRateLimiter.cs
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiter.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiter.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update FixedWindowRateLimiter.cs
* Update SlidingWindowRateLimiter.cs
* Fixup
* Whitespace
* ArgumentNullException
* React to test change
* Fix tests
* Another test fix
* Feedback
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/ConcurrencyLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/FixedWindowRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/FixedWindowRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/SlidingWindowRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/SlidingWindowRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Update src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/TokenBucketRateLimiterOptions.cs
Co-authored-by: Brennan <brecon@microsoft.com>
* Fix checks, add test
Co-authored-by: Brennan <brecon@microsoft.com>
Pavel Savara [Tue, 26 Jul 2022 14:47:26 +0000 (16:47 +0200)]
[wasm] optimize WebSocket perf for small buffers (#72800)
* use MemoryHandle instead of ArraySegment marshaling to improve WS performance for small buffers
* re-use responseStatus buffer
Radek Zikmund [Tue, 26 Jul 2022 14:43:30 +0000 (16:43 +0200)]
Remove Http3RequestStream from _activeRequest when response is read/aborted. (#72670)
* Remove Http3RequestStream from _activeRequest when response is read/aborted.
* Add time limit in test
* Wait for both sides to be completed
* Code review feedback
Natalia Kondratyeva [Tue, 26 Jul 2022 14:28:16 +0000 (16:28 +0200)]
Fix running HTTP stress tests on local docker (#72844)
Mitchell Hwang [Tue, 26 Jul 2022 13:50:03 +0000 (09:50 -0400)]
[iOS] Enable System.Data.Common tests (#72554)
* [libs] Reenable TokenForEmptyFilter Microsoft.Extensions.FileProviders.Physical Test
* [iOS] Enable System.Data.Common Tests
Viktor Hofer [Tue, 26 Jul 2022 13:35:36 +0000 (15:35 +0200)]
Emit warning instead of an error in package compat (#72518)
Based on the discussed in https://github.com/open-telemetry/opentelemetry-dotnet/issues/3448, we are now emitting a warning instead of an error on unsupported target frameworks. We still explicitly indicate that this is an unsupported scenario but don't actively block consumers anymore and also indicate how to suppress the warning.
Pavel Savara [Tue, 26 Jul 2022 11:52:15 +0000 (13:52 +0200)]
[wasm] improve startup (#72275)
- streaming wasm instantiation
- more parallel download of DLLs
- new hook `downloadResource` and `config.assets[].resolvedUrl `
- improved `locateFile` allows to run dotnet with another working directory
- call `init_crypto` in blazor startup sequence
Co-authored-by: Marek Fišera <mara@neptuo.com>
Lakshan Fernando [Tue, 26 Jul 2022 11:42:25 +0000 (04:42 -0700)]
Removing the PublishAot check from the SDK (#72820)
Jakob Botsch Nielsen [Tue, 26 Jul 2022 11:25:48 +0000 (13:25 +0200)]
JIT: Fix creating small-typed LCL_VAR nodes in fgMakeTemp (#72771)
Fix #72763
Stephen Toub [Tue, 26 Jul 2022 11:12:45 +0000 (07:12 -0400)]
Fix HttpListenerRequestUriBuilder.GetPath's search for `?` (#72794)
It's intended to only be searching in the path, but earlier logic may have detected the path to start beyond 0.
Juan Hoyos [Tue, 26 Jul 2022 09:42:12 +0000 (02:42 -0700)]
Bail second pass redirection after catch in thread abort on Unix (#72705)
The redirection stub was never implemented, leading to crashes in scenarios like Debugger Function Evaluations. Instead of rethrowing the exception after the catch clause, this allows the ThreadAbortException to flow as any usual exception and hopefully surface through other points that call mechanisms like Thread::HandleThreadAbort. This is a behavior difference between Unix and non-Unix plaforms with some observable side effects, but Thread.Abort is not supported in core. Most commonly the debugger is the major scenario where ThreadAbort gets used, and this prevents the crash.
Michal Strehovský [Tue, 26 Jul 2022 06:20:16 +0000 (15:20 +0900)]
Represent field RVA data with a dedicated node (#72826)
We were using the general purpose `ReadOnlyDataBlobNode` but that meant that whenever we needed to refer to one, we had to read the RVA data into a freshly allocated array and then see if there's a node with that data.
Removes 200 MB of allocations while compiling the Techempower benchmark.
Dan Moseley [Tue, 26 Jul 2022 04:40:06 +0000 (22:40 -0600)]
Fix MemoryCache test failures due to race (#72821)
Larry Ewing [Mon, 25 Jul 2022 21:08:25 +0000 (16:08 -0500)]
[wasm] Move some defaults out of the templates (#72626)
* Move some defaults out of the template
* Fix build for template tests, and satellite assembly tests
- Running with `node` fails when relinking, or AOT'ing in Debug config
- this seems to be when linking is done with `-O0`
- it seems to work fine with emsdk `3.1.7` though
- For `Debug` config we automatically set `_WasmDevel=true`, which
then sets `-O0`
- This is not seen on CI, since we don't run non-template tests in
`Debug`. But for local runs, we do.
- The template tests are explicitly run for Debug, and Release, and
they break because of this
- So, setting `_WasmDevel=false` for now, till this gets fixed
- Also, set `OutputType=Exe` in the project file itself, so it gets set
before `Microsoft.NET.Sdk` gets imported, or early enough.
* Wasm.Build.Tests: add relinking tests for templates
* Revert unintended change
* Fix WasmTemplateTests on windows
* Wasm.Build.Tests: Explicitly allow web server port in chrome, on windows
Fixes https://github.com/dotnet/runtime/issues/72436
Co-authored-by: Ankit Jain <radical@gmail.com>
Andy Ayers [Mon, 25 Jul 2022 21:03:23 +0000 (14:03 -0700)]
JIT: add more inlining bail out checks (#72795)
When inlining, new temp allocation may fail, and callers of methods
that allocate new temps must do suitable checks.
Add a few that were missing.
Fixes #64787.
Steve Pfister [Mon, 25 Jul 2022 20:32:45 +0000 (13:32 -0700)]
[iOS] Enable Diagnostics.Tracing tests (#72545)
This change modifies System.Diagnostics.Tracing tests to enable the diagnostics runtime component feature. Additionally, the AppleAppBuilder task was modified to read the `AotDataFile` path that is produced when aot'ing assemblies. Previously, we would assume they were located in the publish directory.
Co-authored-by: Ankit Jain <radical@gmail.com>
Matt Mitchell [Mon, 25 Jul 2022 20:20:25 +0000 (13:20 -0700)]
Re-enable the ability to use in-build signing (#72690)
Re-enable in-build signing (as an option, not on by default yet). In constrast to how in-build signing was performed previously for any installer artifacts, the new in-build signing uses the same exact approach as post-build signing does today. Pass all top-level artifacts and wixpacks as ItemsToSign, and let the signing infrastructure do all the unpacking and repacking.
Also increase the timeout in the prepare-artifacts stage.
Egor Bogatov [Mon, 25 Jul 2022 19:03:44 +0000 (21:03 +0200)]
Enable NI_Vector256_Create on AVX1 (#72522)
Egor Bogatov [Mon, 25 Jul 2022 19:03:24 +0000 (21:03 +0200)]
Improve String.EndsWith for OrdinalIgnoreCase (#72750)
Miriam España Acebal [Mon, 25 Jul 2022 18:49:12 +0000 (20:49 +0200)]
when building on Ubuntu, avoid warning on shlibdeps libSystem.IO.Compression.Native.so contains an unresolvable reference to symbol log2: it's probably a plugin (#72785)
Kevin Jones [Mon, 25 Jul 2022 18:14:54 +0000 (14:14 -0400)]
Dispose of IncrementalHash in CmsSigner
Pavel Savara [Mon, 25 Jul 2022 17:17:20 +0000 (19:17 +0200)]
fix project references, transient dependency doesn't work great on windows (#72787)
Aleksey Kliger (λgeek) [Mon, 25 Jul 2022 17:16:38 +0000 (13:16 -0400)]
[wasm-ep] Implement DiagnosticServer and startup sessions for WebAssembly (#72482)
Add a diagnostic server for WebAssembly. Enable by building the runtime with `/p:WasmEnablePerfTracing=true` or `/p:WasmEnableThreads=true`.
To configure a project to start the diagnostic server, add this to the .csproj:
```xml
<WasmExtraConfig Include="diagnostic_options" Value='
{
"server": { "suspend": false, "connect_url": "ws://localhost:8088/diagnostics" }
}' />
```
The `connect_url` should be a WebSocket url serviced by `dotnet-dsrouter server-websocket` **from this branch** https://github.com/lambdageek/diagnostics/tree/wasm-server
Note that setting `"suspend": true` will hang the browser tab until a diagnostic tool such as `dotnet-trace collect` connects to the dsrouter.
---
Implement creating VFS file based sessions at runtime startup. Add the following to a .csproj:
```xml
<WasmExtraConfig Include="diagnostic_options" Value='
{
"sessions": [ { "collectRundownEvents": "true", "providers": "WasmHello::5:EventCounterIntervalSec=1" } ]
}' />
```
That will create and start one or more EventPipe sessions that will store their results into the VFS.
The startup session can be retrieved via `MONO.diagnostics.getStartupSessions()`. Each session `s` should be stopped via `s.stop()` and the data can then be extraced in a `Blob` using `s.getTraceBlob()`.
This is orthogonal to the diagnostic server support. You don't need `dotnet-dsrouter` running on the host. But you do need access to JavaScript on the main thread.
---
Notes/Issues:
* Tree shaking: I verified that if threads are not available, all the TypeScript diagnostics code is removed.
* Right now the server is not very robust to `dotnet-dsrouter` stopping, or starting after the runtime starts. The ideal order is to start `dotnet-dsrouter` first, and then open the browser
* Unrelated housekeeping fixes:
* Tell `wasm.proj` about all the subdirectories with .ts files - makes incremental builds notice changes in subdirectories.
* Add a rollup `dependencies` property to quiet a warning about `node/buffer`
* There's a mock implementation of a "websocket" that was used for protocol testing. I verified that tree-shaking removes this in thread-enabled Release builds.
* Bump `PTHREAD_POOL_SIZE` to `4` and set `PTHREAD_POOL_SIZE_STRICT=2` (returns `EAGAIN` from `pthread_create` if the pool needs to grow). The previous setting `PTHREAD_POOL_SIZE_STRING=1` (warn and try to grow the pool) seemed to lead to hangs. Usually that means the main thread is creating a thread and immediately calling `pthread_join` without returning to JS. We should investigate separately.
* The only implemented diagnostic server commands are `CollectTracing2`, `StopCollecting` and `ResumeRuntime`. None of the `Dump`, `Process` and `Profiler` commands are implemented and the server will crash if it receives them. It should be relatively straightforward to return a "command unsupported" reply (which would allow clients to gracefully disconnect), but it's not done yet.
* In some error states the runtime kills the browser tab with the following in a terminal window (if Chrome is started from a terminal: `FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory`). This probably means we're hitting a loop somewhere that rapidly exhausts JIT memory, but it's difficult to investigate when the JS console dies, too (happens with chrome stable v103 and chrome beta v104).
Fixes https://github.com/dotnet/runtime/issues/69674, contributes to https://github.com/dotnet/runtime/issues/72481
---
* [wasm] Enable the tracing component if threading is supported
* add a way to specify EP sessions in the MonoConfig
Currently not wired up to the runtime
* Add a mechanism to copy startup configs into the runtime and session IDs out
* checkpoint. Do more from JS
The issue is that once we're setting up streaming sessions, we will need to send back a DS IPC reply with the session id before we start streaming. So it's better to just call back to JS when we start up and setup all the EP sessions from JS so that when we return to C everything is all ready.
* checkpoint: starting a session at startup works
* checkpoint add a controller and a webworker for DS
* checkpoint: diagnostic server
* fix eslint
* [diagnostic_server] wasm-specific fn_table
We won't be using the native C version
* [wasm-ep] disable DS connect ports in C, too
we will implement DS in JS
* Start diagnostic server pthread
Clean up some of the old WIP code - we will probably not send configuration strings from the diagnostic server back to the main thread.
* checkpoint: try to start the server
It doesn't work right now because the MessagePort is not created until the server thread attaches to Mono, which doesn't happen because it's started before Mono.
Also it doesn't yet send a resume event, so the main thread just blocks forever
* Add a mock WebSocket connection to simulate the remote end
Start the diagnostic server and have it perform the open/advertise steps with the mock.
* wasm-mt: use a PThreadSelf struct instead of a raw MessagePort
* Move all the EP and diagnostic server modules to one directory
* Refactor; remove dead code; rationalize controller
the flow is now:
```
main -{creates pthread}-> server
. server creates event listener
. <-{sends diagnostic MessagePort}- .
main creates event listener .
. -{posts "start" message}-> .
. begins server loop
```
after the server loop is running, the main thread will get a "resume_startup" message once the diagnostic server receives the right command from the websocket.
next TODO: the runtime needs to send a "attach to runtime" message which will signal the server that it can attach to the runtime (in native) and start calling EP session creation functions.
* checkpoint: start adding queue from streaming thread to DS thread
We can't set up a shared MessagePort very easily (we need to bounce through the main thread but it probably won't be able to process our message until it's too late).
Also Atomics.waitAsync isn't available on many browsers (Chrome only).
So we use emscripten's dispatch mechanism to trigger an event in the diagnostic thread to wake up and service the streaming thread's queue. Right now the queue is dumb so we trigger on every write. and also the write is synchronous.
But it's simple to think about and it's implementable.
* [wasm] Incremental build and rollup warnings cleanups
- Add 'node/buffer' as an extrenal dependency. This doesn't do anything except quiet a rollup warning about the import.
- Add all the .ts files, and the tsconfig files (except node_modules) to the rollup inputs, to make sure we re-run rollup when anything changes.
* WIP: work on wiring up DS protocol commands (mock); resume hack
- start adding commands so that we can strt some sessions from DS
- we can't avoid a busy loop in ds_server_wasm_pause_for_diagnostics_monitor.
we can't make the main thread pause until we get a resume command
until after we're able to start an EP session (DS client won't send
a resume command until we send an EP session ID back). If the DS
pauses until it can attach to the runtime, and the runtime pauses
until DS tells it to resume, the main thread pause has to be after
we get EP and DS initialized. But that means it can't be async. So
we'll just have to busy wait on a condition variable in native.
* WIP: set up a WasmIpcStream, create EP sessions from DS
Seems to create the session, but not seeing write events
yet. possibly due to not flushing?
* WIP: starting to stream works; needs PTHREAD_POOL_SIZE bump
Looks like we can send the initial nettrace header some events.
We're starting more threads, so we need a bigger thread pool.
Also PTHREAD_POOL_SIZE_STRICT=1 (the default - warn if worker pool needs to grow,
but still try to grow it) seems to deadlock the browser-eventpipe
sample.
Set PTHREAD_POOL_SIZE_STRICT=2 (don't try to allocate a worker, make
pthread_create fail with EAGAIN) instead so we get some kind of
exception instead in other circumstances.
Set the pool size to 4.
* cleanup browser-eventpipe sample
* call mono_wasm_event_pipe_early_startup_callback from event_pipe init
instead of from the rundown_execution_checkpoint_2 function
* if diagnostics server isn't enabled, don't try to initialize it
* checkpoint: start parsing binary commands
* checkpoint: Can parse a CollectTracing2 command and attempt to create a
session!
* [wasm-ep] use the new PromiseController<T>
* get back to the server loop quicker by queueing the parsing in the microtask
* update mock for binary ADVR_V1 message
* sample: don't suspend, and use a mock url
* wasm_ipc_stream: wire up close command
Use a sentinal "buf" value (-1) to signal that the writer closed the stream
* Send proper OK messages in replies to binary protocol commands
* (testing) turn off the file session for now
* remove em_asm(console.log); simplify wasm EP init
Just call the EP JS callback directly from native
* remove debug output
* cleanup wasm ipc stream impl
* put diagnostics mocks behind a const flag
* don't build wasm-specific DS if threads are disabled
* refactor and cleanup
- Move the IPC parsing and serialization into separate files
- Try to have one responsibility per class
- update comments and docs
* help treeshaking
verified that all the DS and EP JS code is dropped if monoWasmThreads is false.
* update DS design notes
* use PromiseController in more places
* fix Windows build
* add MONO_WASM prefix to console logging outputs
* improve debug output for DS server
keep track of open/advertise counts and print them when receiving replies
* bugfix: don't confuse buf_addr for the value stored in it
the buf_addr is always the same for a given queue. the value in it is what we need to check to see if it's the sentinel value
* fix bug in queue_push_sync main thread detection
* merge fixup
* fix rollup warning when making the crypto worker
* add MONO_WASM: prefix to logging
* make diagnostic server mocking friendlier
Allow each test project to specify its own mock script.
Also provide TypeScript declarations for the mocking interfaces
Also always use binary protocol commands - don't send json for mocks.
* disable mocking in the sample project by default
* fixup after merge
* review feedback
- improve diagnostics mock README
- note that mocking just uses ES6 modules, testing with CJS is not supported right now.
- fix iteration over listeners when dispatching a one-shot event in the EventTargt polyfill
- use U32 getter in EP session creation
SingleAccretion [Mon, 25 Jul 2022 17:04:57 +0000 (20:04 +0300)]
Delete dead code from and fix `getSIMDStructFromField` (#71226)
* Clean out dead code from "getSIMDStructFromField"
The only pattern possible here is "FIELD(ADDR(LCL_VAR))".
* Fix the field type issue
* Fix the field offset issue
* Add tests
Tarek Mahmoud Sayed [Mon, 25 Jul 2022 16:27:13 +0000 (09:27 -0700)]
Enable NJulianRuleTest (#72707)
Zoltan Varga [Mon, 25 Jul 2022 16:02:53 +0000 (12:02 -0400)]
[mono][llvm] Fix generation of LLVM IR for OP_SSE_CVTII. (#72731)
Viktor Hofer [Mon, 25 Jul 2022 16:02:26 +0000 (18:02 +0200)]
Include EventLog.Messages in WindowsDesktop pack (#72280)
* Include EventLog.Messages in WindowsDesktop pack
The System.Diagnostics.EventLog.Messages assembly is missing from the WindowsDesktop transport package. Adding it to the package.
Andy Ayers [Mon, 25 Jul 2022 15:45:17 +0000 (08:45 -0700)]
JIT: teach VN to fold type comparisons (#72136)
Teach VN to fold some comparisons involving calls to `TypeHandleToRuntimeType`.
Closes #71909.
feiyun0112 [Mon, 25 Jul 2022 15:24:41 +0000 (23:24 +0800)]
TryAddWithoutValidation ViaHeaderValue (#72741)
* TryAddWithoutValidation ViaHeaderValue
* checking for 0
dotnet bot [Mon, 25 Jul 2022 15:11:28 +0000 (08:11 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1900011 (#72729)
Marek Safar [Mon, 25 Jul 2022 14:17:07 +0000 (16:17 +0200)]
Expands a list of always trimmed mobile+web CA with few recently added (#72678)
* Expands a list of aggressively trimmed CA with few recently added ones
* Add also UnscopedRefAttribute
Radek Zikmund [Mon, 25 Jul 2022 14:02:00 +0000 (16:02 +0200)]
Fix SendAsync_GetWithInvalidHostHeader_ThrowsException (#72779)
mathieubourgeois [Mon, 25 Jul 2022 13:16:29 +0000 (09:16 -0400)]
Ensure `GetCorElementType` returns value type for enums on Mono runtime (#72685)
`Type.GetTypeCode` on Mono was calling `GetCorElementType`, which, when invoked on an enum nested in a generic class, would return `TypeCode.Object` instead of `TypeCode.Int32`. Matching to CoreClr, we change `GetCorElementType` to return `VALUETYPE` for enums to fix the issue. The original issue would also provoke Enum parsing to trigger an assert in a debug runtime and go through a slower, rare path for parsing as well.
Fixes https://github.com/dotnet/runtime/issues/72543