Skip to content

Commit a3ad331

Browse files
legendecasRafaelGSS
authored andcommitted
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 <yagiz@nizipli.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 310ccb5 commit a3ad331

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

node.gyp

Lines changed: 2 additions & 0 deletions
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

Lines changed: 7 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy