You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test-code-cache fails on a Linux/riscv64 build with FFI enabled. #64717
Running the parallel/test-code-cache test on a build with FFI enabled. This is spun out from the comment in nodejs/build#4099 (comment)
As background FFI was first able to be enabled after #63794 and superceded by the update in #64040 which included the upstream fix.
How often does it reproduce? Is there a required condition?
Seems to be 100%
What is the expected behavior? Why is that the expected behavior?
Test passes.
What do you see instead?
Here are the first fiew lines of failures - the lines towards the end are replicated with different module names (i.e. it's not just internal/streams for example assert and net are included in these lines int he full log:
Path: parallel/test-code-cache
node:internal/assert/utils:146
throw error;
^
AssertionError [ERR_ASSERTION]: "internal/abort_controller" should've been compiled **with** code cache
"internal/streams/end-of-stream" should've been compiled **with** code cache
"internal/streams/operators" should've been compiled **with** code cache
"internal/streams/destroy" should've been compiled **with** code cache
"internal/streams/legacy" should've been compiled **with** code cache
"internal/streams/add-abort-signal" should've been compiled **with** code cache
[...]
@nodejs/ffi @joyeecheung i haven't gone digging yet but would any of you have any idea why enabling FFI in the build might be breaking this test? I'm assuming this hasn't been spotted on any other platform so far and really is specific to Linux/riscv64.
Which means the parallel/test-code-cache problem seems to be the one remaining that will need addressing. Noting that node -pe 'process.config.variables.node_use_node_code_cache' returns true on the native builds but false on the unofficial (cross-compiled) builds so those pass. It looks like it started failing when the FFI support was added, and I've confirmed (sample size of 1!) that building with --without-ffi seems to allow that test to pass. We need to understand why this might only be affecting RISC-V so I'll split out another issue to cover this failure.
Hmm, I didn't encounter this test failure with a native build on SG2042.
./node -pe 'process.config.variables.node_use_node_code_cache'
true
<]$ out/Release/node test/parallel/test-code-cache.js
NOTE: The test started as a child_process using these flags: [ '--expose-internals' ] And these environment variables: {} Use NODE_SKIP_FLAG_CHECK to run the test with the original flags.
(node:1603257) internal/test/binding: These APIs are for internal testing only. Do not use them.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1603257) internal/test/transfer: These APIs are for internal testing only. Do not use them.
(node:1603257) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
[kxxt@centiskorch node-riscv]$ echo $?
0
[kxxt@centiskorch node-riscv]$ ./node --experimental-ffi -e "require('node:ffi');console.log('ffi is enabled')"
ffi is enabled
(node:1603620) ExperimentalWarning: FFI is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
would any of you have any idea why enabling FFI in the build might be breaking this test?
The last time I encounter such weird issues is that configuring node.js with --shared broke some tests on riscv64. But it later turned out to be a mis-compilation done by GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116057). Maybe it is worthwhile to check the compiler version and if you could reproduce it with clang.
Thanks for confirming - most of the stuff I'm doing at the moment is with Bianbu's clang22 and yeah it's looking quite likely that it's specific to that compiler. I've just checked with a v26 build produced with clang-21 on another machine that doesn't seem to show the problem.
I'll give it a shot with clang-21 from the Bianbu since that version seems to be available in their repos.
OK looks like the test passes when it's built with clang-21 on the same machine so there's something in clang-22 that's breaking this. <<< Incorrect - I misread the logs unfortunately due to the failure not showing where I expected. It doesn't seem to be a problem with clang-22 on x64 (tested with the version in the Fedora44 repositories in a container).
Activity
sxa commentedon Jul 24, 2026
@nodejs/ffi @joyeecheung i haven't gone digging yet but would any of you have any idea why enabling FFI in the build might be breaking this test? I'm assuming this hasn't been spotted on any other platform so far and really is specific to Linux/riscv64.
kxxt commentedon Jul 25, 2026
Hmm, I didn't encounter this test failure with a native build on SG2042.
Test logs available at https://github.com/riscv-forks/node-riscv/actions/runs/30152090741/job/89671914200.
kxxt commentedon Jul 25, 2026
The last time I encounter such weird issues is that configuring node.js with
--sharedbroke some tests on riscv64. But it later turned out to be a mis-compilation done by GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116057). Maybe it is worthwhile to check the compiler version and if you could reproduce it with clang.sxa commentedon Jul 27, 2026
Thanks for confirming - most of the stuff I'm doing at the moment is with Bianbu's clang22 and yeah it's looking quite likely that it's specific to that compiler. I've just checked with a v26 build produced with clang-21 on another machine that doesn't seem to show the problem.
I'll give it a shot with clang-21 from the Bianbu since that version seems to be available in their repos.
sxa commentedon Jul 27, 2026
OK looks like the test passes when it's built with clang-21 on the same machine so there's something in clang-22 that's breaking this. <<< Incorrect - I misread the logs unfortunately due to the failure not showing where I expected. It doesn't seem to be a problem with clang-22 on x64 (tested with the version in the Fedora44 repositories in a container).I'll try and see if it will build with
gcc...sxa commentedon Aug 4, 2026
Seems to pass ok with Node 26 built with gcc 15 🤔