Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 89961ba

Browse filesBrowse files
committed
src: fix process.abort() interaction with V8
Since V8 5.9 V8 installs a default signal handler for some signals when creating a default platform instance that prints a stack trace. However, Node already does the same thing, so it would seem like the two different stack traces would be printed; also, the V8 handler would lead to a `SIGSEGV` under some circumstances, rather than letting the abort continue normally. Resolve this by disabling V8’s signal handler by default. PR-URL: #13985 Fixes: #13865 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent da1913c commit 89961ba
Copy full SHA for 89961ba

File tree

Expand file treeCollapse file tree

3 files changed

+28
-22
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+28
-22
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ node::DebugOptions debug_options;
247247
static struct {
248248
#if NODE_USE_V8_PLATFORM
249249
void Initialize(int thread_pool_size) {
250-
platform_ = v8::platform::CreateDefaultPlatform(thread_pool_size);
250+
platform_ = v8::platform::CreateDefaultPlatform(
251+
thread_pool_size,
252+
v8::platform::IdleTaskSupport::kDisabled,
253+
v8::platform::InProcessStackDumping::kDisabled);
251254
V8::InitializePlatform(platform_);
252255
tracing::TraceEventHelper::SetCurrentPlatform(platform_);
253256
}
Collapse file
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
const common = require('../common');
3+
const assert = require('assert');
4+
5+
// This test makes sure that an aborted node process
6+
// exits with code 3 on Windows, and SIGABRT on POSIX.
7+
// Spawn a child, force an abort, and then check the
8+
// exit code in the parent.
9+
10+
const spawn = require('child_process').spawn;
11+
if (process.argv[2] === 'child') {
12+
process.abort();
13+
} else {
14+
const child = spawn(process.execPath, [__filename, 'child']);
15+
child.on('exit', common.mustCall((code, signal) => {
16+
if (common.isWindows) {
17+
assert.strictEqual(code, 3);
18+
assert.strictEqual(signal, null);
19+
} else {
20+
assert.strictEqual(code, null);
21+
assert.strictEqual(signal, 'SIGABRT');
22+
}
23+
}));
24+
}
Collapse file

‎test/async-hooks/async-hooks.status‎

Copy file name to clipboardExpand all lines: test/async-hooks/async-hooks.status
-21Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.