-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[NativeAot] Triage another 14 libs tests #73442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tagging subscribers to this area: @dotnet/area-meta Issue Detailsnull
|
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
...ing.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs
Outdated
Show resolved
Hide resolved
} | ||
|
||
[Fact] | ||
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] | |
[Fact] | |
[DynamicDependency(DynamicallyAccessedMemberTypes.NonPublicFields, typeof(Process))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work. error IL2037: System.Diagnostics.Tests.ProcessTests.RefreshResetsAllRefreshableFields(): No members were resolved for 'NonPublicFields'.
on WASM legs because of WarnAsError and illink trying to be "helpful".
NativeAOT is also still crashing with a NullRef.
I don't think there's enough value in this test to spend this much time on it trying to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NativeAOT is also still crashing with a NullRef.
Why is that? Is it a bug or expected?
I agree that the test itself is not super valuable for AOT. However, I believe that there is a value in trying to use the annotations in cases like these to validate that they work as expected and to tech people how to annotate the private reflection patterns correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that? Is it a bug or expected?
Likely because of the reflection on System.Diagnostics.ProcessInfo
below.
tech people how to annotate the private reflection patterns correctly.
There are only two places where DynamicDependency is an appropriate things to use:
- Internal reflection happening within the runtime (pretty much just corelib is eligible), or
- Other reflection happening outside trimming reach (pretty much just hosting scenarios).
It's not the appropriate thing to use anywhere else because it doesn't make the analysis warning go away. One needs to suppress the warnings with DynamicDependency and most people will get the suppressions wrong.
I wouldn't be able to rewrite this to use the correct pattern because uses of object.GetType
can only be correctly done by placing DynamicallyAccessedMembers
on the type itself, or making it sealed. But we don't want to mark Process as DynamicallyAccessedMembers or mark it sealed just so that the test can get to the internals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird:
typeof(Process).GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance)
Is basically going to do the same thing as
[DynamicDependency(DynamicallyAccessedMemberTypes.NonPublicFields, typeof(Process))]
So we should not need the DynamicDependency.
And we could rewrite:
typeof(Process).Assembly.GetType("System.Diagnostics.ProcessInfo")
To
Type.GetType("System.Diagnostics.ProcessInfo")
and that part should also work.
...ging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs
Outdated
Show resolved
Hide resolved
...ing.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Jan Kotas <[email protected]>
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
@VSadov I see some odd test failures in the Linux ARM64 legs (these are not new tests that I'm enabling here). Could "illegal instruction" be suspension related?
The CI captured crash dumps: |
“illegal instruction” would be unexpected. Anything can be a result of some stack/heap corruption, but it it is hard to see how, since suspension does not change code. |
Running into illegal instruction in https://github.com/dotnet/runtime/pull/73546/checks?check_run_id=7718877740 (different pull request) as well. In any case - this looks new - I've ran the runtime-extra-platforms pipeline quite extensively last week as I was banging my head against the various tests and didn't see this, but today 2 out of 3 pull requests hit it somewhere. |
The NativeAOT failures are in tests that I'm not newly enabling. @dotnet/ilc-contrib could someone review this? |
I've looked at two dumps and it looks like it somehow involves libcrypto.so.1.1, but the instruction at reported address does not look illegal - in both cases |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
@dotnet/ilc-contrib could someone have a look? This is just a bunch of test changes. The test results look good, just a bunch of device failures that fail pretty much always. |
Cc @dotnet/ilc-contrib