Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] Crash on Android when attemping to runOnJS or runAsync

未关闭
#232 7 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, javascript, react-native
领域
mobile

调研方向

Start by reproducing the provided runAsync and runOnJS frame-processor example on Android with the listed React Native, Vision Camera, and Worklets Core versions. Read the Android crash logs around ImageReader, ImageAnalysisAnalyzer, and the SIGSEGV in libjsc.so. Done means the same example no longer crashes the Android app or exhausts the ImageReader buffers.

由索引模型根据 Issue 内容生成。

描述

Hey there,

When attempting to use the following code:

  const frameProcessor = useFrameProcessor(
    frame => {
      'worklet';
      console.log('test');
    
      runAsync(frame, () => {
        'worklet';
        console.log('test2');
      });
    },
    [],
  );

with @mrousavy react-vision-camera library the entire Android app crashes. on iOS is perfectly fine with no isses.

Logs:

2025-01-06 15:18:08.765 15044-15724 ImageReader_JNI         com.swinghub.android                 W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
2025-01-06 15:18:08.766 15044-15724 ImageAnalysisAnalyzer   com.swinghub.android                 E  Failed to acquire image.
                                                                                                    java.lang.IllegalStateException: maxImages (6) has already been acquired, call #close before acquiring more.
                                                                                                    	at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                                                                                                    	at androidx.camera.core.AndroidImageReaderProxy.acquireNextImage(AndroidImageReaderProxy.java:86)
                                                                                                    	at androidx.camera.core.SafeCloseImageReaderProxy.acquireNextImage(SafeCloseImageReaderProxy.java:86)
                                                                                                    	at androidx.camera.core.ImageAnalysisBlockingAnalyzer.acquireImage(ImageAnalysisBlockingAnalyzer.java:39)
                                                                                                    	at androidx.camera.core.ImageAnalysisAbstractAnalyzer.onImageAvailable(ImageAnalysisAbstractAnalyzer.java:126)
                                                                                                    	at androidx.camera.core.SafeCloseImageReaderProxy.lambda$setOnImageAvailableListener$1$androidx-camera-core-SafeCloseImageReaderProxy(SafeCloseImageReaderProxy.java:211)
                                                                                                    	at androidx.camera.core.SafeCloseImageReaderProxy$$ExternalSyntheticLambda0.onImageAvailable(D8$$SyntheticClass:0)
                                                                                                    	at androidx.camera.core.AndroidImageReaderProxy.lambda$setOnImageAvailableListener$0$androidx-camera-core-AndroidImageReaderProxy(AndroidImageReaderProxy.java:167)
                                                                                                    	at androidx.camera.core.AndroidImageReaderProxy$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                                                                                                    	at java.lang.Thread.run(Thread.java:929)
2025-01-06 15:18:08.886 15044-15265 libc                    com.swinghub.android                 A  Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x75d3cc2fb0 in tid 15265 (ionCamera.video), pid 15044 (winghub.android)
2025-01-06 15:18:08.938 15044-15667 CameraView              com.swinghub.android                 I  invokeOnAverageFpsChanged(NaN)
2025-01-06 15:18:09.106 15733-15733 DEBUG                   pid-15733                            A  pid: 15044, tid: 15265, name: ionCamera.video  >>> com.swinghub.android <<<
2025-01-06 15:18:09.107 15733-15733 DEBUG                   pid-15733                            A        #05 pc 00000000003cd920  /data/app/com.swinghub.android-JILhOcVL9UeWxRMsrjHXNw==/base.apk!libjsc.so (offset 0x9720000) (BuildId: 9cb83e4124e3ee1471bc717c722b4109614385ba)
2025-01-06 15:18:09.107 15733-15733 DEBUG                   pid-15733                            A        #06 pc 00000000002622dc  /data/app/com.swinghub.android-JILhOcVL9UeWxRMsrjHXNw==/base.apk!libjsc.so (offset 0x9720000) (JSStringCreateWithUTF8CString+20) (BuildId: 9cb83e4124e3ee1471bc717c722b4109614385ba)
---------------------------- PROCESS STARTED (15735) for package com.swinghub.android ----------------------------

Version:
"react-native": "0.76.5",
"react-native-vision-camera": "^4.6.3",
"react-native-vision-camera-face-detector": "^1.7.2",
"react-native-worklets-core": "^1.5.0",

Babel:

    //['transform-remove-console'],
    ['react-native-worklets-core/plugin'],
    [
      'react-native-reanimated/plugin',
      {
        processNestedWorklets: true,
      },
    ],

However did try babel without the core/plugin and kept re-animated but still an issue.

主要语言
C++
星标
791
派生
65
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

margelo/react-native-worklets-core 的其他 Issue

查看 margelo/react-native-worklets-core 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。