Search Issue Tracker

By Design

Votes

0

Found in

2017.1.0p4

Issue ID

952361

Regression

No

[Android][.NET 4.6] Traceless crash on devices with Qualcomm Krait CPUs when instantiating AndroidJavaObject or AndroidJavaProxy

Mobile

-

Using Android Java objects on certain Qualcomm CPUs causes a crash when using .NET 4.6.

Steps to reproduce:
1) Open the attached project.
2) Build & Run on a device.
3) Wait for 20-40 seconds.

The app crashes without a trace. The crash only seems to occur on Qualcomm Krait CPUs. Switching API compatibility to .NET 3.5/2.0 disables the crash. Reproducible with Mono and IL2CPP.

Reproduced on:
2018.1.0a1 (1442398fd94a - trunk as of 12/10/2017), 2017.1.0a6

Devices that reproduced the issue:
LG G3 Android 5.0 w/ 4x Qualcomm Krait 400 @ 2500MHz
Motorola Moto X Android 5.1 w/ 4x Qualcomm Krait 400 @ 2500 MHz

Devices that didn't reproduce the issue:
Samsung Galaxy S6 Android 7.0 w/ 2x Qualcomm Kryo @ 1593 MHz + 2x Qualcomm Kryo @ 2150 MHz
Google Pixel Android 8.0 w/ 4x Qualcomm Kryo 100 @ 2150 MHz

  1. Resolution Note:

    This is user error: low level AndroidJNI functions are not used correctly.
    Users code calls AndroidJNI.AttachCurrentThread(), but doesn't call AndroidJNI.DetachCurrentThread(). This results in issues when Garbage Collector runs for C# side.
    The code that does JNI calls from non-main thread should be wrapped with attach/detach.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.