isolated-vm
isolated-vm copied to clipboard
Test failed with WSL ubuntu 16 + Node v14.16.1
npm install
npm test
then all test cases get the same error:
exception-info.js: *fail*
code: null signal: SIGABRT
stderr: node: ../src/lib/suspend.h:32: ivm::thread_suspend_handle::initialize::initialize(): Assertion `sigaction(SIGRTMIN, &handler, nullptr) == 0' failed.
any clues?
Hmm WSL is a really wonky environment. Can you try in CMD and let me know if it works? I may have to modify or disable this particular feature on WSL
Any update on this issue ?
It seems that the sigaction
struct is not initialised properly. One can patch the code located at node_modules\isolated-vm\src\lib\suspend.h
, adding the code memset(&handler, '\0', sizeof(handler));
just after struct sigaction handler;
(line 29).
Patched code:
struct initialize {
initialize() {
// Set process-wide signal handler
struct sigaction handler;
memset(&handler, '\0', sizeof(handler));
handler.sa_handler = callback;
sigemptyset(&handler.sa_mask);
assert(sigaction(SIGRTMIN, &handler, nullptr) == 0);
}
};
Then one should run npm run rebuild
while inside node_modules\isolated-vm
to rebuild the code.