Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#232 7 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
android, javascript, react-native
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
791
Fork
65
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di margelo/react-native-worklets-core

Tutte le issue di margelo/react-native-worklets-core

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.