Skip to content

Android AOT crashes at runtime #55567

@jonathanpeppers

Description

@jonathanpeppers

Description

Using my changes here: dotnet/android#5539

Along with a custom MonoAOTCompiler.dll: dotnet/android#5539 (comment)

I'm able to produce an Android .apk file with AOT support.

However, I hit a crash at runtime, which seems the same on an x86 emulator or arm64 device:

#00 0x001da8b8 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_aot_method_hash
/__w/1/s\src/mono/mono/mini/aot-compiler.c:10610:112
#01 0x001fa794 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
find_aot_method
/__w/1/s\src/mono/mono/mini/aot-runtime.c:4414:17
#02 0x001fb527 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_aot_get_method
/__w/1/s\src/mono/mono/mini/aot-runtime.c:4715:19
#03 0x0016d159 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_jit_compile_method_with_opt
/__w/1/s\src/mono/mono/mini/mini-runtime.c:2558:10
#04 0x0016cf7b /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_jit_compile_method
/__w/1/s\src/mono/mono/mini/mini-runtime.c:2672:9
#05 0x000922e1 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_compile_method_checked
/__w/1/s\src/mono/mono/metadata/object.c:757:8
#06 0x0006df93 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_ftnptr_to_delegate_impl
/__w/1/s\src/mono/mono/metadata/marshal.c:511:27
#07 0x0005f922 /data/app/~~e3TF6FHv0tIRDsWfRxthKg==/com.microsoft.net6.helloandroid-X5qQ8XVyBbnX10icmRYrnw==/lib/x86/libmonosgen-2.0.so (BuildId: db9e68bea0d5ea221ca34add47841cf6d134b55c)
mono_ftnptr_to_delegate
/__w/1/s\src/mono/mono/mini/../metadata/icall-def.h:137:1
#08 0x00002e3b <anonymous:dbc48000>

Configuration

This is .NET 6.0.100-preview.7.21327.2:

https://github.com/xamarin/xamarin-android/blob/064301bfd9a412895bf526455549a3d4170b8621/eng/Version.Details.xml#L3-L14

Regression?

No, AOT on Android is new, and we're trying to get it working.

Other information

Here is the full adb logcat output: aot.txt

This was using adb shell setprop debug.mono.log debug,timing,aot,assembly.

/cc @steveisok @akoeplinger

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions