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


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `lldb-remote-linux-ubuntu` running on `as-builder-9` while building `clang` at step 7 "build-default".

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

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

```
Step 7 (build-default) failure: cmake (failure)
...
18.862 [472/11/4716] Building CXX object tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o
18.933 [472/10/4717] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndex.cpp.o
18.953 [472/9/4718] Building CXX object tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/core_main.cpp.o
19.046 [472/8/4719] Building CXX object tools/clang/tools/clang-scan-deps/CMakeFiles/clang-scan-deps.dir/ClangScanDeps.cpp.o
19.051 [472/7/4720] Building CXX object tools/clang/tools/clang-repl/CMakeFiles/clang-repl.dir/ClangRepl.cpp.o
19.112 [472/6/4721] Building CXX object tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o
19.126 [472/5/4722] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXExtractAPI.cpp.o
19.862 [472/4/4723] Building CXX object lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/AsmParser.cpp.o
19.984 [471/4/4724] Linking CXX static library lib/libLLVMMCParser.a
20.054 [469/5/4725] 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/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/clang/lib/StaticAnalyzer/Checkers -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/lib/StaticAnalyzer/Checkers -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/clang/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include -D__OPTIMIZE__ -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-maybe-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 -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/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:28: error: declaration of ‘const clang::StackFrameContext* FindStackRegionsSymbolVisitor::StackFrameContext’ changes meaning of ‘StackFrameContext’ [-Wchanges-meaning]
  252 |   const StackFrameContext *StackFrameContext;
      |                            ^~~~~~~~~~~~~~~~~
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:252:9: note: used here to mean ‘class clang::StackFrameContext’
  252 |   const StackFrameContext *StackFrameContext;
      |         ^~~~~~~~~~~~~~~~~
In file included from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/include/clang/Analysis/ProgramPoint.h:17,
                 from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/include/clang/StaticAnalyzer/Core/Checker.h:16,
                 from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:18,
                 from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp:17:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/clang/include/clang/Analysis/AnalysisDeclContext.h:299:7: note: declared here
  299 | class StackFrameContext : public LocationContext {
      |       ^~~~~~~~~~~~~~~~~
20.093 [469/4/4726] Linking CXX static library lib/libLLVMAArch64AsmParser.a
20.150 [469/3/4727] Linking CXX static library lib/libLLVMObject.a
24.893 [469/2/4728] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
25.874 [469/1/4729] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
In file included from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/LTO/LTO.h:32,
                 from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/LTO/LTO.cpp:13:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Transforms/IPO/FunctionImport.h: In constructor ‘llvm::FunctionImporter::ImportListsTy::ImportListsTy()’:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Transforms/IPO/FunctionImport.h:273:33: warning: member ‘llvm::FunctionImporter::ImportListsTy::ImportIDs’ is used uninitialized [-Wuninitialized]
  273 |     ImportListsTy() : EmptyList(ImportIDs) {}
      |                                 ^~~~~~~~~
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Transforms/IPO/FunctionImport.h: In constructor ‘llvm::FunctionImporter::ImportListsTy::ImportListsTy(size_t)’:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Transforms/IPO/FunctionImport.h:274:44: warning: member ‘llvm::FunctionImporter::ImportListsTy::ImportIDs’ is used uninitialized [-Wuninitialized]
  274 |     ImportListsTy(size_t Size) : EmptyList(ImportIDs), ListsImpl(Size) {}
      |                                            ^~~~~~~~~
ninja: build stopped: subcommand failed.

```

</details>

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


More information about the cfe-commits mailing list