Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
test: add coverage for child_process bounds check#11800
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
cjihrig left a comment
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.
Trott commented Mar 12, 2017
Link and ESLint comments removed. |
Trott commented Mar 12, 2017
CI again with adjustment for Windows CLI: https://ci.nodejs.org/job/node-test-pull-request/6815/ |
Trott commented Mar 14, 2017
Test still failing on Windows. Marking |
Trott commented Mar 17, 2017
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) |
Trott commented Mar 17, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 Onlyassert.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
Trott commented Mar 17, 2017
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/ |
Trott commented Mar 17, 2017
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
Trott commented Mar 17, 2017
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
MylesBorins commented Apr 18, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 > 0check (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