Skip to content

Commit b6af552

Browse files
committed
src: disable abseil deadlock detection
Abseil deadlock detection is reporting false positives in tests. Disable it for now. PR-URL: #57582 Refs: nodejs/node-v8#301 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Stefan Stojanovic <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 5fd67df commit b6af552

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

node.gyp

+2
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@
838838
'deps/googletest/googletest.gyp:gtest_prod',
839839
'deps/histogram/histogram.gyp:histogram',
840840
'deps/nbytes/nbytes.gyp:nbytes',
841+
'tools/v8_gypfiles/abseil.gyp:abseil',
841842
'node_js2c#host',
842843
],
843844

@@ -1160,6 +1161,7 @@
11601161
'deps/googletest/googletest.gyp:gtest_main',
11611162
'deps/histogram/histogram.gyp:histogram',
11621163
'deps/nbytes/nbytes.gyp:nbytes',
1164+
'tools/v8_gypfiles/abseil.gyp:abseil',
11631165
],
11641166

11651167
'includes': [

src/node.cc

+7
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
#include <unistd.h> // STDIN_FILENO, STDERR_FILENO
119119
#endif
120120

121+
#include "absl/synchronization/mutex.h"
122+
121123
// ========== global C++ headers ==========
122124

123125
#include <cerrno>
@@ -1224,6 +1226,11 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
12241226

12251227
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
12261228
V8::Initialize();
1229+
1230+
// Disable absl deadlock detection in V8 as it reports false-positive cases.
1231+
// TODO(legendecas): Replace this global disablement with case suppressions.
1232+
// https://github.com/nodejs/node-v8/issues/301
1233+
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
12271234
}
12281235

12291236
if (!(flags & ProcessInitializationFlags::kNoInitializeCppgc)) {

test/cctest/node_test_fixture.cc

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "node_test_fixture.h"
2+
#include "absl/synchronization/mutex.h"
23
#include "cppgc/platform.h"
34

45
ArrayBufferUniquePtr NodeZeroIsolateTestFixture::allocator{nullptr, nullptr};
@@ -31,6 +32,11 @@ void NodeTestEnvironment::SetUp() {
3132
v8::V8::SetFlagsFromString("--no-freeze-flags-after-init");
3233

3334
v8::V8::Initialize();
35+
36+
// Disable absl deadlock detection in V8 as it reports false-positive cases.
37+
// TODO(legendecas): Replace this global disablement with case suppressions.
38+
// https://github.com/nodejs/node-v8/issues/301
39+
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
3440
}
3541

3642
void NodeTestEnvironment::TearDown() {

tools/v8_gypfiles/abseil.gyp

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@
267267
'<(ABSEIL_ROOT)/absl/synchronization/internal/waiter.h',
268268
'<(ABSEIL_ROOT)/absl/synchronization/internal/waiter_base.h',
269269
'<(ABSEIL_ROOT)/absl/synchronization/internal/waiter_base.cc',
270+
'<(ABSEIL_ROOT)/absl/synchronization/internal/win32_waiter.h',
271+
'<(ABSEIL_ROOT)/absl/synchronization/internal/win32_waiter.cc',
270272
'<(ABSEIL_ROOT)/absl/synchronization/mutex.h',
271273
'<(ABSEIL_ROOT)/absl/synchronization/mutex.cc',
272274
'<(ABSEIL_ROOT)/absl/time/civil_time.h',

0 commit comments

Comments
 (0)