<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/139779>139779</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
New --analyze crash with -ftime-trace
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:static analyzer,
crash-on-valid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
gregbedwell
</td>
</tr>
</table>
<pre>
This is a new clang crash, bisected to 6078f5eb214d4cbb74ca9b024b88ff88d963ffd2
Reproducer:
```
// ===================
struct {} a;
// -------------------
```
Use ```clang --analyze -ftime-trace foo.cpp``` to observe the crash.
Error output from compiler explorer: https://godbolt.org/z/WPW3revnG
```
clang++: warning: argument unused during compilation: '-S' [-Wunused-command-line-argument]
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics --analyze -ftime-trace <source>
1. <eof> parser at end of file
#0 0x0000000003f91538 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f91538)
#1 0x0000000003f8f1c4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f8f1c4)
#2 0x0000000003ed3df8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007acec9442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00000000065bc7c4 clang::ento::SymbolConjured::getStmt() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65bc7c4)
#5 0x00000000065bc89c clang::ento::SymbolConjured::dumpToStream(llvm::raw_ostream&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65bc89c)
#6 0x000000000651ff97 clang::ento::SymbolicRegion::dumpToStream(llvm::raw_ostream&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x651ff97)
#7 0x000000000651f538 clang::ento::ElementRegion::dumpToStream(llvm::raw_ostream&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x651f538)
#8 0x000000000652068c clang::ento::MemRegion::getString[abi:cxx11]() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x652068c)
#9 0x00000000065b9aee clang::ento::Loc::dumpToStream(llvm::raw_ostream&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65b9aee)
#10 0x000000000657771f std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> llvm::function_ref<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> ()>::callback_fn<(anonymous namespace)::RegionStoreManager::bind(LimitedRegionBindingsRef const&, clang::ento::Loc, clang::ento::SVal)::'lambda'()>(long) RegionStore.cpp:0:0
#11 0x0000000003f23363 llvm::TimeTraceProfiler::begin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, llvm::function_ref<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> ()>, llvm::TimeTraceEventType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f23363)
#12 0x0000000003f24934 llvm::timeTraceProfilerBegin(llvm::StringRef, llvm::function_ref<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f24934)
#13 0x000000000657de5b (anonymous namespace)::RegionStoreManager::bind(LimitedRegionBindingsRef const&, clang::ento::Loc, clang::ento::SVal) RegionStore.cpp:0:0
#14 0x000000000657e67a (anonymous namespace)::RegionStoreManager::Bind(void const*, clang::ento::Loc, clang::ento::SVal) RegionStore.cpp:0:0
#15 0x00000000065454ca clang::ento::ProgramState::bindLoc(clang::ento::Loc, clang::ento::SVal, clang::LocationContext const*, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65454ca)
#16 0x0000000006125943 clang::ento::errno_modeling::setErrnoValue(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::CheckerContext&, unsigned long, clang::ento::errno_modeling::ErrnoCheckState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6125943)
#17 0x0000000006126aa4 void clang::ento::check::BeginFunction::_checkBeginFunction<(anonymous namespace)::ErrnoModeling>(void*, clang::ento::CheckerContext&) ErrnoModeling.cpp:0:0
#18 0x000000000647f6ba clang::ento::CheckerManager::runCheckersForBeginFunction(clang::ento::ExplodedNodeSet&, clang::BlockEdge const&, clang::ento::ExplodedNode*, clang::ento::ExprEngine&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x647f6ba)
#19 0x00000000064bdac9 clang::ento::ExprEngine::processBeginOfFunction(clang::ento::NodeBuilderContext&, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&, clang::BlockEdge const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64bdac9)
#20 0x000000000648c38c clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x648c38c)
#21 0x0000000006048ea7 (anonymous namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*, void>>*) AnalysisConsumer.cpp:0:0
#22 0x000000000604ac3e (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int) AnalysisConsumer.cpp:0:0
#23 0x000000000604c4f3 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) AnalysisConsumer.cpp:0:0
#24 0x00000000066145ec clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66145ec)
#25 0x0000000004c2ce05 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c2ce05)
#26 0x0000000004baba3e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4baba3e)
#27 0x0000000004d209a9 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4d209a9)
#28 0x0000000000daacdf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdaacdf)
#29 0x0000000000da0eaa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#30 0x000000000499d9e9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#31 0x0000000003ed4294 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ed4294)
#32 0x000000000499dfff clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#33 0x000000000495fdcd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x495fdcd)
#34 0x0000000004960e5e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4960e5e)
#35 0x0000000004969145 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4969145)
#36 0x0000000000da6c48 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xda6c48)
#37 0x0000000000c2c554 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc2c554)
#38 0x00007acec9429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#39 0x00007acec9429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#40 0x0000000000da0955 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xda0955)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkWl1zm7j3_jTkRkMGCzBwkQvHdfbfnXY3E2e3lx4hHRxtQWIkkZf99P-RhI2hdpJtk05nfhl3aoOQnuc5LzoSIlrzrQC4CNLLIP1wRjpzJ9XFVsG2BPYAdX1WSvZ0cXvHNeIaESTgAdGaiC2iiui7AC9RyTVQAwwZieZRllcplHiWsISWZZZQUpQRTso8r6o8Z8U8riqGg2gRRIsbaJVkHQUVxAt_KZhH_SdaBPgqwFcoiD985ydaaKM6alCQXQbZB0SC-HLoN_z2bwogWvylAe0veeJhSASpn_4FFFaGNxAaRSigSspz2rb7xlYOWWpQ94DMHXi9zn2vK6WkQrIzbWdQpWSDqGxaXoNC8NjWUjlF0J0xrbbSOMBbyUpZm3OptgG--jfAV1-uv8QK7sVv32rnoAb40n7iBXogSnCxtV-J2nYNCIM60WlgiHWKW3M6AMRwKWyrAGfhOsAZCtLL8ItvGlLZNESwsOYCwl0_QWqFvv60WqxXSHdlww0iqOy2SEErlbE6TIhwc9eV51Q2Ab6q6_vdf2Gr5D9ATYCvuNYdaGslIhjigtYdO5ARlYR-dbJbB2yV9SMK2tLRslP-sn2SaC0pJ9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