<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/101602>101602</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang static analyzer] Clang crashed: Assertion `Permissive || !(!LabelAndGotoScopes.count(To))' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
iamanonymouscs
</td>
</tr>
</table>
<pre>
Clang crashed when using CSA.
It appears that employing any kind of analyzer results in crashes.
Taking `uninitialized.Assign` analyzer as an example:
Compiler explorer(assertion trunck): https://godbolt.org/z/7YME81GPa
```
$ cat program.C
void foo (int x)
{
if (x == 1)
goto l1;
[[assume (({ l1:; 1; }))]];
}
$ clang --analyze --analyzer-output text -Xclang -analyzer-checker=core.uninitialized.Assign program.C
clang: /home/compiler/llvm/clang/lib/Sema/JumpDiagnostics.cpp:934: void (anonymous namespace)::JumpScopeChecker::CheckJump(Stmt *, Stmt *, SourceLocation, unsigned int, unsigned int, unsigned int): Assertion `Permissive || !(!LabelAndGotoScopes.count(To))' failed.
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: /home/software/llvm-trunk-eed7c5e/bin/clang --analyze --analyzer-output text -Xclang -analyzer-checker=core.uninitialized.Assign program.C
1. <eof> parser at end of file
2. program.C:2:1: parsing function body 'foo'
#0 0x00007fd09b062617 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libLLVM.so.19.0git+0xffc617)
#1 0x00007fd09b05eb92 llvm::sys::RunSignalHandlers() (/home/software/llvm-trunk-eed7c5e/bin/../lib/libLLVM.so.19.0git+0xff8b92)
#2 0x00007fd09b06126f llvm::sys::CleanupOnSignal(unsigned long) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libLLVM.so.19.0git+0xffb26f)
#3 0x00007fd09aeed8e4 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) CrashRecoveryContext.cpp:0:0
#4 0x00007fd09aeedd4b CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#5 0x00007fd099b46520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#6 0x00007fd099b9a9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#7 0x00007fd099b46476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#8 0x00007fd099b2c7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#9 0x00007fd099b2c71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#10 0x00007fd099b3de96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00007fd0b5c2cd83 (anonymous namespace)::JumpScopeChecker::CheckJump(clang::Stmt*, clang::Stmt*, clang::SourceLocation, unsigned int, unsigned int, unsigned int) JumpDiagnostics.cpp:0:0
#12 0x00007fd0b5c25516 (anonymous namespace)::JumpScopeChecker::JumpScopeChecker(clang::Stmt*, clang::Sema&) JumpDiagnostics.cpp:0:0
#13 0x00007fd0b5c24e6b clang::Sema::DiagnoseInvalidJumps(clang::Stmt*) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x21a0e6b)
#14 0x00007fd0b60cbecb clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x2647ecb)
#15 0x00007fd0b4a3b153 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfb7153)
#16 0x00007fd0b4a6cd7b clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfe8d7b)
#17 0x00007fd0b4908fed clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xe84fed)
#18 0x00007fd0b4a6b27d clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfe727d)
#19 0x00007fd0b4a6a4b3 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfe64b3)
#20 0x00007fd0b4a68fb1 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfe4fb1)
#21 0x00007fd0b4a6606e clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfe206e)
#22 0x00007fd0b4a65626 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xfe1626)
#23 0x00007fd0b48defce clang::ParseAST(clang::Sema&, bool, bool) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0xe5afce)
#24 0x00007fd0b91c7ed5 clang::FrontendAction::Execute() (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x5743ed5)
#25 0x00007fd0b9080cbb clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x55fccbb)
#26 0x00007fd0b92c8fd1 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x5844fd1)
#27 0x00005597977d71bf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/software/llvm-trunk-eed7c5e/bin/clang+0x1d1bf)
#28 0x00005597977cca94 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#29 0x00007fd0b89ff5de 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::$_0>(long) Job.cpp:0:0
#30 0x00007fd09aeed7cd llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libLLVM.so.19.0git+0xe877cd)
#31 0x00007fd0b89fce35 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x4f78e35)
#32 0x00007fd0b8987aee clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x4f03aee)
#33 0x00007fd0b898817d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x4f0417d)
#34 0x00007fd0b89bc557 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/home/software/llvm-trunk-eed7c5e/bin/../lib/libclang-cpp.so.19.0git+0x4f38557)
#35 0x00005597977cbf57 clang_main(int, char**, llvm::ToolContext const&) (/home/software/llvm-trunk-eed7c5e/bin/clang+0x11f57)
#36 0x00005597977f3e25 main (/home/software/llvm-trunk-eed7c5e/bin/clang+0x39e25)
#37 0x00007fd099b2dd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#38 0x00007fd099b2de40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#39 0x00005597977c86d5 _start (/home/software/llvm-trunk-eed7c5e/bin/clang+0xe6d5)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 19.0.0git (https://github.com/llvm/llvm-project.git eed7c5e29c1dc5f78bd01608430e2b4e0c439bb1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/software/llvm-trunk-eed7c5e/bin
Build config: +assertions
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/program-ec8379.cpp
clang: note: diagnostic msg: /tmp/program-ec8379.sh
clang: note: diagnostic msg:
********************
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWk9T4zoS_zTioiJly_8PHEIg85jiLdTAvt09pWSpnWhxLK8kM-F9-i3JTogMZODNhMPulKdw5Far-9etVktqqrVYNgBnKDlHycUJ7cxKqjNB17SRzdNadprpk1Lyp7NZTZslZorqFXD8fQUN7rRolnh2N52g4AIF0yuDadsCVRqbFTUY1m0tnywNbZ7wg2g4lhWmDa2f_gSFFeiuNhqLZmCrBz739MF2QmnQNaIRRtBa_Al8MnXSojR45kE1pg2GDV23NaBo2jOYyXUralAYNm0tFShEcqo1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