Skip to content

Commit 78af51c

Browse files
authored
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 3db5491 commit 78af51c

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
@@ -834,6 +834,7 @@
834834
'deps/googletest/googletest.gyp:gtest_prod',
835835
'deps/histogram/histogram.gyp:histogram',
836836
'deps/nbytes/nbytes.gyp:nbytes',
837+
'tools/v8_gypfiles/abseil.gyp:abseil',
837838
'node_js2c#host',
838839
],
839840

@@ -1159,6 +1160,7 @@
11591160
'deps/googletest/googletest.gyp:gtest_main',
11601161
'deps/histogram/histogram.gyp:histogram',
11611162
'deps/nbytes/nbytes.gyp:nbytes',
1163+
'tools/v8_gypfiles/abseil.gyp:abseil',
11621164
],
11631165

11641166
'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>
@@ -1211,6 +1213,11 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
12111213

12121214
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
12131215
V8::Initialize();
1216+
1217+
// Disable absl deadlock detection in V8 as it reports false-positive cases.
1218+
// TODO(legendecas): Replace this global disablement with case suppressions.
1219+
// https://github.com/nodejs/node-v8/issues/301
1220+
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
12141221
}
12151222

12161223
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
@@ -277,6 +277,8 @@
277277
'<(ABSEIL_ROOT)/absl/synchronization/internal/waiter.h',
278278
'<(ABSEIL_ROOT)/absl/synchronization/internal/waiter_base.h',
279279
'<(ABSEIL_ROOT)/absl/synchronization/internal/waiter_base.cc',
280+
'<(ABSEIL_ROOT)/absl/synchronization/internal/win32_waiter.h',
281+
'<(ABSEIL_ROOT)/absl/synchronization/internal/win32_waiter.cc',
280282
'<(ABSEIL_ROOT)/absl/synchronization/mutex.h',
281283
'<(ABSEIL_ROOT)/absl/synchronization/mutex.cc',
282284
'<(ABSEIL_ROOT)/absl/time/civil_time.h',

0 commit comments

Comments
 (0)