-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add coverage for child_process bounds check #11800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think the link and ESLint comments could be dropped though.
Link and ESLint comments removed. |
CI again with adjustment for Windows CLI: https://ci.nodejs.org/job/node-test-pull-request/6815/ |
Test still failing on Windows. Marking |
Sample failure on Windows: https://ci.nodejs.org/job/node-test-binary-windows/7064/RUN_SUBSET=1,VS_VERSION=vs2015,label=win2012r2/console not ok 31 parallel/test-cli-eval
---
duration_ms: 3.517
severity: fail
stack: |-
assert.js:81
throw new assert.AssertionError({
^
AssertionError: '' === '42\n'
at child.exec.common.mustCall (c:\workspace\node-test-binary-windows\RUN_SUBSET\1\VS_VERSION\vs2015\label\win2012r2\test\parallel\test-cli-eval.js:154:14)
at c:\workspace\node-test-binary-windows\RUN_SUBSET\1\VS_VERSION\vs2015\label\win2012r2\test\common.js:473:15
at ChildProcess.exithandler (child_process.js:238:7)
at emitTwo (events.js:127:13)
at ChildProcess.emit (events.js:215:7)
at maybeClose (internal/child_process.js:893:16)
at Socket.<anonymous> (internal/child_process.js:335:11)
at emitOne (events.js:117:13)
at Socket.emit (events.js:212:7)
at Pipe._handle.close [as _onclose] (net.js:534:12) |
So, Windows is not getting the output from Perhaps related to nodejs/node-v0.x-archive#3871? Maybe this is some "this OS blocks stdio but that one doesn't" thing? Maybe I'm reaching here... Relevant code: child.exec(
`${nodejs} -e "process.execArgv = ['-e', 'console.log(42)', 'thirdArg'];
require('child_process').fork('${emptyFile}')"`,
common.mustCall((err, stdout, stderr) => {
assert.ifError(err);
assert.strictEqual(stdout, '42\n'); // <- Raises AssertionError on Windows Only
assert.strictEqual(stderr, '');
})); /cc @nodejs/platform-windows |
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
Trying to squash everything into a single line to see if that makes a difference (which makes sense if so). New CI: https://ci.nodejs.org/job/node-test-pull-request/6909/ |
OMG, that did it! Landing soon... |
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. PR-URL: nodejs#11800 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
Landed in df69d95 |
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. PR-URL: nodejs#11800 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. PR-URL: nodejs#11800 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
not landing cleanly on v6.x feel free to backport edit: nvm got it |
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. PR-URL: #11800 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. PR-URL: #11800 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
Make sure that monkey-patching process.execArgv doesn't cause child_process to incorrectly munge execArgv in fork(). This basically is adding coverage for an `index > 0` check (see Refs). Previously, that condition was never false in any of the tests. PR-URL: nodejs/node#11800 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Refs: https://github.com/nodejs/node/blob/c67207731f16a78f6cae90e49c53b10728241ecf/lib/child_process.js#L76
Make sure that monkey-patching process.execArgv doesn't cause
child_process to incorrectly munge execArgv in fork().
This basically is adding coverage for an
index > 0
check (see commentin this commit). Previously, that condition was never false in any of
the tests.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test child_process