SIGSEGV (invalid memory reference) after returning a freshly-compiled function
Hi all,
apologies if this is not the right place to ask, but we're hitting an
Here's a bit more context: we're using the
The nix language has an "import" mechanism, which we're trying to implement through a Rust function[3], that's available to the transpiled JS code in the global scope[4].
The segmentation fault happens in tests. Here are the reproduction steps:
1. Clone our repository (master branch): https://github.com/urbas/rix
2. Run
You should get this test output:
Note that this segmentation fault does not happen if you run the test
The tests run sequentially and each test creates its own isolate. Any tips or hints on what we should look out for or change?
Cheers!
[1] https://github.com/urbas/rix
[2] https://nix.dev/manual/nix/2.18/language/index.html
[3] https://github.com/urbas/rix/blob/721f02a3ac9f1ffbe113cc60c8adf934c97d4c1d/src/eval/execution.rs#L98-L119
[4] https://github.com/urbas/rix/blob/721f02a3ac9f1ffbe113cc60c8adf934c97d4c1d/src/eval/execution.rs#L23-L37
apologies if this is not the right place to ask, but we're hitting an
invalid memory reference error when using deno_core and would like to ask for help narrowing the problem down or even identifying the cause of the error.Here's a bit more context: we're using the
deno_core crate to write a transpiler/interpreter[1] for the Nix language[2].The nix language has an "import" mechanism, which we're trying to implement through a Rust function[3], that's available to the transpiled JS code in the global scope[4].
The segmentation fault happens in tests. Here are the reproduction steps:
1. Clone our repository (master branch): https://github.com/urbas/rix
2. Run
RUST_TEST_THREADS=1 cargo test tests::builtins::import::evalYou should get this test output:
Note that this segmentation fault does not happen if you run the test
tests::builtins::import::eval_child_folder_import on its own. We also don't know why the error doesn't manifest itself in GitHub's action.The tests run sequentially and each test creates its own isolate. Any tips or hints on what we should look out for or change?
Cheers!
[1] https://github.com/urbas/rix
[2] https://nix.dev/manual/nix/2.18/language/index.html
[3] https://github.com/urbas/rix/blob/721f02a3ac9f1ffbe113cc60c8adf934c97d4c1d/src/eval/execution.rs#L98-L119
[4] https://github.com/urbas/rix/blob/721f02a3ac9f1ffbe113cc60c8adf934c97d4c1d/src/eval/execution.rs#L23-L37
