-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build,test: increase stack size limit on Windows
Fixes: #43630 PR-URL: #43632 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
|
||
const assert = require('assert'); | ||
const { spawnSync } = require('child_process'); | ||
|
||
// The default --stack-size is 984, which is below Windows' default stack size | ||
// limit of 1 MiB. However, even a slight increase would cause node to exceed | ||
// the 1 MiB limit and thus to crash with the exit code STATUS_STACK_OVERFLOW. | ||
// Newer versions of Node.js allow the stack size to grow to up to 8 MiB, which | ||
// better aligns with default limits on other platforms and which is commonly | ||
// used for browsers on Windows. | ||
// See https://github.com/nodejs/node/issues/43630. | ||
|
||
const { status, signal, stderr } = spawnSync(process.execPath, [ | ||
'--stack-size=2000', | ||
'-e', | ||
'(function explode() { return explode(); })()', | ||
], { | ||
encoding: 'utf8' | ||
}); | ||
|
||
assert.strictEqual(status, 1); | ||
assert.strictEqual(signal, null); | ||
assert.match(stderr, /Maximum call stack size exceeded/); |