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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [Android] Native method - jdk.internal.misc.Unsafe.park Input dispatching timed out #2874

Open
3 of 5 tasks
short-dsb opened this issue May 13, 2024 · 6 comments
Open
3 of 5 tasks
Labels
馃悰 bug Something isn't working

Comments

@short-dsb
Copy link

short-dsb commented May 13, 2024

What's happening?

Seeing this issue in production logs. Have not been able to reproduce it locally.

Uploading the log here versus pasting it below: stacktrace.log

Reproduceable Code

const device = useCameraDevice("back", {
  physicalDevices: [
    "ultra-wide-angle-camera",
    "wide-angle-camera",
    "telephoto-camera",
  ],
});
// ...
<Camera
  ref={camera}
  device={device}
  isActive={isActive}
  photo={true}
  style={styles.camera}
/>

Relevant log output

"main" tid=1 Timed Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
  at kotlinx.coroutines.BlockingCoroutine.joinBlocking (Builders.kt:88)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking (Builders.kt:59)
  at kotlinx.coroutines.BuildersKt.runBlocking (unavailable:1)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default (Builders.kt:38)
  at kotlinx.coroutines.BuildersKt.runBlocking$default (unavailable:1)
  at com.mrousavy.camera.core.CameraSession.close (CameraSession.kt:92)
  at com.mrousavy.camera.CameraView.destroy (CameraView.kt:135)
  at com.mrousavy.camera.CameraViewManager.onDropViewInstance (CameraViewManager.kt:38)
  at com.mrousavy.camera.CameraViewManager.onDropViewInstance (CameraViewManager.kt:16)
  at com.facebook.react.uimanager.NativeViewHierarchyManager.dropView (NativeViewHierarchyManager.java:635)
  at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren (NativeViewHierarchyManager.java:499)
  at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute (UIViewOperationQueue.java:217)
  at com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:926)
  at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:1037)
  at com.facebook.react.uimanager.UIViewOperationQueue.-$$Nest$mflushPendingBatches (unavailable)
  at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded (UIViewOperationQueue.java:1097)
  at com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.java:29)
  at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame (ReactChoreographer.java:175)
  at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame (ChoreographerCompat.java:85)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1035)
  at android.view.Choreographer.doCallbacks (Choreographer.java:845)
  at android.view.Choreographer.doFrame (Choreographer.java:775)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1022)
  at android.os.Handler.handleCallback (Handler.java:978)
  at android.os.Handler.dispatchMessage (Handler.java:104)
  at android.os.Looper.loopOnce (Looper.java:238)
  at android.os.Looper.loop (Looper.java:357)
  at android.app.ActivityThread.main (ActivityThread.java:8103)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1026)

"mqt_native_modules" tid=45 Blocked
  at com.facebook.react.uimanager.NativeViewHierarchyManager.getRootViewNum (unavailable)
  at com.facebook.react.uimanager.UIImplementation.getRootViewNum (UIImplementation.java:181)
  at com.facebook.react.uimanager.UIManagerModule.onBatchComplete (UIManagerModule.java:725)
  at com.facebook.react.bridge.NativeModuleRegistry.onBatchComplete (NativeModuleRegistry.java:118)
  at com.facebook.react.bridge.CatalystInstanceImpl$BridgeCallback.onBatchComplete (CatalystInstanceImpl.java:170)
  at com.facebook.jni.NativeRunnable.run (Native method)
  at android.os.Handler.handleCallback (Handler.java:978)
  at android.os.Handler.dispatchMessage (Handler.java:104)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:29)
  at android.os.Looper.loopOnce (Looper.java:238)
  at android.os.Looper.loop (Looper.java:357)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:234)
  at java.lang.Thread.run (Thread.java:1012)

Camera Device

// Unable to log this as it's occurring in production.

Device

Multiple, e.g., motorola ellis (moto g pure), samsung dm3q (Galaxy S23 Ultra)

VisionCamera Version

4.0.3

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

@short-dsb short-dsb added the 馃悰 bug Something isn't working label May 13, 2024
@mrousavy
Copy link
Owner

Hm, that doesn't look like a crash though? It's just a lock being in waiting state. What's the crash messsage?

@short-dsb
Copy link
Author

Good morning! 馃檪 This is an ANR, not a crash. We had been on v2 until recently and didn鈥檛 start seeing this issue on our dashboard until after upgrading to v4.

At the moment, it鈥檚 our third most reported issue and on the verge of exceeding our bad behavior threshold, which will negatively impact our app鈥檚 discoverability.

Any help you can provide would be appreciated.

@mrousavy
Copy link
Owner

Ah okay - well I currently have a lot of other things to work on, if you want to prioritize that issue consider sponsoring me through your company :)

@short-dsb
Copy link
Author

We did! 馃檪 Although our priority is the RN 0.74 upgrade, it would be nice to uncover the root cause of this issue as well.

Thanks for all your work.

@mrousavy
Copy link
Owner

Ah sorry with which company?

Although our priority is the RN 0.74 upgrade

Yep, that's high prio for me as well - just lots of effort

@short-dsb
Copy link
Author

Ah sorry with which company?

Sent you an email. 馃檪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants