Closed
Description
with something very long like https://img.ayaya.dev/G1rZTjcJRL7v
run script + pp source (remove .txt extensions):
mhw_vdbox_hcp_hwcmd_g11_X-59d4c7.cpp.txt
mhw_vdbox_hcp_hwcmd_g11_X-59d4c7.sh.txt
an attempted minimisation with cvise:
$ cat /tmp/repro.ii
struct mhw_vdbox_hcp_g9_glk {
struct HCP_FQM_STATE_CMD {
int Quantizermatrix[];
HCP_FQM_STATE_CMD();
};
};
void memset(void *__attribute__((pass_dynamic_object_size(0))));
mhw_vdbox_hcp_g9_glk::HCP_FQM_STATE_CMD::HCP_FQM_STATE_CMD() {
memset(Quantizermatrix);
}
$ clang++ /tmp/repro.ii
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-chimera-linux-musl -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name repro.ii -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -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/demon/src/cports -fcoverage-compilation-dir=/home/demon/src/cports -resource-dir /usr/lib/clang/18 -fdeprecated-macro -ferror-limit 19 -stack-protector 2 -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/repro-c9f84f.o -x c++-cpp-output /tmp/repro.ii
1. <eof> parser at end of file
2. /tmp/repro.ii:8:42: LLVM IR generation of declaration 'mhw_vdbox_hcp_g9_glk::HCP_FQM_STATE_CMD::HCP_FQM_STATE_CMD'
3. /tmp/repro.ii:8:42: Generating code for declaration 'mhw_vdbox_hcp_g9_glk::HCP_FQM_STATE_CMD::HCP_FQM_STATE_CMD'
4. /tmp/repro.ii:8:62: LLVM IR generation of compound statement ('{}')
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.3
Target: x86_64-chimera-linux-musl
Thread model: posix
InstalledDir: /usr/bin
clang++: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
also on debian, has a nice stacktrace:
cq14# clang++-18 /tmp/repro.ii
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/lib/llvm-18/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name repro.ii -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=/root -fcoverage-compilation-dir=/root -resource-dir /usr/lib/llvm-18/lib/clang/18 -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/repro-8c15f6.o -x c++-cpp-output /tmp/repro.ii
1. <eof> parser at end of file
2. /tmp/repro.ii:8:42: LLVM IR generation of declaration 'mhw_vdbox_hcp_g9_glk::HCP_FQM_STATE_CMD::HCP_FQM_STATE_CMD'
3. /tmp/repro.ii:8:42: Generating code for declaration 'mhw_vdbox_hcp_g9_glk::HCP_FQM_STATE_CMD::HCP_FQM_STATE_CMD'
4. /tmp/repro.ii:8:62: LLVM IR generation of compound statement ('{}')
#0 0x00007fffed5a924a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xda924a)
#1 0x00007fffed5a7274 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xda7274)
#2 0x00007fffed5a990b (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0xda990b)
#3 0x00007fffec25a510 (/lib/x86_64-linux-gnu/libc.so.6+0x3c510)
#4 0x00007ffff5c19255 clang::CodeGen::CodeGenFunction::FindFlexibleArrayMemberField(clang::ASTContext&, clang::RecordDecl const*, llvm::StringRef, unsigned long&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1c19255)
#5 0x00007ffff5c195eb clang::CodeGen::CodeGenFunction::emitFlexibleArrayMemberSize(clang::Expr const*, unsigned int, llvm::IntegerType*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1c195eb)
#6 0x00007ffff5c18d73 clang::CodeGen::CodeGenFunction::emitBuiltinObjectSize(clang::Expr const*, unsigned int, llvm::IntegerType*, llvm::Value*, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1c18d73)
#7 0x00007ffff5c18bcd clang::CodeGen::CodeGenFunction::evaluateOrEmitBuiltinObjectSize(clang::Expr const*, unsigned int, llvm::IntegerType*, llvm::Value*, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1c18bcd)
#8 0x00007ffff5d2ba31 clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, clang::CodeGen::CodeGenFunction::PrototypeWrapper, llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr const* const, clang::Stmt const* const>>, clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, clang::CodeGen::CodeGenFunction::EvaluationOrder) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1d2ba31)
#9 0x00007ffff5de85e9 clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, clang::CodeGen::CGCallee const&, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot, llvm::Value*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1de85e9)
#10 0x00007ffff5de775b clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1de775b)
#11 0x00007ffff5e2dff9 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1e2dff9)
#12 0x00007ffff5e1cfa1 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1e1cfa1)
#13 0x00007ffff5dca55d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1dca55d)
#14 0x00007ffff5f24cc0 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1f24cc0)
#15 0x00007ffff5f25541 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1f25541)
#16 0x00007ffff5f24be1 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1f24be1)
#17 0x00007ffff5d3ab42 clang::CodeGen::CodeGenFunction::EmitConstructorBody(clang::CodeGen::FunctionArgList&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1d3ab42)
#18 0x00007ffff5f8aa0f clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1f8aa0f)
#19 0x00007ffff5d17950 clang::CodeGen::CodeGenModule::codegenCXXStructor(clang::GlobalDecl) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1d17950)
#20 0x00007ffff60298fe (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x20298fe)
#21 0x00007ffff5fa5718 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1fa5718)
#22 0x00007ffff5fa9563 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1fa9563)
#23 0x00007ffff6024fc9 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x2024fc9)
#24 0x00007ffff60448dc (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x20448dc)
#25 0x00007ffff5f7ac12 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x1f7ac12)
#26 0x00007ffff4b8b0ba clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0xb8b0ba)
#27 0x00007ffff69ebb89 clang::FrontendAction::Execute() (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x29ebb89)
#28 0x00007ffff69634e4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x29634e4)
#29 0x00007ffff6a6751e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18.1+0x2a6751e)
#30 0x0000555555567576 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-18/bin/clang+0x13576)
#31 0x0000555555564825 (/usr/lib/llvm-18/bin/clang+0x10825)
#32 0x00005555555639d8 clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-18/bin/clang+0xf9d8)
#33 0x000055555557179a main (/usr/lib/llvm-18/bin/clang+0x1d79a)
#34 0x00007fffec2456ca (/lib/x86_64-linux-gnu/libc.so.6+0x276ca)
#35 0x00007fffec245785 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27785)
#36 0x0000555555561181 _start (/usr/lib/llvm-18/bin/clang+0xd181)
clang++-18: error: unable to execute command: Segmentation fault (core dumped)
clang++-18: error: clang frontend command failed due to signal (use -v to see invocation)
Debian clang version 18.1.3 (1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++-18: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
clang 17 works fine
Metadata
Metadata
Assignees
Type
Projects
Status
Done