Skip to content

Commit

Permalink
test: fix wasi/test-return-on-exit on 32-bit systems
Browse files Browse the repository at this point in the history
Starting with the V8 8.8 update, this test has been regularly
crashing with an out of memory error on 32-bit Windows. The issue
has been narrowed down to a function not being bound. This seems
like a V8 bug, but at least it seems that we can work around it.

Fixes: nodejs#37374
  • Loading branch information
cjihrig committed Mar 5, 2021
1 parent f3d3769 commit 2d2bad3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion test/wasi/test-return-on-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const buffer = fs.readFileSync(modulePath);
// Verify that if a WASI application throws an exception, Node rethrows it
// properly.
const wasi = new WASI({ returnOnExit: true });
wasi.wasiImport.proc_exit = () => { throw new Error('test error'); };
const patchedExit = () => { throw new Error('test error'); };
wasi.wasiImport.proc_exit = patchedExit.bind(wasi.wasiImport);
const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
const { instance } = await WebAssembly.instantiate(buffer, importObject);

Expand Down
4 changes: 0 additions & 4 deletions test/wasi/wasi.status
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ prefix wasi
# sample-test : PASS,FLAKY

[true] # This section applies to all platforms

[$system==win32]
# https://github.com/nodejs/node/pull/36139
test-return-on-exit: PASS,FLAKY

0 comments on commit 2d2bad3

Please sign in to comment.