Skip to content
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

Encountering a crash on startup when enabling hybrid AOT #1241

Closed
pjcollins opened this issue Jan 25, 2018 · 4 comments
Closed

Encountering a crash on startup when enabling hybrid AOT #1241

pjcollins opened this issue Jan 25, 2018 · 4 comments
Labels
Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc.

Comments

@pjcollins
Copy link
Member

Steps to Reproduce

  1. Attempt to run the Runtime test suite (src/Mono.Android/Test/Mono.Android-Tests.csproj) with AOT, LLVM, and Hybrid AOT (/p:AndroidAotMode=Hybrid) enabled.

Expected Behavior

Test suite ruins to completion successfully.

Actual Behavior

--------- beginning of crash
01-25 04:01:19.169 F/libc    (31621): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x745a3fffd0 in tid 31640 (Threadpool work)
01-25 04:01:19.199 E/HsmCoreServiceImpl( 1080): onTransact in code is: 103
01-25 04:01:19.242 F/DEBUG   (31642): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-25 04:01:19.242 F/DEBUG   (31642): Build fingerprint: 'HUAWEI/VTR-L29/HWVTR:7.0/HUAWEIVTR-L29/C636B120:user/release-keys'
01-25 04:01:19.242 F/DEBUG   (31642): Revision: '0'
01-25 04:01:19.242 F/DEBUG   (31642): ABI: 'arm64'
01-25 04:01:19.242 F/DEBUG   (31642): pid: 31621, tid: 31640, name: Threadpool work  >>> Mono.Android_Tests <<<
01-25 04:01:19.242 F/DEBUG   (31642): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x745a3fffd0
01-25 04:01:19.242 F/DEBUG   (31642):     x0   0000007474a262d8  x1   000000745a400000  x2   0000000000000008  x3   0000007474a262d8
01-25 04:01:19.242 F/DEBUG   (31642):     x4   0000800000000000  x5   0000000000000000  x6   000000745a400270  x7   6451ff6b6f6c4864
01-25 04:01:19.242 F/DEBUG   (31642):     x8   000000745a400260  x9   000000000000000b  x10  000000745a400270  x11  0000000000000028
01-25 04:01:19.242 F/DEBUG   (31642):     x12  000000745ac8dc08  x13  0000000000000001  x14  00000000170240bb  x15  000000001f2fdb25
01-25 04:01:19.242 F/DEBUG   (31642):     x16  000000747b137b68  x17  000000747e7a3a88  x18  0000000000000005  x19  000000745a400260
01-25 04:01:19.242 F/DEBUG   (31642):     x20  000000745a400000  x21  0000000000000000  x22  000000745a400260  x23  0000000000000001
01-25 04:01:19.242 F/DEBUG   (31642):     x24  0000000000000001  x25  000000747b13a000  x26  000000745ba37b48  x27  0000007472198400
01-25 04:01:19.242 F/DEBUG   (31642):     x28  000000747b13ae20  x29  000000745a400250  x30  000000747af9ae38
01-25 04:01:19.242 F/DEBUG   (31642):     sp   000000745a400000  pc   000000747af9f748  pstate 0000000020000000
01-25 04:01:19.243 F/DEBUG   (31642): 
01-25 04:01:19.243 F/DEBUG   (31642): backtrace:
01-25 04:01:19.243 F/DEBUG   (31642):     #00 pc 0000000000184748  /data/app/Mono.Android_Tests-1/lib/arm64/libmonosgen-2.0.so
01-25 04:01:19.243 F/DEBUG   (31642):     #01 pc 000000000017fe34  /data/app/Mono.Android_Tests-1/lib/arm64/libmonosgen-2.0.so

Version Information

Operating System: Mac OS X 10.12.3
Product Name: Xamarin.Android
Branch Name: d15-6
Build Revision: 2e24209998f93aa15c66ea5733724660a122dd88
[Device] Manufacturer: HUAWEI, Model: VTR-L29, Version: 7.0, ABI: arm64-v8a, Timezone: Not set

Log File

http://xqa.blob.core.windows.net/gist/log-2d21177b132f4d1fa79c25bdf55007ae.txt

@jonpryor
Copy link
Member

Attempt to run the Runtime test suite (src/Mono.Android/Test/Mono.Android-Tests.csproj) with AOT, LLVM, and Hybrid AOT (/p:AndroidAotMode=Hybrid) enabled

Is that any of them separately or all of them together?

Does this happen for all ABIs, or just arm64-v8a?

(More a question for @vargaz, but) Is there any relation between this bug and Issue #1218?

@pjcollins
Copy link
Member Author

pjcollins commented Jan 26, 2018

After further investigation this issue appears to be constant across multiple ABIs (armeabi-v7a, arm64-v8a), and occurs with multiple projects, including a newly created simple "Hello World" template. It should be very easy to reproduce with the following:

msbuild /t:Install /p:Configuration=Release /p:AotAssemblies=true /p:EnableLLvm=true /p:AndroidAotMode=Hybrid *.csproj

Diagnostic build output:
https://gist.githubusercontent.com/pjcollins/797cdb7eb2e6948505723d29d6e32bba/raw/d9d2cf011bd3ecc09bf630fe4241212ebba6ecf7/gistfile1.txt

There are also about 20 messages coming from [aot-compiler stderr] which are not treated as fatal in the build output above. I am not sure if this is something that should be tracked separately.

@pjcollins pjcollins changed the title The runtime test suite crashes when enabling hybrid AOT Encountering a crash on startup when enabling hybrid AOT Jan 26, 2018
@bulente
Copy link

bulente commented Feb 20, 2018

Any news for this topic? I really need the speed improvements of AOT without sacrificing code protection and hybrid AOT seems to be correct path for my purpose but currently I'm also getting a startup crash when enabled.

@pjcollins
Copy link
Member Author

Using d15-8, I am no longer able to reproduce this on 64bit devices when arm64-v8a support is enabled. However, I can still reproduce a crash on 32bit devices and on 64bit devices when only armeabi-v7a support is enabled. As such I am going to mark this as closed, as the behavior I am now seeing appears to be a duplicate of #1218.

jonpryor added a commit to jonpryor/xamarin-android that referenced this issue Feb 24, 2022
Changes: xamarin/monodroid@2c3e786...5e2b25e

  * xamarin/monodroid@5e2b25ea1: Bump to xamarin/androidtools@01d05424 (dotnet#1241)

Changes: dotnet/android-tools@bbe85df...f0b3abd

  * dotnet/android-tools@f0b3abd: Revert "[Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (dotnet#156)"

We do not yet have all of our proverbial ducks in a row to bump these
Android SDK versions.  Revert until we're fully ready to bump.
jonpryor added a commit that referenced this issue Feb 24, 2022
Changes: xamarin/monodroid@2c3e786...5e2b25e

  * xamarin/monodroid@5e2b25ea1: Bump to xamarin/androidtools@01d05424 (#1241)

Changes: dotnet/android-tools@bbe85df...f0b3abd

  * dotnet/android-tools@f0b3abd: Revert "[Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (#156)"

We do not yet have all of our proverbial ducks in a row to bump these
Android SDK versions.  Revert until we're fully ready to bump.
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc.
Projects
None yet
Development

No branches or pull requests

3 participants