-
Notifications
You must be signed in to change notification settings - Fork 17
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
Issue: SIGSEGV on consecutive runs via unit tests #26
Comments
Thanks for reporting! The Maybe we should first try to update the If this can be reproduced with the latest |
Thanks. For now I'm going to "brute force" using V8 directly using JSON serialization/deserialization with serde. When I get a bit more rust-fu under my belt, I'll revisit and maybe look into whether we can transplant Deno's serialization/deserialization and use that without the "rest" of Deno. |
FWIW, I was able to reproduce the issue with rusty v8, no Deno or js-sandbox involved. I've submitted an issue here if you want to track progress. |
So, by default, V8 needs to be run in the main thread. If you are going to call it from another thread, you have to set up the platform using new_unprotected_default_platform. That's why |
I see. Thanks for reporting and getting back so quickly! Do you think there's a way to set up our tests so they honor the main thread for setup? 🤔 |
Maybe define an environment variable (V8_TEST) that, if set, would trigger creating the platform using new_unprotected_default_platform? We'd set that environment variable in something like an .env used for testing. |
Your library is saving my sanity. I'm writing a webservice test utility and want to integrate a BDD-style test capability using JavaScript. js-sandbox is working splendidly. Except... I'm getting a weird behavior when unit testing and I'm not sure if it's something I should be worried about. Further down is a simplified code example demonstrating the issue.
I'm using "0.2.0-rc.2" on Linux. When executing more than one unit test for js-sandbox via
cargo test
, I am getting a SIGSEGV crash. I don't know if this something I should be worried about, or if it just an oddity with cargo test that I should just workaround.Thanks for providing this library. I'll hopefully be in a position to "pay it forward" soon...
What is odd is that if I comment out the second unit test, which does exactly the same as the first, I get a successful run.
Am I doing something wrong? Should I even worry about this?
src/lib.rs
Cargo.toml
The text was updated successfully, but these errors were encountered: