Skip to content

Instantly share code, notes, and snippets.

View misterdjules's full-sized avatar

Julien Gilli misterdjules

View GitHub Profile
@misterdjules
misterdjules / gist:9a840e1cc590561d3e81
Created October 23, 2014 00:07
Latest SSL tests, including parts of the SSL fixes from TJ
diff --git a/lib/crypto.js b/lib/crypto.js
index f88c55d..dedecc4 100644
--- a/lib/crypto.js
+++ b/lib/crypto.js
@@ -61,6 +61,32 @@ var StringDecoder = require('string_decoder').StringDecoder;
var CONTEXT_DEFAULT_OPTIONS = undefined;
+function getSecureOptions(secureProtocol, secureOptions) {
+ if (CONTEXT_DEFAULT_OPTIONS === undefined) {
var domain = require('domain');
var d = domain.create();
d.on('error', function() {
// Swallowing the error on purpose, the goal is to reproduce
// a bug when, even if there's a top level domain error handler
// that swallows the error, the process exits because of the
// original exception
});
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h
index 71a0d01..6087d32 100644
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -2856,7 +2856,7 @@ class V8EXPORT Isolate {
* restored when exiting. Re-entering an isolate is allowed.
*/
void Enter();
-
+ void SetDisableAbortOnUncaughtException(bool disable);
diff --git a/src/node.cc b/src/node.cc
index 18c743f..6716667 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -1942,16 +1961,16 @@ void FatalException(TryCatch &try_catch) {
TryCatch fatal_try_catch;
// this will return true if the JS layer handled it, false otherwise
- Local<Value> caught = fatal_f->Call(process, ARRAY_SIZE(argv), argv);
+ Local<Value> uncaughtException_v = fatal_f->Call(process, ARRAY_SIZE(argv), argv);
➜ node git:(fix-domain-abort-on-uncaught-exception) ✗ ./node ~/dev/test-tj.js
/Users/JulienGilli/dev/test-tj.js:1
{ function a() { b(); } function b() { c(); } function c() { throw new Error(
^
Error: hello
at c (/Users/JulienGilli/dev/test-tj.js:1:128)
at b (/Users/JulienGilli/dev/test-tj.js:1:100)
at a (/Users/JulienGilli/dev/test-tj.js:1:78)
at Object.<anonymous> (/Users/JulienGilli/dev/test-tj.js:1:149)
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h
index 27c5444..2fb6c86 100644
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -2856,7 +2856,7 @@ class V8EXPORT Isolate {
* restored when exiting. Re-entering an isolate is allowed.
*/
void Enter();
- typedef bool (*abort_on_uncaught_exception_handler_t)();
+ typedef bool (*abort_on_uncaught_exception_handler_t)(bool should_report, bool can_be_caught_externally, bool flag_abort_on_uncaught_exception);
var domain = require('domain');
var d = domain.create();
var fs = require('fs');
process.on('uncaughtException', function onUncaughtException() {
});
d.on('error', function() {
try {
throw new Error('Bar');
diff --git a/test/simple/test-domain-with-abort-on-uncaught-exception.js b/test/simple/test-domain-with-abort-on-uncaught-exception.js
index 9392723..743e06e 100644
--- a/test/simple/test-domain-with-abort-on-uncaught-exception.js
+++ b/test/simple/test-domain-with-abort-on-uncaught-exception.js
@@ -134,11 +134,19 @@ if (process.argv[2] === 'child') {
// --abort-on-uncaught-exception is passed on the command line,
// the process must abort.
expectedExitCode = null;
+ expectedSignal = 'SIGABRT';
+

Main Thread

node.exe!uv_cond_condvar_wait	Normal
[External Code]	 
node.exe!uv_cond_condvar_wait(uv_cond_t * cond, _RTL_CRITICAL_SECTION * mutex) Line 589	 
node.exe!uv_cond_wait(uv_cond_t * cond, _RTL_CRITICAL_SECTION * mutex) Line 596	 
node.exe!node::TaskQueue::Push(v8::Task * task) Line 139	 
node.exe!node::Platform::CallOnBackgroundThread(v8::Task * task, v8::Platform::ExpectedRuntime expected_runtime) Line 78	 
node.exe!v8::internal::MarkCompactCollector::StartSweeperThreads() Line 566	 
diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc
index 6e5e310..1b75729 100644
--- a/src/node_dtrace.cc
+++ b/src/node_dtrace.cc
@@ -331,7 +331,7 @@ void InitDTrace(Environment* env, Handle<Object> target) {
}
#ifdef HAVE_ETW
- init_etw();
+ init_etw(env->isolate());