<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90993>90993</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang++ crashes when compiling from comand-line
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bluefish43
</td>
</tr>
</table>
<pre>
Clang++ encountered a segmentation fault when compiling the input file.
Here is its output:
```
$ clang++ test.cc -o test -Wall -Werror
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
error: null character ignored [-Werror,-Wnull-character]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
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-18 -cc1 -triple x86_64-suse-linux -emit-obj -mrelax-all -dumpdir test- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.cc -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/user/Projetos/ccbuild -fcoverage-compilation-dir=/home/user/Projetos/ccbuild -resource-dir /usr/lib64/clang/18 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/backward -internal-isystem /usr/lib64/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Werror -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/test-78294d.o -x c++ test.cc
1. <unknown> parser at unknown location
#0 0x00007f71d7bd9a09 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.18.1+0x9d9a09)
#1 0x00007f71d7bd7430 llvm::sys::RunSignalHandlers() (/lib64/libLLVM.so.18.1+0x9d7430)
#2 0x00007f71d7bda1fb (/lib64/libLLVM.so.18.1+0x9da1fb)
#3 0x00007f71d6a41240 __restore_rt (/lib64/libc.so.6+0x41240)
#4 0x00007f71df017305 clang::Lexer::SkipWhitespace(clang::Token&, char const*, bool&) (/lib64/libclang-cpp.so.18.1+0xa17305)
#5 0x00007f71df01bc3e clang::Lexer::LexTokenInternal(clang::Token&, bool) (/lib64/libclang-cpp.so.18.1+0xa1bc3e)
#6 0x00007f71df08663d clang::Preprocessor::Lex(clang::Token&) (/lib64/libclang-cpp.so.18.1+0xa8663d)
#7 0x00007f71df09566e (/lib64/libclang-cpp.so.18.1+0xa9566e)
#8 0x00007f71df167744 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67744)
#9 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#10 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#11 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#12 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#13 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#14 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#15 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#16 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#17 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#18 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#19 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#20 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#21 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#22 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#23 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#24 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#25 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#26 0x00007f71df167633 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/lib64/libclang-cpp.so.18.1+0xb67633)
#27 0x00007f71df0a6798 clang::Parser::SkipMalformedDecl() (/lib64/libclang-cpp.so.18.1+0xaa6798)
#28 0x00007f71df0a5790 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/lib64/libclang-cpp.so.18.1+0xaa5790)
#29 0x00007f71df16c5e7 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/lib64/libclang-cpp.so.18.1+0xb6c5e7)
#30 0x00007f71df16bf98 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/lib64/libclang-cpp.so.18.1+0xb6bf98)
#31 0x00007f71df16b004 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.18.1+0xb6b004)
#32 0x00007f71df169225 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/lib64/libclang-cpp.so.18.1+0xb69225)
#33 0x00007f71df08ec6c clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.18.1+0xa8ec6c)
#34 0x00007f71e132a756 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.18.1+0x2d2a756)
#35 0x00007f71e129d1b4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.18.1+0x2c9d1b4)
#36 0x00007f71e13a5e36 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.18.1+0x2da5e36)
#37 0x000055ea0d0a6660 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-18+0x12660)
#38 0x000055ea0d0a33a8 (/usr/bin/clang-18+0xf3a8)
#39 0x000055ea0d0a20fb clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang-18+0xe0fb)
#40 0x000055ea0d0af6e9 main (/usr/bin/clang-18+0x1b6e9)
#41 0x00007f71d6a2a1f0 __libc_start_call_main (/lib64/libc.so.6+0x2a1f0)
#42 0x00007f71d6a2a2b9 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a2b9)
#43 0x000055ea0d09fb25 _start (/usr/bin/clang-18+0xbb25)
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 18.1.4
Target: x86_64-suse-linux
Thread model: posix
InstalledDir: /usr/bin
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/test-d4937e.cpp
clang++: note: diagnostic msg: /tmp/test-d4937e.sh
clang++: note: diagnostic msg:
********************
```
The preprocessed file and associated run script are attached to this issue, with a `.txt` suffix for me to be able to submit them to GitHub.
[test-d4937e.cpp.txt](https://github.com/llvm/llvm-project/files/15203846/test-d4937e.cpp.txt)
[test-d4937e.sh.txt](https://github.com/llvm/llvm-project/files/15203855/test-d4937e.sh.txt)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW0tz2zgS_jX0pQsqEnxIOvggW1biWmfjij2TowoEmxTGJMAFQEf591sA9aJsx_ZMdqdWm5RLIcHm1183Ht0CWswYUUnE8yC9CNL5GevsSunzvO6wFGaVxGe5Kr6fX9ZMVgG9COgFoOSqkxY1FsDAYNWgtMwKJaFkXW3h2wolcNW0ohayArtCELLtLJSixlEQzoNw1n9-RI0gDAhrQHW27WwQbx4FWbj5629pAvyAhEVjR5wDUf4SyFdW10C-otZK96_0l_EMZFfXwFdMM25Rg6ikctyD9GIrTy_JVydFdlJBOv-F8gvlF8ovlP8flJJZVsMOyyoFDZPf-xYD2AhrsQjoJRir2tYt7lJ98-CllyG1aIQN4vkO8vbmanZ3BabLG2GBQd5VoLFV2oJVsLK2NW7Jp4uALiphV10-4qoJ6KKuH7f_kVarP5DbgC6EMR2agC6AyQKE5HVXoI8wXDOzgpzxB6sZR0ey1dhqxdEYLMCoTvfN7k1mjOKCWSxAdxIM16K1m9B0Zxl_gKJr2l0wCkdwq1WlWQNMV50LeI42BHTRGR3QRS5kQBc-QJFoAoTzCIjVoq0R1pNsmSXEdAZJLWS3BuI8SVT-B5BGY83WxAcvp7IQ2gc0AqQQhuU1klIjAuE1Mk2YsSTHUmkkzlSUxV7Ou-oRtSgFat_MmS7II6s7JJ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