-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
clang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]needs-reductionLarge reproducer that should be reduced into a simpler formLarge reproducer that should be reduced into a simpler form
Description
Trying to build the linux kernel with -std=gnu2x ended up never finishing as one file ended up in an endless loop:
clang-18 --target=x86_64-unknown-linux-gnu -S -O2 -D__KERNEL__ -std=gnu2x -Wno-address-of-packed-member -Wno-gnu-variable-sized-type-not-at-end -Wno-constant-logical-operand -fsanitize=array-bounds policy-e3a9a0.c
Sending SIGABRT shows
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-18 --target=x86_64-unknown-linux-gnu -S -O2 -D__KERNEL__ -std=gnu2x -Wno-address-of-packed-member -Wno-gnu-variable-sized-type-not-at-end -Wno-constant-logical-operand -fsanitize=array-bounds policy-e3a9a0.c
1. /home/arnd/arm-soc/net/netlink/policy.c:485:1: current parser token 'void'
2. /home/arnd/arm-soc/net/netlink/policy.c:430:5: LLVM IR generation of declaration 'netlink_policy_dump_write'
3. /home/arnd/arm-soc/net/netlink/policy.c:430:5: Generating code for declaration 'netlink_policy_dump_write'
#0 0x0000ffff2df64b40 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd44b40)
#1 0x0000ffff2df62de8 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xd42de8)
#2 0x0000ffff2deb4ae8 (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc94ae8)
#3 0x0000ffff383307fc (linux-vdso.so.1+0x7fc)
#4 0x0000ffff36431810 clang::CodeGen::CodeGenFunction::BuildCountedByFieldExpr(clang::Expr const*, clang::ValueDecl const*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cc1810)
#5 0x0000ffff36431d84 clang::CodeGen::CodeGenFunction::EmitBoundsCheck(clang::Expr const*, clang::Expr const*, llvm::Value*, clang::QualType, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cc1d84)
#6 0x0000ffff364419c8 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cd19c8)
#7 0x0000ffff3643404c clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(clang::ArraySubscriptExpr const*, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cc404c)
#8 0x0000ffff3643486c clang::CodeGen::CodeGenFunction::EmitLValueHelper(clang::Expr const*, clang::CodeGen::KnownNonNull_t) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cc486c)
#9 0x0000ffff3642bf08 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*, clang::CodeGen::KnownNonNull_t) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cbbf08)
#10 0x0000ffff36479fe0 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1d09fe0)
#11 0x0000ffff364797c0 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1d097c0)
#12 0x0000ffff3646ee30 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cfee30)
#13 0x0000ffff3642ba9c clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cbba9c)
#14 0x0000ffff3642b994 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1cbb994)
#15 0x0000ffff3654cd60 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1ddcd60)
#16 0x0000ffff365560d8 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1de60d8)
#17 0x0000ffff365a2184 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e32184)
#18 0x0000ffff365c001c clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e5001c)
#19 0x0000ffff365b9d70 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e49d70)
#20 0x0000ffff365bd83c clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e4d83c)
#21 0x0000ffff365b8ad0 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e48ad0)
#22 0x0000ffff3664fe6c (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1edfe6c)
#23 0x0000ffff36595124 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x1e25124)
#24 0x0000ffff352cb3d8 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0xb5b3d8)
#25 0x0000ffff36f4aea0 clang::FrontendAction::Execute() (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x27daea0)
#26 0x0000ffff36edc8c8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x276c8c8)
#27 0x0000ffff36fc07f4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x28507f4)
#28 0x0000aaab84c71f90 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-18/bin/clang+0x11f90)
#29 0x0000aaab84c6fb64 (/usr/lib/llvm-18/bin/clang+0xfb64)
#30 0x0000ffff36bf1c18 (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x2481c18)
#31 0x0000ffff2deb485c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm-18/bin/../lib/libLLVM-18.so.1+0xc9485c)
#32 0x0000ffff36bf1534 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x2481534)
#33 0x0000ffff36bc11e8 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24511e8)
#34 0x0000ffff36bc13f0 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&, bool) const (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x24513f0)
#35 0x0000ffff36bd8a14 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/usr/lib/llvm-18/bin/../lib/libclang-cpp.so.18+0x2468a14)
#36 0x0000aaab84c6f304 clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-18/bin/clang+0xf304)
#37 0x0000aaab84c7a8f4 main (/usr/lib/llvm-18/bin/clang+0x1a8f4)
#38 0x0000ffff2cd37780 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#39 0x0000ffff2cd37858 call_init ./csu/../csu/libc-start.c:128:20
#40 0x0000ffff2cd37858 __libc_start_main ./csu/../csu/libc-start.c:347:5
#41 0x0000aaab84c6c9b0 _start (/usr/lib/llvm-18/bin/clang+0xc9b0)
clang-18: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Debian clang version 18.0.0 (++20231211112323+3c1e7fb95e44-1~exp1~20231211112338.393)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-18: note: diagnostic msg:
********************
Metadata
Metadata
Assignees
Labels
clang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]needs-reductionLarge reproducer that should be reduced into a simpler formLarge reproducer that should be reduced into a simpler form