-
Notifications
You must be signed in to change notification settings - Fork 35
RuntimeError: memory access out of bounds #330
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you have any tight loops that run many, many times that create anything in CML? We've enabled weakrefs in wasm/js which are supposed to be freed automatically when they go out of scope but I think JS gets behind on this sometimes so anywhere that is creating lots of the same struct you might want to explicitly call free(). When I tested this I had the tx builder create millions of transactions in a loop and it'd get out of memory after I think 500k if I had it in a regular loop, but if I put some pauses in it it'd still eventually run out of memory but usually not until after many millions. The more pause I gave it the less likely it was to do that but it'd still tend to happen when I was doing it with like 50k iterations before pausing. And are you sure nothing in JS is maintaining references to any of these wasm structs? That would stop it from being automatically GC'd too. I'm not sure if it's smart enough to detect things that reference each other and nothing else or if it just counts refs but it could be the latter. |
I have implemented a retry loop in case the transaction fails, but it is currently configured for only four attempts, with exponential delays of 20 seconds. Now, I have made the following updates: and I get this error...
I think this error relates to this? rustwasm/wasm-bindgen#1578 |
Is it possible to return more information when an error occurs, like using something such as https://github.com/rustwasm/console_error_panic_hook , @rooooooooob ? |
I'm also wondering if CML is using the latest https://github.com/rustwasm/wasm-bindgen/releases/tag/0.2.92 , @rooooooooob ? |
@rooooooooob @SebastienGllmt I managed to fix the error by manipulating the file. I commented out these 2 lines My question is, can we disable them on demand? |
That code is generated by wasm-pack tooling. Unless you create a script to modify the CML outputs, you would have to go make a PR to the underlying wasm pack library |
I've noticed that when I replaced |
I think I can close this, I've been testing the |
I'm running into some issues when running some tests
I think the issues has to do with rust releasing memory,
This CML error points to line 11219 which is
const DatumOptionFinalization = new FinalizationRegistry(ptr => wasm.__wbg_datumoption_free(ptr));
I've also had to manually free
CML.TransactionBuilder
when is not longer needed, along withCML.TransactionBuilderConfig
The text was updated successfully, but these errors were encountered: