aries-framework-go icon indicating copy to clipboard operation
aries-framework-go copied to clipboard

Aries WebAssembly - call stack issues

Open sudeshrshetty opened this issue 3 years ago • 5 comments

Currently running aries wasm in browsers like iOS safari is causing:

maximum call stack size exceeded while performing JSON LD related operations for credentials.

Similar issues found in few other modules in aries.

sudeshrshetty avatar Sep 09 '22 15:09 sudeshrshetty

I'm seeing this with even the simplest of Aries actions such as establishing a connection, but it could be down to using more stack in the JS side. This does seem to be recent, maybe a solution is to run on a secondary thread and up the stack to 4 MB. IIRC, main thread gets only 1 MB of stack.

borancar avatar Sep 23 '22 14:09 borancar

To give more details, well, not sure how useful, the error is:

Unhandled Promise Rejection: RangeError: Maximum call stack size exceeded.

mono for example has had issues like these before on iOS.

borancar avatar Sep 23 '22 14:09 borancar

I'm seeing this with even the simplest of Aries actions such as establishing a connection

Can you describe briefly how to reproduce this.

Abdulbois avatar Sep 23 '22 14:09 Abdulbois

Can you describe briefly how to reproduce this.

There's not really much to describe, it's now happening with the Aries WASM loaded, and the browser console error log reports it as the main function entrypoint into the WASM code.

borancar avatar Sep 28 '22 15:09 borancar

If you think it could be helpful to open up to the code to you, I believe I can do it. But I also think a minimal reproducible example could be made just by having a limited recursive function in JS whose sole job is to occupy stack before invoking anything from the WASM side.

borancar avatar Sep 28 '22 15:09 borancar