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

SIGSEGV Error on production/compiled app when using `Worklets.createContext`

Aperta
#173 19 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, react-native
Ambito
mobile-dev

Direzione di ricerca

Start with the Worklets.createContext and createRunAsync entry points, then reproduce the SIGSEGV using the Index example and the release command npx expo run:android -d --variant release. Compare release behavior with dev mode and the older workaround; done means the reproduced app no longer crashes while running the context callback.

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

Descrizione

This problem is related to this issue.

If I try to use runAsync method (wich uses Worklets.createContext method) my app crash while running compiled apk or running it in expo production mode (npx expo run:android -d --variant release).

In dev mode the app don't crash and everything works really fine.

With any version before 1.0.0-beta.3 (and also after a lot of tests) I came to the conclusion that the app don't crash and everything works fine (this was also my workaround to get my vision-camera's face-detector plugin working) if I create my context this way:

function useWorklet(
  func: () => void,
  dependencyList: DependencyList
): WorkletType {
  const worklet = React.useMemo( () => {
    // this was the trick
    const context: any = 'MyContext'
    return Worklets.createRunInContextFn( func, context )
  }, dependencyList )

  return worklet
}

const test = useWorklet() {
  'worklet'
  .... do anything
}

But after 1.0.0-beta.3 I can't do this workaround anymore as now we must call createRunAsync from a created context and this makes the app crash.

I'm currently using worklets core 1.1.1 version with vision camera 4.0.1 and this problem is still happening.

Here's a very simple reproducible code:

function Index() {
  const runOnJs = Worklets.createRunOnJS( () => {
    console.log( 'hello from js' )
  } )

  const context = Worklets.createContext( 'MyContext' )
  const runOnContext = context.createRunAsync( () => {
    'worklet'
    console.log( 'hello from context' )
    runOnJs()
  } )

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

    runOnContext()
  }, [] )

  return <Reanimated.View>
    <VisionCamera
      frameProcessor={ frameProcessor }
      pixelFormat='yuv'
      .... other vision camera props
    />
  </Reanimated.View>
}

Thanks for any help.

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.