[flang-commits] [flang] [flang] Avoid undefined behaviour when parsing format expressions (PR #147539)
LLVM Continuous Integration via flang-commits
flang-commits at lists.llvm.org
Wed Jul 9 07:40:42 PDT 2025
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `amdgpu-offload-rhel-8-cmake-build-only` running on `rocm-docker-rhel-8` while building `flang` at step 4 "annotate".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/14933
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[37/49] Linking CXX shared library /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libomptarget.so.21.0git
[38/49] Creating library symlink /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libomptarget.so
[39/49] Linking CXX shared library /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libLLVMOffload.so.21.0git
[40/49] Creating library symlink /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libLLVMOffload.so
[41/49] Generating /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/compile_commands.json
[42/49] Linking CXX executable /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/llvm-offload-device-info
[43/49] Linking CXX executable /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/llvm-omp-kernel-replay
[44/49] Building LLVM bitcode Workshare.cpp-amdgpu.o
[45/49] Building LLVM bitcode Parallelism.cpp-amdgpu.o
[46/49] Building CXX object flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o
FAILED: flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/../flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins/flang-rt -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 -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -UNDEBUG -fno-lto -fno-exceptions -fno-rtti -funwind-tables -fno-asynchronous-unwind-tables -U_GLIBCXX_ASSERTIONS -U_LIBCPP_ENABLE_ASSERTIONS -MD -MT flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o -MF flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o.d -o flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/lib/runtime/format.cpp
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/lib/runtime/format.cpp:9:
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/include/flang-rt/runtime/format-implementation.h:18:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Common/format.h:14:10: fatal error: 'llvm/Support/MathExtras.h' file not found
14 | #include "llvm/Support/MathExtras.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[47/49] Linking CXX executable /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libomptarget-amdgpu.bc
clang++: warning: joined argument expects additional value: '-mcpu=' [-Wunused-command-line-argument]
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-stamps/runtimes-build
cd /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 50, in step
yield
File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 41, in main
run_command(["ninja"])
File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 63, in run_command
util.report_run_cmd(cmd, cwd=directory)
File "/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
subprocess.check_call(cmd, shell=shell, *args, **kwargs)
File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
Step 7 (build cmake config) failure: build cmake config (failure)
...
[37/49] Linking CXX shared library /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libomptarget.so.21.0git
[38/49] Creating library symlink /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libomptarget.so
[39/49] Linking CXX shared library /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libLLVMOffload.so.21.0git
[40/49] Creating library symlink /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libLLVMOffload.so
[41/49] Generating /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/compile_commands.json
[42/49] Linking CXX executable /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/llvm-offload-device-info
[43/49] Linking CXX executable /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/llvm-omp-kernel-replay
[44/49] Building LLVM bitcode Workshare.cpp-amdgpu.o
[45/49] Building LLVM bitcode Parallelism.cpp-amdgpu.o
[46/49] Building CXX object flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o
FAILED: flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/../flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins/flang-rt -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 -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -UNDEBUG -fno-lto -fno-exceptions -fno-rtti -funwind-tables -fno-asynchronous-unwind-tables -U_GLIBCXX_ASSERTIONS -U_LIBCPP_ENABLE_ASSERTIONS -MD -MT flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o -MF flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o.d -o flang-rt/lib/runtime/CMakeFiles/flang_rt.runtime.static.dir/format.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/lib/runtime/format.cpp
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/lib/runtime/format.cpp:9:
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/include/flang-rt/runtime/format-implementation.h:18:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Common/format.h:14:10: fatal error: 'llvm/Support/MathExtras.h' file not found
14 | #include "llvm/Support/MathExtras.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[47/49] Linking CXX executable /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib/libomptarget-amdgpu.bc
clang++: warning: joined argument expects additional value: '-mcpu=' [-Wunused-command-line-argument]
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-stamps/runtimes-build
cd /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 50, in step
yield
File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 41, in main
run_command(["ninja"])
File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 63, in run_command
util.report_run_cmd(cmd, cwd=directory)
File "/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
subprocess.check_call(cmd, shell=shell, *args, **kwargs)
File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
program finished with exit code 0
elapsedTime=393.671125
```
</details>
https://github.com/llvm/llvm-project/pull/147539
More information about the flang-commits
mailing list