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


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-hip-vega20` running on `hip-vega20-0` while building `clang` at step 3 "annotate".

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

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

```
Step 3 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=' (failure)
...
[65/148] Linking CXX executable bin/llvm-symbolizer
[66/148] Generating ../../bin/llvm-addr2line
[67/148] Linking CXX executable bin/verify-uselistorder
[68/148] Linking CXX executable bin/llvm-xray
[69/148] Linking CXX executable bin/obj2yaml
[70/148] Linking CXX executable bin/llvm-jitlink
[71/148] Linking CXX executable bin/sancov
[72/148] Linking CXX executable bin/llvm-extract
[73/148] Linking CXX executable bin/diagtool
[74/148] 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/clang-hip-vega20/botworker/clang-hip-vega20/llvm/tools/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/clang-hip-vega20/llvm-project/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include -I/home/botworker/bbot/clang-hip-vega20/botworker/clang-hip-vega20/llvm/tools/clang/include -I/home/botworker/bbot/clang-hip-vega20/botworker/clang-hip-vega20/llvm/include -I/home/botworker/bbot/clang-hip-vega20/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-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -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/botworker/bbot/clang-hip-vega20/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/botworker/bbot/clang-hip-vega20/llvm-project/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/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/Analysis/ProgramPoint.h:17,
                 from /home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
                 from /home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
                 from /home/botworker/bbot/clang-hip-vega20/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: note: ‘StackFrameContext’ declared here as ‘class clang::StackFrameContext’
  299 | class StackFrameContext : public LocationContext {
      |       ^~~~~~~~~~~~~~~~~
[75/148] Linking CXX executable bin/clang-diff
[76/148] Linking CXX executable bin/modularize
[77/148] Linking CXX executable bin/clang-include-fixer
[78/148] Linking CXX executable bin/clang-reorder-fields
[79/148] Linking CXX executable bin/clang-doc
[80/148] Linking CXX executable bin/clang-refactor
[81/148] Linking CXX executable bin/pp-trace
[82/148] Linking CXX executable bin/clang-installapi
[83/148] Linking CXX executable bin/find-all-symbols
[84/148] Linking CXX executable bin/clang-move
[85/148] Linking CXX executable bin/tool-template
[86/148] Linking CXX executable bin/clang-include-cleaner
[87/148] Linking CXX executable bin/clang-change-namespace
[88/148] Linking CXX executable bin/clang-query
[89/148] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[90/148] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
ninja: build stopped: subcommand failed.
Step 7 (Building LLVM) failure: Building LLVM (failure)
...
[65/148] Linking CXX executable bin/llvm-symbolizer
[66/148] Generating ../../bin/llvm-addr2line
[67/148] Linking CXX executable bin/verify-uselistorder
[68/148] Linking CXX executable bin/llvm-xray
[69/148] Linking CXX executable bin/obj2yaml
[70/148] Linking CXX executable bin/llvm-jitlink
[71/148] Linking CXX executable bin/sancov
[72/148] Linking CXX executable bin/llvm-extract
[73/148] Linking CXX executable bin/diagtool
[74/148] 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/clang-hip-vega20/botworker/clang-hip-vega20/llvm/tools/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/clang-hip-vega20/llvm-project/clang/lib/StaticAnalyzer/Checkers -I/home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include -I/home/botworker/bbot/clang-hip-vega20/botworker/clang-hip-vega20/llvm/tools/clang/include -I/home/botworker/bbot/clang-hip-vega20/botworker/clang-hip-vega20/llvm/include -I/home/botworker/bbot/clang-hip-vega20/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-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -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/botworker/bbot/clang-hip-vega20/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/botworker/bbot/clang-hip-vega20/llvm-project/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/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/Analysis/ProgramPoint.h:17,
                 from /home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
                 from /home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
                 from /home/botworker/bbot/clang-hip-vega20/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/botworker/bbot/clang-hip-vega20/llvm-project/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: note: ‘StackFrameContext’ declared here as ‘class clang::StackFrameContext’
  299 | class StackFrameContext : public LocationContext {
      |       ^~~~~~~~~~~~~~~~~
[75/148] Linking CXX executable bin/clang-diff
[76/148] Linking CXX executable bin/modularize
[77/148] Linking CXX executable bin/clang-include-fixer
[78/148] Linking CXX executable bin/clang-reorder-fields
[79/148] Linking CXX executable bin/clang-doc
[80/148] Linking CXX executable bin/clang-refactor
[81/148] Linking CXX executable bin/pp-trace
[82/148] Linking CXX executable bin/clang-installapi
[83/148] Linking CXX executable bin/find-all-symbols
[84/148] Linking CXX executable bin/clang-move
[85/148] Linking CXX executable bin/tool-template
[86/148] Linking CXX executable bin/clang-include-cleaner
[87/148] Linking CXX executable bin/clang-change-namespace
[88/148] Linking CXX executable bin/clang-query
[89/148] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[90/148] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=20.362923

```

</details>

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


More information about the cfe-commits mailing list