zig icon indicating copy to clipboard operation
zig copied to clipboard

`zig cc` aborts randomly (in Clang code) on CI machines

Open alexrp opened this issue 3 months ago • 6 comments

test
+- test-standalone
   +- standalone_test_cases
      +- standalone_test_cases.tsan
         +- install tsan_linux_loongarch64
            +- compile exe tsan_linux_loongarch64 Debug loongarch64-linux failure
error: Program aborted due to an unhandled Error:
No such file or directory
error: the following command terminated unexpectedly:
/home/ci/.cache/act/b15cca0a2e938b9b/hostexecutor/build-debug/stage3-debug/bin/zig build-exe -fsanitize-thread -ODebug -target loongarch64-linux -mcpu baseline -Mroot=/home/ci/.cache/act/b15cca0a2e938b9b/hostexecutor/test/standalone/tsan/main.zig --cache-dir /home/ci/.cache/act/b15cca0a2e938b9b/hostexecutor/zig-local-cache --global-cache-dir /home/ci/.cache/act/b15cca0a2e938b9b/hostexecutor/zig-global-cache --name tsan_linux_loongarch64 -L /home/ci/deps/zig+llvm+lld+clang-x86_64-freebsd-none-0.16.0-dev.312+164c598cd/lib -I /home/ci/deps/zig+llvm+lld+clang-x86_64-freebsd-none-0.16.0-dev.312+164c598cd/include --zig-lib-dir /home/ci/.cache/act/b15cca0a2e938b9b/hostexecutor/lib/ --listen=-

I've seen this both on Linux and FreeBSD CI. The particular target of the compiled executable doesn't seem to matter.

I'll disable this test for now, but we should probably try to get to the bottom of this. I can't repro it locally though.

alexrp avatar Oct 05 '25 00:10 alexrp

cc @Rexicon226 (#24734)

alexrp avatar Oct 05 '25 00:10 alexrp

I would be very interested to know what it is even trying to open. If anyone is able to repro this with strace or something, that would be big.

Rexicon226 avatar Oct 05 '25 00:10 Rexicon226

FWIW, that error appears to come from LLVM:

❯ git grep "Program aborted due to an unhandled Error"
• llvm/lib/Support/Error.cpp
129:14:  dbgs() << "Program aborted due to an unhandled Error:\n";

• llvm/unittests/ADT/FallibleIteratorTest.cpp
184:8:      "Program aborted due to an unhandled Error:")

• llvm/unittests/Support/ErrorTest.cpp
111:17:               "Program aborted due to an unhandled Error:")
137:17:               "Program aborted due to an unhandled Error:")
152:17:               "Program aborted due to an unhandled Error:")

I'm thinking maybe from LLD...?

alexrp avatar Oct 05 '25 00:10 alexrp

May not be limited to this particular test, actually:

test
+- test-link
   +- link_test_cases
      +- test-elf
         +- test-elf-linking-cpp-x86_64-linux-musl-Debug-llvm-no-lld
            +- run exe test
               +- compile exe test Debug x86_64-linux-musl failure
error: Program aborted due to an unhandled Error:
No such file or directory
error: the following command terminated unexpectedly:
/home/ci/.cache/act/05ae1cbf0483039d/hostexecutor/build-debug/stage3-debug/bin/zig build-exe -fllvm -fno-lld /home/ci/.cache/act/05ae1cbf0483039d/hostexecutor/zig-local-cache/o/fc8f59feae6b2efc14764ab42ab03cf0/a.cpp -ODebug -target x86_64-linux-musl -mcpu baseline -Mroot -lc++ -lc --cache-dir /home/ci/.cache/act/05ae1cbf0483039d/hostexecutor/zig-local-cache --global-cache-dir /home/ci/.cache/act/05ae1cbf0483039d/hostexecutor/zig-global-cache --name test -L /home/ci/deps/zig+llvm+lld+clang-aarch64-linux-musl-0.16.0-dev.104+689461e31/lib -I /home/ci/deps/zig+llvm+lld+clang-aarch64-linux-musl-0.16.0-dev.104+689461e31/include --zig-lib-dir /home/ci/.cache/act/05ae1cbf0483039d/hostexecutor/lib/ --listen=-

This suggests to me that the error is coming from Clang.

alexrp avatar Oct 18 '25 09:10 alexrp

test
mq test-incremental
   mq incr-check 'change_fn_type' failure
error: update 'initial version': zig cc stderr:
Program aborted due to an unhandled Error:
No such file or directory
error: update 'initial version': zig cc for '.local-cache/o/2fb8215b6691b4d9e1f0bf3cbf8d0945/root.c' terminated unexpectedly
error: process exited with code 1 (expected exited with code 0)
failed command: /home/ci/.cache/act/3d7118ab91192faf/hostexecutor/zig-local-cache/o/516279c3a8e97f2a06ba53538d8f9276/incr-check /home/ci/.cache/act/3d7118ab91192faf/hostexecutor/build-release/stage3-release/bin/zig /home/ci/.cache/act/3d7118ab91192faf/hostexecutor/test/incremental/change_fn_type --zig-lib-dir /home/ci/.cache/act/3d7118ab91192faf/hostexecutor/lib/

alexrp avatar Nov 19 '25 08:11 alexrp

test
mq test-standalone
   mq standalone_test_cases
      mq standalone_test_cases.coff_dwarf
         mq run exe main
            mq compile exe main Debug native-windows
               mq compile lib shared_lib Debug native-windows failure
error: Program aborted due to an unhandled Error:
       No such file or directory
       
error: process terminated unexpectedly
failed command: /home/ci/.cache/act/2d0d7783bae9d413/hostexecutor/build-release/stage3-release/bin/zig build-lib -cflags -gdwarf -- /home/ci/.cache/act/2d0d7783bae9d413/hostexecutor/test/standalone/coff_dwarf/shared_lib.c -ODebug -target native-windows -mcpu native -Mroot -lc -femit-implib --cache-dir /home/ci/.cache/act/2d0d7783bae9d413/hostexecutor/zig-local-cache --global-cache-dir /home/ci/.cache/act/2d0d7783bae9d413/hostexecutor/zig-global-cache --name shared_lib -dynamic -L /home/ci/deps/zig+llvm+lld+clang-x86_64-freebsd-none-0.16.0-dev.312+164c598cd/lib -I /home/ci/deps/zig+llvm+lld+clang-x86_64-freebsd-none-0.16.0-dev.312+164c598cd/include --zig-lib-dir /home/ci/.cache/act/2d0d7783bae9d413/hostexecutor/lib/ --listen=-

alexrp avatar Nov 22 '25 18:11 alexrp