* add yml files
* add file version and condition package reference on source build
* to avoid copying the file from the cache
Co-authored-by: Anirudh Agnihotry <[email protected]>
* increment source generator assembly versions with every build
* use isGenerator Project property
* add comment
* Replacement tokens in logging test baseline files (#58220)
* Replacement tokens in logging test baseline files
Instead of using a hardcoded version of the assembly version
on the logging generated baseline files used by tests we use
replacement tokens and at runtime we replace them.
fixes#58175
Co-authored-by: Anirudh Agnihotry <[email protected]>
Co-authored-by: Allan Targino <[email protected]>
* Remove benign assert
It is perfectly possible for us to replace a promoted struct by its only
field where that field is marked do-not-enregister. Since this path does
handle the proper retyping when normalization is required this assertion
is benign.
Fix#58972
* Fix test
Co-authored-by: Jakob Botsch Nielsen <[email protected]>
If sample profiler was initially created before sampling has been
enabled, happens when setting up sessions during startup,
sample_profiler_load_dependecies won't get called, meaning we won't
setup timeBeginPeriod/timeEndPeriod on Windows, and won't adjust
default scheduling resolution to 1ms staying on default 16ms.
There is a ref count check in current sample_profiler_enable checking
if we should call sample_profiler_load_dependecies (_ref_count == 0),
but in case where we can't start profiling _can_start_sampling == false,
we won't call sample_profiler_enable but always increase _ref_count
that in turn will prevent calls to sample_profiler_load_dependecies when
enabling sample profiler and that in turn won't call timeBeginPeriod
staying on default scheduling resolution.
Fix is to always call sample_profiler_load_dependecies making sure we
will setup needed dependencies when _ref_count == 0.
Co-authored-by: lateralusX <[email protected]>
* Set generic type arguments nullability for value types
* Skip test on mono
* Apply commment
* Separate var name parts with _
* Reflection nullability API: improve test coverage, fix bug found (#58479)
* Add/remove some tests, fix generics indexing bug
Co-authored-by: Buyaa Namnan <[email protected]>
* Throw on unsupported types in src gen
* Misc non-functional changes and feedback
* Fix typo
* Change disallowed terminology to unsupported
Co-authored-by: Steve Harter <[email protected]>
Identified deadlock between finalizer thread and rundown enumerating
all interpreter method. Since rundown will query for method name
in callback when iterating interpreter methods, interp_jit_info_foreach,
that might lead to additional loader activity. The hash map in
interpreter keeping the methods is locked with default JIT memory manager,
but since the callback might end up in mono_class_create_from_typedef
that will take loader lock, we get the following lock order on that
code path, memory manager->loader lock. Finalizer thread invokes
OnThreadExiting using interpreter and that might end up with a reverse
lock order, loader lock->memory manager on that code path, so these
two have a potential to deadlock. This is not a problem under JIT
or AOT since the JIT hash table is lock free therefore not causing
any deadlocks due to lock order between memory manager and loader lock.
Could be fixed by changing into a lock free hash table in interpreters
for interp_code_hash might be to risky at this point. A more safe fix
is to take a copy of the pointers while holding lock and then iterate
using local copy (simple array of pointers). Since this method is
only called during rundown, only when using interpreter, and only
include the pointers (InterpMethod *) we use with the callback,
it will have some temporary memory impact (allocating an array
of pointers), but will mitigate the deadlock since we can safely
call iterator callback without holding the lock. It will also
improve interpreter performance in situations where we run session
rundown, since lock will be held a much shorter amount of time.
Co-authored-by: lateralusX <[email protected]>
* NT prefix shall not be treated as a relative path
* Remove file-folder-match validation
* Use SubstituteName instead of PrintName since the latter is just for display and can be misleading
* Fix MS.IO.Redist
* Fix whitespace in Strings.resx
* Address suggestions
* [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory
Reference the same versions of System.Threding.Tasks.Extensions and
System.Text.Json that MSBuild in Visual Studio 2022 uses.
Fixes build errors on maui-ios (and possibly blazorwasm) targets on Windows
like:
```
System.MissingMethodException: Method not found: 'System.Threading.Tasks.ValueTask`1<!!0> System.Text.Json.JsonSerializer.DeserializeAsync(System.IO.Stream, System.Text.Json.JsonSerializerOptions, System.Threading.CancellationToken)'.
at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.<GetJsonAsync>d__24.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.GetJsonAsync(String jsonFilePath, FileStream file)
at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.TryGetJson(String jsonFilePath, JsonModelRoot& json)
at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at
Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
```
from `C:\Program
Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk\6.0.0-rc.1.21451.13\Sdk\RuntimeComponentManifest.targets`
* assembly version is 4.2.0.1, but nuget version is 4.5.4, apparently
Co-authored-by: Aleksey Kliger <[email protected]>
Manual backport of #57208, #58519, #58562, #58210, #57732, #58428, #58586, #58745, #57687 to release/6.0
Numerous test suites have been failing for iOS/tvOS/MacCatalyst consistently on CI without useful logs as to why. Moreover, some of these suites pass locally.
This PR looks to reduce the failures on CI by skipping the problematic suites
Skips test suites logged in #53624
ActiveIssues
#58440#58418#58367#58584
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Jo Shields <[email protected]>
On Windows/x86, if a call returns a SIMD8 in two registers
(eax, edx), and needs to be assembled and stored into a single
SIMD register, AND we don't have the SSE41 ABI available (because
the hardware doesn't support it, or we specifically disable it),
then we need a temporary register. In the failure case, the target
register and temporary register were the same, and then interfered
with each other. The fix is to force the temporary register to
be different from the target register.
Fixes#58899
Co-authored-by: Bruce Forstall <[email protected]>
* Add cast when replacing promoted struct with field in lowering
We may need to sign/zero-extend when we do this replacement very late.
Normally this cast would be inserted in morph.
Fix#58373
* Add test
* Fix formatting
* Fix test cases
* Type returned-struct-as-primitive correctly for normalization
Retyping it to the type of the ret node is not right when reinterpreting
small structs as a type that needs to be normalized.
* Fix assertion
* Run jit-format
Co-authored-by: Jakob Botsch Nielsen <[email protected]>
Microsoft.NET.ILLink.Tasks
From Version 6.0.100-preview.6.21424.4 -> To Version 6.0.100-1.21459.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Without this PR when a P/Invoke lookup fails we'll return an exception message that refers to `libcoreclr` instead of the real native library name since we have logic to retry the lookup using libcoreclr. This is very confusing for customers as can be seen in https://github.com/dotnet/runtime/issues/58185.
Co-authored-by: Filip Navara <[email protected]>
We considered mscorlib.dll as the "core" assembly instead of System.Private.CoreLib.dll which meant Cecil hit an issue while resolving types in it.
This only happened when the IL Linker was not being used since it'd have removed the mscorlib.dll facade.
Brings in https://github.com/dotnet/runtime-assets/pull/176
This is used to correlate PE's with their corresponding PerfMaps. For example the header in the perfmap could be:
```
FFFFFFFF 00 026D4D21B3EE3D93843FF7A964235822
FFFFFFFE 00 1
FFFFFFFD 00 1
FFFFFFFC 00 3
FFFFFFFB 00 1
```
And the PE will have the corresponding entries in the PE as:
```
PerfMap (Type 21):
System.Private.CoreLib.ni.r2rmap, Signature = 026d4d21b3ee3d93843ff7a964235822, Version = 1
```
MacOS 12 introduces a new X.509 chain status, DuplicateExtension. As we do not report this in Windows and nor do we have a flag to map it to, we ignore it from macOS.
Co-authored-by: Kevin Jones <[email protected]>
* Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled
The NI_Vector256_GetElement intrinsic, in some situations, requires
a stack temporary. With AVX2 disabled, this temporary was getting
allocated as a TYP_SIMD16 instead of a TYP_SIMD32, leading to overwriting
the local variable.
Add a type argument to the temp variable allocation, and allocate the
temp as the largest sized type required by any use.
Fixes#58295
* Code review change: improve arm64 SIMD temp creation type
Co-authored-by: Bruce Forstall <[email protected]>
* Fix Windows 8 detection.
Windows 8's actual version is 6.2, not 8. The test would succeed only on Windows 10+.
* Explain that Windows 8's version is 6.2.
Co-authored-by: Jeff Handley <[email protected]>
Co-authored-by: Theodore Tsirpanis <[email protected]>
Co-authored-by: Jeff Handley <[email protected]>
* Always write sample events in EventPipe based on sample frequency.
If no managed frames (including helper frames) are located on stack,
sample was dropped and not emitted into EventPipe. This cause issues
in tooling that try to do thread time calculations based on sample,
especially in cases where embedded threads returned to native
code during several samples before calling back into runtime. In such
scenarios the last sampled event would be prolonged, giving false
information that that stackframe lasted much longer than it really did.
Always writing samples into EventPipe will also visualize time an attached
thread spend outside of runtime, not running managed code.
* Adjust included profiler samples.
Only include external samples still on top fram (no callstack) or
managed/external samples includig a callstack.
Co-authored-by: lateralusX <[email protected]>
In case where ep_disable is called by a different thread (close IPC command)
there was a race between streaming threads setting
session->streaming_thread to NULL and IPC command triggering a call
to disable_holding_lock and freeing session.
Resetting the streaming_thread in streaming thread must happens before
it signals its shutdown event to prevent the race.
Co-authored-by: lateralusX <[email protected]>
We hit a case where the ILStrip task assembly is IL-merged with a few other task assemblies on the Xamarin side which causes a clash because of trying to merge different Mono.Cecil versions.
Rename the Mono.Cecil used here to avoid that clash. Brings in https://github.com/dotnet/runtime-assets/pull/169
* Fix detection of unsupported links
* Add Directory.Exists check
* Fix CI issue caused by local testing code
Co-authored-by: David Cantu <[email protected]>