-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[net8.0-ios] App crashes on ios device when calling static abstract generic interface method #90732
Comments
I managed to reproduce the issue locally using Mono AOT LLVM configuration. Test case: using System;
namespace HelloWorld
{
public interface ITypeChecker
{
static abstract bool Test<T>();
}
public interface IHandler
{
bool Test<T>();
}
public class TypeChecker : ITypeChecker
{
public static bool Test<T>() => true;
}
public class Handler<TChecker> : IHandler where TChecker : ITypeChecker
{
public bool Test<T>() => TChecker.Test<T>();
}
internal class Program
{
private static void Main(string[] args)
{
var handler = GetHandler();
bool test = handler.Test<int>();
Console.WriteLine(test);
}
public static IHandler GetHandler() => new Handler<TypeChecker>();
}
} Stack trace:
|
@vargaz If cmethod is a static virtual method, the receiver's type is null. In such case, if klass is used instead of the receiver's type, the test case works. I am not sure if the /cc: @lambdageek |
Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos Issue DetailsDescriptionApp crashes on ios device with Reproduction Steps
Expected behaviorNo crashes Actual behaviorNative crash:
Regression?No response Known WorkaroundsNo response ConfigurationNET 8.0 Preview 7 Other informationNo response
|
/cc @BrzVlad |
@vargaz @lambdageek Please let me know if I am on the right track :) I've opened a draft PR to test the CI. UPDATE: The |
The fix has been merged. We should verify if it resolves the customer issue. Additionally, a runtime test should be added if this scenario is not already covered by full AOT llvm job on the CI. |
Hi everyone! |
The issue has been merged into main after the RC1 snap and backported to .NET 8 branch (not RC1). At some point, it will flow into RC2 and GA. @SamMonoRT Please fill in with details if I missed something. |
You can either wait for RC2 or switch to Preview 7. I will check if we can backport it to the RC1 as well. |
Description
App crashes on ios device with
<UseInterpreter>false</UseInterpreter>
flag when calling static abstract generic interface method.Reproduction Steps
Expected behavior
No crashes
Actual behavior
Native crash:
Regression?
No response
Known Workarounds
No response
Configuration
NET 8.0 Preview 7
Other information
No response
The text was updated successfully, but these errors were encountered: