0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

25633 Commits

Author SHA1 Message Date
Anna Henningsen
63ab54248b
worker,etw: only enable ETW on the main thread
The Windows ETW code is not written to be compatible with multi
threading, and in particular it relies on global state like a
single static `uv_async_t`. Adding that to multiple threads
would corrupt the corresponding loops' handle queues.

This addresses the flakiness of at least
`test-worker-exit-code` and very likely other flaky tests that
relate to Worker threads on Windows as well.

Fixes: https://github.com/nodejs/node/issues/25847
Fixes: https://github.com/nodejs/node/issues/25702
Fixes: https://github.com/nodejs/node/issues/24005
Fixes: https://github.com/nodejs/node/issues/23873

PR-URL: https://github.com/nodejs/node/pull/25907
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-05 18:05:20 +01:00
cjihrig
9bbe29dcce
report: use libuv calls for OS and machine info
PR-URL: https://github.com/nodejs/node/pull/25900
Fixes: https://github.com/nodejs/node/issues/25843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-05 08:56:16 -05:00
David Benjamin
50f9062396 crypto: don't crash X509ToObject on error
Use MaybeLocal::ToLocal and don't crash X509ToObject on error.

PR-URL: https://github.com/nodejs/node/pull/25717
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-05 07:28:09 +01:00
David Benjamin
ebda39a2a9 crypto: fix malloc mixing in X509ToObject
EC_KEY_key2buf returns an OPENSSL_malloc'd pointer so it shouldn't be
passed into Buffer::New, which expect a libc malloc'd pointer. Instead,
factor out the ECDH::GetPublicKey code which uses EC_POINT_point2oct.

This preserves the existing behavior where encoding failures are
silently ignored, but it is probably safe to CHECK fail them instead.

PR-URL: https://github.com/nodejs/node/pull/25717
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-05 07:17:37 +01:00
Yang Guo
793c63073a test: relax expectations in test-icu-transcode
Chromium's ICU considers "latin1" and "ascii" to mean Windows-1252,
which is consistent with
[WHATWG spec](https://encoding.spec.whatwg.org/#names-and-labels). If
linked against Chromium's ICU, Node.js therefore fails
`test/parallel/test-icu-transcode`.

PR-URL: https://github.com/nodejs/node/pull/25866
Refs: https://github.com/nodejs/node/issues/25851
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2019-02-05 05:52:23 +01:00
Jeremy Apthorp
1ac6ea2e6b src: use visibility("default") exports on POSIX
Electron uses this because Chromium builds with symbols
hidden by default.

Refs:https://github.com/electron/node/commit/
88b494191c2a5b50b01dab80cd61ba3c0e0fbeb9
Refs: https://github.com/electron/node/commit/
1293d1d7d0c33d3925da11ceccdce4eb2e927a43

PR-URL: https://github.com/nodejs/node/pull/25893
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2019-02-05 05:33:59 +01:00
Rich Trott
3fe9267592 doc: improve doc on unintended breaking changes
Improve the material in the Collaborator Guide on unintended breaking
changes.

PR-URL: https://github.com/nodejs/node/pull/25887
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-02-04 10:32:49 -08:00
Sam Roberts
f395a4a401 deps: remove OpenSSL git and travis configuration
OpenSSL is packaging its git and travis configuration files. Remove
them, Node.js has its own.

PR-URL: https://github.com/nodejs/node/pull/25689
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2019-02-04 10:25:05 -08:00
Anna Henningsen
5506dcdd73
src: fix race condition in ~NodeTraceBuffer
Libuv does not guarantee that handles have their close
callbacks called in the order in which they were added
(and in fact, currently calls them in reverse order).

This patch ensures that the `flush_signal_` handle
is no longer in use (i.e. its close callback has already
been run) when we signal to the main thread that
`~NodeTraceBuffer` may be destroyed.

The same applies for `~NodeTraceWriter`.

Credit for debugging goes to Gireesh Punathil.

Fixes: https://github.com/nodejs/node/issues/25512
Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com>

PR-URL: https://github.com/nodejs/node/pull/25896
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
2019-02-04 18:18:02 +01:00
Yang Guo
dfe5f8f288 test: do not fail SLOW tests if they are not slow
PR-URL: https://github.com/nodejs/node/pull/25868
Refs: https://github.com/nodejs/node/issues/25867
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2019-02-04 11:46:29 -05:00
Sam Roberts
6b7c402518 tls: check arg types of renegotiate()
Don't throw on invalid property access if options is not provided, and
ensure callback is a function.

PR-URL: https://github.com/nodejs/node/pull/25876
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-04 08:06:41 -08:00
gengjiawen
c6ecbd36fa src: remove unimplemented method in node_http2.h
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/25732
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-04 10:52:50 +01:00
gengjiawen
66f08fdf8b src: use nullptr in node_buffer.cc
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/25820
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-04 07:21:53 +01:00
Daniel Bevenius
d6a32cfe7c test: add hasCrypto to worker-cleanexit-with-moduleload
Currently, this test fails when configured --without-ssl:

=== release test-worker-cleanexit-with-moduleload ===
Path: parallel/test-worker-cleanexit-with-moduleload
events.js:173
      throw er; // Unhandled 'error' event
      ^
internal/util.js:101
    throw new ERR_NO_CRYPTO();
    ^

Error [ERR_NO_CRYPTO]:
Node.js is not compiled with OpenSSL crypto support

This commit as a check for crypto so that this test is skipped if there
is no crypto support.

PR-URL: https://github.com/nodejs/node/pull/25811
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-02-04 05:36:39 +01:00
Rich Trott
46af4c1d01 tools: replace deprecated ESLint configuration
For `globals`, booleans are deprecated in favor strings
`'readable'`/`'writeable'`.

PR-URL: https://github.com/nodejs/node/pull/25877
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2019-02-03 16:46:31 -08:00
Rich Trott
7540f9dbe8 tools: update ESLint to 5.13.0
PR-URL: https://github.com/nodejs/node/pull/25877
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2019-02-03 16:46:26 -08:00
Rich Trott
b322b76dad tools: update dmn in update-estlint.sh
Version 2.1.0 of dmn will get rid of .map and .ts files.

PR-URL: https://github.com/nodejs/node/pull/25877
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2019-02-03 16:46:19 -08:00
Anna Henningsen
363ef3faec
src: remove main_isolate
PR-URL: https://github.com/nodejs/node/pull/25823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-03 20:42:11 +01:00
Anna Henningsen
270ffb0fa7
src,lib: remove dead process.binding() code
There are no non-internal builtin modules left, so this
should be safe to remove to a large degree.

PR-URL: https://github.com/nodejs/node/pull/25829
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-03 20:41:53 +01:00
Anna Henningsen
cca897ef5d
inspector,vm: remove --eval wrapper
Report the actual source code when running with `--eval` and
`--inspect-brk`, by telling the vm module to break on the
first line of the script being executed rather than wrapping
the source code in a function.

PR-URL: https://github.com/nodejs/node/pull/25832
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-03 20:40:16 +01:00
Anna Henningsen
f72254037e
src: handle errors while printing error objects
Handle situations where accessing `.name` or `.stack` on an object
fails.

Fixes: https://github.com/nodejs/node/issues/25718

PR-URL: https://github.com/nodejs/node/pull/25834
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-03 20:37:52 +01:00
Anna Henningsen
30545a5b21
src: use struct as arguments to node::Assert
This just makes the code a bit more obvious (subjectively).

PR-URL: https://github.com/nodejs/node/pull/25869
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-03 20:35:27 +01:00
Raido Kuli
d0bce9a82d doc: document os.userInfo() throwing SystemError
`os.userInfo()` throws an exception which was not documented
in environments like: `docker run --user $(id -u): $(id -g)`.

PR-URL: https://github.com/nodejs/node/pull/25724
Fixes: https://github.com/nodejs/node/issues/25714
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-03 13:44:06 +02:00
Rich Trott
3418956349 benchmark: use consistent coding style in assert/*
Files in benchmark/assert/* were sometimes using trailing commas for
multi-line objects and sometimes not, mixing the approaches in the same
file sometimes. Standardize these files to always use trailing commas in
multi-line objects.

Additionally, remove some unnecessary line-wrapping (so that there are
fewer multi-line objects).

PR-URL: https://github.com/nodejs/node/pull/25865
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-02-03 01:48:32 -08:00
Rich Trott
4deb23a2f6 tools: improve prerequisites for test-all-suites
The prerequisistes for test-all-suites were running some tests
themselves. When one of those tests failed during a coverage run, it
resulted in artificially low coverage. Fix the prerequisites to only
build stuff, not test.

PR-URL: https://github.com/nodejs/node/pull/25892
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-02 17:20:20 -08:00
cjihrig
fba96ca1fd
doc: fix machine field in example report
PR-URL: https://github.com/nodejs/node/pull/25855
Refs: https://github.com/nodejs/node/pull/25755
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-02-02 14:39:11 -05:00
Rich Trott
28c0f84a69 doc: remove redundant LTS/Current information in Collaborator Guide
Remove bullet points about how breaking changes are handled in Current
and LTS branches.

* This information is covered in
  https://github.com/nodejs/Release#release-plan.
* Having it here and in the above link means that the two may get out of
  sync, resulting in confusion.
* The above link appears later in the doc in the LTS section.
* Most Collaborators should not land *anything* in LTS branches and will
  almost never have a reason to land things into Current branches. They
  land stuff on the master branch. Adding this material here is
  confusing because it implies that Collaborators do land stuff on those
  branches. Save talk about those branches and how they're managed for
  later in the LTS section where it can be made clear that most
  Collaborators should not be landing code there anyway.

PR-URL: https://github.com/nodejs/node/pull/25842
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-01 23:44:34 -08:00
Rich Trott
8198ca0b26 tools: exclude benchmark code from coverage report
Refs: https://github.com/nodejs/build/issues/1676#issuecomment-459218651

PR-URL: https://github.com/nodejs/node/pull/25841
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-01 23:11:58 -08:00
Luigi Pinca
988482e234 test: refactor test-http-agent-timeout-option
Fix flakyness caused by usage of a non-routable IP address.

Refs: https://github.com/nodejs/node/pull/25488#issuecomment-459385146

PR-URL: https://github.com/nodejs/node/pull/25854
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-02-01 22:44:33 -08:00
Sam Roberts
0f8e8f7c6b tls: introduce client 'session' event
OpenSSL has supported async notification of sessions and tickets since
1.1.0 using SSL_CTX_sess_set_new_cb(), for all versions of TLS. Using
the async API is optional for TLS1.2 and below, but for TLS1.3 it will
be mandatory. Future-proof applications should start to use async
notification immediately. In the future, for TLS1.3, applications that
don't use the async API will silently, but gracefully, fail to resume
sessions and instead do a full handshake.

See: https://wiki.openssl.org/index.php/TLS1.3#Sessions

PR-URL: https://github.com/nodejs/node/pull/25831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2019-02-01 19:06:58 -08:00
Rich Trott
e1aa9438ea tools: add test-all-suites to Makefile
There is currently no Makefile target that runs every test suite. This
adds one.

PR-URL: https://github.com/nodejs/node/pull/25799
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-02-01 15:40:46 -08:00
Sakthipriyan Vairamani (thefourtheye)
5e0a3261f0
tools: make test.py Python 3 compatible
PR-URL: https://github.com/nodejs/node/pull/25767
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: cclauss <cclauss@me.com>
Reviewed-By: gengjiawen <technicalcute@gmail.com>
2019-02-02 00:24:54 +01:00
gengjiawen
dee9a61bb9
src: remove unused AsyncResource constructor in node.h
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/25793
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-02-02 00:21:50 +01:00
gengjiawen
8c8144e51c
src: remove unused method in js_stream.h
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/25790
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-02 00:20:59 +01:00
Joyee Cheung
fa5e097530
process: move DEP0062 (node --debug) to end-of-life
This has already been practically end-of-life since `node --debug`
alone would exit the process. This patch drops support of
`node --inspect --debug-brk` as well.

`node --inspect --debug-brk` has been deprecated since v8,
it has been maintained so that vendors can target Node.js
v6 and above without detecting versions.
The support of `--inspect`, which starts from v6, will reach
end-of-life in April 2019, it should be safe to drop the support
of `--inspect --debug-brk` altogether in v12.

Also removes `process._deprecatedDebugBrk`

PR-URL: https://github.com/nodejs/node/pull/25828
Refs: https://github.com/nodejs/node/pull/12949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-02-02 05:45:05 +08:00
Joyee Cheung
154efc9bde
process: exit on --debug and --debug-brk after option parsing
Moves the exit of `--debug` and `--debug-brk` earlier, that is,
after the option parsing is done in the C++ land.

Also removes `process._invalidDebug`.

PR-URL: https://github.com/nodejs/node/pull/25828
Refs: https://github.com/nodejs/node/pull/12949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-02-02 05:45:05 +08:00
Michael Dawson
c369b3e929 test: exclude additional test for coverage
Exclude async-hooks/test-callback-error as it seems
to fail consistently when run with coverage on
the docker ubuntu16 machines we plan to run the
coverage sanity test on.

PR-URL: https://github.com/nodejs/node/pull/25833
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2019-02-01 16:44:01 -05:00
Joyee Cheung
406329de57
process: move process mutation into bootstrap/node.js
This patch moves the part in the report initialization
that mutates the process object into bootstrap/node.js
so it's easier to tell the side effect of the initialization
on the global state during bootstrap.

PR-URL: https://github.com/nodejs/node/pull/25821
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-02-02 05:42:48 +08:00
Joyee Cheung
c2359bdad6
process: expose process.features.inspector
Instead of using process.config.variables.v8_enable_inspector
to detect whether inspector is enabled in the build.

PR-URL: https://github.com/nodejs/node/pull/25819
Refs: https://github.com/nodejs/node/issues/25343
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-02 05:41:45 +08:00
Joyee Cheung
39d922123c
lib: save primordials during bootstrap and use it in builtins
This patches changes the `safe_globals` internal module into a
script that gets run during bootstrap and saves JavaScript builtins
(primordials) into an object that is available for all other builtin
modules to access lexically later.

PR-URL: https://github.com/nodejs/node/pull/25816
Refs: https://github.com/nodejs/node/issues/18795
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
2019-02-02 05:40:47 +08:00
Ali Ijaz Sheikh
1d996f58af src: properly configure default heap limits
Unless configured, V8 defaults to limiting the max heaps size to 700 MB
or 1400MB on 32 and 64-bit platforms respectively. This default is
based on the browser use-cases and doesn't make a lot of sense
generally. This change properly configures the heap size based on
actual available memory.

PR-URL: https://github.com/nodejs/node/pull/25576
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-01 13:18:13 -08:00
Richard Lau
d0d84b009c report: separate release metadata
Report release metadata separately from `componentVersions`.
Test `componentVersions` and `release` values in the report.

PR-URL: https://github.com/nodejs/node/pull/25826
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-01 14:30:45 -05:00
Anna Henningsen
393c196605
worker: refactor thread id management
- Assign thread IDs to `Environment` instances, rather than Workers.
  This is more embedder-friendly than the current system, in which
  all “main threads” (if there are multiple ones) would get the
  id `0`.
- Because that means that `isMainThread === (threadId === 0)` no longer
  holds, refactor `isMainThread` into a separate entity. Implement it
  in a way that allows for future extensibility, because we use
  `isMainThread` in multiple different ways (determining whether there
  is a parent thread; determining whether the current thread has control
  of the current process; etc.).

PR-URL: https://github.com/nodejs/node/pull/25796
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2019-02-01 20:22:33 +01:00
Albert Still
bcf2886a84 http: return HTTP 431 on HPE_HEADER_OVERFLOW error
Instead of returning a generic 400 response when the
max header size is reached, return a 431 Request Header
Fields Too Large.

This is a semver-major because it changes the HTTP
status code for requests that trigger the header
overflow error.

PR-URL: https://github.com/nodejs/node/pull/25605
Fixes: https://github.com/nodejs/node/issues/25528
Refs: https://tools.ietf.org/html/rfc6585#section-5

Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-01 19:48:23 +01:00
Benjamin Coe
a861adde3b
test: allow coverage threshold to be enforced
If COV_ENFORCE_THRESHOLD is set, tests run in coverage mode will
exit with an error, if line coverage is below the percentage
threshold.

PR-URL: https://github.com/nodejs/node/pull/25675
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-02-01 10:20:40 -08:00
Anna Henningsen
0ff0af534e
worker: throw for duplicates in transfer list
Throw a `DataCloneError` exception when encountering duplicate
`ArrayBuffer`s or `MessagePort`s in the transfer list.

Fixes: https://github.com/nodejs/node/issues/25786

PR-URL: https://github.com/nodejs/node/pull/25815
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-01 16:09:22 +01:00
Yang Guo
7c8ac5a01b deps: cherry-pick c736883 from upstream V8
Original commit message:

    Optionally use halfsiphash for integer hashing.

    Change-Id: Ibd14f7b3fe78635675c76ae864112e3a3a7bc701
    Reviewed-on: https://chromium-review.googlesource.com/c/1382463
    Commit-Queue: Yang Guo <yangguo@chromium.org>
    Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#58674}

Refs: c736883ed4
2019-02-01 15:09:33 +01:00
Daniel Bevenius
f4510c4148 test, tools: suppress addon function cast warnings
Currently, there are a number of compiler warnings generated when
building the addons on Linux, for example:

make[1]: Entering directory '/node/test/addons/zlib-binding/build'
  CXX(target) Release/obj.target/binding/binding.o
  SOLINK_MODULE(target) Release/obj.target/binding.node
  COPY Release/binding.node
make[1]: Leaving directory '/node/test/addons/zlib-binding/build'
In file included from ../binding.cc:1:
/node/src/node.h:515:51: warning:
cast between incompatible function types from
'void (*)(v8::Local<v8::Object>,
          v8::Local<v8::Value>,
          v8::Local<v8::Context>)' to
'node::addon_context_register_func' {aka
'void (*)(v8::Local<v8::Object>,
          v8::Local<v8::Value>,
          v8::Local<v8::Context>,
          void*)'} [-Wcast-function-type]
(node::addon_context_register_func) (regfunc), \
					   ^
/node/src/node.h:533:3:
note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE_X'
   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../binding.cc:58:1:
note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE'
 NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, Initialize)
 ^~~~~~~~~~~~~~~~~~~~~~~~~

This commit adds the flag -Wno-cast-function-type to suppress these
warnings. With this change the warnings are not displayed anymore and
the output matches that of osx when running
'make -j8 test/addons/.buildstamp'.

PR-URL: https://github.com/nodejs/node/pull/25663
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-01 14:08:20 +01:00
David Benjamin
80873ec3c2 crypto: fix public key encoding name in comment
PKCS#8 describes an encoding for private keys, not public keys. Using
the name as a format usually refers to the PrivateKeyInfo structure it
defines. (Or sometimes the EncryptedPrivateKeyInfo variant or the
little-used OneAsymmetricKey extension defined in RFC 5958.) None of
these structures can hold public keys to begin with.

d2i_PUBKEY actually parses the public key analogous format defined in
X.509, SubjectPublicKeyInfo. This function already uses "X.509" to refer
to an entire certificate, so say SubjectPublicKeyInfo in the comment.

(The abbreviation SPKI sometimes refers to SubjectPublicKeyInfo, e.g. in
RFC 7469, but it can also an alternate S-expression-based PKI to X.509,
Simple Public Key Infrastructure. To avoid confusion, stick with the
expanded name.)

PR-URL: https://github.com/nodejs/node/pull/25736
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-01 10:45:20 +01:00
Rich Trott
7c9fba30ef benchmark: refactor benchmark/common.js
Refactor benchmark/common.js to consistently use arrow functions for
anonymous callbacks and trailing commas.

PR-URL: https://github.com/nodejs/node/pull/25805
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-31 20:46:54 -08:00