[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:22:36 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime` running on `omp-vega20-0` while building `clang` at step 5 "compile-openmp".

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

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

```
Step 5 (compile-openmp) failure: build (failure)
...
40.753 [554/13/3791] Linking CXX executable bin/llvm-exegesis
41.177 [554/12/3792] Building AMDGPUGenAsmWriter.inc...
41.530 [554/11/3793] Linking CXX executable bin/clang-diff
42.128 [554/10/3794] Linking CXX executable bin/clang-refactor
42.204 [554/9/3795] Linking CXX executable bin/clang-installapi
42.775 [554/8/3796] Building AMDGPUGenGlobalISel.inc...
43.439 [554/7/3797] Building AMDGPUGenAsmMatcher.inc...
43.712 [554/6/3798] Building AMDGPUGenInstrInfo.inc...
43.756 [554/5/3799] Building AMDGPUGenDAGISel.inc...
44.183 [554/4/3800] 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/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/tools/clang/lib/StaticAnalyzer/Checkers -I/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/StaticAnalyzer/Checkers -I/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/include -I/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/tools/clang/include -I/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/include -I/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/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-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -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/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:28: error: declaration of ‘const clang::StackFrameContext* FindStackRegionsSymbolVisitor::StackFrameContext’ changes meaning of ‘StackFrameContext’ [-fpermissive]
  252 |   const StackFrameContext *StackFrameContext;
      |                            ^~~~~~~~~~~~~~~~~
In file included from /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/include/clang/Analysis/ProgramPoint.h:17,
                 from /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
                 from /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
                 from /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: note: ‘StackFrameContext’ declared here as ‘class clang::StackFrameContext’
  299 | class StackFrameContext : public LocationContext {
      |       ^~~~~~~~~~~~~~~~~
44.460 [554/3/3801] Linking CXX executable bin/clang-import-test
47.635 [554/2/3802] Building AMDGPUGenRegisterInfo.inc...
48.208 [554/1/3803] Building AMDGPUGenRegisterBank.inc...
ninja: build stopped: subcommand failed.

```

</details>

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


More information about the cfe-commits mailing list