Skip to content

[analyzer] Crash with "ArrayInitLoopExpr contains unexpected source expression" #112813

@i80287

Description

@i80287

Got an error while running clang-tidy. Clang-tidy is executed by CodeChecker, flags and options are generated by the cmake with -DCMAKE_EXPORT_COMPILE_COMMANDS=1. The same error occurs when CodeChecker runs clang static analyzer

Stack dump:
0.	Program arguments: /usr/lib/llvm-18/bin/clang-tidy /home/waste/Projects/cplusplus/algorithms/tf_idf_actrie/test_actrie.cpp --export-fixes /home/waste/Projects/cplusplus/algorithms/tests/cmake-build-codechecker/report_clang/fixit/test_actrie.cpp_clang-tidy_889ac94762fd440ca0328d94131f3632.yaml -- -Qunused-arguments -Wno-everything -x c++ --target=x86_64-pc-linux-gnu -D_GLIBCXX_CONCEPT_CHECKS -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_SANITIZE_VECTOR -D_LIBCPP_ENABLE_ASSERTIONS -fsanitize=address,undefined -O2 -g -std=c++20 -Wall -Wextra -Wcast-qual -Wpedantic -Wunused -Wshadow -Wnull-dereference -Wundef -Wwrite-strings -Wsign-conversion -Wsign-compare -Wsign-promo -Wconversion -Wmissing-noreturn -Wunreachable-code -Wcast-align -Wformat=2 -Wswitch-bool -Wswitch-default -Wswitch-enum -Wold-style-cast -Wdeprecated -Weffc++ -fstack-protector-strong -mshstk -Warray-bounds -Wshift-overflow -Wshift-sign-overflow -Wshorten-64-to-32 -Wthread-safety -fcolor-diagnostics -fansi-escape-codes -ftemplate-backtrace-limit=0 -U_GLIBCXX_USE_DEPRECATED -isystem /usr/include/c++/13 -isystem /usr/include/x86_64-linux-gnu/c++/13 -isystem /usr/include/c++/13/backward -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include
1.	<eof> parser at end of file
2.	While analyzing stack: 
	#0 Calling (anonymous namespace)::replacing_actrie_tests::test_replacing_actrie(const std::string_view (&)[5][2], std::string &, const std::string_view, const _Bool) at line /home/waste/Projects/cplusplus/algorithms/tf_idf_actrie/test_actrie.cpp:155:5 <Spelling=/home/waste/Projects/cplusplus/algorithms/tf_idf_actrie/test_actrie.cpp:155:12>
	#1 Calling (anonymous namespace)::replacing_actrie_tests::test0() at line 448
	#2 Calling main()
3.	/home/waste/Projects/cplusplus/algorithms/tf_idf_actrie/test_actrie.cpp:118:44: Error evaluating statement
4.	/home/waste/Projects/cplusplus/algorithms/tf_idf_actrie/test_actrie.cpp:118:44: Error evaluating statement
 #0 sys::PrintStackTrace(raw_ostream&, int) Signals.inc:723:13
 #1 sys::RunSignalHandlers() Signals.cpp:106:18
 #2 SignalHandler Signals.inc:413:1
 #3 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
 #4 getCanonicalDecl clang/AST/Decl.h:1274:40
 #5 MemRegionManager::getVarRegion(VarDecl const*, LocationContext const*) MemRegion.cpp:1007:10
 #6 clang/StaticAnalyzer/Core/PathSensitive/Store.h:136:5
 #7 getType clang/AST/Expr.h:143:37
 #8 bindRequiredArrayElementToEnvironment ExprEngineCXX.cpp:577:39
 #9 ExprEngine::handleConstructor(Expr const*, ExplodedNode*, ExplodedNodeSet&) ExprEngineCXX.cpp:660:15
#10 ExprEngine::Visit(Stmt const*, ExplodedNode*, ExplodedNodeSet&) ExprEngine.cpp:0:7
#11 ExprEngine::ProcessStmt(Stmt const*, ExplodedNode*) ExprEngine.cpp:1132:9
#12 ExprEngine::processCFGElement(CFGElement, ExplodedNode*, unsigned int, NodeBuilderContext*) ExprEngine.cpp:0:7
#13 CoreEngine::dispatchWorkItem(ExplodedNode*, ProgramPoint, WorkListUnit const&) CoreEngine.cpp:223:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:static analyzerconfirmedVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions