Viktor Hofer [Tue, 18 Jan 2022 15:03:50 +0000 (16:03 +0100)]
Move ApiCompat files into own directory
Peter Sollich [Thu, 24 Feb 2022 11:16:22 +0000 (12:16 +0100)]
Equalize promoted (#64206)
I have observed that in server GC scenarios, the amount of promoted memory is often very uneven between heaps, which leads to suboptimal work distribution between server GC threads.
The PR introduces a new method equalize_promoted_bytes that attemps to even out the promoted memory between heaps by moving regions from heaps with lots of promotion of heaps with less promotion.
The algorithm used removes regions from heaps that have more than average promotion. These surplus regions are arranged into size classes by the amount of promoted memory in them. The heaps are also arranged into size classes by how much their promoted memory is short of the average promoted memory per heap.
Then we repeatedly move the surplus region with the most promoted memory to the heap with the biggest deficit. If the heap still has a deficit, it is reconsidered under its new deficit size class. Otherwise, it now has average or more promoted memory and is removed from further consideration.
Because regions may now move between heaps, it is no longer true that the finalization queue entry for an object is always on the same heap as the object itself. This necessitated moving the call to finalize_queue->UpdatePromotedGenerations to a later point in time when all threads have finished updating the final generation for a region.
Peter Sollich [Thu, 24 Feb 2022 10:17:16 +0000 (11:17 +0100)]
Changes to reduce committed memory: (#65367)
* Changes to reduce committed memory:
- Be more careful about estimating what is needed in the future
- Decommit regions that haven't been used in 20 GCs
- Keep regions sorted by decreasing commit size and increasing age
- Insturmentation enhancements
* Address code review feedback:
- optimize add_region_in_descending_order to search backwards if the region to be added is not fully committed
- adjust dprintf levels
- fix formatting issues
- made merge_sort_by_committed_and_age more efficient
- fix comment to use symbolic constant instead of number
- added new helper generation_start_segment_rw
Jeff Handley [Thu, 24 Feb 2022 09:41:08 +0000 (01:41 -0800)]
Update area-owners and fabricbot to reflect libraries area pod changes (#65830)
* Update area-owners to use area team names for the libraries area pods
* Update fabricbot for libraries pod changes; remove configs for old project boards
* Remove intra-team consultants from libraries areas
dotnet-maestro[bot] [Thu, 24 Feb 2022 09:01:40 +0000 (10:01 +0100)]
Update dependencies from https://github.com/dotnet/linker build
20220222.1 (#65772)
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22121.2 -> To Version 7.0.100-1.22122.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
monojenkins [Thu, 24 Feb 2022 08:53:59 +0000 (03:53 -0500)]
[mono] Throw a MarshalDirectiveException when marshalling generic instances as return types from pinvoke callbacks. (#65743)
Fixes https://github.com/dotnet/runtime/issues/63962.
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
Evgeny Peshkov [Thu, 24 Feb 2022 07:52:15 +0000 (10:52 +0300)]
Process.GetProcessById bugfix (#64723)
* Bugfix: Process.GetProcessById claims killed process is still alive in .NET Core #63937
* Added test for GetProcessById with killed process
Co-authored-by: epeshk <>
Ankit Jain [Thu, 24 Feb 2022 07:31:56 +0000 (02:31 -0500)]
[wasm] Use `--emit-symbol-map` to generate a `dotnet.js.symbols` (#65162)
* [wasm] Use --emit-symbol-map to generate a dotnet.js.symbols
.. and package it in the runtime pack. This can be disabled with
`$(WasmEmitSymbolMap)`.
* wasm.proj: cleanup
* [wasm] honor XunitShowProgress property
* [wasm] avoid extra build when publishing
* [wasm] WasmAppBuilder: Fix handling of ExtraFilesToDeploy
It incorrectly treated `TargetPath` metadata as a directory.
* [wasm] Disable generation of symbol maps by default
- this is needed because the sdk needs to handle this file specifically,
and would break tests.
- Once, the sdk gets the fix, then we can turn this on by default.
- For tests, turn it on by default
* [wasm] Deploy dotnet.js.symbols with the tests
* cleanup
* [wasm] dotnet-install.sh logs errors from curl, while trying older urls,
.. don't let that fail the build.
* [wasm] Temporarily disable WasmEmitSymbolMap by default
.. because sdk needs a fix for blazor projects to handle
`dotnet.js.symbols`.
But explicitly enable this for tests.
* Address review feedback
Tomas Weinfurt [Thu, 24 Feb 2022 07:19:21 +0000 (23:19 -0800)]
fix few Filesystem tests on FreeBSD (#65059)
* fix few FileSystem tests on FreeBSD
* fix MoveDirectory_FailToMoveLowerCaseDirectoryWhenUpperCaseDirectoryExists
* feedback from review
Michal Strehovský [Thu, 24 Feb 2022 05:49:00 +0000 (14:49 +0900)]
Reduce alignment of dispatch maps (#65823)
We've been aligning these at 16 bytes [since dispatch maps were added](https://github.com/dotnet/corert/pull/626) in 2016. Not clear where the 16 came from. Rhbind seems to be aligning these at pointer boundaries, but we only place `ushort`s in here.
This likely results in some size savings.
Aleksey Kliger (λgeek) [Thu, 24 Feb 2022 03:52:46 +0000 (22:52 -0500)]
[MonoAPI] Split type and function headers, add MONO_API_FUNCTION macro (#65446)
* [monoapi] Split type and function headers, add MONO_API_FUNCTION macro
The idea is that the function header can be included multiple times with different definitions of MONO_API_FUNCTION in order to make it easier to re-used the definitions for embedding the runtime in late-binding scenarios
* rename public mono/mini subdirectory to mono/jit
To match how embedders see the tree.
Update the runtime to include <mono/jit/jit.h> instead of <mono/mini/jit.h>.
No change in public API
* Add needed includes to mobile testing host templates
* add unstable API comment to the details headers, too
* use install(FILES) to copy the headers
not other stray files to the include dir
* update CODEOWNERS
* Remove duplicate definitions of mono_event_get_remove_method
This was already duplicated before the header reorganization, e.g. here https://github.com/dotnet/runtime/blob/
b9a55b4f52243325359ced26e3d4b31ccacdc381/src/native/public/mono/metadata/class.h#L279-L282
Jeremy Koritzinsky [Thu, 24 Feb 2022 03:17:58 +0000 (19:17 -0800)]
Remove checks and settings for Internal.Runtime.CompilerServices.Unsafe since that type is gone (#65809)
Elinor Fung [Thu, 24 Feb 2022 02:36:10 +0000 (18:36 -0800)]
Update GeneratedDllImportAttribute CharSet -> StringMarshalling (#65544)
Ankit Jain [Thu, 24 Feb 2022 01:08:23 +0000 (20:08 -0500)]
[wasm] Misc Debugger improvements (including tests) (#65752)
* [wasm][debugger] Fail test if an assertion is detected
* [wasm][debugger] Make DevToolsProxy's `pending_ops` thread-safe
Currently, `pending_ops` can get written by different threads at the
same time, and also read in parallel. This causes tests to randomly fail
with:
```
DevToolsProxy::Run: Exception System.ArgumentException: The tasks argument included a null value. (Parameter 'tasks')
at System.Threading.Tasks.Task.WhenAny(Task[] tasks)
at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.Run(Uri browserUri, WebSocket ideSocket) in /_/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsProxy.cs:line 269
```
Instead, we use `Channel<T>` to add the ops, and then read those in
the main loop, and add to the *local* `pending_ops` list.
* [wasm] Install chrome for debugger tests
- controlled by `$(InstallChromeForDebuggerTests)` which defaults to
`true` for non-CI docker containers
- Useful for using the correct chrome version when testing locally, or
on codespaces
- Also, add support for detecting, and defaulting to such an
installation
* [wasm][debugger] Disable tests failing with runtime assertions
`DebuggerTests.EvaluateOnCallFrameTests.EvaluateSimpleMethodCallsError`: https://github.com/dotnet/runtime/issues/65744
`DebuggerTests.ArrayTests.InvalidArrayId`: https://github.com/dotnet/runtime/issues/65742
* [wasm][debugger] Fix NRE with `"null"` condition for a breakpoint
`ConditionalBreakpoint` test fails.
The test with condition=`"null"` failed with a NRE, instead of correctly
handling it as a condition that returns null.
```
Unable evaluate conditional breakpoint: System.Exception: Internal Error: Unable to run (null ),
error: Object reference not set to an instance of an object..
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 399
--- End of inner exception stack trace ---
at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 407
at Microsoft.WebAssembly.Diagnostics.MonoProxy.EvaluateCondition(SessionId sessionId, ExecutionContext context, Frame mono_frame, Breakpoint bp, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 801 condition:null
```
* [wasm] Improve default message for ReturnAsErrorException,
.. since we seem to be not catching them as intended in many places.
* [wasm] Better log, and surface errors in evaluation conditional
.. breakpoints.
Catch the proper exception `ReturnAsErrorException`, so we can get the
actual error message. And log that as an error for the user too.
* [wasm][debugger] Allow setting proxy port for BrowserDebugHost
.. with `--proxy-port=<port>`.
Fixes https://github.com/dotnet/runtime/issues/65209 .
* [wasm][debugger] Handle errors in getting value for locals
Essentially, catch, and skip.
* message cleanup
* remove trailing space
Viktor Hofer [Wed, 23 Feb 2022 22:45:30 +0000 (23:45 +0100)]
Disable packaging for DllImportGenerator for now (#65795)
* Disable packaging for DllImportGenerator for now
For reasoning see https://github.com/dotnet/runtime/issues/65495#issuecomment-
1049111768.
Jeremy Koritzinsky [Wed, 23 Feb 2022 22:26:24 +0000 (14:26 -0800)]
Add proposed plan for the COM source generator (#60143)
Ankit Jain [Wed, 23 Feb 2022 20:00:00 +0000 (15:00 -0500)]
[wasm][debugger] Add per-test ids, and save logs to files for the test, and proxy messages (#63564)
* [wasm][debugger] Add test ids, and log test output, and proxy messages
.. to files.
* log level cleanup
* [wasm][debugger] Allow setting proxy port for BrowserDebugHost
.. with `--proxy-port=<port>`.
Fixes https://github.com/dotnet/runtime/issues/65209 .
Qiao Pengcheng [Wed, 23 Feb 2022 18:59:06 +0000 (02:59 +0800)]
[LoongArch64] submit some compiling depended files. (#65769)
Radek Zikmund [Wed, 23 Feb 2022 18:08:05 +0000 (19:08 +0100)]
Make NegotiatedCipherSuiteTests.SupportedNonTls13CipherSuites lazy (#65771)
This greatly reduces number of exceptions thrown when debugging
System.Net.Security tests on Unix platforms
Radek Zikmund [Wed, 23 Feb 2022 17:42:12 +0000 (18:42 +0100)]
Change default of SslServerAuthenticationOptions.AllowRenegotiation to false (#65777)
Fixes #65547
Miha Zupan [Wed, 23 Feb 2022 16:28:51 +0000 (08:28 -0800)]
Implement HttpTelemetry for HTTP/3 (#65644)
Theodore Tsirpanis [Wed, 23 Feb 2022 13:54:47 +0000 (15:54 +0200)]
Optimize the Regex source generator's handling of `Compilation` objects. (#65431)
* Optimize the Regex source generator's handling of Compilation objects.
* Use the common downlevel IsExternalInit file in the regex source generator.
And remove a now-unused file.
* Address PR feedback; revert to the old way of matching symbols.
* Fix an outdated comment.
Adam Sitnik [Wed, 23 Feb 2022 09:24:01 +0000 (10:24 +0100)]
Add missing GC.SuppressFinalize (#64997)
Juan Hoyos [Wed, 23 Feb 2022 08:21:20 +0000 (00:21 -0800)]
[EventPipe] Fix reverse connection socket leaking to child processes. (#65365)
* [EventPipe] Fix reverse connection socket leaking to child processes.
Radek Zikmund [Wed, 23 Feb 2022 08:01:56 +0000 (09:01 +0100)]
Fix unwanted session caching in mutual authentication tests (#65739)
Egor Bogatov [Wed, 23 Feb 2022 07:40:50 +0000 (10:40 +0300)]
JIT: Faster vector == Vector128.Zero on arm64 (#65632)
Ankit Jain [Wed, 23 Feb 2022 05:12:02 +0000 (00:12 -0500)]
[wasm][tests] Fix use of `RandomTest*Orderer` with trimming (#65754)
With trimming the tests would fail to load the types:
```
[21:11:50] info: Discovered: System.Runtime.Tests.dll (found 6200 of 6302 test cases)
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCaseOrderer' in TestUtilities for assembly-level test case orderer
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCollectionOrderer' in TestUtilities for assembly-level test collection orderer
```
Jeremy Koritzinsky [Wed, 23 Feb 2022 03:28:40 +0000 (19:28 -0800)]
Fix entrypoint name. (#65745)
Fixes #65648
Stephen Toub [Wed, 23 Feb 2022 02:55:47 +0000 (21:55 -0500)]
Fix inlining of IPAddress ctor (#65735)
Jan Kotas [Wed, 23 Feb 2022 02:01:04 +0000 (18:01 -0800)]
Cleanup platform-specific ifdefs (#65624)
Zoltan Varga [Wed, 23 Feb 2022 01:44:00 +0000 (20:44 -0500)]
[mono][jit] Remove support for -O=-float32, i.e. treating r4 values as r8 on the IL stack. (#65740)
This is not compatible with coreclr, and it has been disabled
and untested for a long time.
SingleAccretion [Wed, 23 Feb 2022 01:14:51 +0000 (04:14 +0300)]
Deduplicate some HWI codegen code (#65302)
* Add OperandDesc
* Clean two 'instr_XYZ' methods up
* Clean HWI codegen up using OperandDesc
Aleksey Kliger (λgeek) [Wed, 23 Feb 2022 00:50:33 +0000 (19:50 -0500)]
[docs] Create mono-thread-state-machine.md (#65720)
* Create mono-thread-state-machine.md
Add the thread state machine design document
* Add some sequence diagrams
* Add hybrid suspend race sequence diagram
* More details on self-transitions
* fix coop GC suspend discussion
* undo accidental deletion
Zoltan Varga [Tue, 22 Feb 2022 22:11:12 +0000 (17:11 -0500)]
[mono] Remove an usage of g_utf8_strup (), its not needed. (#65727)
Badre BSAILA [Tue, 22 Feb 2022 20:48:40 +0000 (21:48 +0100)]
Add back StructWithPublicDefaultConstructor test (#65616)
Ankit Jain [Tue, 22 Feb 2022 20:02:28 +0000 (15:02 -0500)]
[wasm][debugger] Add support for using Conditional* attributes for tests (#65684)
- Discoverer for `ActiveIssue` doesn't seem to be running, so that is
not working right now.
- Only, `ConditionalFact`, and `ConditionalTheory` work
William Godbe [Tue, 22 Feb 2022 17:41:06 +0000 (09:41 -0800)]
Always dispose inner stream in StreamPipeWriter.Complete* (#65462)
* Always dispose inner stream in StreamPipeWriter.Complete*
* Add tests
* Fixup
* Update StreamPipeWriterTests.cs
Alexander Köplinger [Tue, 22 Feb 2022 17:34:03 +0000 (18:34 +0100)]
Disable no_tiered_compilation scenario for mono in run-test-job.yml (#65701)
Mono doesn't do tiered compilation today so we're just duplicating work that runs the same config.
Tom Deseyn [Tue, 22 Feb 2022 17:31:45 +0000 (18:31 +0100)]
NetworkAddressChange.Unix: use async Socket API to wait for events. (#64614)
* NetworkAddressChange.Unix: use async Socket API to wait for events.
By replacing the raw handle with a Socket, we ensure only the handle
we own gets used.
By using the Socket async APIs we no longer need a dedicated Thread
to synchronously read the events.
* Fix compilation.
* PR feedback.
* Add logging of unexpected errors.
* Assert lock is entered.
Tomas Weinfurt [Tue, 22 Feb 2022 17:22:55 +0000 (09:22 -0800)]
Allow SslStream in ConnectCallback (#63851)
* Allow SslStream in ConnectCallback
* fix win7
* disable win7
dotnet-maestro[bot] [Tue, 22 Feb 2022 17:08:37 +0000 (18:08 +0100)]
[main] Update dependencies from dotnet/linker (#65561)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Viktor Hofer [Tue, 22 Feb 2022 16:18:54 +0000 (17:18 +0100)]
Fix slngen.proj and update solution files (#65711)
* Fix slngen.proj
The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.
* Update solution files
Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.
SingleAccretion [Tue, 22 Feb 2022 15:37:25 +0000 (18:37 +0300)]
Do not set GLOB_REF for invariant indirections (#65709)
The GTF_GLOB_REF flag in the compiler has the meaning that
the node marked with it produces a value that could be modified
by a call or an indirect store. It is used for optimizations
that need to know whether it is safe to reorder two trees.
Invariant indirections, by definition, always produce the
same value, and as such do not need to be marked with GLOB_REF.
Some nice diffs from args sorting: string literals can now
be put in the "late args" list directly (without a temp).
Vlad Brezae [Tue, 22 Feb 2022 14:43:53 +0000 (16:43 +0200)]
[mono][interp] Fix conv.r.un from r4 (#65697)
Eirik Tsarpalis [Tue, 22 Feb 2022 14:28:42 +0000 (14:28 +0000)]
Fix scheduled search in issue cleanup (#65699)
Meri Khamoyan [Tue, 22 Feb 2022 11:58:49 +0000 (15:58 +0400)]
Added OnesComplement, Sqrt, Negate vector intrinsics (#65438)
* Added Not, Sqrt, Negate vector intrinsics
Eirik Tsarpalis [Tue, 22 Feb 2022 10:22:29 +0000 (10:22 +0000)]
Roll out automated issue cleanup (#65576)
* Roll out automated issue cleanup
* Update .github/fabricbot.json
* Update .github/fabricbot.json
Adam Sitnik [Tue, 22 Feb 2022 09:40:20 +0000 (10:40 +0100)]
Ensure all expected paths are logged on test failure (#65666)
* move duplicated logic to a method
* ensure all paths are logged, so we can diagnose #65601
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Stephen Toub [Tue, 22 Feb 2022 00:12:47 +0000 (19:12 -0500)]
More clean up for RegexOptions.NonBacktracking (#65479)
* More clean up for RegexOptions.NonBacktracking
- Added more comments
- Removed some dead code and ifdef'd some code to DEBUG-only
- Updated an IComparable implementation to IComparable<T>
- Sealed some internal types
- Made UnicodeCategoryTheory into a static type
- Made CharSetSolver into a singleton
- Renamed a bunch of Mk* methods to Create*
- Renamed Watchdog
- Removed duplicative helper functions
- Fixed thread-safety of UnicodeCategoryTheory (in practice it was probably fine but we now have true singletons)
- Changed some iterators to be lists
- Used var less
- Cleaned up the set parsing code in RegexNodeConverter
- Lazily-initialized a bunch of members of SymbolicRegexBuilder
- Fixed a bug in the handling of \w
- And some other style stuff...
* Rename file
Buyaa Namnan [Mon, 21 Feb 2022 23:35:46 +0000 (15:35 -0800)]
Fix Type.IsPublic for pointer and byref types (#65156)
Ankit Jain [Mon, 21 Feb 2022 21:58:09 +0000 (16:58 -0500)]
[wasm] Add support for a random test case orderer, for xunit tests (#65628)
* [wasm] Add support for a random test case orderer, for xunit tests
This is enabled by default for wasm with
`$(XUnitUseRandomizedTestOrderer)=true`.
When the library tests run, they print two messages like:
```
info: Using random seed for test cases:
700149826
info: Using random seed for collections:
700149826
info: Starting: System.Collections.Immutable.Tests.dll
```
These seeds are picked randomly every time the tests are run. To run the
tests with a specific seed, use environment variable
`XUNIT_RANDOM_ORDER_SEED`.
When running with tests, this can be used as:
`WasmXHarnessMonoArgs="--setenv=XUNIT_RANDOM_ORDER_SEED=<seed>`
* Enable test orderer only for libraries tests
* [wasm] Automatically pass XUNIT_RANDOM_ORDER_SEED envvar to wasm apps
* Disable random test ordering for `System.Xml.RW.XmlWriterApi.Tests`
`System.Xml.Tests.TCCloseOutput.*` tests seem to depend on the order of
execution.
```
[06:35:14] fail: [FAIL] System.Xml.Tests.TCCloseOutput.CloseOutput_4(utils: XmlWriterUtils { Async = False, WriterType = UTF8Writer }, outputType: "Stream")
[06:35:14] info: System.IO.FileNotFoundException : File Not Found: writer.out
[06:35:14] info: at XmlCoreTest.Common.FilePathUtil.getStream(String filename)
[06:35:14] info: at System.Xml.Tests.TCCloseOutput.CloseOutput_4(XmlWriterUtils utils, String outputType)
[06:35:14] info: at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```
* [wasm] Disable random tests ordering for `System.Runtime.Loader`
It seems to cause failures like, reproducible with
`XUNIT_RANDOM_ORDER_SEED=
2106784294`:
```
[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual: "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info: at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info: at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```
* [wasm] Disable random test ordering for `System.Runtime.Numerics`
Randomized runs seem to fail with:
```
[03:29:54] info: Starting: System.Runtime.Numerics.Tests.dll
[03:29:58] fail: [FAIL] System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests
[03:29:58] info: Assert.Equal() Failure
[03:29:58] info: ↓ (pos 0)
[03:29:58] info: Expected: -0
[03:29:58] info: Actual: 0
[03:29:58] info: ↑ (pos 0)
[03:29:58] info: at System.Numerics.Tests.cast_toTest.VerifyDoubleExplicitCastToBigInteger(Double value)
[03:29:58] info: at System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests()
[03:29:58] info: at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```
Reproducible with `XUNIT_RANDOM_SEED_ORDER=
1883302047`.
* Add issues for the failing tests
Alexander Köplinger [Mon, 21 Feb 2022 21:02:29 +0000 (22:02 +0100)]
Fix PGO jobs on official builds (#65669)
After https://github.com/dotnet/runtime/pull/65603 the official build failed because we missed passing in the `isOfficialBuild` variable on the PGO jobs.
* Don't sign PGO bits
* Don't run upload-intermediate-artifacts-step.yml for PGO leg
SingleAccretion [Mon, 21 Feb 2022 19:25:35 +0000 (22:25 +0300)]
Do not number partial definitions and `ARGPLACE` nodes (#64898)
* Refactor LCL_VAR/FLD numbering
Do not number "partial definitions" - it is simply wasted work.
* Don't create unnecessary unique VNs
For ARGPLACE nodes, they will be overwritten when numbering the call.
For nodes that do not produce values, they serve no purpose, and just
waste memory.
Also, delete RET_EXPR/FTN_ADDR handling. They will never appear in VN.
* Fix printing for ASG(struct, CALL)
Andy Ayers [Mon, 21 Feb 2022 19:08:33 +0000 (11:08 -0800)]
JIT: revise approach for x64 OSR epilogs (#65609)
Rework x64 OSR so OSR methods have standard epilogs.
Details in attached doc.
Kevin Jones [Mon, 21 Feb 2022 18:17:32 +0000 (13:17 -0500)]
Move more things out of Internal/Cryptography
Adeel Mujahid [Mon, 21 Feb 2022 17:01:43 +0000 (19:01 +0200)]
Cleanup CLRConfig (#65655)
* Cleanup CLRConfig
Co-authored-by: Robin Sue <robinsue@live.de>
SingleAccretion [Mon, 21 Feb 2022 16:47:16 +0000 (19:47 +0300)]
Fix liveness for dead non-removable partial definitions (#65618)
* Harmonize front-end liveness with SSA
It is the case that in our SSA model "partial defs" are considered uses.
However, liveness was not considering them as such in one particular
case: when a dead partial store wasn't removed. The consequence of this
is that SSA would miss pushing a definition for the "use" portion of the
partial def.
This change fixes that.
Notably, back-end liveness does not need to pessimize itself like that
because we don't have SSA in the backend.
* Add test
Maxim Lipnin [Mon, 21 Feb 2022 16:00:48 +0000 (19:00 +0300)]
Move iOS/tvOS simulator and Android emulator legs from runtime-staging to runtime-extra-platforms pipeline (#65551)
This change is to move the Apple mobile simulator (iOS/tvOS x64, iOS arm64) and Android emulator (x86/x64) CI leg definitions, used to build the whole product using Mono and run libraries tests, from runtime-staging to runtime-extra-platforms pipeline. The iOS simulator arm64 leg will remain on rolling build until we can get significantly more devices.
Tomáš Rylek [Mon, 21 Feb 2022 14:16:42 +0000 (15:16 +0100)]
Fix several casing mismatches causing failures on Unix (#65639)
While there might be a way to make the merged test wrapper infra tolerant to these casing
mismatches, in general they amount to one-off typos and I believe they are worth fixing.
Thanks
Tomas
Santiago Fernandez Madero [Mon, 21 Feb 2022 12:17:41 +0000 (04:17 -0800)]
Always build ref pack even in servicing releases (#65579)
This was already done in release/6.0 branch, this is just making sure we have it in main so that in future servicing branches this is already taken care of.
Santiago Fernandez Madero [Mon, 21 Feb 2022 12:12:44 +0000 (04:12 -0800)]
Allow to run tests for internal AzDo PRs (#65603)
Addresses https://github.com/dotnet/runtime/issues/47328
This allows to run tests when submitting PRs in AzDO.
TrymPet [Mon, 21 Feb 2022 10:29:02 +0000 (11:29 +0100)]
Treat TZCNT/POPCNT/LZCNT as never negative (#64951)
Vitek Karas [Mon, 21 Feb 2022 10:28:47 +0000 (02:28 -0800)]
Suppress some new trimmer warnings (#65580)
The next update of linker will improve some data flow analysis and this uncovers more warnings in the libraries.
None of these warnings are a real problem, they're all basically inability to express the desired behavior with the current annotation system.
This change suppresses the new warnings.
Tomáš Rylek [Mon, 21 Feb 2022 08:41:29 +0000 (09:41 +0100)]
Slightly relax file pattern for copying native components (#65640)
Apparently not all native test components stick to the $(LibPrefix)
style; checking $(LibSuffix) should be sufficient for now.
Thanks
Tomas
Vlad Brezae [Sun, 20 Feb 2022 20:03:17 +0000 (22:03 +0200)]
[mono][jit] Fix --break (#65467)
Wraith [Sun, 20 Feb 2022 05:50:14 +0000 (05:50 +0000)]
Remove S.R.CS.Unsafe and Intrinsify Unsafe (#64861)
* private assemblies moved from Internal to System Runtime.CompilerServices
* reformat existing unsafe vm intrinsics
* implement Copy, CopyBlock, CopyBlockUnaligned, InitBlock, InitBlockUnaligned, Unbox, Add, Subtract, SubtractByteOffset
* remove System.Runtime.CompilerServices.Unsafe il project and replace with forward only cs project
* change all ilproj references to csproj
* remove nativeaot Unsafe
* add conditional package reference for S.R.CS.Unsafe on netcoreapp 6.0
* regenerate solutions
* mono interp
* [mono][interp] Implement Copy and Unbox intrinsics
* [mono][jit] Implement Copy and Unbox intrinsics
Co-authored-by: Vlad Brezae <brezaevlad@gmail.com>
Egor Bogatov [Sat, 19 Feb 2022 23:51:48 +0000 (02:51 +0300)]
Faster Math.Max/Min on arm64 (#65584)
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Tomáš Rylek [Sat, 19 Feb 2022 13:52:17 +0000 (14:52 +0100)]
Propagate native references to merged project wrapper outputs (#65592)
When building tests in merged mode, we need to copy the native
references along with the component test dlls to the output folder
to make them discoverable by the OS loader.
Thanks
Tomas
Tomáš Rylek [Sat, 19 Feb 2022 13:51:29 +0000 (14:51 +0100)]
Don't mark prefldinit4 as requiring process isolation (#65596)
Turns out this particular test doesn't actually need process
isolation, I overzealously marked it as such in a previous wave
just because it's a static initialization test. This lets us
postpone dealing with out-of-process ilproj tests to a later
phase.
Thanks
Tomas
Jan Vorlicek [Sat, 19 Feb 2022 07:20:29 +0000 (08:20 +0100)]
Fix HelperMethodFrame::UpdateRegDisplay on x86 (#65589)
While running managed debugger tests with x86 runtime debug build, I was
hiting an assert in MachineState::pRetAddress() method in a couple of
tests.
It turns out there was a bug in the HelperMethodFrame::UpdateRegDisplay
introduced about 5 years ago that only happens in DAC. The m_MachState
can be uninitialized when we enter the method and we were calling
m_MachState.pRetAddr() before performing the initialization.
This change fixes it.
Jeremy Koritzinsky [Sat, 19 Feb 2022 06:51:27 +0000 (22:51 -0800)]
Remove ExactSpelling from GeneratedDllImport (#65343)
* Update conversion code fix to offer multiple fixes for appending each previously probed entry-point suffix when ExactSpelling is false.
* Remove ExactSpelling property and move properties that were relying on ExactSpelling = false to use explicit entrypoint names.
* Emit ExactSpelling = true for all of our emitted target DllImports.
* Fix a few entry points
* Add a comment around CharSet.Auto
* Update compatibility doc.
* Update docs/design/libraries/DllImportGenerator/Compatibility.md
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Ankit Jain [Sat, 19 Feb 2022 01:08:37 +0000 (20:08 -0500)]
[wasm] Trigger all wasm jobs, if `eng/Version.Details.xml` has any chan… (#65451)
* [wasm] Trigger all wasm jobs, if eng/Version.Details.xml has any changes, so we run a full check on emsdk updates
* fix yml
* Fix merge
* [wasm] Pass isRollingBuild to runtime-extra-platforms-wasm template, to correctly trigger the EAT/AOT builds
* .. and pass isWasmOnlyBuild also
Tarek Mahmoud Sayed [Sat, 19 Feb 2022 00:46:07 +0000 (16:46 -0800)]
Allow Trace Samplers to Modify the Activity Trace State (#65530)
Larry Ewing [Fri, 18 Feb 2022 23:09:37 +0000 (17:09 -0600)]
[wasm] Make the sanitize pass less aggressive (#65571)
* Make the sanitize pass less aggressive
Elinor Fung [Fri, 18 Feb 2022 23:06:24 +0000 (15:06 -0800)]
Disable System.Diagnostics.Tests.EventLogRecordTests.ExceptionOnce on Windows Server 2022 (#65588)
Marek Fišera [Fri, 18 Feb 2022 22:14:22 +0000 (23:14 +0100)]
[wasm] Implicit NodeJS version on Helix (#65514)
- Read first directory name under node instead of hardcoded version.
Bruce Forstall [Fri, 18 Feb 2022 21:33:17 +0000 (13:33 -0800)]
Improve SuperPMI script robustness (#65586)
1. Be more robust to temp directory removal failure
If we fail to remove a temporary directory, don't crash. Log the failure
and the set of directories and files still remaining, and continue.
We have seen this failure in at least one Linux x64 PMI coreclr_tests
SuperPMI collection:
```
[Errno 39] Directory not empty: '/datadisks/disk1/work/
B18E0979/t/tmpov3b4_qa'
```
2. Limit the length of file names created by `make_safe_filename`. We were creating
file names out of full path names, where those paths contained long temporary directory
paths, and thus we were exceeding the maximum allowed file name component.
Viktor Hofer [Fri, 18 Feb 2022 21:03:14 +0000 (22:03 +0100)]
Clean-up slngen related logic (#65507)
* Clean-up slngen related logic
* Update dotnet-tools.json
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Stephen Toub [Fri, 18 Feb 2022 20:41:08 +0000 (15:41 -0500)]
Skip RegexOptions.NonBacktracking phase 3 for some patterns (#65531)
* Skip RegexOptions.NonBacktracking phase 3 for some patterns
If a pattern doesn't have any captures and if any match of that pattern will always be the same length, we can skip the Phase 3 computation as, given the computed starting position of the match, we know exactly where it's going to end.
* Add example to the phase comments
Will Smith [Fri, 18 Feb 2022 19:51:53 +0000 (11:51 -0800)]
Allow constant propagation of Vector.Zero. (#65028)
* Initial work
* Added a comma to display
* Cleanup
* Fixing build
* More cleanup
* Update comment
* Update comment
* Added CompareEqual Vector64/128 with Zero tests
* Do not contain op1 for now
* Wrong intrinsic id used
* Removing generated tests
* Removing generated tests
* Added CompareEqual tests
* Supporting containment for first operand
* Fix test build
* Passing correct register
* Check IsVectorZero before not allocing a register
* Update comment
* Fixing test
* Minor format change
* Fixed formatting
* Renamed test
* Adding AdvSimd_Arm64 tests:
* Adding support for rest of 'cmeq' and 'fcmeq' instructions
* Removing github csproj
* Minor test fix
* Fixed tests
* Fix print
* Minor format change
* Fixing test
* Initial commit for Vector.Create to Vector.Zero normalization
* Added some emitter tests
* Feedback
* Update emitarm64.cpp
* Feedback
* Handling variations of Vector.Create
* Use Operands iterator instead of edges
* Fix condition
* Simplify
* format
* Fixed IsFloatPositiveZero
* Uncomment
* Updated tests to include Vector64.Create/Vector128.Create for ARM64
* Making implementation of IsFloatPositiveZero explicit
* Update src/coreclr/jit/gentree.cpp
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
* Feedback
* Update comment
* Update comment
* Do not perform optimization when VN CSE phase
* use ResetHWIntrinsicId
* Assert !optValnumCSE_phase
* Simplify IsVectorZero
* Simplify IsVectorZero
* Simplify some uses of Vector*_get_Zero
* Added another test
* Fixed formatting
* Revert lowering removal
* Initial work for optimizations on VectorZero value numbering
* Allowing all Vector.Zero to be constant prop'ed. Added VNFuncSimdTypeInfo.
* Update gentree.h
* Quick rename
* Removed extra variable
* Added default case
* Format
* Fixed vnDumpSimdType to take into account CorInfoType
* Fixed gtNewSimdZeroNode to produce the right Vector*_get_Zero based on simdSize
* Formatting
* Feedback and a loop test
* Added another test. Formatting fixes
* Added GetSimdBaseJitPreciseType
* Feedback
* Minor fix
* Minor comment update
* Added another comment
* Added another comment
* Added another comment
* Update comment
* Formatting
* Feedback
* Fixing build
* Feedback
* Update assertionprop.cpp
* Formatting
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
David Wrighton [Fri, 18 Feb 2022 19:35:57 +0000 (11:35 -0800)]
Fix Vector256.IsHardwareAccelerated in R2R binaries (#65351)
* Fix Vector256.IsHardwareAccelerated in R2R binaries
- If a function had a dependency on Vector256<T> but not on any Avx2 functionality then we would fail to produce an R2R image using a debug version of the compiler, and would generate an incorrect function where the result of calling Vector256.IsHardwareAccelerated would produce the wrong result.
- To fix this we now annotate the VectorXXX instruction sets so that if there is a negative depenedency on them during R2R generation, that the function is not available for use if the underlying actual instruction set is available to use at runtime.
- Adjust test Runtime_34587 to test instruction set manner in a way that allows testing crossgen2 instruction set variation
- Move instruction set issupported checks into standalone functions to isolate the tests in the JIT/Crossgen2 compiler to better see exactly what is happening
- Add diagnostic output to test, for better diagnosis of future failures.
Jeremy Koritzinsky [Fri, 18 Feb 2022 18:05:18 +0000 (10:05 -0800)]
Class types with layout that inherit from System.Object should be ManagedSequential (#65447)
Jeremy Koritzinsky [Fri, 18 Feb 2022 18:04:03 +0000 (10:04 -0800)]
Forward DefaultDllImportSearchPathsAttribute to the inner P/Invoke. (#65458)
SingleAccretion [Fri, 18 Feb 2022 17:51:51 +0000 (20:51 +0300)]
Fix missing zero-offset sequences and add checking (#64805)
* Add checking for zero-offset FldSeq addition
* Add a test
* Fix ADDR(LCL_VAR) Zero [FldSeq]
* Always add NotAField field sequences
* NotAField printing improvements
SingleAccretion [Fri, 18 Feb 2022 17:48:22 +0000 (20:48 +0300)]
Fix assert (#65564)
We only require the "greater than" condition on x86.
Nikola Milosavljevic [Fri, 18 Feb 2022 16:51:48 +0000 (08:51 -0800)]
New Arcade Installers package with Mariner cm.2 change (#65542)
Marek Fišera [Fri, 18 Feb 2022 16:47:17 +0000 (17:47 +0100)]
[wasm] Ensure NodeJS for running tests isn't too old (#65549)
Ankit Jain [Fri, 18 Feb 2022 16:16:31 +0000 (11:16 -0500)]
[wasm] Rationalize wasm jobs run on CI (#65035)
* Rationalize wasm jobs run on CI
Essentially:
- For rolling builds, we want to run all the wasm jobs, unconditionally
- And `runtime-extra-platforms` runs the tests that were not in `runtime`, and `runtime-staging`
- For PRs, we use the various path checks
Changes:
- split wasm jobs into various templates
- combine, and simplify some jobs
* `runtime-extra-platforms`, and `runtime-wasm` run only when manually
triggered with a comment - `/azp run <pipeline-name>`
* `runtime`, and `runtime-staging`, run jobs only when relevant paths
change. And for `EAT`, and `AOT`, only smoke tests are run.
* And when `runtime-wasm` is triggered manually, it runs *all* the wasm
jobs completely
| . | runtime | runtime-staging | runtime-extra-platforms(manual only) | runtime-wasm (manual only) |
| ----------------- | -------------------- | --------------- | ------------------------------------ | ------- |
| libtests | linux: all, only-pc | windows: all, only-pc | linux+windows: all, only-pc | linux+windows: all, always |
| libtests eat | linux: smoke, only-pc | - | linux: all, only-pc | linux: all, always |
| libtests aot | linux: smoke, only-pc | windows: smoke, only-pc | linux+windows: all, only-pc | linux+windows: all, always |
| | | | | |
| Wasm.Build.Tests | linux: only-pc | windows: only-pc | linux+windows: only-pc | linux+windows |
| Debugger tests | - | linux+windows: only-pc | linux+windows: only-pc | linux+windows |
| Runtime tests | linux: only-pc | - | linux: only-pc | linux |
* `runtime`, and `runtime-staging`, run all the wasm jobs unconditionally, but `EAT`, and `AOT` still run only smoke tests.
* `runtime-extra-platforms` also runs by default. And it runs only the cases not covered by the above two pipelines.
* jobs w/o `only-pc` are always run
| . | runtime | runtime-staging | runtime-extra-platforms (always run) | runtime-wasm (manual only) |
| ----------------- | ------------- | --------------- | ------------------------------------ | ------ |
| libtests | linux: all(v8/chr/node) | windows: all | linux+windows: all with node | N/A |
| libtests eat | linux: smoke | - | linux: all | |
| libtests aot | linux: smoke | windows: smoke | linux+windows: all | |
| | | | | |
| Wasm.Build.Tests | linux: always | windows: always | none | |
| Debugger tests | - | linux+windows: always | none | |
| Runtime tests | linux: always | - | none | |
* [wasm] Run tests with node only on runtime-wasm
Alexander Köplinger [Fri, 18 Feb 2022 13:46:35 +0000 (14:46 +0100)]
Improve PipeWriterTests.CompleteWithLargeWriteThrows (#65506)
Allocate the buffer outside of the loop so we don't hit OOM issues.
While looking at the test I noticed that it actually had a bug too:
Nothing was asserting that we indeed throw an InvalidOperationException when the writer is completed. Adding `Assert.ThrowsAsync` revealed that the current loop iteration count was too low to hit the exception reliably
within the 10ms delay so instead check for the execution time.
Fixes https://github.com/dotnet/runtime/issues/64930
Eirik Tsarpalis [Fri, 18 Feb 2022 10:44:23 +0000 (10:44 +0000)]
Support resumable serialization in NullableConverter<T> (#65524)
* Support resumable serialization in NullableConverter<T>
* use null instead of default
Krzysztof Wicher [Fri, 18 Feb 2022 08:12:10 +0000 (09:12 +0100)]
Fix XNodeReaderFunctionalTests (#65500)
* Fix XNodeReaderFunctionalTests
* cleanup Flush/Dispose
* cleanup few more flushes
Qiao Pengcheng [Fri, 18 Feb 2022 08:07:48 +0000 (16:07 +0800)]
[LoongArch64] JIT/EE interface for getting ABI-info (#62893)
* [LoongArch64] add ToolBox directory about jitinterace for getting ABI-info. (#59561)
Co-authored-by: Loongson's .NET-teams
* [LoongArch64] add new interace for getting ABI-info. (#59561)
* [LoongArch64] add the linking page for LoongArch64 ABI-info. (#59561)
* [LoongArch64] moved ThunkInput.txt to #62885.
* [LoongArch64] moved vm/jitinterface.cpp to #62885.
* remove the JIT/EE interface back from #62885..
* [LoongArch64] Fix the compiling error after merge.
* [LoongArch64] add comments for the returned value of `getFieldTypeByHnd`.
* [LoongArch64] rename getFieldTypeByHnd to getFieldSizeClassificationByHnd.
Also add macro define for returned value of `getFieldSizeClassificationByHnd`.
* [LoongArch64] Delete the interface `getArgType2`.
And refactor the returned values of `getFieldSizeClassificationByHnd`.
* [LoongArch64] delete `GetArgType` within `ToolBox/superpmi`.
* [LoongArch64] rename `getFieldSizeClassificationByHnd` to
`getLoongArch64PassStructInRegisterFlags`.
* [LoongArch64] amend the floating-ABI for native-struct.
* [LoongArch64] update all related `GetFieldSizeClassificationByHnd`
by `GetLoongArch64PassStructInRegisterFlags` and amend some comments.
* [LoongArch64] replace `LookupApproxFieldTypeHandle()`
by `GetFieldTypeHandleThrowing()`.
* [LoongArch64] implements the crossgen2 for LoongArch64.
* Revert "[LoongArch64] implements the crossgen2 for LoongArch64."
This reverts commit
b05a2b90e8d8a2f6d1cf7f101ddfc9d4ed8d984e.
The crossgen2 for LoongArch64 will be submitted by a new PR.
* [LoongArch64] update the `GUID JITEEVersionIdentifier`.
Also delete some unused comments.
Co-authored-by: qiaopengcheng <qiaopengcheng-hf@loongson.cn>
Marek Fišera [Fri, 18 Feb 2022 07:55:22 +0000 (08:55 +0100)]
[wasm] Replace active issue for browser platform with NodeJS only (#65505)
Tom Deseyn [Fri, 18 Feb 2022 07:49:37 +0000 (08:49 +0100)]
FileSystemWatcher.Linux: handle races while adding child directories. (#64906)
* FileSystemWatcher.Linux: handle races while adding child directories.
This handles the child directory getting removed or replaced by a file
while we are adding a watch for it or enumerating its subdirectories.
* Pass other enumeration exceptions to the user.
Vladimir Sadov [Fri, 18 Feb 2022 07:09:20 +0000 (23:09 -0800)]
Use CopyContext to restore saved context on X86 (#65490)
* Use CopyContext to restore saved context on X86
* PR feedback
* more PR feedback
Steve Pfister [Fri, 18 Feb 2022 03:29:36 +0000 (22:29 -0500)]
[mono] Cache aotdata file in AOTCompiler task (#65472)
This change improves the inner devloop experience by making sure to cache the .aotdata file when it's generated. Otherwise, if you clean your artifacts directory and no aot changes have been made, it will not be generated again. The result being an error when building an app.
I believe this mostly impacts iOS configurations.
Zoltan Varga [Fri, 18 Feb 2022 02:25:10 +0000 (21:25 -0500)]
[mono][wasm] Link the aot profiler into dotnet.wasm by default in debug mode. (#63262)
Enable it using a define instead of generating code into driver-gen.c.
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Radek Doulik [Fri, 18 Feb 2022 01:02:47 +0000 (02:02 +0100)]
[wasm] Rollback emscripten to 2.0.23 (#65517)
* [wasm] Rollback emscripten to 2.0.23
* Enable disabled tests
Immo Landwerth [Fri, 18 Feb 2022 00:37:39 +0000 (16:37 -0800)]
Add line break to please Firefox
Elinor Fung [Fri, 18 Feb 2022 00:25:49 +0000 (16:25 -0800)]
[wasm] Disable wasm aot tests hitting OOM on all platforms (#65521)