<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57517>57517</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
parser crash in fscanf format string
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
grooverdan
</td>
</tr>
</table>
<pre>
```
[4/9] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o
FAILED: sql/CMakeFiles/sql.dir/mysqld.cc.o
/usr/lib64/ccache/clang++ -DDBUG_TRACE -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -D_FILE_OFFSET_BITS=64 -I/home/dan/repos/build-mariadb-server-10.11/include -I/home/dan/repos/mariadb-server-10.11/include/providers -I/home/dan/repos/mariadb-server-10.11/include -I/home/dan/repos/mariadb-server-10.11/sql -I/home/dan/repos/build-mariadb-server-10.11/extra/wolfssl -I/home/dan/repos/mariadb-server-10.11/extra/wolfssl/wolfssl -I/home/dan/repos/mariadb-server-10.11/extra/wolfssl/wolfssl/wolfssl -I/home/dan/repos/build-mariadb-server-10.11/sql -I/home/dan/repos/mariadb-server-10.11/tpool -fstack-protector --param=ssp-buffer-size=4 -O2 -g -DNDEBUG -fno-omit-frame-pointer -D_FORTIFY_SOURCE=2 -DDBUG_OFF -Wall -Wdeclaration-after-statement -Wenum-compare -Wenum-conversion -Wextra -Wformat-security -Wno-init-self -Wno-null-conversion -Wno-unused-parameter -Wno-unused-private-field -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -DHAVE_OPENSSL -DHAVE_WOLFSSL -DWOLFSSL_USER_SETTINGS -std=gnu++11 -MD -MT sql/CMakeFiles/sql.dir/mysqld.cc.o -MF sql/CMakeFiles/sql.dir/mysqld.cc.o.d -o sql/CMakeFiles/sql.dir/mysqld.cc.o -c /home/dan/repos/mariadb-server-10.11/sql/mysqld.cc
/home/dan/repos/mariadb-server-10.11/sql/mysqld.cc:6111:33: warning: more '%' conversions than data arguments [-Wformat-insufficient-args]
fscanf(cgroup, "%*d:%[^:]:%900s", &path[sizeof(base)]);
~~~~^
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: /usr/bin/clang++ -fstack-protector --param=ssp-buffer-size=4 -O2 -g -fno-omit-frame-pointer -Wall -Wdeclaration-after-statement -Wenum-compare -Wenum-conversion -Wextra -Wformat-security -Wno-init-self -Wno-null-conversion -Wno-unused-parameter -Wno-unused-private-field -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -std=gnu++11 -DDBUG_TRACE -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -D_FILE_OFFSET_BITS=64 -I/home/dan/repos/build-mariadb-server-10.11/include -I/home/dan/repos/mariadb-server-10.11/include/providers -I/home/dan/repos/mariadb-server-10.11/include -I/home/dan/repos/mariadb-server-10.11/sql -I/home/dan/repos/build-mariadb-server-10.11/extra/wolfssl -I/home/dan/repos/mariadb-server-10.11/extra/wolfssl/wolfssl -I/home/dan/repos/mariadb-server-10.11/extra/wolfssl/wolfssl/wolfssl -I/home/dan/repos/build-mariadb-server-10.11/sql -I/home/dan/repos/mariadb-server-10.11/tpool -DNDEBUG -D_FORTIFY_SOURCE=2 -DDBUG_OFF -DHAVE_OPENSSL -DHAVE_WOLFSSL -DWOLFSSL_USER_SETTINGS -c -MD -MT sql/CMakeFiles/sql.dir/mysqld.cc.o -MF sql/CMakeFiles/sql.dir/mysqld.cc.o.d -fcolor-diagnostics -o sql/CMakeFiles/sql.dir/mysqld.cc.o /home/dan/repos/mariadb-server-10.11/sql/mysqld.cc
1. /home/dan/repos/mariadb-server-10.11/sql/mysqld.cc:6111:56: current parser token ')'
2. /home/dan/repos/mariadb-server-10.11/sql/mysqld.cc:6099:1: parsing function body 'resource_monitors_init'
3. /home/dan/repos/mariadb-server-10.11/sql/mysqld.cc:6099:1: in compound statement ('{}')
#0 0x00007f90da60c975 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM-14.so+0xc0c975)
#1 0x00007f90da60cbfb (/lib64/libLLVM-14.so+0xc0cbfb)
#2 0x00007f90da60a2b4 llvm::sys::RunSignalHandlers() (/lib64/libLLVM-14.so+0xc0a2b4)
#3 0x00007f90da60be8b llvm::sys::CleanupOnSignal(unsigned long) (/lib64/libLLVM-14.so+0xc0be8b)
#4 0x00007f90da51a7cd (/lib64/libLLVM-14.so+0xb1a7cd)
#5 0x00007f90d923ea70 __restore_rt (/lib64/libc.so.6+0x3ea70)
#6 0x00007f90e0d187e7 clang::Expr::tryEvaluateObjectSize(unsigned long&, clang::ASTContext&, unsigned int) const (/lib64/libclang-cpp.so.14+0xd187e7)
#7 0x00007f90e112aa65 (/lib64/libclang-cpp.so.14+0x112aa65)
#8 0x00007f90e112ab58 (/lib64/libclang-cpp.so.14+0x112ab58)
#9 0x00007f90e112a0b4 (/lib64/libclang-cpp.so.14+0x112a0b4)
#10 0x00007f90e0e358a3 clang::analyze_format_string::ParseScanfString(clang::analyze_format_string::FormatStringHandler&, char const*, char const*, clang::LangOptions const&, clang::TargetInfo const&) (/lib64/libclang-cpp.so.14+0xe358a3)
#11 0x00007f90e1139b38 clang::Sema::checkFortifiedBuiltinMemoryFunction(clang::FunctionDecl*, clang::CallExpr*) (/lib64/libclang-cpp.so.14+0x1139b38)
#12 0x00007f90e13e92bd clang::Sema::BuildResolvedCallExpr(clang::Expr*, clang::NamedDecl*, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, clang::CallExpr::ADLCallKind) (/lib64/libclang-cpp.so.14+0x13e92bd)
#13 0x00007f90e1666f90 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/lib64/libclang-cpp.so.14+0x1666f90)
#14 0x00007f90e13e3a54 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/lib64/libclang-cpp.so.14+0x13e3a54)
#15 0x00007f90e13e9aff clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/lib64/libclang-cpp.so.14+0x13e9aff)
#16 0x00007f90e0a3ed24 clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) (/lib64/libclang-cpp.so.14+0xa3ed24)
#17 0x00007f90e0a37d01 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/lib64/libclang-cpp.so.14+0xa37d01)
#18 0x00007f90e0a3aa0d clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/lib64/libclang-cpp.so.14+0xa3aa0d)
#19 0x00007f90e0a3abec clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/lib64/libclang-cpp.so.14+0xa3abec)
#20 0x00007f90e0a3e4bd clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/lib64/libclang-cpp.so.14+0xa3e4bd)
#21 0x00007f90e0a98e91 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/lib64/libclang-cpp.so.14+0xa98e91)
#22 0x00007f90e0a99659 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributesWithRange&) (/lib64/libclang-cpp.so.14+0xa99659)
#23 0x00007f90e0a9a793 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/lib64/libclang-cpp.so.14+0xa9a793)
#24 0x00007f90e0a9b553 clang::Parser::ParseCompoundStatementBody(bool) (/lib64/libclang-cpp.so.14+0xa9b553)
#25 0x00007f90e0a9e73a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/lib64/libclang-cpp.so.14+0xa9e73a)
#26 0x00007f90e0ac7213 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/lib64/libclang-cpp.so.14+0xac7213)
#27 0x00007f90e0a1681b clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/lib64/libclang-cpp.so.14+0xa1681b)
#28 0x00007f90e0ac1ec9 (/lib64/libclang-cpp.so.14+0xac1ec9)
#29 0x00007f90e0ac8aec clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.14+0xac8aec)
#30 0x00007f90e0ac9218 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/lib64/libclang-cpp.so.14+0xac9218)
#31 0x00007f90e09f2481 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.14+0x9f2481)
#32 0x00007f90e22e15f9 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.14+0x22e15f9)
#33 0x00007f90e22718a9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.14+0x22718a9)
#34 0x00007f90e234de5c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.14+0x234de5c)
#35 0x00005559d6e8b5ee cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+++0x165ee)
#36 0x00005559d6e88623 (/usr/bin/clang+++0x13623)
#37 0x00007f90e1f7d1c9 (/lib64/libclang-cpp.so.14+0x1f7d1c9)
#38 0x00007f90da51a315 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib64/libLLVM-14.so+0xb1a315)
#39 0x00007f90e1f7da31 (/lib64/libclang-cpp.so.14+0x1f7da31)
#40 0x00007f90e1f5199b clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/lib64/libclang-cpp.so.14+0x1f5199b)
#41 0x00007f90e1f5213e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/lib64/libclang-cpp.so.14+0x1f5213e)
#42 0x00007f90e1f5c5c2 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/lib64/libclang-cpp.so.14+0x1f5c5c2)
#43 0x00005559d6e85a02 main (/usr/bin/clang+++0x10a02)
#44 0x00007f90d9229550 __libc_start_call_main (/lib64/libc.so.6+0x29550)
#45 0x00007f90d9229609 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x29609)
#46 0x00005559d6e87aa5 _start (/usr/bin/clang+++0x12aa5)
clang-14: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 14.0.5 (Fedora 14.0.5-1.fc36)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-14: note: diagnostic msg:
********************
```
[mysqld-cb4914.sh.gz](https://github.com/llvm/llvm-project/files/9475134/mysqld-cb4914.sh.gz)
[mysqld-cb4914.cpp.gz](https://github.com/llvm/llvm-project/files/9475135/mysqld-cb4914.cpp.gz)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztW1uX2jgS_jX0i445vmCDH_qB5pL0Lh16G5LMPHFkWQZvjM3Idqc7v36rJAOWG4jJJHt2zk4fArYsVX31SaoqyUqQha-3HXPcMYc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