Skip to content

Commit 7b76d54

Browse files
committed
test: fix DebugSymbolsTest.ReqWrapList on PPC64LE
Currently, DebugSymbolsTest.ReqWrapList fails on PPC64LE when Node has been configured with Link Time Optimization (LTO) and using RHEL 8.5 and gcc: ```console $ . /opt/rh/gcc-toolset-11/enable $ export CC='ccache gcc' $ export CXX='ccache g++' $ ./configure --enable-lto $ make -j8 cctest ... 21:52:27 [ RUN ] DebugSymbolsTest.ReqWrapList 21:52:27 ../test/cctest/test_node_postmortem_metadata.cc:203: Failure 21:52:27 Expected equality of these values: 21:52:27 expected 21:52:27 Which is: 140736537072320 21:52:27 calculated 21:52:27 Which is: 1099680328560 21:52:27 [ FAILED ] DebugSymbolsTest.ReqWrapList (43 ms) ``` After looking into this is seems that the compiler is tampering with the `last` variable when compiling with LTO enabled. This commit suggests adding volatile to this variable to prevent the compiler from tampering with it.
1 parent cfdc713 commit 7b76d54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/cctest/test_node_postmortem_metadata.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ TEST_F(DebugSymbolsTest, ReqWrapList) {
194194
// ARM64 CI machinies.
195195
for (auto it : *(*env)->req_wrap_queue()) (void) ⁢
196196

197-
auto last = tail + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
197+
volatile uintptr_t last =
198+
tail + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
198199
last = *reinterpret_cast<uintptr_t*>(last);
199200

200201
auto expected = reinterpret_cast<uintptr_t>(&obj);

0 commit comments

Comments
 (0)