-
Notifications
You must be signed in to change notification settings - Fork 44
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
bug: full crash when evaluating some invalid contracts #164
Comments
Hey @balthazar .
in your host code? This should allow to parent process to work properly, eg:
|
Yeah was hoping there would be a better solution than this, as it would mean some unhandled errors of the main code will get swallowed when the process should actually crash in order to be fixed. |
probably the other option for now would be to run the contract evaluation in a separate worker thread. The isolated vm fixes this issue (ie. only the isolate crashes, not the host process), but as I've mentioned - I need a few days to implement it fully (for example - I need to manually map each of the function from the Arweave library...) |
Yeah will probably be the only way while waiting for the new integration, thanks |
Hey @balthazar , the Can you please test it on your side and share your feedback? The for a comparison - the |
Works perfectly, thanks 😃 |
Issue with isolated-vm - requires at least 2GB of ram to be installed via npm (i.e. the c++ compilation requires at least this amount of memory). Re. VM2 - turns out that adding a global handler for dealing with async errors is a solution suggested be the readme - https://github.com/patriksimek/vm2#error-handling I've created an issue whether this can be fixed/enhanced - patriksimek/vm2#441 |
A global error handler isn't an ideal "solution" as it simply catches any unhandled error of the process, not just vm-related errors which might result in some important errors being caught by it and overlooked. Wouldn't there be a way to copy built binaries and headers over if the memory requirement is just at build time? |
yeah yeah, I'm fully aware of the issues with global handler (this probably could be minimized by analyzing the stack trace (i.e. Error.stack), but still..) Copying is one solution, dockerization - another.. The biggest issue is that in general - isolated-vm can introduce some issues for the warp library users (probably those on Windows - but - for example - I also wasn't able to install it out of the box (after adding g++ etc.) on my prev. development machine - with Fedora 34)... |
quickjs-emscripten - justjake/quickjs-emscripten#70 (comment) - no luck so far. |
Happens when the contract in question is invalid.
For example
F2V2zXs1ylUO4hskxfNOvPlceLlk1hp_q-xEMQCPbBQ
which is missing anawait
and thus make the main process crash.Some others:
aWZe5ZZIBOKZYEQuZRZRw1ElwRnZUsk3Y_4LMoN7UC4
0CFuevmMBfylDZkAFV_HETPZZDh2VFRbHZnq2QGUTjw
hfb7rGeMsc58G3fjnVBJaP9ogXumUE6Oc_st-QJQkLE
The text was updated successfully, but these errors were encountered: