Skip to content
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

(v6.x backport) child_process: fix deoptimizing use of arguments #13752

Closed
wants to merge 23 commits into from
Closed

(v6.x backport) child_process: fix deoptimizing use of arguments #13752

wants to merge 23 commits into from

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Jun 17, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark, child_process

Backport of #11535

I've removed changes in execFile(): one cause was not in code yet, another one is relevant only from v8 5.6.

Commit message also was edited: one Refs was removed, the wording was a bit corrected. All other metadata was left untouched.

I've checked the benchmark with the last v6. We need to run CI for the lib.

danbev and others added 23 commits June 17, 2017 19:42
When upgrading OpenSSL, Step 6 in upgrading guide explains the steps
that need to be taken if asm files need updating. This might not
always be the case and something that needs to be checked from
release to release.

This commit adds an example of using github to manually compare two tags
to see if any changes were made to asm files.

PR-URL: #13234
Backport-PR-URL: #13695
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
This replaces all sources of openssl-1.0.2l.tar.gz into
deps/openssl/openssl

Fixes: #13161
PR-URL: #13233
Backport-PR-URL: #13695
Reviewed-By: Shigeki Ohtsu <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
All symlink files in deps/openssl/openssl/include/openssl/ are removed
and replaced with real header files to avoid issues on Windows. Two
files of opensslconf.h in crypto and include dir are replaced to refer
config/opensslconf.h.

Fixes: #13161
PR-URL: #13233
Backport-PR-URL: #13695
Reviewed-By: Shigeki Ohtsu <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and
perhaps others) are requiring .686 .

Fixes: #589
PR-URL: #1389
Backport-PR-URL: #13695
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Shigeki Ohtsu <[email protected]>
See
https://mta.openssl.org/pipermail/openssl-dev/2015-February/000651.html

iojs needs to stop using masm and move to nasm or yasm on Win32.

Fixes: #589
PR-URL: #1389
Backport-PR-URL: #13695
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reapply b910613 .

Fixes: #589
PR-URL: #1389
Backport-PR-URL: #13695
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
In openssl s_client on Windows, RAND_screen() is invoked to initialize
random state but it takes several seconds in each connection.
This added -no_rand_screen to openssl s_client on Windows to skip
RAND_screen() and gets a better performance in the unit test of
test-tls-server-verify.
Do not enable this except to use in the unit test.

Fixes: #1461
PR-URL: #1836
Backport-PR-URL: #13695
Reviewed-By: Ben Noordhuis <[email protected]>
Regenerate config files for supported platforms with Makefile.

Fixes: #13161
PR-URL: #13233
Backport-PR-URL: #13695
Reviewed-By: Shigeki Ohtsu <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Regenerate asm files with Makefile and CC=gcc and ASM=nasm where gcc
version was 5.4.0 and nasm version was 2.11.08.

Also asm files in asm_obsolete dir to support old compiler and
assembler are regenerated without CC and ASM envs.

Fixes: #13161
PR-URL: #13233
Backport-PR-URL: #13695
Reviewed-By: Shigeki Ohtsu <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Added the missing make command in steps 6.3 when building
asm_obsolete.

Also updated the commit message to include the version nasm in
addition to the gcc version.

Fixes: #13161
PR-URL: #13233
Backport-PR-URL: #13695
Reviewed-By: Shigeki Ohtsu <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #11167
Backport-PR-URL: #13054
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #11167
Backport-PR-URL: #13054
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #11658
Backport-PR-URL: #13054
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: #11697
Backport-PR-URL: #13054
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Refactor test for situations where it was expected to fail.
Move from disabled directory to parallel.

PR-URL: #12403
Backport-PR-URL: #13060
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Ref: #12442
PR-URL: #12489
Backport-PR-URL: #13103
Reviewed-By: Matthew Loring <[email protected]>
Reviewed-By: Julien Gilli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Add documentation for `common.crashOnUnhandledRejection()`.

Ref: https://github.com/nodejs/node/pull/12489/files/a9c2078a60bc3012dc6156df19772697a56a2517#r113737423
PR-URL: #12699
Backport-PR-URL: #13103
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
This is a partial backport of semver-patch bits of
9e4660b.

This commit fixes the Node process crashing when constructors of classes
of the zlib module are given invalid options.

* Throw an Error when the zlib library rejects the value of windowBits,
  instead of crashing with an assertion.

* Treat windowBits and memLevel options consistently with other ones and
  don't crash when non-numeric values are given.

PR-URL: #13098
Backport-PR-URL: #13201
Fixes: #13082
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Functions that call `ECDH::BufferToPoint` were not clearing the
error stack on failure, so an invalid key could leave leftover
error state and cause subsequent (unrelated) signing operations
to fail.

PR-URL: #13275
Backport-PR-URL: #13397
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
This is a local patch because upstream fixed it differently by moving
large chunks of code out of objects.h.  We cannot easily back-port
those changes due to their size and invasiveness.

Fixes: #10388
PR-URL: #12392
Backport-PR-URL: #13574
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
The test uses common.PORT, and has already been deleted on master.

PR-URL: #13580
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
They tend to hang if they happen to run in parallel with another test
that uses common.PORT.

PR-URL: #13592
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Remove use of arguments in
normalizeExecArgs() and normalizeSpawnArguments().

Refs: #10323
PR-URL: #11535
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@nodejs-github-bot nodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. v6.x labels Jun 17, 2017
@vsemozhetbyt vsemozhetbyt changed the title (vN.x backport) child_process: fix deoptimizing use of arguments (v6.x backport) child_process: fix deoptimizing use of arguments Jun 17, 2017
@gibfahn
Copy link
Member

gibfahn commented Jun 17, 2017

It would be good to get a review or two from @nodejs/performance, @targos, @cjihrig, @jasnell (who reviewed the original PR).

I've checked the benchmark with the last v6. We need to run CI for the lib.

So you still see the perf benefits on v6.x? Could you post some results?

@gibfahn
Copy link
Member

gibfahn commented Jun 17, 2017

@vsemozhetbyt
Copy link
Contributor Author

@gibfahn I've just roughly checked if it is compatible and can be run on v6.
Should I build two v6 and run it with a comparison?

@mscdex
Copy link
Contributor

mscdex commented Jun 17, 2017

@vsemozhetbyt Yes, before and after this PR.

@vsemozhetbyt
Copy link
Contributor Author

@gibfahn @mscdex It seems we still have a tiny certain improvement in two cases without any significant downgrade in other ones:

Results:
                                                                                  improvement confidence      p.value
 child_process\\child-process-params.js params=1 methodName="exec" n=1000             -0.34 %            4.515010e-01
 child_process\\child-process-params.js params=1 methodName="execFile" n=1000          0.12 %            5.251958e-01
 child_process\\child-process-params.js params=1 methodName="execFileSync" n=1000      1.14 %            2.147775e-01
 child_process\\child-process-params.js params=1 methodName="execSync" n=1000          0.17 %            3.557482e-01
 child_process\\child-process-params.js params=1 methodName="spawn" n=1000             0.97 %        *** 4.384927e-05
 child_process\\child-process-params.js params=1 methodName="spawnSync" n=1000        -0.91 %            5.033024e-01
 child_process\\child-process-params.js params=2 methodName="exec" n=1000             -0.06 %            8.951647e-01
 child_process\\child-process-params.js params=2 methodName="execFile" n=1000         -0.12 %            5.468676e-01
 child_process\\child-process-params.js params=2 methodName="execFileSync" n=1000      0.14 %            8.581547e-01
 child_process\\child-process-params.js params=2 methodName="execSync" n=1000          0.01 %            9.721929e-01
 child_process\\child-process-params.js params=2 methodName="spawn" n=1000             1.05 %        *** 6.128593e-07
 child_process\\child-process-params.js params=2 methodName="spawnSync" n=1000        -0.99 %            3.905834e-01
 child_process\\child-process-params.js params=3 methodName="exec" n=1000              0.09 %            7.962740e-01
 child_process\\child-process-params.js params=3 methodName="execFile" n=1000          0.01 %            9.255018e-01
 child_process\\child-process-params.js params=3 methodName="execFileSync" n=1000     -1.30 %            1.967642e-01
 child_process\\child-process-params.js params=3 methodName="spawn" n=1000            -0.05 %            7.675626e-01
 child_process\\child-process-params.js params=3 methodName="spawnSync" n=1000        -0.81 %            5.329509e-01
 child_process\\child-process-params.js params=4 methodName="execFile" n=1000          0.05 %            6.862553e-01

@mscdex
Copy link
Contributor

mscdex commented Jun 18, 2017

In that case maybe we don't need to backport? Unless it helps with the ease of backporting other child_process PRs?

@gibfahn
Copy link
Member

gibfahn commented Jun 18, 2017

All other things being equal, from a backporting perspective I'd rather minimize the v6.x...master delta where possible. The question is whether the risk is worth it.

Given that this has been in v7.x since March I'd say we're okay to backport, however I'd be interested to know how risky people think this PR is.

@gibfahn
Copy link
Member

gibfahn commented Jun 19, 2017

@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

Single ARM failure looks like a flake, rerun: https://ci.nodejs.org/job/node-test-commit/10674/

@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

@nodejs/performance anyone willing to review this (that it's okay for 6.x)?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gibfahn gibfahn force-pushed the v6.x-staging branch 2 times, most recently from 6ef8c5b to 4c2fa3d Compare June 20, 2017 19:04
gibfahn pushed a commit that referenced this pull request Jun 20, 2017
Remove use of arguments in
normalizeExecArgs() and normalizeSpawnArguments().

Refs: #10323
PR-URL: #11535
Backport-PR-URL: #13752
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

Landed in 327f11f.

@vsemozhetbyt I see you moved var cmd = file; in the original PR, just wanted to confirm that this that this isn't necessary in v6.x.

@gibfahn gibfahn closed this Jun 20, 2017
@vsemozhetbyt vsemozhetbyt deleted the backport-11535-to-v6.x branch June 20, 2017 23:28
@vsemozhetbyt
Copy link
Contributor Author

@gibfahn Yes, this was due to https://bugs.chromium.org/p/v8/issues/detail?id=6010 which is not a case for Node.js v6.x

MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
Remove use of arguments in
normalizeExecArgs() and normalizeSpawnArguments().

Refs: #10323
PR-URL: #11535
Backport-PR-URL: #13752
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.