[libc-commits] [libc] [libc] Add printf error handling (PR #162876)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Mon Nov 3 11:45:50 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `libc` at step 6 "test-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/16589

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 6 (test-openmp) failure: test (failure)
******************** TEST 'libarcher :: races/critical-unrelated.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 13
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang -fopenmp  -gdwarf-4 -O1 -fsanitize=thread  -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src   /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp -latomic && env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/deflake.bash /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp 2>&1 | tee /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp.log | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang -fopenmp -gdwarf-4 -O1 -fsanitize=thread -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp -latomic
# note: command had no output on stdout or stderr
# executed command: env TSAN_OPTIONS=ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1 /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/deflake.bash /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp
# note: command had no output on stdout or stderr
# executed command: tee /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp.log
# note: command had no output on stdout or stderr
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c
# note: command had no output on stdout or stderr
# RUN: at line 14
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang -fopenmp  -gdwarf-4 -O1 -fsanitize=thread  -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src   /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp -latomic && env ARCHER_OPTIONS="ignore_serial=1 report_data_leak=1" env TSAN_OPTIONS='ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1' /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/deflake.bash /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp 2>&1 | tee /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp.log | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang -fopenmp -gdwarf-4 -O1 -fsanitize=thread -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp -latomic
# note: command had no output on stdout or stderr
# executed command: env 'ARCHER_OPTIONS=ignore_serial=1 report_data_leak=1' env TSAN_OPTIONS=ignore_noninstrumented_modules=0:ignore_noninstrumented_modules=1 /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/deflake.bash /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp
# note: command had no output on stdout or stderr
# executed command: tee /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/tools/archer/tests/races/Output/critical-unrelated.c.tmp.log
# note: command had no output on stdout or stderr
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c
# .---command stderr------------
# | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c:41:11: error: CHECK: expected string not found in input
# | // CHECK: ThreadSanitizer: reported {{[1-7]}} warnings
# |           ^
# | <stdin>:23:5: note: scanning from here
# | DONE
# |     ^
# | <stdin>:24:1: note: possible intended match here
# | ThreadSanitizer: thread T4 finished with ignores enabled, created at:
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            18:  #0 pthread_create /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1078:3 (critical-unrelated.c.tmp+0xa40aa) 
# |            19:  #1 __kmp_create_worker z_Linux_util.cpp (libomp.so+0xcbad2) 
# |            20:  
# |            21: SUMMARY: ThreadSanitizer: data race /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/tools/archer/tests/races/critical-unrelated.c:29:8 in main.omp_outlined_debug__ 
# |            22: ================== 
...
Step 10 (Add check check-libc-amdgcn-amd-amdhsa) failure: test (failure)
...
[1654/3299] Building CXX object libc/test/src/stdbit/CMakeFiles/libc.test.src.stdbit.stdc_bit_ceil_uc_test.__hermetic__.__build__.dir/stdc_bit_ceil_uc_test.cpp.o
[1655/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.f16add_test.__hermetic__.__build__.dir/f16add_test.cpp.o
[1656/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.f16subf_test.__hermetic__.__build__.dir/f16subf_test.cpp.o
[1657/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strcspn_test.__hermetic__.libc.a
[1658/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strdup_test.__hermetic__.libc.a
[1659/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strerror_test.__hermetic__.libc.a
[1660/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strlcat_test.__hermetic__.libc.a
[1661/3299] Building CXX object libc/test/src/stdbit/CMakeFiles/libc.test.src.stdbit.stdc_bit_ceil_ui_test.__hermetic__.__build__.dir/stdc_bit_ceil_ui_test.cpp.o
[1662/3299] Building CXX object libc/test/src/stdbit/CMakeFiles/libc.test.src.stdbit.stdc_bit_ceil_ul_test.__hermetic__.__build__.dir/stdc_bit_ceil_ul_test.cpp.o
[1663/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.snprintf_test.__hermetic__.__build__.dir/snprintf_test.cpp.o
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.snprintf_test.__hermetic__.__build__.dir/snprintf_test.cpp.o 
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_22_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc -isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/include/amdgcn-amd-amdhsa -fPIC -fno-semantic-interposition -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 -ffunction-sections -fdata-sections -O3 -DNDEBUG -UNDEBUG --target=amdgcn-amd-amdhsa -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fno-math-errno -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SHARED -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_SINGLE -DLIBC_TARGET_OS_IS_GPU -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wall -Wextra -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -DLIBC_TEST=HERMETIC -Wno-multi-gpu -nogpulib -mcpu=native -flto -mcode-object-version=6 -MD -MT libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.snprintf_test.__hermetic__.__build__.dir/snprintf_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.snprintf_test.__hermetic__.__build__.dir/snprintf_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.snprintf_test.__hermetic__.__build__.dir/snprintf_test.cpp.o -c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/stdio/snprintf_test.cpp
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/stdio/snprintf_test.cpp:75:19: error: use of undeclared identifier 'EOVERFLOW'
   75 |   ASSERT_ERRNO_EQ(EOVERFLOW);
      |                   ^~~~~~~~~
1 error generated.
[1664/3299] Building CXX object libc/test/src/stdbit/CMakeFiles/libc.test.src.stdbit.stdc_bit_ceil_us_test.__hermetic__.__build__.dir/stdc_bit_ceil_us_test.cpp.o
[1665/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strncat_test.__hermetic__.libc.a
[1666/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strlen_test.__hermetic__.libc.a
[1667/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strlcpy_test.__hermetic__.libc.a
[1668/3299] Building CXX object libc/test/src/stdbit/CMakeFiles/libc.test.src.stdbit.stdc_bit_ceil_ull_test.__hermetic__.__build__.dir/stdc_bit_ceil_ull_test.cpp.o
[1669/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strncpy_test.__hermetic__.libc.a
[1670/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strncmp_test.__hermetic__.libc.a
[1671/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.f16div_test.__hermetic__.__build__.dir/f16div_test.cpp.o
[1672/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.asprintf_test.__hermetic__.__build__.dir/asprintf_test.cpp.o
[1673/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strnlen_test.__hermetic__.libc.a
[1674/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.f16addl_test.__hermetic__.__build__.dir/f16addl_test.cpp.o
[1675/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.ungetc_test.__hermetic__.__build__.dir/ungetc_test.cpp.o
[1676/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strndup_test.__hermetic__.libc.a
[1677/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strpbrk_test.__hermetic__.libc.a
[1678/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.printf_test.__hermetic__.__build__.dir/printf_test.cpp.o
[1679/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strrchr_test.__hermetic__.libc.a
[1680/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strsep_test.__hermetic__.libc.a
[1681/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strspn_test.__hermetic__.libc.a
[1682/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.f16divf_test.__hermetic__.__build__.dir/f16divf_test.cpp.o
[1683/3299] Linking CXX static library libc/test/src/string/liblibc.test.src.string.strstr_test.__hermetic__.libc.a
[1684/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.vprintf_test.__hermetic__.__build__.dir/vprintf_test.cpp.o
[1685/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.ufromfpbf16_test.__hermetic__.__build__.dir/ufromfpbf16_test.cpp.o
[1686/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fputs_test.__hermetic__.__build__.dir/fputs_test.cpp.o
[1687/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.f16divl_test.__hermetic__.__build__.dir/f16divl_test.cpp.o
[1688/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.vasprintf_test.__hermetic__.__build__.dir/vasprintf_test.cpp.o
[1689/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.fsubl_test.__hermetic__.__build__.dir/fsubl_test.cpp.o
[1690/3299] Building CXX object libc/test/src/math/smoke/CMakeFiles/libc.test.src.math.smoke.getpayloadbf16_test.__hermetic__.__build__.dir/getpayloadbf16_test.cpp.o
[1691/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.vsnprintf_test.__hermetic__.__build__.dir/vsnprintf_test.cpp.o
[1692/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.puts_test.__hermetic__.__build__.dir/puts_test.cpp.o
[1693/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.putc_test.__hermetic__.__build__.dir/putc_test.cpp.o
[1694/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.vsscanf_test.__hermetic__.__build__.dir/vsscanf_test.cpp.o
[1695/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fputc_test.__hermetic__.__build__.dir/fputc_test.cpp.o
[1696/3299] Building CXX object libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fprintf_test.__hermetic__.__build__.dir/fprintf_test.cpp.o

```

</details>

https://github.com/llvm/llvm-project/pull/162876


More information about the libc-commits mailing list