llvm / llvm/llvm-project

[libc][math] Flaky CI

Open
#218,253 1 comment 0 reactions 0 assignees View on GitHub
libc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Occurring in:
#209406
https://lab.llvm.org/buildbot/#/builders/196/builds/23162

```sh
-- Skipping integration test libc.test.integration.src.sys.sem.sem_test as it has missing deps: libc.src.sys.sem.semctllibc.src.sys.sem.semgetlibc.src.sys.sem.semop.
-- Skipping integration test libc.test.integration.src.ucontext.ucontext_test as it has missing deps: libc.src.ucontext.getcontextlibc.src.ucontext.setcontext.
-- Skipping fuzzer target libc.fuzzing.math.f16sqrt_fuzz as it has missing deps: libc.src.math.f16sqrt.
-- Configuring done (5.8s)
-- Generating done (25.5s)
-- Build files have been written to: /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/2] Building CXX object libc/src/stdlib/linux/CMakeFiles/libc.src.stdlib.linux.system.dir/system.cpp.o
FAILED: libc/src/stdlib/linux/CMakeFiles/libc.src.stdlib.linux.system.dir/system.cpp.o
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -isystem /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/include -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Xclang -fno-pch-timestamp -g -std=gnu++17 --target=riscv32-unknown-linux-gnu -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_COPT_MEMCPY_X86_USE_NTA_STORES -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_COPT_HARDENING_MODE=LIBC_HARDENING_MODE_NONE -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter=/usr/include -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -fstack-protector-strong -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COMPILER_HAS_STDC_FENV_ACCESS -DLIBC_COPT_PUBLIC_PACKAGING -DLIBC_COPT_RWLOCK_DEFAULT_SPIN_COUNT=100 -MD -MT libc/src/stdlib/linux/CMakeFiles/libc.src.stdlib.linux.system.dir/system.cpp.o -MF libc/src/stdlib/linux/CMakeFiles/libc.src.stdlib.linux.system.dir/system.cpp.o.d -o libc/src/stdlib/linux/CMakeFiles/libc.src.stdlib.linux.system.dir/system.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/stdlib/linux/system.cpp
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/stdlib/linux/system.cpp:24:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/OSUtil/linux/syscall_wrappers/wait4.h:30:33: error: use of undeclared identifier 'SYS_wait4'
30 | return syscall_checked(SYS_wait4, pid, wstatus, options, rusage);
| ^
1 error generated.
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
File "/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 181, in step
yield
File "/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 143, in main
run_command(['ninja', 'libc'])
File "/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 196, in run_command
util.report_run_cmd(cmd, cwd=directory)
File "/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
subprocess.check_call(cmd, shell=shell, *args, **kwargs)
File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
@@@BUILD_STEP build libc-startup@@@
Running: ninja libc-startup
ninja: no work to do.
@@@BUILD_STEP libc-unit-tests@@@
Running: ninja libc-unit-tests
ninja: no work to do.
program finished with exit code 0
elapsedTime=33.794772
```

Contributor guide

Open the contributing guide

Research direction

Start with libc/src/__support/OSUtil/linux/syscall_wrappers/wait4.h and libc/src/stdlib/linux/system.cpp, then inspect the failing RISC-V build linked in the issue. Reproduce the ninja libc step or review the target’s syscall definitions. Done means the RISC-V CI build completes without the SYS_wait4 error and the reported failure no longer recurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
ci-cd, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.