Skip to content

Commit ee5f46a

Browse files
committed
src: disable abseil deadlock detection
Abseil deadlock detection is reporting false positives in tests. Disable it for now. PR-URL: nodejs#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 717eb8d commit ee5f46a

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
@@ -840,6 +840,7 @@
840840
'deps/googletest/googletest.gyp:gtest_prod',
841841
'deps/histogram/histogram.gyp:histogram',
842842
'deps/nbytes/nbytes.gyp:nbytes',
843+
'tools/v8_gypfiles/abseil.gyp:abseil',
843844
'node_js2c#host',
844845
],
845846

@@ -1162,6 +1163,7 @@
11621163
'deps/googletest/googletest.gyp:gtest_main',
11631164
'deps/histogram/histogram.gyp:histogram',
11641165
'deps/nbytes/nbytes.gyp:nbytes',
1166+
'tools/v8_gypfiles/abseil.gyp:abseil',
11651167
],
11661168

11671169
'includes': [

src/node.cc

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

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

124126
#include <cerrno>
@@ -1258,6 +1260,11 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
12581260

12591261
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
12601262
V8::Initialize();
1263+
1264+
// Disable absl deadlock detection in V8 as it reports false-positive cases.
1265+
// TODO(legendecas): Replace this global disablement with case suppressions.
1266+
// https://github.com/nodejs/node-v8/issues/301
1267+
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
12611268
}
12621269

12631270
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)