Skip to content

[aot][armeabi-v7a]Android-App crashes when AOT is in use #3367

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
dasa-hoermann opened this issue Jul 18, 2019 · 1 comment
Closed

[aot][armeabi-v7a]Android-App crashes when AOT is in use #3367

dasa-hoermann opened this issue Jul 18, 2019 · 1 comment

Comments

@dasa-hoermann
Copy link

Steps to Reproduce

Run the Project below in Release-Configuration on armeabi-v7a architecture.

AOTTest.zip

Expected Behavior

The TestApp should be started and show the MainActivity.

Actual Behavior

The App crashes before MainActivity is shown and doesn't start.

Version Information

=== Visual Studio Community 2019 for Mac ===

Version 8.1.5 (build 9)
Installation UUID: 0d7b598b-59f1-4777-916c-2f38603ed113
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.6.0.25 (d16-0 / 50f75273)

Package version: 518010028

=== Mono Framework MDK ===

Runtime:
Mono 5.18.1.28 (2018-08/223ea7ef92e) (64-bit)
Package version: 518010028

=== NuGet ===

Version: 5.0.2.5988

=== .NET Core ===

Laufzeit: /usr/local/share/dotnet/dotnet
Laufzeitversionen:
2.1.11
2.1.9
2.1.8
2.1.2
1.1.1
1.0.4
SDK: /usr/local/share/dotnet/sdk/2.1.700/Sdks
SDK-Versionen:
2.1.700
2.1.505
2.1.504
2.1.302
1.0.3
MSBuild-SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.10
Speicherort: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.2.1 (14490.122)
Build 10E1001

=== Xamarin.Mac ===

Version: 5.10.0.157 (Visual Studio Community)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:48-0400

=== Xamarin.Android ===

Version: 9.3.0.23 (Visual Studio Community)
Commit:HEAD/d0b48056f
Android SDK: /Users/sawatzky_d/Library/Android/sdk
Unterstützte Android-Versionen:
7.1 (API-Ebene 25)
8.0 (API-Ebene 26)
8.1 (API-Ebene 27)

Version von SDK Tools: 26.1.1
Version der SDK-Plattformtools: 29.0.1
Version der SDK-Buildtools: 28.0.3

Buildinformationen:
Mono: mono/mono@3a07bd426d3
Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
LibZipSharp: grendello/LibZipSharp/d16-1@44de300
LibZip: nih-at/libzip@b95cf3f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/sawatzky_d/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL-Code ist hier verfügbar:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 1.2.0.44
Hash: aac645b
Branch: remotes/origin/d16-1
Build date: 2019-05-29 19:55:24 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Xamarin.iOS ===

Version: 12.10.0.157 (Visual Studio Community)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:47-0400

=== Xamarin Designer ===

Version: 16.1.0.467
Hash: f1657e133
Branch: remotes/origin/d16-1-new-document-model
Build date: 2019-06-18 21:57:42 UTC

=== Build Information ===

Release ID: 801050009
Git revision: bd0ab28ba941b19b39322247db020dcd0fb305d0
Build date: 2019-07-03 17:15:21+00
Build branch: release-8.1
Xamarin extensions: 8cc25b5cb090e6c23b62a7901000c299977eb08d

=== Operating System ===

Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
Thu Apr 25 23:16:27 PDT 2019
root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

Log File

aot_bug.log

@dasa-hoermann dasa-hoermann changed the title [aot][armv7]Android-App crashes when AOT is in use [aot][armeabi-v7a]Android-App crashes when AOT is in use Jul 18, 2019
@brendanzagaeski
Copy link
Contributor

Thanks for the report and the test case! It looks like you are seeing an issue with the undocumented <AndroidAotMode>Hybrid</AndroidAotMode> setting.

I was able to reproduce a crash report that matched the SIGBUS crash you are seeing by following the steps in #1218, so I will close this as a duplicate of #1218.

It looks like the original symptom from #1218 has changed slightly with recent Mono AOT compiler versions such that the invalid memory address is now resulting in a SIGBUS signal instead of a SIGSEGV signal.

Latest error text from this scenario for searchability

Unmanaged signal information from the aot_bug.log attachment:

Fatal signal 7 (SIGBUS), code 1, fault addr 0xff882373 in tid 16136 (ot.test.aottest)
debuggerd: handling request: pid=16136 uid=10172 gid=10172 tid=16136
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/xcover4ltexx/xcover4lte:7.0/NRD90M/G390FXXU2ARF2:user/release-keys'
Revision: '4'
ABI: 'arm'
pid: 16136, tid: 16136, name: ot.test.aottest  >>> aot.test.aottest <<<
signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xff882373
    r0 c9800ac8  r1 ff88246c  r2 ff88239f  r3 c861b690
    r4 c98005a0  r5 00000000  r6 c98005a0  r7 ff882464
    r8 c861b690  r9 ff8828fc  sl e8929008  fp ff882480
    ip ca371814  sp ff882397  lr c9e77248  pc ca371814  cpsr 600f0010

backtrace:
    #00 pc 00116814  /data/app/aot.test.aottest-1/lib/arm/libmonosgen-2.0.so

Managed exception when running on arm64-v8a Android OS or with the managed debugger attached on armeabi-v7a Android OS:

System.NotSupportedException: Unable to activate instance of type AndroidBlankApp1.MainActivity from native handle 0xbeb0e78c (key_handle 0x38cee26). ---> System.MissingMethodException: No constructor found for AndroidBlankApp1.MainActivity::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 6, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants