<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62306>62306</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-16.0.0 error: unable to execute command: Segmentation fault
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
anbu1024
</td>
</tr>
</table>
<pre>
```
$ clang 2.c
2.c:11:10: warning: too many arguments in call to 'foo'
foo(foo);
~~~ ^
2.c:11:6: warning: passing arguments to 'foo' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
foo(foo);
^
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: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name 2.c -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 -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fcoverage-compilation-dir=/path-to-llvm-test -resource-dir clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16 -internal-isystem clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/path-to-llvm-test -ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/2-f6c459.o -x c 2.c
1. <eof> parser at end of file
2. Per-file LLVM IR generation
#0 0x000055c8f1d03b68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x3103b68)
#1 0x000055c8f1d01aae llvm::sys::RunSignalHandlers() (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x3101aae)
#2 0x000055c8f1d041ed SignalHandler(int) Signals.cpp:0:0
#3 0x00007fa06dd5c420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x000055c8f20bdf25 replaceUsesOfNonProtoConstant(llvm::Constant*, llvm::Function*) CodeGenModule.cpp:0:0
#5 0x000055c8f20af3be clang::CodeGen::CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef, llvm::Type*, clang::GlobalDecl, bool, bool, bool, llvm::AttributeList, clang::CodeGen::ForDefinition_t) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x34af3be)
#6 0x000055c8f20b506a clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl, llvm::Type*, bool, bool, clang::CodeGen::ForDefinition_t) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x34b506a)
#7 0x000055c8f20a0e4e clang::CodeGen::CodeGenModule::GetAddrOfGlobal(clang::GlobalDecl, clang::CodeGen::ForDefinition_t) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x34a0e4e)
#8 0x000055c8f209f041 clang::CodeGen::CodeGenModule::EmitDeferred() (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x349f041)
#9 0x000055c8f209cc2d clang::CodeGen::CodeGenModule::Release() (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x349cc2d)
#10 0x000055c8f2be6cb4 (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#11 0x000055c8f2be3f56 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x3fe3f56)
#12 0x000055c8f3a1978d clang::ParseAST(clang::Sema&, bool, bool) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x4e1978d)
#13 0x000055c8f2642fd7 clang::FrontendAction::Execute() (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x3a42fd7)
#14 0x000055c8f25bb354 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x39bb354)
#15 0x000055c8f26fa8ef clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x3afa8ef)
#16 0x000055c8efeed9e4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x12ed9e4)
#17 0x000055c8efeea656 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#18 0x000055c8efeea2f9 clang_main(int, char**) (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x12ea2f9)
#19 0x00007fa06d7b6083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#20 0x000055c8efee659a _start (clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16+0x12e659a)
clang-16: error: unable to execute command: Segmentation fault (core dumped)
clang-16: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 16.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
clang-16: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/2-d005f7.c
clang-16: note: diagnostic msg: /tmp/2-d005f7.sh
clang-16: note: diagnostic msg:
--------------------------------
$ cat /tmp/2-d005f7.c
# 1 "<built-in>"
# 1 "2.c"
volatile int g;
static void foo()
{
g = 1;
}
void bar()
{
foo(foo);
}
--------------------------------
$ cat /tmp/2-d005f7.sh
# Crash reproducer for clang version 16.0.0
# Driver args: "2.c"
# Original command: "clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "2.c" "-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" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/llvm-test" "-resource-dir" "clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16" "-internal-isystem" "clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/include" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-fdebug-compilation-dir=/llvm-test" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/2-f6c459.o" "-x" "c" "2.c"
"clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "2.c" "-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" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/llvm-test" "-fdebug-compilation-dir=/llvm-test" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c" "2-d005f7.c"
--------------------------------
This is a regression bug, clang-14.0.6 is not affected.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWk9v2ziw_zTKZUBDomTFPuTg2HFboLspmuzu0aDIkcJdiTRIKk0u-9kfSMmy5Th5aevF4j1skcoS_8z8ZjicoWbErJWVQryKptfRdHXBWvegzRVTRZvENLsotHi-ivK4_4tXUbyIaAa8ZqoCOuF9U7j6x3SRJP4SR-kCvjGjpKr8rdMaGqaegZmqbVA5C1IBZ3UNTkNEL0utI3rZEQIIT7NwnUfp9a7577__BgCIpjcvOOZHDLdeNFUd8DvkA9-ke9CtAwZbo512z1sEaUHg1iBnDoWH59E9orFSKwu6hCUwJfwwpR3YdrvVph-5pE8QTa_JH3sCRGlFBuLRdNUL8Ypoh2J9-XyzuLsB2xaN9BCLtgKDnpsX4sG5rY3SRUTXEV1X0j20xYTrJqLrun7c_XjWfyJ3EV1La1u0EV138BWvW4HgHhC4YfYBCsb_coZxjOgStga3RnO0FgVY3Zqu2c9k1moug3JMq8ByI7du0kG-c4z_BaJtth5ZaIonUTz_YnRlWLNfBr82wXoieh1wJvkknsTkaZZv8ozU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