-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insta crash on Hermes but works with JSC #56
Comments
oh weird, maybe we use ArrayBuffer wrong, Hermes should have native support for that.... cc @Szymon20000 |
Hermes doesn't allocate any memory for an ArraysBuffer's dataBuffer if the size is 0. It's a nullpointer.. The code also doesn't check if the ArrayBuffer size is sufficiently large to carry the BigNumber's data and potentially overflows. |
Any news on this? I would be excited to implement this library into my app. But this exact same issue is causing my app to insta-crash as well. |
I'm having the same crash as above as well with @solana/web3.js |
To everyone struggling with this issue. I recommend migrating to BigInt |
Hey friends 馃憢,
I recently enabled this library in a project. Everything seemingly went through until I enabled Hermes engine. The app crashes immediately after launching with error:
I found out that the issue happens in either of these methods
BN_bn2lebinpad
,BN_bn2binpad
:react-native-bignumber/cpp/MGBigNumberHostObject.cpp
Lines 138 to 145 in 56873d9
Here's value of
ab
:What I tried so far:
toArrayLike
(insidecommonjs/BigNumber.js
) below here but weirdly the issue is still there. I wasn't able to find any toArrayLike invocations anywhere elsereact-native-bignumber/src/BigNumber.ts
Lines 247 to 252 in 56873d9
if(ab.data(runtime) != NULL)
the issue goes away but application doesn't behave correctly.I would appreciate any suggestions.
Thanks!
The text was updated successfully, but these errors were encountered: