[clang] [analyzer] Remove some false negatives in StackAddrEscapeChecker (PR #125638)
LLVM Continuous Integration via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 10 14:23:19 PST 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 `clang` at step 4 "annotate".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/431
<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)
...
[6519/7633] Creating library symlink lib/libCUFAttrs.so
[6520/7633] Building CXX object tools/lld/Common/CMakeFiles/lldCommon.dir/Version.cpp.o
[6521/7633] Linking CXX shared library lib/libMLIRExecutionEngineUtils.so.21.0git
[6522/7633] Linking CXX shared library lib/libMLIRCAPITarget.so.21.0git
[6523/7633] Creating library symlink lib/libMLIRExecutionEngineUtils.so
[6524/7633] Creating library symlink lib/libMLIRCAPITarget.so
[6525/7633] Linking CXX shared library lib/libMLIRLLVMTestPasses.so.21.0git
[6526/7633] Creating library symlink lib/libMLIRLLVMTestPasses.so
[6527/7633] Linking CXX executable bin/llvm-extract
[6528/7633] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o
FAILED: tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o
ccache /usr/bin/c++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -std=c++17 -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o -MF tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o.d -o tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:28: error: declaration of ‘const clang::StackFrameContext* FindStackRegionsSymbolVisitor::StackFrameContext’ [-fpermissive]
const StackFrameContext *StackFrameContext;
^~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Analysis/ProgramPoint.h:17,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: error: changes meaning of ‘StackFrameContext’ from ‘class clang::StackFrameContext’ [-fpermissive]
class StackFrameContext : public LocationContext {
^~~~~~~~~~~~~~~~~
[6529/7633] Linking CXX shared library lib/libMLIRCAPISparseTensor.so.21.0git
[6530/7633] Linking CXX shared library lib/liblldCommon.so.21.0git
[6531/7633] Linking CXX shared library lib/libLLVMGlobalISel.so.21.0git
[6532/7633] Linking CXX shared library lib/libMLIRSparseTensorTransformOps.so.21.0git
[6533/7633] Linking CXX shared library lib/libMLIRTargetLLVM.so.21.0git
[6534/7633] Linking CXX shared library lib/libLLVMOrcJIT.so.21.0git
[6535/7633] Linking CXX shared library lib/libclangAST.so.21.0git
[6536/7633] Linking CXX shared library lib/libMLIRTestDialect.so.21.0git
[6537/7633] Building AMDGPUGenAsmWriter.inc...
[6538/7633] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
In file included from /usr/include/c++/8/cassert:44,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:39,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h:16,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h:18,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/lib/LTO/LTO.cpp:56:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:968:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
~~~~~~~~~~~^~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:977:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
~~~~~~~~~~~^~~~~~~~~~~~
[6539/7633] Building AMDGPUGenAsmMatcher.inc...
[6540/7633] Building AMDGPUGenGlobalISel.inc...
[6541/7633] Building AMDGPUGenDAGISel.inc...
[6542/7633] Linking CXX shared library lib/libFortranEvaluate.so.21.0git
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6519/7633] Creating library symlink lib/libCUFAttrs.so
[6520/7633] Building CXX object tools/lld/Common/CMakeFiles/lldCommon.dir/Version.cpp.o
[6521/7633] Linking CXX shared library lib/libMLIRExecutionEngineUtils.so.21.0git
[6522/7633] Linking CXX shared library lib/libMLIRCAPITarget.so.21.0git
[6523/7633] Creating library symlink lib/libMLIRExecutionEngineUtils.so
[6524/7633] Creating library symlink lib/libMLIRCAPITarget.so
[6525/7633] Linking CXX shared library lib/libMLIRLLVMTestPasses.so.21.0git
[6526/7633] Creating library symlink lib/libMLIRLLVMTestPasses.so
[6527/7633] Linking CXX executable bin/llvm-extract
[6528/7633] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o
FAILED: tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o
ccache /usr/bin/c++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -std=c++17 -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o -MF tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o.d -o tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/StackAddrEscapeChecker.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:28: error: declaration of ‘const clang::StackFrameContext* FindStackRegionsSymbolVisitor::StackFrameContext’ [-fpermissive]
const StackFrameContext *StackFrameContext;
^~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Analysis/ProgramPoint.h:17,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: error: changes meaning of ‘StackFrameContext’ from ‘class clang::StackFrameContext’ [-fpermissive]
class StackFrameContext : public LocationContext {
^~~~~~~~~~~~~~~~~
[6529/7633] Linking CXX shared library lib/libMLIRCAPISparseTensor.so.21.0git
[6530/7633] Linking CXX shared library lib/liblldCommon.so.21.0git
[6531/7633] Linking CXX shared library lib/libLLVMGlobalISel.so.21.0git
[6532/7633] Linking CXX shared library lib/libMLIRSparseTensorTransformOps.so.21.0git
[6533/7633] Linking CXX shared library lib/libMLIRTargetLLVM.so.21.0git
[6534/7633] Linking CXX shared library lib/libLLVMOrcJIT.so.21.0git
[6535/7633] Linking CXX shared library lib/libclangAST.so.21.0git
[6536/7633] Linking CXX shared library lib/libMLIRTestDialect.so.21.0git
[6537/7633] Building AMDGPUGenAsmWriter.inc...
[6538/7633] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
In file included from /usr/include/c++/8/cassert:44,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:39,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h:16,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h:18,
from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/lib/LTO/LTO.cpp:56:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:968:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
~~~~~~~~~~~^~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:977:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
~~~~~~~~~~~^~~~~~~~~~~~
[6539/7633] Building AMDGPUGenAsmMatcher.inc...
[6540/7633] Building AMDGPUGenGlobalISel.inc...
[6541/7633] Building AMDGPUGenDAGISel.inc...
[6542/7633] Linking CXX shared library lib/libFortranEvaluate.so.21.0git
```
</details>
https://github.com/llvm/llvm-project/pull/125638
More information about the cfe-commits
mailing list