Skip to content

Insta crash on Hermes but works with JSC #56

@alexandrius

Description

@alexandrius

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:

error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x0).
The process has been returned to the state before expression evaluation.

I found out that the issue happens in either of these methods BN_bn2lebinpad, BN_bn2binpad:

if (le)
{
BN_bn2lebinpad(thiz->bign, ab.data(runtime), len);
}
else
{
BN_bn2binpad(thiz->bign, ab.data(runtime), len);
}

Here's value of ab:
Screenshot 2023-01-24 at 12 05 06 PM

What I tried so far:

  • I commented out toArrayLike (inside commonjs/BigNumber.js) below here but weirdly the issue is still there. I wasn't able to find any toArrayLike invocations anywhere else

native.toArrayLike.call(
this.internalBigNum,
res.buffer,
endian === 'le',
len || -1
);

  • If I wrap if(ab.data(runtime) != NULL) the issue goes away but application doesn't behave correctly.

I would appreciate any suggestions.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions