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

v4.x-staging to v4.x - PR for CI Testing (do not land) #3566

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
240046c
doc: binary encoding is not deprecated
trevnorris Oct 19, 2015
f6ea99f
tls: TLSSocket options default isServer false
jhamhader Aug 29, 2015
172cccf
stream: fix signature of _write() in a comment
fabiosantoscode Oct 7, 2015
282618e
doc: clarify the use of `option.detached`
smith-kyle Oct 7, 2015
4afcf57
doc: clarify API buffer.concat
Oct 8, 2015
5db1f07
stream: avoid unnecessary concat of a single buffer.
calvinmetcalf Oct 9, 2015
87f8ccf
http: fix stalled pipeline bug
indutny Oct 13, 2015
4023c7d
doc: add information about Assert behavior and maintenance
Trott Oct 12, 2015
925953d
doc: show keylen in pbkdf2 as a byte length
calebboyd Oct 19, 2015
e43c611
test: add test-child-process-emfile fail message
Trott Oct 13, 2015
1888f84
lib: avoid REPL exit on completion error
Trott Oct 14, 2015
31a9ecf
doc: fix typo in changelog
TimothyGu Oct 13, 2015
41a4258
test: replace util with backtick strings
Oct 13, 2015
e223fc7
doc: fix indent in tls resumption example
silverwind Oct 14, 2015
d540666
test: apply correct assert.fail() arguments
Trott Oct 15, 2015
d62d158
test: fix flaky test for symlinks
Trott Oct 17, 2015
0c23e81
test: remove flaky status from eval_messages test
Trott Oct 18, 2015
0b32414
test: fix flaky test-child-process-emfile
Trott Oct 18, 2015
3d1f57d
test: repl-persistent-history is no longer flaky
Fishrock123 Oct 19, 2015
47ab7c7
docs: add missing shell option to execSync
Oct 19, 2015
49549c9
test: skip test-dns-ipv6.js if ipv6 is unavailable
Oct 19, 2015
635f743
test: wrap assert.fail when passed to callback
Oct 20, 2015
e99823b
test: fix test-net-keepalive for AIX
Oct 20, 2015
304eda4
test: harden test-child-process-fork-regr-gh-2847
mhdawson Oct 20, 2015
bc2a80b
test: disable test-tick-processor - aix and be ppc
mhdawson Oct 22, 2015
287e830
buffer: don't CHECK on zero-sized realloc
bnoordhuis Oct 23, 2015
6305d26
test: add Symbol test for assert.deepEqual()
Trott Oct 12, 2015
9fa8c32
test: cleanup, improve repl-persistent-history
Fishrock123 Oct 7, 2015
594e8e7
repl: limit persistent history correctly on load
Fishrock123 Oct 7, 2015
fb3b848
fs: reduced duplicate code in fs.write()
Sep 18, 2015
5222fcc
test: fix domain with abort-on-uncaught on PPC
Oct 14, 2015
bc2120c
buffer: fix value check for writeUInt{B,L}E
trevnorris Oct 23, 2015
9e05af7
test: print helpful err msg on test-dns-ipv6.js
Oct 23, 2015
12d8385
test: improve tests for util.inherits
targos Oct 24, 2015
e4417a1
lib: fix cluster handle leak
Trott Oct 24, 2015
9061aa2
deps: backport 8d6a228 from the v8's upstream
indutny Oct 27, 2015
dee9c74
src: fix stuck debugger process
viirya Sep 9, 2015
5bb6e0f
test: change call to deprecated util.isError()
Trott Sep 26, 2015
c76ef6c
test: parallelize long-running test
Trott Oct 8, 2015
a8425ab
test: split up buffer tests for reliability
Trott Oct 12, 2015
9bffceb
src: fix exception message encoding on Windows
mscdex Oct 13, 2015
4c411ae
test: remove util properties from common
Trott Oct 9, 2015
d4fced7
test: remove util from common
Trott Oct 12, 2015
b8869bd
test: port domains regression test from v0.10
dohse Oct 14, 2015
40bb802
timers: reuse timer in `setTimeout().unref()`
indutny Oct 16, 2015
d918838
repl: handle comments properly
thefourtheye Oct 24, 2015
c85736e
src: fix race condition in debug signal on exit
bnoordhuis Oct 26, 2015
77511eb
deps: backport 010897c from V8 upstream
ofrobots Oct 26, 2015
282065f
doc: mention the behaviour if URL is invalid
thefourtheye Sep 20, 2015
1f6f123
Revert "src: fix stuck debugger process"
bnoordhuis Oct 29, 2015
37aec6a
test: add regression test for --debug-brk -e 0
bnoordhuis Oct 29, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

* [[`b3cbd13340`](https://github.com/nodejs/node/commit/b3cbd13340)] - **buffer**: fix assertion error in WeakCallback (Fedor Indutny) [#3329](https://github.com/nodejs/node/pull/3329)
* [[`102cb7288c`](https://github.com/nodejs/node/commit/102cb7288c)] - **doc**: label v4.2.0 as LTS in changelog heading (Rod Vagg) [#3343](https://github.com/nodejs/node/pull/3343)
* [[`c245a199a7`](https://github.com/nodejs/node/commit/c245a199a7)] - **lib**: fix undefined timeout regression (Ryan Graham) [#3331](https://github.com/nodejs/node/pull/3331
* [[`c245a199a7`](https://github.com/nodejs/node/commit/c245a199a7)] - **lib**: fix undefined timeout regression (Ryan Graham) [#3331](https://github.com/nodejs/node/pull/3331)

## 2015-10-07, Version 4.2.0 'Argon' (LTS), @jasnell

Expand Down
97 changes: 63 additions & 34 deletions deps/v8/src/heap/heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2079,40 +2079,8 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
// for pointers to from semispace instead of looking for pointers
// to new space.
DCHECK(!target->IsMap());
Address obj_address = target->address();

// We are not collecting slots on new space objects during mutation
// thus we have to scan for pointers to evacuation candidates when we
// promote objects. But we should not record any slots in non-black
// objects. Grey object's slots would be rescanned.
// White object might not survive until the end of collection
// it would be a violation of the invariant to record it's slots.
bool record_slots = false;
if (incremental_marking()->IsCompacting()) {
MarkBit mark_bit = Marking::MarkBitFrom(target);
record_slots = Marking::IsBlack(mark_bit);
}
#if V8_DOUBLE_FIELDS_UNBOXING
LayoutDescriptorHelper helper(target->map());
bool has_only_tagged_fields = helper.all_fields_tagged();

if (!has_only_tagged_fields) {
for (int offset = 0; offset < size;) {
int end_of_region_offset;
if (helper.IsTagged(offset, size, &end_of_region_offset)) {
IterateAndMarkPointersToFromSpace(
record_slots, obj_address + offset,
obj_address + end_of_region_offset, &ScavengeObject);
}
offset = end_of_region_offset;
}
} else {
#endif
IterateAndMarkPointersToFromSpace(
record_slots, obj_address, obj_address + size, &ScavengeObject);
#if V8_DOUBLE_FIELDS_UNBOXING
}
#endif

IteratePointersToFromSpace(target, size, &ScavengeObject);
}
}

Expand Down Expand Up @@ -5263,6 +5231,67 @@ void Heap::IterateAndMarkPointersToFromSpace(bool record_slots, Address start,
}


void Heap::IteratePointersToFromSpace(HeapObject* target, int size,
ObjectSlotCallback callback) {
Address obj_address = target->address();

// We are not collecting slots on new space objects during mutation
// thus we have to scan for pointers to evacuation candidates when we
// promote objects. But we should not record any slots in non-black
// objects. Grey object's slots would be rescanned.
// White object might not survive until the end of collection
// it would be a violation of the invariant to record it's slots.
bool record_slots = false;
if (incremental_marking()->IsCompacting()) {
MarkBit mark_bit = Marking::MarkBitFrom(target);
record_slots = Marking::IsBlack(mark_bit);
}

// Do not scavenge JSArrayBuffer's contents
switch (target->ContentType()) {
case HeapObjectContents::kTaggedValues: {
IterateAndMarkPointersToFromSpace(record_slots, obj_address,
obj_address + size, callback);
break;
}
case HeapObjectContents::kMixedValues: {
if (target->IsFixedTypedArrayBase()) {
IterateAndMarkPointersToFromSpace(
record_slots, obj_address + FixedTypedArrayBase::kBasePointerOffset,
obj_address + FixedTypedArrayBase::kHeaderSize, callback);
} else if (target->IsJSArrayBuffer()) {
IterateAndMarkPointersToFromSpace(
record_slots, obj_address,
obj_address + JSArrayBuffer::kByteLengthOffset + kPointerSize,
callback);
IterateAndMarkPointersToFromSpace(
record_slots, obj_address + JSArrayBuffer::kSize,
obj_address + size, callback);
#if V8_DOUBLE_FIELDS_UNBOXING
} else if (FLAG_unbox_double_fields) {
LayoutDescriptorHelper helper(target->map());
DCHECK(!helper.all_fields_tagged());

for (int offset = 0; offset < size;) {
int end_of_region_offset;
if (helper.IsTagged(offset, size, &end_of_region_offset)) {
IterateAndMarkPointersToFromSpace(
record_slots, obj_address + offset,
obj_address + end_of_region_offset, callback);
}
offset = end_of_region_offset;
}
#endif
}
break;
}
case HeapObjectContents::kRawValues: {
break;
}
}
}


void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) {
IterateStrongRoots(v, mode);
IterateWeakRoots(v, mode);
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/heap/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,9 @@ class Heap {

// Iterate pointers to from semispace of new space found in memory interval
// from start to end.
void IteratePointersToFromSpace(HeapObject* target, int size,
ObjectSlotCallback callback);

void IterateAndMarkPointersToFromSpace(bool record_slots, Address start,
Address end,
ObjectSlotCallback callback);
Expand Down
12 changes: 7 additions & 5 deletions deps/v8/src/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,19 @@ class CodeEventLogger::NameBuffer {
}

void AppendInt(int n) {
Vector<char> buffer(utf8_buffer_ + utf8_pos_,
kUtf8BufferSize - utf8_pos_);
int space = kUtf8BufferSize - utf8_pos_;
if (space <= 0) return;
Vector<char> buffer(utf8_buffer_ + utf8_pos_, space);
int size = SNPrintF(buffer, "%d", n);
if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
utf8_pos_ += size;
}
}

void AppendHex(uint32_t n) {
Vector<char> buffer(utf8_buffer_ + utf8_pos_,
kUtf8BufferSize - utf8_pos_);
int space = kUtf8BufferSize - utf8_pos_;
if (space <= 0) return;
Vector<char> buffer(utf8_buffer_ + utf8_pos_, space);
int size = SNPrintF(buffer, "%x", n);
if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
utf8_pos_ += size;
Expand All @@ -147,7 +149,7 @@ class CodeEventLogger::NameBuffer {

private:
static const int kUtf8BufferSize = 512;
static const int kUtf16BufferSize = 128;
static const int kUtf16BufferSize = kUtf8BufferSize;

int utf8_pos_;
char utf8_buffer_[kUtf8BufferSize];
Expand Down
26 changes: 26 additions & 0 deletions deps/v8/test/cctest/test-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14191,6 +14191,32 @@ THREADED_TEST(SkipArrayBufferBackingStoreDuringGC) {
}


THREADED_TEST(SkipArrayBufferDuringScavenge) {
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope handle_scope(isolate);

// Make sure the pointer looks like a heap object
Local<v8::Object> tmp = v8::Object::New(isolate);
uint8_t* store_ptr =
reinterpret_cast<uint8_t*>(*reinterpret_cast<uintptr_t*>(*tmp));

// Make `store_ptr` point to from space
CcTest::heap()->CollectGarbage(i::NEW_SPACE);

// Create ArrayBuffer with pointer-that-cannot-be-visited in the backing store
Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, store_ptr, 8);

// Should not crash,
// i.e. backing store pointer should not be treated as a heap object pointer
CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in survivor space now
CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in old gen now

// Use `ab` to silence compiler warning
CHECK_EQ(ab->GetContents().Data(), store_ptr);
}


THREADED_TEST(SharedUint8Array) {
i::FLAG_harmony_sharedarraybuffer = true;
TypedArrayTestHelper<uint8_t, v8::Uint8Array, i::ExternalUint8Array,
Expand Down
55 changes: 55 additions & 0 deletions deps/v8/test/cctest/test-log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,3 +531,58 @@ TEST(LogVersion) {
}
isolate->Dispose();
}


// https://crbug.com/539892
// CodeCreateEvents with really large names should not crash.
TEST(Issue539892) {
class : public i::CodeEventLogger {
public:
virtual void CodeMoveEvent(Address from, Address to) {}
virtual void CodeDeleteEvent(Address from) {}
virtual void CodeDisableOptEvent(i::Code* code,
i::SharedFunctionInfo* shared) {}

private:
virtual void LogRecordedBuffer(i::Code* code, i::SharedFunctionInfo* shared,
const char* name, int length) {}
} code_event_logger;
SETUP_FLAGS();
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);

{
ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate);
Logger* logger = initialize_logger.logger();
logger->addCodeEventListener(&code_event_logger);

// Function with a really large name.
const char* source_text =
"(function "
"baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac"
"(){})();";

CompileRun(source_text);

// Must not crash.
logger->LogCompiledFunctions();
}
isolate->Dispose();
}
20 changes: 15 additions & 5 deletions doc/api/assert.markdown
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Assert

Stability: 2 - Stable
Stability: 3 - Locked

This module is used for writing assertion tests. You can access it with
`require('assert')`.
This module is used so that Node.js can test itself. It can be accessed with
`require('assert')`. However, it is recommended that a userland assertion
library be used instead.

## assert.fail(actual, expected, message, operator)

Expand All @@ -26,8 +27,17 @@ Tests shallow, coercive inequality with the not equal comparison operator

## assert.deepEqual(actual, expected[, message])

Tests for deep equality. Primitive values are compared with the equal comparison
operator ( `==` ). Doesn't take object prototypes into account.
Tests for deep equality. Primitive values are compared with the equal
comparison operator ( `==` ).

This only considers enumerable properties. It does not test object prototypes,
attached symbols, or non-enumerable properties. This can lead to some
potentially surprising results. For example, this does not throw an
`AssertionError` because the properties on the `Error` object are
non-enumerable:

// WARNING: This does not throw an AssertionError!
assert.deepEqual(Error('a'), Error('b'));

## assert.notDeepEqual(actual, expected[, message])

Expand Down
35 changes: 30 additions & 5 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ encoding method. Here are the different string encodings.

* `'base64'` - Base64 string encoding.

* `'binary'` - A way of encoding raw binary data into strings by using only
the first 8 bits of each character. This encoding method is deprecated and
should be avoided in favor of `Buffer` objects where possible. This encoding
will be removed in future versions of Node.js.
* `'binary'` - A way of encoding the buffer into a one-byte (i.e. `latin-1`)
encoded string. The string `'latin-1'` is not supported. Instead simply pass
`'binary'` to use `'latin-1'` encoding.

* `'hex'` - Encode each byte as two hexadecimal characters.

Expand Down Expand Up @@ -127,7 +126,7 @@ Example:
### Class Method: Buffer.concat(list[, totalLength])

* `list` {Array} List of Buffer objects to concat
* `totalLength` {Number} Total length of the buffers when concatenated
* `totalLength` {Number} Total length of the buffers in the list when concatenated

Returns a buffer which is the result of concatenating all the buffers in
the list together.
Expand All @@ -139,6 +138,32 @@ If totalLength is not provided, it is read from the buffers in the list.
However, this adds an additional loop to the function, so it is faster
to provide the length explicitly.

Example: build a single buffer from a list of three buffers:

var buf1 = new Buffer(10);
var buf2 = new Buffer(14);
var buf3 = new Buffer(18);

buf1.fill(0);
buf2.fill(0);
buf3.fill(0);

var buffers = [buf1, buf2, buf3];

var totalLength = 0;
for (var i = 0; i < buffers.length; i++) {
totalLength += buffers[i].length;
}

console.log(totalLength);
var bufA = Buffer.concat(buffers, totalLength);
console.log(bufA);
console.log(bufA.length);

// 42
// <Buffer 00 00 00 00 ...>
// 42

### Class Method: Buffer.compare(buf1, buf2)

* `buf1` {Buffer}
Expand Down
11 changes: 8 additions & 3 deletions doc/api/child_process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,10 @@ file:
child.unref();

When using the `detached` option to start a long-running process, the process
will not stay running in the background unless it is provided with a `stdio`
configuration that is not connected to the parent. If the parent's `stdio` is
inherited, the child will remain attached to the controlling terminal.
will not stay running in the background after the parent exits unless it is
provided with a `stdio` configuration that is not connected to the parent.
If the parent's `stdio` is inherited, the child will remain attached to the
controlling terminal.

See also: [`child_process.exec()`](#child_process_child_process_exec_command_options_callback) and [`child_process.fork()`](#child_process_child_process_fork_modulepath_args_options)

Expand Down Expand Up @@ -715,6 +716,10 @@ process has exited.
- `stderr` by default will be output to the parent process' stderr unless
`stdio` is specified
* `env` {Object} Environment key-value pairs
* `shell` {String} Shell to execute the command with
(Default: '/bin/sh' on UNIX, 'cmd.exe' on Windows, The shell should
understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows,
command line parsing should be compatible with `cmd.exe`.)
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
* `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined)
Expand Down
4 changes: 2 additions & 2 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,13 @@ Example (obtaining a shared secret):
## crypto.pbkdf2(password, salt, iterations, keylen[, digest], callback)

Asynchronous PBKDF2 function. Applies the selected HMAC digest function
(default: SHA1) to derive a key of the requested length from the password,
(default: SHA1) to derive a key of the requested byte length from the password,
salt and number of iterations. The callback gets two arguments:
`(err, derivedKey)`.

Example:

crypto.pbkdf2('secret', 'salt', 4096, 512, 'sha256', function(err, key) {
crypto.pbkdf2('secret', 'salt', 4096, 64, 'sha256', function(err, key) {
if (err)
throw err;
console.log(key.toString('hex')); // 'c5e478d...1469e50'
Expand Down
Loading