When a vm script aborted after a timeout/signal interruption, test
whether the local timeout/signal watchdog was responsible for
terminating the execution.
Without this, when a shorter timer from an outer `vm.run*` invocation
fires before an inner timeout, the inner timeout would throw an error
instead of the outer one, but because it did not witness the timeout
itself, it would assume the termination was the result of a signal
interruption.
PR-URL: https://github.com/nodejs/node/pull/7373
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Likely fix the flaky parallel/test-vm-timeout. Increase the outer
timeout in the test checking for nested timeouts with `vm` scripts
so that its firing won’t interfere with the inner timeout.
Fixes: https://github.com/nodejs/node/issues/6727
PR-URL: https://github.com/nodejs/node/pull/7373
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/7310
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
This commit fixes an issue when extra utf8 continuation bytes appear
at the end of a chunk of data, causing miscalculations to be made
when checking how many bytes are needed to decode a complete
character.
Fixes: https://github.com/nodejs/node/issues/7308
PR-URL: https://github.com/nodejs/node/pull/7310
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
The Visual C++ Build Tools are supported to build Node on Windows
and already used in CI, so they should be included in the build
instructions.
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/7285
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl.
Certificates added:
- Certum Trusted Network CA 2
- SZAFIR ROOT CA2
Certificates removed:
- CA Disig
- NetLock Notary (Class A) Root
- Staat der Nederlanden Root CA
PR-URL: https://github.com/nodejs/node/pull/7363
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Commit eff96d3 ("src: add include guards to internal headers") adds
include guards. Update tools/mk-ca-bundle.pl to output them when
generating src/node_root_certs.h.
PR-URL: https://github.com/nodejs/node/pull/7363
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit backports a fix to a JIT bug in V8.
After 100 or so comparisons `typeof null ==="undefined"` is returning
`true` instead of `false`.
Original commit message:
Fix 'typeof null' canonicalization in crankshaft
BUG=
Review URL: https://codereview.chromium.org/1912553002
Cr-Commit-Position: refs/heads/master@{#35699}
Ref: https://bugs.chromium.org/p/chromium/issues/detail?id=604033
PR-URL: https://github.com/nodejs/node/pull/7348
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Test fails if tmp dir does not exist when the test is run. Add
common.refreshTmpDir() so that doesn't happen.
PR-URL: https://github.com/nodejs/node/pull/7327
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Buffer.isEncoding and string_decoder.normalizeEncoding shared
quite a bit of logic. This moves the primary logic into
internal/util. The userland modules that monkey patch Buffer.isEncoding
should still work.
PR-URL: https://github.com/nodejs/node/pull/7207
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/7334
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
We will be introducing many more critical sections in the upcoming
multi-isolate changes, so let's make manual synchronization a thing
of the past.
PR-URL: https://github.com/nodejs/node/pull/7334
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
cpplint gets too easily confused by C++ constructs that look like
function declarations but aren't. Furthermore, it's arguably a
bad rule that conflicts with gcc's -Wunused-parameter flag.
PR-URL: https://github.com/nodejs/node/pull/7334
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
When specifing a parameter that requries an additional argument on the
command line, node would segfault. This appears to be specific to
Windows, adjusted command line argument parsing to hold a nullptr
terminal.
Adding unit test for crash on missing arguments.
PR-URL: https://github.com/nodejs/node/pull/6938
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Make BINARY an alias for LATIN1 rather than a distinct enum value.
PR-URL: https://github.com/nodejs/node/pull/7284
Refs: https://github.com/nodejs/node/pull/7262
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* test: check invalid chunk error for readable.push
Test that passing invalid chunks to readable.push() in
non-object mode throw errors.
* test: add simple object mode + decoder stream test
* test: add test for readable stream lacking _read
Check that using a readable stream without a _read method will throw
an error.
* test: add basic test for piping to multiple dests
Add a simple test for piping and unpiping from a readable stream
to multiple writable streams.
PR-URL: https://github.com/nodejs/node/pull/7260
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Return the previous raw mode setting from the internal `_setRawMode`
so that is easier to reset it to its original state later.
PR-URL: https://github.com/nodejs/node/pull/6635
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Adds the `breakEvalOnSigint` option to `vm.runIn(This)Context`.
This uses a watchdog thread to wait for SIGINT and generally works
just like the existing `timeout` option.
- Adds a method to the existing timer-based watchdog to check if it
stopped regularly or by running into the timeout. This is used to
tell a SIGINT abort from a timer-based one.
- Adds (internal) `process._{start,stop}SigintWatchdog` methods to
start/stop the watchdog thread used by the above option manually.
This will be used in the REPL to set up SIGINT handling before
entering terminal raw mode, so that there is no time window in
which Ctrl+C fully aborts the process.
PR-URL: https://github.com/nodejs/node/pull/6635
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
In some cases close callback was called twice, while in some cases the
memory was still not released at all.
PR-URL: https://github.com/nodejs/node/pull/7268
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
This commit updates the node.js script name to reflect its
actual name, which is now bootstrap_node.js. This commit also
fixes the requisite message tests, and relocates a comment
which seems to have drifted.
PR-URL: https://github.com/nodejs/node/pull/7277
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>