react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

๐Ÿ› App crashed(Not yet reproducible)

Open bglgwyng opened this issue 2 years ago โ€ข 7 comments

What's happening?

My app crashed with the following error message. I don't know how to reproduce it yet, however, the crash logs have not been reported yet, I posted it as a draft.

Reproduceable Code

// don't know yet

Relevant log output

FATAL EXCEPTION: mrousavy/VisionCamera.video
Process: com.gwyng.myapp, PID: 7047
com.facebook.jni.CppException: std::exception
    at com.mrousavy.camera.frameprocessor.VisionCameraScheduler.trigger(Native Method)
    at com.mrousavy.camera.frameprocessor.VisionCameraScheduler.$r8$lambda$Rh5vFX2pR6HZnaz5K-D0xg2S108(Unknown Source:0)
    at com.mrousavy.camera.frameprocessor.VisionCameraScheduler$$ExternalSyntheticLambda0.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.os.HandlerThread.run(HandlerThread.java:67)

Camera Device

{"hardwareLevel": "full", "hasFlash": true, "hasTorch": true, "id": "0", "isMultiCam": false, "maxZoom": 8, "minZoom": 1, "name": "BACK (0)", "neutralZoom": 1, "physicalDevices": ["wide-angle-camera"], "position": "back", "sensorOrientation": "landscape-right", "supportsFocus": true, "supportsLowLightBoost": true, "supportsRawCapture": true}

Device

Galaxy S21

VisionCamera Version

3.6.4

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (โš ๏ธ your issue might get ignored & closed if you don't try this)

Additional information

bglgwyng avatar Nov 11 '23 10:11 bglgwyng

I also cannot reproduce this issue but my users get it. RNVC v3.6.11

HONOR HWYAL (HONOR 20 PRO), Android 10

iliapnmrv avatar Dec 08 '23 07:12 iliapnmrv

Hey @bglgwyng! Do you have any crash logs or adb logcat logs for this? Thanks! :)

mrousavy avatar Jan 05 '24 14:01 mrousavy

@mrousavy The posted log output is all I have received from logcat. Do we have a way to obtain more helpful logs? I believe it will take some time to reproduce the same behavior. I'll attempt to do so and share the results.

bglgwyng avatar Jan 06 '24 07:01 bglgwyng

Hm weird, yea adb logcat should normally give more output. Especially relevant are the steps happening before the crash.

mrousavy avatar Jan 08 '24 11:01 mrousavy

@mrousavy I reproduced a similar behavior twice. Still don't know how to do it. I just used my app's camera page for minutes and it crashed suddenly.

The logs are here The crash logs are a bit different from the one reported here, but they share com.mrousavy.camera.frameprocessor.VisionCameraScheduler.trigger part in common.

bglgwyng avatar Jan 08 '24 12:01 bglgwyng

I succeeded at reproducing the same crash logs. I just copied the entire logs here. https://gist.github.com/bglgwyng/88627404b45da41f16400fe468759fce

bglgwyng avatar Jan 08 '24 12:01 bglgwyng

Calling JS function after bridge has been destroyed

Interesting. Are you doing a fast refresh or something?

mrousavy avatar Jan 09 '24 16:01 mrousavy

Fash refresh was disabled.

bglgwyng avatar Jan 14 '24 04:01 bglgwyng

Hey @bglgwyng - could you try to reproduce this bug again with react-native-worklets-core 0.3.0 (includes a fix) and VisionCamera from current main branch (includes a ton of fixes again)?

mrousavy avatar Jan 30 '24 16:01 mrousavy

I'll test it this weekend!

bglgwyng avatar Feb 01 '24 01:02 bglgwyng

Hey - @bglgwyng did you test if this is fixed now in 3.9.x?

mrousavy avatar Feb 13 '24 12:02 mrousavy

Not yet. The example app crashed or showed a black screen on my Galaxy S21 after upgrading to 3.9.0. I wasn't able to test this issue.

bglgwyng avatar Feb 13 '24 12:02 bglgwyng

The example app crashed or showed a black screen on my Galaxy S21 after upgrading to 3.9.0

Wait what? Is there an issue for this? That's weird.

mrousavy avatar Feb 13 '24 13:02 mrousavy

Having same consistent crash when frame.toArrayBuffer() is called.

Device Galaxy A02

VisionCamera Version 3.9.0-beta.3 WorkletsCore Version 0.3.0 PixelFormat yuv

Input channel destroyed: 'a325e7a', fd=111
Finding view 3...
Found view 3!
ImageReader::onImageAvailable!
Converting 1920 x 1440 @ 1920 HardwareBuffer...
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 23986 (ionCamera.video), pid 22209 (com.sampleapp)
nativeRelease nativeObject s[3038512224]
nativeRelease nativeObject e[3038512224]
assignNativeObject: nativeObject = 0 Surface(name=null)/@0x7803300 / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 
nativeRelease nativeObject s[2091512032]
nativeRelease nativeObject e[2091512032]
nativeRelease nativeObject s[2570893312]
nativeRelease nativeObject e[2570893312]
nativeRelease nativeObject s[3017669408]
nativeRelease nativeObject e[3017669408]
Relayout returned: old=(0,0,1555,720) new=(0,0,1555,720) req=(1555,720)0 dur=43 res=0x1 s={true 3063056384} ch=false fn=17
updateBoundsLayer: shouldReparent = false t = android.view.SurfaceControl$Transaction@6ecd175 sc = Surface(name=Bounds for - com.sampleapp/com.sampleapp.MainActivity@0)/@0x25050a frame = 17
pid: 22209, tid: 23986, name: ionCamera.video  >>> com.sampleapp <<<
NativeAlloc concurrent copying GC freed 84017(3050KB) AllocSpace objects, 3(48KB) LOS objects, 49% free, 4789KB/9578KB, paused 879us total 219.229ms
A resource failed to call close. 
      #07 pc 0003ba04  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #08 pc 0003dc63  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #09 pc 00044efd  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #10 pc 0005b15f  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #11 pc 0005a835  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #12 pc 0006176d  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #13 pc 00045121  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #14 pc 00038021  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #15 pc 0004fd44  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (RNWorklet::JsiWorklet::call(std::__ndk1::shared_ptr<facebook::jsi::Function>, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+576) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #16 pc 0004eb04  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+140) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #17 pc 000fa14f  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!librnworklets.so (offset 0x4942000) (RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const+54) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
      #18 pc 000fa107  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!librnworklets.so (offset 0x4942000) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
      #19 pc 000fa091  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!librnworklets.so (offset 0x4942000) (facebook::jsi::Value std::__ndk1::__invoke_void_return_wrapper<facebook::jsi::Value>::__call<RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int>(RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned int&&)+86) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
      #20 pc 000fa033  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!librnworklets.so (offset 0x4942000) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
      #21 pc 000f9645  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!librnworklets.so (offset 0x4942000) (std::__ndk1::__function::__func<RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int), std::__ndk1::allocator<RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned int&&)+84) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
      #22 pc 0003dc63  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #23 pc 00044efd  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #24 pc 0005b15f  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #25 pc 0005a835  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #26 pc 0006176d  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #27 pc 00045121  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #28 pc 00038021  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libhermes.so (offset 0x3af9000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
      #29 pc 0004fd44  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (RNWorklet::JsiWorklet::call(std::__ndk1::shared_ptr<facebook::jsi::Function>, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+576) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #30 pc 0004eb04  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+140) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #31 pc 0004e260  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptr<vision::FrameHostObject> const&) const+356) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #32 pc 0004dd30  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (vision::JFrameProcessor::call(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>)+100) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #33 pc 0004f0c4  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (facebook::jni::detail::MethodWrapper<void (vision::JFrameProcessor::*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>), &(vision::JFrameProcessor::call(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>)), vision::JFrameProcessor, void, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*> >::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&)+48) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #34 pc 0004f17c  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (facebook::jni::detail::CallWithJniConversions<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&), void, facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*> >::call(facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&))+108) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #35 pc 0004f038  /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!libVisionCamera.so (offset 0x197000) (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*> >::call(_JNIEnv*, _jobject*, facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&))+64) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
      #46 pc 0001937c  [anon:dalvik-classes9.dex extracted in memory from /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!classes9.dex] (com.mrousavy.camera.core.VideoPipeline.$r8$lambda$EMriwS_FKhtjTFtppM84Z5V8tiI)
      #49 pc 00019120  [anon:dalvik-classes9.dex extracted in memory from /data/app/~~3QWpXgiqE47BYtQPneq9fQ==/com.sampleapp-eUYUxK3WmwtNk0dMVzk5cw==/base.apk!classes9.dex] (com.mrousavy.camera.core.VideoPipeline$$ExternalSyntheticLambda0.onImageAvailable+4)

EDIT

Also tried with main branch and still crashing, logs below:

17:51:41.053  I  ImageReader::onImageAvailable!
17:51:41.061  I  Converting 1920 x 1440 @ 1920 HardwareBuffer...
17:51:41.062  A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 25439 (ionCamera.video), pid 25092 (com.sampleapp)
17:51:41.256  A  pid: 25092, tid: 25439, name: ionCamera.video  >>> com.sampleapp <<<
17:51:41.511  A        #07 pc 0003ba04  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.512  A        #08 pc 0003dc63  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.512  A        #09 pc 00044efd  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.512  A        #10 pc 0005b15f  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.512  A        #11 pc 0005a835  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.512  A        #12 pc 0006176d  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.512  A        #13 pc 00045121  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.513  A        #14 pc 00038021  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.513  A        #15 pc 0004fd44  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (RNWorklet::JsiWorklet::call(std::__ndk1::shared_ptr<facebook::jsi::Function>, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+576) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.513  A        #16 pc 0004eb04  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+140) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.513  A        #17 pc 000fa14f  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!librnworklets.so (offset 0x47df000) (RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int) const+54) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
17:51:41.513  A        #18 pc 000fa107  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!librnworklets.so (offset 0x47df000) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
17:51:41.514  A        #19 pc 000fa091  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!librnworklets.so (offset 0x47df000) (facebook::jsi::Value std::__ndk1::__invoke_void_return_wrapper<facebook::jsi::Value>::__call<RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int>(RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned int&&)+86) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
17:51:41.514  A        #20 pc 000fa033  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!librnworklets.so (offset 0x47df000) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
17:51:41.514  A        #21 pc 000f9645  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!librnworklets.so (offset 0x47df000) (std::__ndk1::__function::__func<RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int), std::__ndk1::allocator<RNWorklet::JsiObjectWrapper::setFunctionValue(facebook::jsi::Runtime&, facebook::jsi::Value const&)::'lambda'(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned int&&)+84) (BuildId: b7c8d35339b154369ee0b669ca7612ada736eaf3)
17:51:41.514  A        #22 pc 0003dc63  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.514  A        #23 pc 00044efd  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.514  A        #24 pc 0005b15f  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.514  A        #25 pc 0005a835  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.514  A        #26 pc 0006176d  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.515  A        #27 pc 00045121  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.515  A        #28 pc 00038021  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libhermes.so (offset 0x3996000) (BuildId: d3ef7cec979352a0481c2a8436987cd6475424af)
17:51:41.515  A        #29 pc 0004fd44  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (RNWorklet::JsiWorklet::call(std::__ndk1::shared_ptr<facebook::jsi::Function>, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+576) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.515  A        #30 pc 0004eb04  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned int)+140) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.515  A        #31 pc 0004e260  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptr<vision::FrameHostObject> const&) const+356) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.516  A        #32 pc 0004dd30  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (vision::JFrameProcessor::call(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>)+100) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.516  A        #33 pc 0004f0c4  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (facebook::jni::detail::MethodWrapper<void (vision::JFrameProcessor::*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>), &(vision::JFrameProcessor::call(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>)), vision::JFrameProcessor, void, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*> >::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&)+48) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.516  A        #34 pc 0004f17c  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (facebook::jni::detail::CallWithJniConversions<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&), void, facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*> >::call(facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&))+108) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.517  A        #35 pc 0004f038  /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!libVisionCamera.so (offset 0x3022000) (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*> >::call(_JNIEnv*, _jobject*, facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JFrameProcessor, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<vision::JFrame, facebook::jni::JObject, void>::_javaobject*>&&))+64) (BuildId: ec11a8c2b6cc1f734a7fb9c7eabf532cb0dde0f3)
17:51:41.518  A        #44 pc 0000d566  [anon:dalvik-classes8.dex extracted in memory from /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!classes8.dex] (com.mrousavy.camera.CameraView.onFrame+18)
17:51:41.518  A        #47 pc 00019a44  [anon:dalvik-classes8.dex extracted in memory from /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!classes8.dex] (com.mrousavy.camera.core.VideoPipeline._init_$lambda$0+80)
17:51:41.519  A        #50 pc 000196b8  [anon:dalvik-classes8.dex extracted in memory from /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!classes8.dex] (com.mrousavy.camera.core.VideoPipeline.$r8$lambda$EMriwS_FKhtjTFtppM84Z5V8tiI)
17:51:41.519  A        #53 pc 00019448  [anon:dalvik-classes8.dex extracted in memory from /data/app/~~DvnZ80imeXXeOPei0hnbqg==/com.sampleapp-_DSpSIk3wnfkfW5lWqCFpQ==/base.apk!classes8.dex] (com.mrousavy.camera.core.VideoPipeline$$ExternalSyntheticLambda0.onImageAvailable+4)
17:51:42.652  D  unregisterListener :: com.facebook.react.common.ShakeDetector@d5a4c0d
17:51:42.673  I  MSG_WINDOW_FOCUS_CHANGED 0 1

WanderingBit avatar Feb 14 '24 13:02 WanderingBit

@mrousavy I found that this error still occurs. Also, it seems to happen more frequently compared to 3.8.2. I'm not 100% sure. I still don't know how to reproduce this behavior, so if you have any idea about it, please let me know. Here's another crash log I got.

2024-02-15 19:59:16.937 28061-28183 libc                    com.gwyng.shootee                    A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x72757465723b29 in tid 28183 (ionCamera.video), pid 28061 (m.gwyng.shootee)
2024-02-15 19:59:17.059 28061-28061 VisionCameraProxy       com.gwyng.shootee                    D  Finding view 367...
2024-02-15 19:59:17.059 28061-28061 VisionCameraProxy       com.gwyng.shootee                    D  Found view 367!
---------------------------- PROCESS STARTED (28655) for package com.gwyng.shootee ----------------------------
2024-02-15 19:59:17.310 28061-28061 VisionCameraProxy       com.gwyng.shootee                    D  Finding view 367...
2024-02-15 19:59:17.310 28061-28061 VisionCameraProxy       com.gwyng.shootee                    D  Found view 367!
2024-02-15 19:59:17.977 28654-28654 DEBUG                   crash_dump64                         A  Cmdline: com.gwyng.shootee
2024-02-15 19:59:17.977 28654-28654 DEBUG                   crash_dump64                         A  pid: 28061, tid: 28183, name: ionCamera.video  >>> com.gwyng.shootee <<<
2024-02-15 19:59:17.977 28654-28654 DEBUG                   crash_dump64                         A        #00 pc 0000000000063f98  /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!libVisionCamera.so (offset 0x596000) (vision::JVisionCameraScheduler::trigger()+120) (BuildId: cca35f6d563d4f8bf98eaccd0e670ba2219223cc)
2024-02-15 19:59:17.977 28654-28654 DEBUG                   crash_dump64                         A        #01 pc 0000000000065874  /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!libVisionCamera.so (offset 0x596000) (facebook::jni::detail::MethodWrapper<void (vision::JVisionCameraScheduler::*)(), &(vision::JVisionCameraScheduler::trigger()), vision::JVisionCameraScheduler, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>)+32) (BuildId: cca35f6d563d4f8bf98eaccd0e670ba2219223cc)
2024-02-15 19:59:17.978 28654-28654 DEBUG                   crash_dump64                         A        #02 pc 0000000000065914  /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!libVisionCamera.so (offset 0x596000) (facebook::jni::detail::CallWithJniConversions<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), void, facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>::call(facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+76) (BuildId: cca35f6d563d4f8bf98eaccd0e670ba2219223cc)
2024-02-15 19:59:17.978 28654-28654 DEBUG                   crash_dump64                         A        #03 pc 00000000000657ec  /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!libVisionCamera.so (offset 0x596000) (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+60) (BuildId: cca35f6d563d4f8bf98eaccd0e670ba2219223cc)
2024-02-15 19:59:17.978 28654-28654 DEBUG                   crash_dump64                         A        #04 pc 00000000000642e8  /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!libVisionCamera.so (offset 0x596000) (facebook::jni::detail::MethodWrapper<void (vision::JVisionCameraScheduler::*)(), &(vision::JVisionCameraScheduler::trigger()), vision::JVisionCameraScheduler, void>::call(_JNIEnv*, _jobject*)+36) (BuildId: cca35f6d563d4f8bf98eaccd0e670ba2219223cc)
2024-02-15 19:59:17.978 28654-28654 DEBUG                   crash_dump64                         A        #10 pc 00000000000ebce4  [anon:dalvik-classes2.dex extracted in memory from /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!classes2.dex] (com.mrousavy.camera.frameprocessor.VisionCameraScheduler.$r8$lambda$QQXCER7V8WTCtwJ_0_iVk6pXtyc+0)
2024-02-15 19:59:17.978 28654-28654 DEBUG                   crash_dump64                         A        #15 pc 00000000000ebcc8  [anon:dalvik-classes2.dex extracted in memory from /data/app/~~dwVy3JiQwlcecdfhM_rGbg==/com.gwyng.shootee-dLlSo6_sTyQbP64gBIWi8Q==/base.apk!classes2.dex] (com.mrousavy.camera.frameprocessor.VisionCameraScheduler$$ExternalSyntheticLambda0.run+0)

bglgwyng avatar Feb 15 '24 11:02 bglgwyng

Is that with enableGpuBuffers set to true or false?

mrousavy avatar Feb 15 '24 11:02 mrousavy

@bglgwyng vision::JVisionCameraScheduler::trigger()+120 is just so weird. I don't know in what case this is ever being called ๐Ÿคจ

Is that immediately on camera startup or just after a while of running?

@WanderingBit your SIGSEV and the nativeRelease calls before might hint that the HardwareBuffer we are trying to access is already being deleted... I don't know how that can happen either. Is that also on app startup, or just after a while of running?

mrousavy avatar Feb 15 '24 11:02 mrousavy

or is that on some session change, like a prop to the Camera changes or you fast-refresh?

mrousavy avatar Feb 15 '24 11:02 mrousavy

Is that immediately on camera startup or just after a while of running?

I just left my app running. I needed to wait a few minutes until the error occurred. The error occurred without any session change.

bglgwyng avatar Feb 15 '24 12:02 bglgwyng

@mrousavy I just got a hint to create a reproducing step. Please wait a moment!

bglgwyng avatar Feb 15 '24 12:02 bglgwyng

@mrousavy Here's the reproducing step. https://github.com/bglgwyng/react-native-vision-camera/commit/10e5b4bd3dfaf81ae4b9e03b2a5e8afaeca593fa I made useRunAtTargetFps to replace the old runAtTargetFps with bugs, and I didn't replace it with the new one without bugs yet.

On my Galaxy S21, I could see the crash before the count value hits around 2000. You just need to open the example app and wait.

Now I'll try to make the code more minimal to detect the source of the bug more easily.

bglgwyng avatar Feb 16 '24 13:02 bglgwyng

I'm still not sure what's actually broken here?

Both runAtTargetFps and runAsync work for me in the example app (at least on 3.8.x, I'll double check if it works on 3.9.x later).

Also you could just use runAtTargetFps inside of runAsync ;)

mrousavy avatar Feb 16 '24 13:02 mrousavy

I'm still not sure what's actually broken here?

Both runAtTargetFps and runAsync work for me in the example app (at least on 3.8.x, I'll double check if it works on 3.9.x later).

Also you could just use runAtTargetFps inside of runAsync ;)

const frameProcessor = useFrameProcessor((frame) => {
    'worklet'
    if (model == null) return;
    runAsync(frame, () => {
      'worklet'
      runAtTargetFps(1, () => {
        'worklet'
        const resized = resize(frame, {
          scale: {
            width: 640,
            height: 640
          },
          pixelFormat: 'rgb',
          dataType: 'uint8'
        })
        const output = model.runSync([resized])
        const detections = output[0]

        const conf_threshold = 34
  
        
      })
    })
    
  }, [model])

No hot reload induced. It's weird model gives output without runAsync successfully but it freezes camera. For given code block above I leave the crash log below:

17:18:35.225  I  ImageReader::onImageAvailable!
17:18:35.228  E  [put()] Err:   330:, Yang OBC2 is put
17:18:35.233  I  [DBQ] (q2:0xacfb3000) Reallocate Slot(1), pool(0 -> 0) size(0 -> 2304000)  
17:18:35.239  I  [DBQ] (q2:0xacfb3000) Alloc Slot(1), handle=0xacf8cce0 c=0 w=720 h=1600 p=736 ys=736 vs=1600 f=268  
17:18:35.244  I  running async
17:18:35.244  I  Target scale: 640 x 640
17:18:35.244  I  Cropping to 1440 x 1440 at (240, 0)
17:18:35.244  I  Target Format: RGB
17:18:35.245  I  Target DataType: UINT8
17:18:35.245  I  Converting YUV 4:2:0 -> ARGB 8888...
17:18:35.247  I  Allocating _argbBuffer Buffer with size 11059200...
17:18:35.254  I  ImageReader::onImageAvailable!
17:18:35.257  I  [cust_ChangeTableByCond]Sensor_idx = 0 ,SHOOTING_MODE = 0,SceneMode = 0
17:18:35.258  I  [cust_ChangeSceneBy3rdpartyApp]VT_MODE = 0 ,MinFps = 30000,MaxFps = 30000,SceneMode = 7,AeMode = 1
17:18:35.258  I  [cust_mapAOSPAeMode] u4AeMode(1), u4AospAeMode(1)
17:18:35.258  I  [Scenario4AE] SensorMode(0), ShootMode(0), AeMode(1)
17:18:35.258  I  [setParams] SEC date.0222, disable auto flicker
17:18:35.261  E  [put()] Err:   330:, Yang OBC2 is put
17:18:35.266  I  [DBQ] (q2:0xacfb3000) Reallocate Slot(2), pool(0 -> 0) size(0 -> 2304000)  
17:18:35.271  I  [DBQ] (q2:0xacfb3000) Alloc Slot(2), handle=0xacf8b7e0 c=0 w=720 h=1600 p=736 ys=736 vs=1600 f=268  
17:18:35.274  I  Cropping [0, 0 @ 1920x1440] ARGB buffer to [240, 0 @ 1440x1440]...
17:18:35.274  I  Allocating _cropBuffer Buffer with size 8294400...
17:18:35.292  I  Scaling [0, 0 @ 1440x1440] ARGB buffer to [0, 0 @ 640x640]...
17:18:35.292  I  Allocating _scaleBuffer Buffer with size 1638400...
17:18:35.294  I  [cust_ChangeTableByCond]Sensor_idx = 0 ,SHOOTING_MODE = 0,SceneMode = 0
17:18:35.294  I  [cust_ChangeSceneBy3rdpartyApp]VT_MODE = 0 ,MinFps = 30000,MaxFps = 30000,SceneMode = 7,AeMode = 1
17:18:35.294  I  [cust_mapAOSPAeMode] u4AeMode(1), u4AospAeMode(1)
17:18:35.294  I  [Scenario4AE] SensorMode(0), ShootMode(0), AeMode(1)
17:18:35.294  I  [setParams] SEC date.0222, disable auto flicker
17:18:35.299  E  [put()] Err:   330:, Yang OBC2 is put
17:18:35.301  I  ImageReader::onImageAvailable!
17:18:35.304  I  Converting ARGB Buffer to Pixel Format 0...
17:18:35.304  I  Allocating _customFormatBuffer Buffer with size 1228800...
17:18:35.309  I  Wrapping Java ByteBuffer with size 1228800...
17:18:35.311  A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x39f75e42 in tid 10663 (mqt_js), pid 10107 (com.sampleapp)

WanderingBit avatar Feb 16 '24 14:02 WanderingBit

@mrousavy My description was a bit misleading. I explained the reason why I didn't use runAtTargetFps, just in case you wonder why. The example code was written a year ago, before this commit was made. Anyway, it's not an important part.

This behavior is observed only on Android. Have you tried the example on Android? I wonder if it's reproducible on your device. If not, then it's not an Android issue, but a Samsung issue instead again. The example code is just a combination of a run-in-js call and shared value updates, so I don't see anything unusual either. I'm trying to minimize the example code to narrow down the hypotheses.

bglgwyng avatar Feb 16 '24 16:02 bglgwyng

I found a much easier way to reproduce it.

const [count, setCount] = useReducer((count) => count + 1, 0)
  const setCount$ = useMemo(() => Worklets.createRunInJsFn(setCount), [])

  const frameProcessor = useFrameProcessor(
    (frame) => {
      'worklet'

      console.info(count)
      setCount$()
    },
    [setCount$, count],
  )

You can see the example app crashes until count hits 2000.

count in deps triggers reinitializing of the frame processor. When you omit it, the crash doesn't occur. I tested this code on my iPhone, there was no crash. It happens only on Android devices.

bglgwyng avatar Feb 17 '24 12:02 bglgwyng

count in deps triggers reinitializing of the frame processor.

So you think the Frame Processor being updated causes a crash?

mrousavy avatar Feb 19 '24 11:02 mrousavy

This is the code that gets called when the Frame Processor changes: https://github.com/mrousavy/react-native-vision-camera/blob/f6b7163660679599e48d1b75ab444ba8b5564809/package/android/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp#L59-L70

mrousavy avatar Feb 19 '24 11:02 mrousavy

So you think the Frame Processor being updated causes a crash?

Not sure. But it crashes the app very easily.

The following code crahes,

const [count, setCount] = useReducer((count) => count + 1, 0)

useEffect(() => {
  const interval = setInterval(setCount, 10)
  return () => { clearInterval(interval) }
}, [])

const frameProcessor = useFrameProcessor(
  (frame) => {
    'worklet'
  },
  [count],
)

while this one doesn't crash

const frameProcessor = useFrameProcessor(
  (frame) => {
    'worklet'
  },
  [], // no `count` in `deps`
)

The example code in https://github.com/mrousavy/react-native-vision-camera/issues/2153#issuecomment-1950038141 includes the usage of createRunInJsFn, but now I found that it's not necessary to reproduce the crash.

However, it doesn't mean that the frame processor update is mandatory to cause a crash. I observed the app crash (with the same error message) without frame processor updates several times. But it's so hard to reproduce.

Updating frame processors is the fastest way to cause a crash that I know.

bglgwyng avatar Feb 19 '24 12:02 bglgwyng

@mrousavy I tried this fix https://github.com/bglgwyng/react-native-vision-camera/commit/eff64de2d98da160ab0add65cb093f645b3b974b without expectation, but it seems to work...?! Do you have any idea about it?

bglgwyng avatar Feb 19 '24 14:02 bglgwyng

lol yes this should actually be there, I don't know why I didn't spot that mistake ๐Ÿ˜‚

can you send a PR? looks good

mrousavy avatar Feb 19 '24 14:02 mrousavy