react-native-vision-camera
react-native-vision-camera copied to clipboard
🐛 Crash in CodeScanner/MLKit: `BarhopperV3_recognizeBufferNative`
What's happening?
I'm using react-native-vision-camera v3.6.4
. On QR code scan I get google mlkit error Java_com_google_android_libraries_barhopper_BarhopperV3_recognizeBufferNative
. I've found known issues in mlkit repository. Do you have any ideas?
Did not have any issues on v3.5.1
Sentry error here may be useful
Reproduceable Code
const codeScanner: CodeScanner = {
codeTypes: ['qr'],
onCodeScanned: codes => {},
};
<Camera
device={device}
isActive={isCameraActive}
codeScanner={codeScanner}
style={styles.cameraStyle}
/>
Relevant log output
10-31 18:40:45.183 3395 7552 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x749afc3f53 in tid 7552 (pool-9-thread-9), pid 3395 (tscloud.scanner)
10-31 18:40:45.425 9017 9017 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-31 18:40:45.425 9017 9017 F DEBUG : Build fingerprint: 'samsung/a32ser/a32:11/RP1A.200720.012/A325FXXU2AVC1:user/release-keys'
10-31 18:40:45.425 9017 9017 F DEBUG : Revision: '4'
10-31 18:40:45.425 9017 9017 F DEBUG : ABI: 'arm64'
10-31 18:40:45.426 9017 9017 F DEBUG : Timestamp: 2023-10-31 18:40:45+0300
10-31 18:40:45.426 9017 9017 F DEBUG : pid: 3395, tid: 7552, name: pool-9-thread-9 >>> com.ticketscloud.scanner <<<
10-31 18:40:45.426 9017 9017 F DEBUG : uid: 10356
10-31 18:40:45.426 9017 9017 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x749afc3f53
10-31 18:40:45.426 9017 9017 F DEBUG : x0 00000074bdd7c878 x1 00000000000000e2 x2 0000007609005d38 x3 0000000000000014
10-31 18:40:45.426 9017 9017 F DEBUG : x4 0000000000000014 x5 0000000000000000 x6 0000000000001dff x7 00000074bdd7d470
10-31 18:40:45.426 9017 9017 F DEBUG : x8 0000000000000000 x9 0000000000000071 x10 000000000000006d x11 b4000074af2c8000
10-31 18:40:45.426 9017 9017 F DEBUG : x12 0000000000000070 x13 0000000000057f53 x14 000000749afc3f53 x15 000000749afc3a53
10-31 18:40:45.426 9017 9017 F DEBUG : x16 000000749af6c000 x17 000000769ae6e080 x18 00000000000e05fc x19 00000074bdd7c998
10-31 18:40:45.426 9017 9017 F DEBUG : x20 00000074bdd7c938 x21 00000074bdd7cad0 x22 0000000000000071 x23 000000000000006d
10-31 18:40:45.426 9017 9017 F DEBUG : x24 b4000074a7372278 x25 00000000000002d0 x26 00000000133a7e60 x27 00000074bdd7d188
10-31 18:40:45.426 9017 9017 F DEBUG : x28 00000074bdd7d1c8 x29 00000000000006ef
10-31 18:40:45.426 9017 9017 F DEBUG : lr 000000748c46dff4 sp 00000074bdd7c870 pc 000000748c46e0bc pst 0000000080000000
10-31 18:40:45.809 9017 9017 F DEBUG : backtrace:
10-31 18:40:45.810 9017 9017 F DEBUG : NOTE: Function names and BuildId information is missing for some frames due
10-31 18:40:45.810 9017 9017 F DEBUG : NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
10-31 18:40:45.810 9017 9017 F DEBUG : NOTE: found under the lib/ directory are readable.
10-31 18:40:45.810 9017 9017 F DEBUG : #00 pc 00000000001290bc /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.810 9017 9017 F DEBUG : #01 pc 00000000000816a8 /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.810 9017 9017 F DEBUG : #02 pc 000000000007b294 /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.810 9017 9017 F DEBUG : #03 pc 000000000007afe8 /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.810 9017 9017 F DEBUG : #04 pc 000000000007b544 /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.810 9017 9017 F DEBUG : #05 pc 0000000000079924 /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.810 9017 9017 F DEBUG : #06 pc 00000000000799c4 /data/user_de/0/com.google.android.gms/app_chimera/m/0000021d/dl-VisionBarcode.optional_234212100400.apk
10-31 18:40:45.811 9017 9017 F DEBUG : #07 pc 000000000013eed4 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.811 9017 9017 F DEBUG : #08 pc 00000000021d19b8 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.android.libraries.barhopper.BarhopperV3.recognize+104)
10-31 18:40:45.811 9017 9017 F DEBUG : #09 pc 0000000002011204 /memfd:jit-cache (deleted) (offset 0x2000000) (m.pp.g+452)
10-31 18:40:45.811 9017 9017 F DEBUG : #10 pc 00000000020fbd20 /memfd:jit-cache (deleted) (offset 0x2000000) (m.pp.b+5376)
10-31 18:40:45.811 9017 9017 F DEBUG : #11 pc 00000000021c580c /memfd:jit-cache (deleted) (offset 0x2000000) (m.bgj.a+396)
10-31 18:40:45.811 9017 9017 F DEBUG : #12 pc 00000000021bff08 /memfd:jit-cache (deleted) (offset 0x2000000) (m.bq.onTransact+200)
10-31 18:40:45.811 9017 9017 F DEBUG : #13 pc 00000000021113fc /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Binder.transact+140)
10-31 18:40:45.811 9017 9017 F DEBUG : #14 pc 00000000021caa6c /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.android.gms.internal.mlkit_vision_barcode.zza.zzb+124)
10-31 18:40:45.811 9017 9017 F DEBUG : #15 pc 00000000021cabe0 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.android.gms.internal.mlkit_vision_barcode.zzvt.zzd+128)
10-31 18:40:45.811 9017 9017 F DEBUG : #16 pc 0000000002112d18 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.vision.barcode.internal.zzn.zza+776)
10-31 18:40:45.811 9017 9017 F DEBUG : #17 pc 00000000020cde84 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.vision.barcode.internal.zzk.zze+164)
10-31 18:40:45.812 9017 9017 F DEBUG : #18 pc 00000000021da77c /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.vision.barcode.internal.zzk.run+92)
10-31 18:40:45.812 9017 9017 F DEBUG : #19 pc 00000000021e4cd8 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.vision.common.internal.MobileVisionBase.zza+136)
10-31 18:40:45.812 9017 9017 F DEBUG : #20 pc 00000000021e3aac /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.vision.common.internal.zza.call+76)
10-31 18:40:45.812 9017 9017 F DEBUG : #21 pc 00000000021d51d4 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.common.sdkinternal.ModelResource.zza+244)
10-31 18:40:45.812 9017 9017 F DEBUG : #22 pc 00000000021da6b4 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.common.sdkinternal.zzn.run+132)
10-31 18:40:45.812 9017 9017 F DEBUG : #23 pc 00000000021cc3b8 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.common.sdkinternal.zzt.run+152)
10-31 18:40:45.812 9017 9017 F DEBUG : #24 pc 0000000002110c08 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze+152)
10-31 18:40:45.812 9017 9017 F DEBUG : #25 pc 00000000021ccb2c /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc+140)
10-31 18:40:45.812 9017 9017 F DEBUG : #26 pc 00000000021ceb98 /memfd:jit-cache (deleted) (offset 0x2000000) (com.google.mlkit.common.sdkinternal.zzk.run+56)
10-31 18:40:45.812 9017 9017 F DEBUG : #27 pc 00000000020f9c74 /memfd:jit-cache (deleted) (offset 0x2000000) (java.util.concurrent.ThreadPoolExecutor.runWorker+388)
10-31 18:40:45.812 9017 9017 F DEBUG : #28 pc 0000000000135564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #29 pc 00000000001ab7e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #30 pc 00000000003260c0 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #31 pc 000000000031c2a8 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #32 pc 00000000006919e0 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #33 pc 000000000012f814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #34 pc 00000000001f8eb0 /apex/com.android.art/javalib/core-oj.jar (java.util.concurrent.ThreadPoolExecutor$Worker.run+4)
10-31 18:40:45.813 9017 9017 F DEBUG : #35 pc 00000000006936c4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.813 9017 9017 F DEBUG : #36 pc 000000000012fa14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.814 9017 9017 F DEBUG : #37 pc 000000000054bfc4 /data/app/~~WWPxHzksEkaj9FpEv1Ufjw==/com.ticketscloud.scanner-0uNGsi-S3GFiZ9zPOq6yYQ==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd+20)
10-31 18:40:45.815 9017 9017 F DEBUG : #38 pc 0000000000694be0 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.815 9017 9017 F DEBUG : #39 pc 000000000012f994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.817 9017 9017 F DEBUG : #40 pc 0000000000550334 /data/app/~~WWPxHzksEkaj9FpEv1Ufjw==/com.ticketscloud.scanner-0uNGsi-S3GFiZ9zPOq6yYQ==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.zzi.run+4)
10-31 18:40:45.817 9017 9017 F DEBUG : #41 pc 00000000006936c4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.817 9017 9017 F DEBUG : #42 pc 000000000012fa14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.817 9017 9017 F DEBUG : #43 pc 00000000000eb858 /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
10-31 18:40:45.818 9017 9017 F DEBUG : #44 pc 0000000000313550 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6193178744241938144)+264) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #45 pc 0000000000680168 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #46 pc 000000000013eff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #47 pc 0000000000135564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #48 pc 00000000001ab7e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #49 pc 0000000000567e94 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #50 pc 00000000005b8184 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: bd4bbcfee9112dc043c9dc3ab6bd8478)
10-31 18:40:45.818 9017 9017 F DEBUG : #51 pc 00000000000ed098 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 7c95cc0d17d92058007afa23409fd94e)
10-31 18:40:45.819 9017 9017 F DEBUG : #52 pc 000000000008cb10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 7c95cc0d17d92058007afa23409fd94e)
Camera Device
{
"sensorOrientation": "landscape-right",
"hardwareLevel": "limited",
"maxZoom": 4,
"minZoom": 1,
"supportsLowLightBoost": false,
"neutralZoom": 1,
"physicalDevices": [
"wide-angle-camera"
],
"supportsFocus": true,
"supportsRawCapture": false,
"isMultiCam": false,
"name": "BACK (0)",
"hasFlash": true,
"hasTorch": true,
"position": "back",
"id": "0"
}
Device
Android Samsung, Honor, Huawei, Redmi
VisionCamera Version
3.6.4
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information
- [ ] I am using Expo
- [ ] I have enabled Frame Processors (react-native-worklets-core)
- [X] I have read the Troubleshooting Guide
- [X] I agree to follow this project's Code of Conduct
- [X] I searched for similar issues in this repository and found none.
You can using try another version of MLKit by editing the build.gradle
of vision-camera.
I have no idea which (or if any) other version works so, good hunting.
I'm seeing the same issue appearing at random after scanning a QR code.
Perhaps unsurprisingly, this happens whether using the com.google.android.gms/[email protected]
or the bundled com.google.mlkit:[email protected]
.
The frequency of this issue and the numbers being reported from the field are staggering. It appears that the problem lies within the MLKit itself, rather than this specific library, though. Let's hope Google gets their act together and deals with this soon.
Also same issue after upgrading to version 3
Java_com_google_android_libraries_barhopper_BarhopperV3_recognizeBufferNative
Another reported issue that i think is related
Java_com_google_android_gms_vision_barcode_internal_NativeBarcodeDetector_recognizeBufferNative
Any updates? Having same issue.
can you guys please test if this change solves the issue for you?
remove node_modules
modify vision-camera in package.json
to be like below and see what happens
"dependencies": {
"react-native-vision-camera": "github:rodgomesc/react-native-vision-camera#cad3699"
}
Appears to be working! I will run it on others devices to confirm.
Appears to be working! I will run it on others devices to confirm.
looking forward to know if it will work then i'll send a pr, @WitchMad qualquer coisa me chama no discord user: rodgomesc
can you guys please test if this change solves the issue for you?
remove
node_modules
modify vision-camera inpackage.json
to be like below and see what happens
Thank you for the fix! I've tested it on multiple devices, and it works perfectly. go ahead and create a pull request.
does anyone get an npm error once i set "github:rodgomesc/react-native-vision-camera#cad3699"
?
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/user/.npm/_cacache/tmp/git-cloneOHBQrz/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/user/.npm/_cacache/tmp/git-cloneOHBQrz/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: /Users/user/.npm/_logs/debug-0.log
@iliapnmrv Use gitpkg
"react-native-vision-camera": "https://gitpkg.now.sh/rodgomesc/react-native-vision-camera/package?cad3699"
@iliapnmrv Use gitpkg
"react-native-vision-camera": "https://gitpkg.now.sh/rodgomesc/react-native-vision-camera/package?cad3699"
it works, thanks a lot❤️
@rodgomesc It still crashes for me on android after scanning a qr code (same on latest): cannot open libmiuindbg.so: No such file or directory
. On my device, it works with 3.6.8, but we got error reports of the BarhopperV3_recognizeBufferNative crash
11-23 10:30:50.911 1195 2550 I CHIUSECASE: [INFO ] chxperf.cpp:850 ReleasePerfLock() Release perflock type: 16
11-23 10:30:50.911 1195 2550 I CHIUSECASE: [INFO ] chxperf.cpp:1138 ReleasePerfLock() Perflock already released or not acquired
11-23 10:30:50.911 1195 2550 I CHIUSECASE: [INFO ] chxextensionmodule.cpp:1198 GetCameraIdIndex() AppId => LogicalId:0 => 0
11-23 10:30:50.911 1195 2550 E CamX : [ERROR][HAL ] camxhal3module.cpp:149 ReleaseTorchForCamera() Facing = 0.
11-23 10:30:50.911 1195 2550 E CamX : [ERROR][HAL ] camxhal3module.cpp:155 ReleaseTorchForCamera() sensor: 0, logicalCameraId: 0, facing: 0
11-23 10:30:50.911 1195 2550 I CamX : [ INFO][HAL ] camxhal3module.cpp:377 SetTorchModeInternal() forbid torchStatus 1 3 0
11-23 10:30:50.911 1195 2550 I CamX : [ INFO][HAL ] camxhal3module.cpp:385 SetTorchModeInternal() Torch notify state is (inReleaseMode = 1, dropCallbacks
= 0, logicalCameraId = 0)
11-23 10:30:50.911 1748 25093 I CameraProviderManager: Camera device [email protected]/legacy/0 torch status is now AVAILABLE_OFF
11-23 10:30:50.911 1748 25093 I CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=1
11-23 10:30:50.912 14976 15002 I BpBinder: onLastStrongRef automatically unlinking death recipients:
11-23 10:30:50.958 14976 15002 I OpenGLRenderer: Davey! duration=731ms; Flags=0, FrameTimelineVsyncId=5271905, IntendedVsync=475006579992478, Vsync=475006579992478, InputEventId=0, HandleInputStart=475006580657491, AnimationStart=475006580660772, PerformTraversalsStart=475007296530876, DrawStart=475007297202751, FrameDeadline=475006596659144, FrameInterval=475006580635043, FrameStartTime=16666666, SyncQueued=475007299674782, SyncStart=475007299972386, IssueDrawCommandsStart=475007303516918, SwapBuffers=475007308849365, FrameCompleted=475007312201240, DequeueBufferDuration=77292, QueueBufferDuration=2076510, GpuCompleted=475007312201240, SwapBuffersCompleted=475007312201240, DisplayPresentTime=0,
11-23 10:30:50.958 15483 15483 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-23 10:30:50.958 15483 15483 F DEBUG : Build fingerprint: 'Xiaomi/toco_global/toco:12/SKQ1.210908.001/V13.0.4.0.SFNMIXM:user/release-keys'
11-23 10:30:50.958 15483 15483 F DEBUG : Revision: '0'
11-23 10:30:50.958 15483 15483 F DEBUG : ABI: 'arm64'
11-23 10:30:50.958 15483 15483 F DEBUG : Timestamp: 2023-11-23 10:30:50.552294286+0100
11-23 10:30:50.958 15483 15483 F DEBUG : Process uptime: 0s
11-23 10:30:50.958 15483 15483 F DEBUG : Cmdline: com.fotologusmobile
11-23 10:30:50.958 15483 15483 F DEBUG : pid: 14976, tid: 15460, name: pool-20-thread- >>> com.fotologusmobile <<<
11-23 10:30:50.958 15483 15483 F DEBUG : uid: 10523
11-23 10:30:50.958 15483 15483 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7968145370
11-23 10:30:50.958 15483 15483 F DEBUG : x0 00000079680e0de8 x1 00000000000000d0 x2 00000079680e0f08 x3 0000000000000002
11-23 10:30:50.958 15483 15483 F DEBUG : x4 00000079680e1140 x5 00000079680e11a8 x6 b400007b00000100 x7 00000079680e19e0
11-23 10:30:50.958 15483 15483 F DEBUG : x8 0000000000000000 x9 0000000000000068 x10 000000000000005f x11 b400007996db8800
11-23 10:30:50.958 15483 15483 F DEBUG : x12 0000000000000067 x13 0000000000058370 x14 0000007968145370 x15 0000007968144e70
11-23 10:30:50.958 15483 15483 F DEBUG : x16 00000079680ed000 x17 0000007bac0f8884 x18 00000000000e05fc x19 00000079680e0f08
11-23 10:30:50.958 15483 15483 F DEBUG : x20 00000079680e0ea8 x21 00000079680e1040 x22 0000000000000068 x23 000000000000005f
11-23 10:30:50.958 15483 15483 F DEBUG : x24 b400007b01d174fc x25 0000007b24e16000 x26 0000000000000007 x27 00000079680e16f8
11-23 10:30:50.958 15483 15483 F DEBUG : x28 00000079680e1738 x29 00000000000006ef
11-23 10:30:50.958 15483 15483 F DEBUG : lr 00000079763689ec sp 00000079680e0de0 pc 0000007976368ab4 pst 0000000080000000
11-23 10:30:50.958 15483 15483 F DEBUG : backtrace:
11-23 10:30:50.958 15483 15483 F DEBUG : NOTE: Function names and BuildId information is missing for some frames due
11-23 10:30:50.958 15483 15483 F DEBUG : NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
11-23 10:30:50.958 15483 15483 F DEBUG : NOTE: found under the lib/ directory are readable.
11-23 10:30:50.958 15483 15483 F DEBUG : NOTE: On this device, run setenforce 0 to make the libraries readable.
11-23 10:30:50.958 15483 15483 F DEBUG : #00 pc 0000000000128ab4 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #01 pc 00000000000812d4 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #02 pc 000000000007af18 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #03 pc 000000000007ac18 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #04 pc 000000000007b1c8 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #05 pc 0000000000079554 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #06 pc 00000000000795f4 /data/user_de/0/com.google.android.gms/app_chimera/m/00000583/dl-VisionBarcode.optional_234414100400.apk
11-23 10:30:50.958 15483 15483 F DEBUG : #07 pc 000000000034aa30 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-23 10:30:50.958 15483 15483 F DEBUG : #08 pc 0000000000333fa4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-23 10:30:50.958 15483 15483 F DEBUG : #09 pc 0000000000380e60 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+300) (BuildId: 4cfdaa9e5146c43e20ae36ee1caf9b7f)
11-23 10:30:50.958 15483 15483 F DEBUG : #10 pc 0000000000380684 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall
11-23 10:30:51.018 2052 2668 I DropBoxManagerService: add tag=SYSTEM_TOMBSTONE_PROTO isTagEnabled=true flags=0x4
@rodgomesc, thanks for the solution! I tried it, but it unfortunately didn't fix the issue on my end. Still, appreciate your help! 👍
I can confirm, though, that downgrading to v3.5.1 seems to do the trick. 🎉 Here's the commit diff between v3.5.1 and v3.6.4, for the interested. I'll dig into this and see if I can make progress.
For reference and posterity, you can also track this issue via #2189 in this project, while the root cause itself, which lies within the mlkit
package, can be tracked at googlesamples/mlkit#714.
Below is what I'm seeing:
11-24 08:04:04.444 29862 29862 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-24 08:04:04.445 29862 29862 F DEBUG : Build fingerprint: 'samsung/a71naeea/a71:13/TP1A.220624.014/A715FXXUADWH4:user/release-keys'
11-24 08:04:04.445 29862 29862 F DEBUG : Revision: '6'
11-24 08:04:04.445 29862 29862 F DEBUG : ABI: 'arm64'
11-24 08:04:04.445 29862 29862 F DEBUG : Processor: '2'
11-24 08:04:04.445 29862 29862 F DEBUG : Timestamp: 2023-11-24 08:04:03.941381277+0100
11-24 08:04:04.445 29862 29862 F DEBUG : Process uptime: 89s
11-24 08:04:04.445 29862 29862 F DEBUG : Cmdline: [redacted]
11-24 08:04:04.445 29862 29862 F DEBUG : pid: 29378, tid: 29614, name: pool-8-thread-8 >>> [redacted] <<<
11-24 08:04:04.445 29862 29862 F DEBUG : uid: 10439
11-24 08:04:04.445 29862 29862 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x00000075e01ad74c
[…]
11-24 08:04:04.445 29862 29862 F DEBUG : backtrace:
11-24 08:04:04.445 29862 29862 F DEBUG : #00 pc 00000000000ed660 /data/app/~~5ZTjAHjyw9v0-g7a8S1RxQ==/[redacted]-ND50NrMo9LMyMfhybnr8LA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
Same error happened to me on v3.6.9
. Going back to v3.5.1
seems to solve this issue.
Heyo! Does https://github.com/mrousavy/react-native-vision-camera/pull/2355 maybe fix your issue?
still seems to be an issue in 3.7.0 .. Tried both VisionCamera_enableCodeScanner=true and VisionCamera_enableCodeScanner=false Samsung device (SDK 33)
I have the same problem, happens to around 4% of my users - so pretty frequent. 3.7.0 did not solve this issue.
I'm seeing some reports of this crash coming from my prod app (vision-camera v3.6.17).
I can reproduce it on roughly 25% of my barcode scans...crashes right after the successful scan.
Update: Tried out 3.7.0...no difference.
@rodgomesc did you ever make a PR for this fix?
@parlet I just went thru the changes again and nothing seems to be related to the CodeScanner.
I don't know why this is happening, on my test devices it does not happen so I currently cannot reproduce this.
If you / your company absolutely needs this fixed, consider contracting me/my agency to fix this issue
@mrousavy, Yeah, I remember doing a cursory run through the code diffs before, and I didn't see anything that would attract my attention either, although of course I don't have an in-depth knowledge of the code base.
I hope I'll find some time to debug this issue and dig deeper into what within this library might help, although ultimately, the problem lies in the libbarhopper_v3.so
and that's where we'd ideally find the solution. Something tells me this might be a race condition.
Anyway, thank you very much for your attention to this issue. =) Just let me know If there is anything more I could assist with.
I might have found a way to avoid or minimize this. I'm curious if others are doing what I was and unmounting the camera component/navigating away right after they get a scan. I can't seem to reproduce the crash anymore after:
- Setting
isActive={false}
on the camera after I get a scan - Inserting a brief setTimeout delay of 500ms before calling my Navigation.dismiss
Give this a shot in your apps. I'm on v3.8.0
now.
I might have found a way to avoid or minimize this. I'm curious if others are doing what I was and unmounting the camera component/navigating away right after they get a scan. I can't seem to reproduce the crash anymore after:
- Setting
isActive={false}
on the camera after I get a scan- Inserting a brief setTimeout delay of 500ms before calling my Navigation.dismiss
Give this a shot in your apps. I'm on
v3.8.0
now.
I will try this - we are using the camera in many different workflows - this means going from one camera instance to the next pretty rapidly. Currently i have minimised the errors by waiting 100 m/s on viewDidMount to initialise the camera.
I'm still getting reports of it in prod even on 3.5.1 for what it's worth, although definitely seems less frequent
By the way, for tracking purposes, this bug is logged in the Google's public issue tracker as #294890843 and #314930525. We may have better luck if we tackle this issue at its source.
I can also seem to reproduce this every once in a while by simply backgrounding the app while the camera view is active, then resuming the app. On the occasional resume, this crash will occur right away.
Agree that we should comment on the Google Issue Tracker instead - this does not seem like an issue on my end. See the issues #294890843 and #314930525.
Also this guy: https://github.com/googlesamples/mlkit/issues/714
I'm hitting this as well (tried both 3.8.2
and 3.9.0-beta.0
) when using my barcode scanner plugin that leverages a frame processor and that relies as well on Google MLKit. Can be reproduced pretty quickly with a hard mount/unmount interval, so I guess it's on MLKit side, but still interesting what changes lead to an increase in reports.
useEffect(() => {
const interval = setInterval(() => {
setIsMounted(prevIsMounted => {
console.log({isMounted: !prevIsMounted});
return !prevIsMounted;
});
}, 3000);
return () => {
clearInterval(interval);
};
}, []);
Java_com_google_android_libraries_barhopper_BarhopperV3_recognizeBufferNative. Getting the same issue in production, It occurs randomly while scanning and navigating between screens.