isolated-vm icon indicating copy to clipboard operation
isolated-vm copied to clipboard

Test failed with WSL ubuntu 16 + Node v14.16.1

Open tigercosmos opened this issue 3 years ago • 3 comments

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?

tigercosmos avatar Jul 04 '21 13:07 tigercosmos

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

laverdet avatar Jul 04 '21 20:07 laverdet

Any update on this issue ?

haynajjar avatar Oct 08 '21 13:10 haynajjar

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.

GramThanos avatar Aug 18 '23 10:08 GramThanos