margelo / react-native-quick-crypto

⚡️ A fast implementation of Node's `crypto` module written in C/C++ JSI
Other
707 stars 86 forks source link

[ios] Crash after reloading app when using with other jsi libs #190

Open ronickg opened 1 year ago

ronickg commented 1 year ago

I've noticed a problem when using react-native-quick-crypto with other libraries that also use jsi and the TypeArray class in c++. It only seems to be a problem on ios. Launching the app works fine, but once you refresh it instanlty crashes. One also has to call some function which is provied by the react-native-quick-crypto library. The libray works fine on its own without crashes. But as soon as I add something like react-native-blob-jsi-helper or rreact-native-random-values-jsi-helper it will cause the crashing. One doesnt have to add any function from the other libraries, just add them as a package. I've provided a repo to make it easy to reproduce. (https://github.com/BubbleTrouble14/crash). To test just add or remove the "react-native-random-values-jsi-helper" package.

error.log

grenos commented 1 year ago

We're seeing the same issue. Here is the log if it could help. mglqc.txt

kyunkakata commented 1 year ago

Same issue. What should we do?

ronickg commented 1 year ago

It only crashes in development so, i just used android instead for most of the time, or just disabled the other lib causing it to crash and filled it with dummy data for the time being.

kyunkakata commented 1 year ago

My application suffers crashes from Production build if import this library. Can you show me how to fix it? I am using React Native version 0.66.5 without enable Hermes. @BubbleTrouble14

kyunkakata commented 1 year ago

On Android, everything is normal.

kyunkakata commented 1 year ago

We are using many libs using JSI like react-native-mmkv, react-native-keys, react-native-random-values-jsi-helper, ...etc. So I cannot disable other libs.

ronickg commented 1 year ago

I see :/ I already asked in the discord,he said he may know a way to fix it. But think he's been very bust with the vision camera.

arneson commented 1 month ago

Hi! Did any of you guys manage to get this working with other jsis? @BubbleTrouble14

ronickg commented 1 month ago

@arneson I actually don't remember sadly, but soon react-native-quick-crypto will be using nitrolmodules as far as I know, which will probably fix the problem.

Rag0n commented 1 week ago

Hey @boorad, since you're the most active maintainer, do you have any plans to fix this crash? Looks like a blocker for using RNQC.

boorad commented 1 week ago

If you can boil it down to a version that used to work, some ideas as to why it doesn't now (in the code), and some failing tests that pinpoint the issue, I may be able to take a look. I have lost the time to do exploratory fixes nowadays, and I'd rather concentrate on getting the entire library over to Nitro Modules.