EXC_BAD_ACCESS crash in async methods

Open
#370 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
react-native, typescript
Domain
mobile

Research direction

Start with the linked expo-pshenmic-dpp-test reproduction: run npm i, npx prebuild, and npm run ios, then exercise node-api methods inside asynchronous code with await after the response. Compare behavior with the pending node-api implementation PR and confirm whether the EXC_BAD_ACCESS crash remains reproducible; the issue does not name source files or tests.

Written by the indexing model from the issue text.

Description

Problem

In recent tests, we found a bug that causes the application to crash. When attempting to call any method from node-api in an asynchronous code block, we receive the error com.facebook.react.runtime.JavaScript: EXC_BAD_ACCESS (code=1, address=0x0). This applies to all methods within the library.

Recent tests have shown that the error only occurs when we call the method inside an asynchronous code block and await after receiving a response. The behavior is unstable, and in certain cases everything works as it should, but repeated execution can cause this error.

upd: maybe gc. Waiting node-api implementation PR merge

Reproduce

  • git clone https://github.com/owl352/expo-pshenmic-dpp-test
  • npm i
  • npx prebuild
  • npm run ios
Dominant language
TypeScript
Stars
206
Forks
12
Avg merge
4h 8m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from callstackincubator/react-native-node-api

All issues in callstackincubator/react-native-node-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.