googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.57k stars 2.93k forks source link

[Bug report] SIGILL crash libmlkit_google_ocr_pipeline.so on certain devices #655

Closed kreativityapps closed 1 year ago

kreativityapps commented 1 year ago

Describe the bug On certain devices SIGILL is caused when trying to use com.google.mlkit.vision.text.TextRecognizer.

Crash log:

F/libc ( 2354): Fatal signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x3ad10798 in tid 2735 (Thread-18), pid 2354 (.appname) Native Crash TIME: 2992183 Build fingerprint: 'motorola/maltalsc_reteu/maltalsc:10/QOJS30.506-7-18/4c055:user/release-keys' Revision: '0' ABI: 'arm' Timestamp: 2023-04-08 21:05:29+0200 pid: 2354, tid: 2735, name: Thread-18 >>> com.app.name <<< uid: 10158 signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x3ad10798 (*pc=0xfe662d40) r0 4759a100 r1 00000010 r2 00000100 r3 47599e08 r4 475aff70 r5 00000030 r6 475affb0 r7 00000008 r8 475aff90 r9 4722cec0 r10 4759a008 r11 475aff50 ip 47599f08 sp 3a57a110 lr 3ad2a96f pc 3ad10798 backtrace:

00 pc 003b2798 /data/app/com.app.name-FoLU8pEHKLoclKTZEyPZkg==/lib/arm/libmlkit_google_ocr_pipeline.so (BuildId: 6adbac2eebca1a500923309bbaf09b52)

Crash thread undumpable

To Reproduce Using com.google.mlkit.vision.text.TextRecognizer on devices like Moto e7i

The last v2 text recognition lib causes the crash com.google.mlkit:text-recognition:16.0.0-beta6 No crash with com.google.mlkit:text-recognition:16.0.0-beta5 Everything works fine also when using the old v1 com.google.android.gms:play-services-mlkit-text-recognition:18.0.2

Expected behavior It shouldn't crash

SDK Info: com.google.mlkit:text-recognition:16.0.0-beta6

Smartphone: ~100 of users affected by the crash in less than one week, I could also reproduce it locally on Moto e7i device. Devices from Play Console crash report:

motorola maltalsc motorola fijisc ZTE P963F60 Nokia COS Nokia IRS ZTE P963F61 ZTE P963F80 ACE BUZZ_3 Hisense HLTE235E MEDIACOM M-SP1AZ3L2 and others

Android versions: 10, 11, 12

stunningdimension22 commented 1 year ago

Hi there, sorry for the late reply!

Question: do you have platform configuration(32bit v.s. 64bit) when building the apk? Going forward google play services support 32bit and 64bit devices, but wont support mismatch case: meaning 32bit binary running on 64bit devices or 64bit binary running on 32bit devices. see https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html

kreativityapps commented 1 year ago

Hi, I'm building the bundle only for 'armeabi-v7a' and 'arm64-v8a'

stunningdimension22 commented 1 year ago

Actually sorry for this regression, we verified this issue fixed in a Moto e7i and will have that in the upcoming release soon.

Dalpatgohil115 commented 1 year ago

Describe the bug On certain devices SIGILL is caused when trying to use com.google.mlkit.vision.text.TextRecognizer.

Crash log:

F/libc ( 2354): Fatal signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x3ad10798 in tid 2735 (Thread-18), pid 2354 (.appname) Native Crash TIME: 2992183 Build fingerprint: 'motorola/maltalsc_reteu/maltalsc:10/QOJS30.506-7-18/4c055:user/release-keys' Revision: '0' ABI: 'arm' Timestamp: 2023-04-08 21:05:29+0200 pid: 2354, tid: 2735, name: Thread-18 >>> com.app.name <<< uid: 10158 signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x3ad10798 (*pc=0xfe662d40) r0 4759a100 r1 00000010 r2 00000100 r3 47599e08 r4 475aff70 r5 00000030 r6 475affb0 r7 00000008 r8 475aff90 r9 4722cec0 r10 4759a008 r11 475aff50 ip 47599f08 sp 3a57a110 lr 3ad2a96f pc 3ad10798 backtrace:

00 pc 003b2798 /data/app/com.app.name-FoLU8pEHKLoclKTZEyPZkg==/lib/arm/libmlkit_google_ocr_pipeline.so (BuildId: 6adbac2eebca1a500923309bbaf09b52)

Crash thread undumpable

To Reproduce Using com.google.mlkit.vision.text.TextRecognizer on devices like Moto e7i

The last v2 text recognition lib causes the crash com.google.mlkit:text-recognition:16.0.0-beta6 No crash with com.google.mlkit:text-recognition:16.0.0-beta5 Everything works fine also when using the old v1 com.google.android.gms:play-services-mlkit-text-recognition:18.0.2

Expected behavior It shouldn't crash

SDK Info: com.google.mlkit:text-recognition:16.0.0-beta6

Smartphone: ~100 of users affected by the crash in less than one week, I could also reproduce it locally on Moto e7i device. Devices from Play Console crash report:

motorola maltalsc motorola fijisc ZTE P963F60 Nokia COS Nokia IRS ZTE P963F61 ZTE P963F80 ACE BUZZ_3 Hisense HLTE235E MEDIACOM M-SP1AZ3L2 and others

Android versions: 10, 11, 12

kreativityapps commented 1 year ago

Hi, I tried it with the new com.google.mlkit:text-recognition:16.0.0 and it looks fixed, no crash. Thank you!

Dalpatgohil115 commented 1 year ago

Describe the bug On certain devices SIGILL is caused when trying to use com.google.mlkit.vision.text.TextRecognizer.

Crash log:

F/libc ( 2354): Fatal signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x3ad10798 in tid 2735 (Thread-18), pid 2354 (.appname) Native Crash TIME: 2992183 Build fingerprint: 'motorola/maltalsc_reteu/maltalsc:10/QOJS30.506-7-18/4c055:user/release-keys' Revision: '0' ABI: 'arm' Timestamp: 2023-04-08 21:05:29+0200 pid: 2354, tid: 2735, name: Thread-18 >>> com.app.name <<< uid: 10158 signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x3ad10798 (*pc=0xfe662d40) r0 4759a100 r1 00000010 r2 00000100 r3 47599e08 r4 475aff70 r5 00000030 r6 475affb0 r7 00000008 r8 475aff90 r9 4722cec0 r10 4759a008 r11 475aff50 ip 47599f08 sp 3a57a110 lr 3ad2a96f pc 3ad10798 backtrace:

00 pc 003b2798 /data/app/com.app.name-FoLU8pEHKLoclKTZEyPZkg==/lib/arm/libmlkit_google_ocr_pipeline.so (BuildId: 6adbac2eebca1a500923309bbaf09b52)

Crash thread undumpable

To Reproduce Using com.google.mlkit.vision.text.TextRecognizer on devices like Moto e7i

The last v2 text recognition lib causes the crash com.google.mlkit:text-recognition:16.0.0-beta6 No crash with com.google.mlkit:text-recognition:16.0.0-beta5 Everything works fine also when using the old v1 com.google.android.gms:play-services-mlkit-text-recognition:18.0.2

Expected behavior It shouldn't crash

SDK Info: com.google.mlkit:text-recognition:16.0.0-beta6

Smartphone: ~100 of users affected by the crash in less than one week, I could also reproduce it locally on Moto e7i device. Devices from Play Console crash report:

motorola maltalsc motorola fijisc ZTE P963F60 Nokia COS Nokia IRS ZTE P963F61 ZTE P963F80 ACE BUZZ_3 Hisense HLTE235E MEDIACOM M-SP1AZ3L2 and others

Android versions: 10, 11, 12

Mi