Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang: error compiling the kernel #116239

Open
odomingao opened this issue Nov 14, 2024 · 7 comments
Open

Clang: error compiling the kernel #116239

odomingao opened this issue Nov 14, 2024 · 7 comments
Labels
clang:codegen crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@odomingao
Copy link

odomingao commented Nov 14, 2024

clang-report.tar.gz

/usr/include/c++/14.2.1/bits/unique_ptr.h:447: typename std::add_lvalue_reference<_Tp>::type std::unique_ptr<_Tp, _Dp>::operator*() const [with _Tp = clang::CodeGen::CGRecordLayout; _Dp = std::default_delete<clang::CodeGen::CGRecordLayout>; typename std::add_lvalue_reference<_Tp>::type = clang::CodeGen::CGRecordLayout&]: Assertion 'get() != pointer()' failed.
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 -Wp,-MMD,net/core/.dev.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ --target=x86_64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument -fmacro-prefix-map=./= -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=branch -fno-jump-tables -m64 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mstack-alignment=8 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mretpoline-external-thunk -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -mharden-sls=all -fpatchable-function-entry=11,11 -fno-delete-null-pointer-checks -O2 -fstack-protector-strong -ftrivial-auto-var-init=zero -fno-stack-clash-protection -pg -mfentry -DCC_USING_NOP_MCOUNT -DCC_USING_FENTRY -fno-lto -flto -fvisibility=hidden -fsanitize=kcfi -falign-functions=16 -fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=2048 -Wno-gnu -Wvla -Wno-pointer-sign -Wcast-function-type -Wimplicit-fallthrough -Werror=date-time -Werror=incompatible-pointer-types -Wenum-conversion -Wextra -Wunused -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-format-overflow -Wno-format-overflow-non-kprintf -Wno-format-truncation-non-kprintf -Wno-override-init -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -Wno-unaligned-access -Wno-enum-compare-conditional -Wno-enum-enum-conversion -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-sign-compare -Wno-unused-parameter -DRANDSTRUCT -frandomize-layout-seed-file=./scripts/basic/randstruct.seed -fsanitize=array-bounds -fsanitize=local-bounds -fsanitize-trap=undefined -DKBUILD_MODFILE=\"net/core/dev\" -DKBUILD_BASENAME=\"dev\" -DKBUILD_MODNAME=\"dev\" -D__KBUILD_MODNAME=kmod_dev -c -o net/core/dev.o net/core/dev.c
1.	net/core/dev.c:10568:1 <Spelling=./include/linux/export.h:56:2>: current parser token 'extern'
2.	net/core/dev.c:10558:6: LLVM IR generation of declaration 'init_dummy_netdev'
3.	net/core/dev.c:10558:6: Generating code for declaration 'init_dummy_netdev'
4.	net/core/dev.c:10565:2 <Spelling=./include/linux/fortify-string.h:501:65>: LLVM IR generation of compound statement ('{}')
 #0 0x00006627841c4d90 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/libLLVM.so.18.1+0x7c4d90)
 #1 0x00006627841c226d llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/libLLVM.so.18.1+0x7c226d)
 #2 0x00006627840a88e9 (/usr/lib/libLLVM.so.18.1+0x6a88e9)
 #3 0x000066278344c1d0 (/usr/lib/libc.so.6+0x3d1d0)
 #4 0x00006627834a53f4 (/usr/lib/libc.so.6+0x963f4)
 #5 0x000066278344c120 raise (/usr/lib/libc.so.6+0x3d120)
 #6 0x00006627834334c3 abort (/usr/lib/libc.so.6+0x244c3)
 #7 0x00006627836d3af0 std::chrono::_V2::system_clock::now() /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/chrono.cc:52:5
 #8 0x000066278d55d000 clang::CodeGen::CodeGenTypes::getCGRecordLayout(clang::RecordDecl const*) (/usr/lib/libclang-cpp.so.18.1+0x195d000)
 #9 0x000066278d3249b5 (/usr/lib/libclang-cpp.so.18.1+0x17249b5)
#10 0x000066278d324a7f (/usr/lib/libclang-cpp.so.18.1+0x1724a7f)
#11 0x000066278d354892 clang::CodeGen::CodeGenFunction::EmitCountedByFieldExpr(clang::Expr const*, clang::FieldDecl const*, clang::FieldDecl const*) (/usr/lib/libclang-cpp.so.18.1+0x1754892)
#12 0x000066278d178aca clang::CodeGen::CodeGenFunction::emitFlexibleArrayMemberSize(clang::Expr const*, unsigned int, llvm::IntegerType*) (/usr/lib/libclang-cpp.so.18.1+0x1578aca)
#13 0x000066278d17949d clang::CodeGen::CodeGenFunction::emitBuiltinObjectSize(clang::Expr const*, unsigned int, llvm::IntegerType*, llvm::Value*, bool) (/usr/lib/libclang-cpp.so.18.1+0x157949d)
#14 0x000066278d1891a1 clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::GlobalDecl, unsigned int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x15891a1)
#15 0x000066278d356b89 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x1756b89)
#16 0x000066278d370b32 (/usr/lib/libclang-cpp.so.18.1+0x1770b32)
#17 0x000066278d3a9ce3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/libclang-cpp.so.18.1+0x17a9ce3)
#18 0x000066278d3542af clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/libclang-cpp.so.18.1+0x17542af)
#19 0x000066278d356fe2 clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(clang::Expr const*) (/usr/lib/libclang-cpp.so.18.1+0x1756fe2)
#20 0x000066278d2a34c5 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) (/usr/lib/libclang-cpp.so.18.1+0x16a34c5)
#21 0x000066278d2a4283 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/libclang-cpp.so.18.1+0x16a4283)
#22 0x000066278d35574f clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, clang::CodeGen::CGCallee const&, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot, llvm::Value*) (/usr/lib/libclang-cpp.so.18.1+0x175574f)
#23 0x000066278d356abe clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x1756abe)
#24 0x000066278d370b32 (/usr/lib/libclang-cpp.so.18.1+0x1770b32)
#25 0x000066278d3a9ce3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/libclang-cpp.so.18.1+0x17a9ce3)
#26 0x000066278d3542af clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/libclang-cpp.so.18.1+0x17542af)
#27 0x000066278d3544d4 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/libclang-cpp.so.18.1+0x17544d4)
#28 0x000066278d39e970 (/usr/lib/libclang-cpp.so.18.1+0x179e970)
#29 0x000066278e396454 (/usr/lib/libclang-cpp.so.18.1+0x2796454)
#30 0x000066278d35975b clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(clang::Expr const*, clang::CodeGen::Address, clang::Qualifiers, bool) (/usr/lib/libclang-cpp.so.18.1+0x175975b)
#31 0x000066278d4a81b8 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x18a81b8)
#32 0x000066278d4a841e clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x18a841e)
#33 0x000066278d375127 (/usr/lib/libclang-cpp.so.18.1+0x1775127)
#34 0x000066278d3a9ce3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/libclang-cpp.so.18.1+0x17a9ce3)
#35 0x000066278d3542af clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/libclang-cpp.so.18.1+0x17542af)
#36 0x000066278d3544d4 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/libclang-cpp.so.18.1+0x17544d4)
#37 0x000066278d4a6f92 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/usr/lib/libclang-cpp.so.18.1+0x18a6f92)
#38 0x000066278d4a80ea clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x18a80ea)
#39 0x000066278d4e3c69 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/usr/lib/libclang-cpp.so.18.1+0x18e3c69)
#40 0x000066278d4f8721 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/libclang-cpp.so.18.1+0x18f8721)
#41 0x000066278d53649d clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/libclang-cpp.so.18.1+0x193649d)
#42 0x000066278d5334b9 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/libclang-cpp.so.18.1+0x19334b9)
#43 0x000066278d533dc3 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/lib/libclang-cpp.so.18.1+0x1933dc3)
#44 0x000066278d53c732 (/usr/lib/libclang-cpp.so.18.1+0x193c732)
#45 0x000066278d599853 (/usr/lib/libclang-cpp.so.18.1+0x1999853)
#46 0x000066278d4b2597 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/lib/libclang-cpp.so.18.1+0x18b2597)
#47 0x000066278c18d022 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/libclang-cpp.so.18.1+0x58d022)
#48 0x000066278dc58451 clang::FrontendAction::Execute() (/usr/lib/libclang-cpp.so.18.1+0x2058451)
#49 0x000066278dbf9097 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/libclang-cpp.so.18.1+0x1ff9097)
#50 0x000066278dcb07fd clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclang-cpp.so.18.1+0x20b07fd)
#51 0x00000d81c96ab3a4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-18+0x133a4)
#52 0x00000d81c96af70a (/usr/bin/clang-18+0x1770a)
#53 0x000066278d92e485 (/usr/lib/libclang-cpp.so.18.1+0x1d2e485)
#54 0x00006627840a8d3a llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/libLLVM.so.18.1+0x6a8d3a)
#55 0x000066278d930e16 (/usr/lib/libclang-cpp.so.18.1+0x1d30e16)
#56 0x000066278d8ec039 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/libclang-cpp.so.18.1+0x1cec039)
#57 0x000066278d8ec43c clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/libclang-cpp.so.18.1+0x1cec43c)
#58 0x000066278d90a864 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/libclang-cpp.so.18.1+0x1d0a864)
#59 0x00000d81c96b2045 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang-18+0x1a045)
#60 0x00000d81c96a2fd5 main (/usr/bin/clang-18+0xafd5)
#61 0x0000662783434e08 (/usr/lib/libc.so.6+0x25e08)
#62 0x0000662783434ecc __libc_start_main (/usr/lib/libc.so.6+0x25ecc)
#63 0x00000d81c96a3035 _start (/usr/bin/clang-18+0xb035)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 18.1.8
Target: x86_64-unknown-linux-gnu
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/dev-8ea089.c
clang: note: diagnostic msg: /tmp/dev-8ea089.sh
clang: note: diagnostic msg: 

********************
make[4]: *** [scripts/Makefile.build:244: net/core/dev.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/core] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
@github-actions github-actions bot added the clang Clang issues not falling into any other category label Nov 14, 2024
@DimitryAndric
Copy link
Collaborator

Make a .tar.gz file or .zip file with the two files in it, you should be able to attach that, if it is not larger than 10MB.

@odomingao
Copy link
Author

Thanks, I uploaded the .tar.gz in the OP.

@EugeneZelenko EugeneZelenko added clang:codegen crash Prefer [crash-on-valid] or [crash-on-invalid] and removed clang Clang issues not falling into any other category labels Nov 14, 2024
@llvmbot
Copy link

llvmbot commented Nov 14, 2024

@llvm/issue-subscribers-clang-codegen

Author: None (odomingao)

clang-report.tar.gz

/usr/include/c++/14.2.1/bits/unique_ptr.h:447: typename std::add_lvalue_reference&lt;_Tp&gt;::type std::unique_ptr&lt;_Tp, _Dp&gt;::operator*() const [with _Tp = clang::CodeGen::CGRecordLayout; _Dp = std::default_delete&lt;clang::CodeGen::CGRecordLayout&gt;; typename std::add_lvalue_reference&lt;_Tp&gt;::type = clang::CodeGen::CGRecordLayout&amp;]: Assertion 'get() != pointer()' failed.
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 -Wp,-MMD,net/core/.dev.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ --target=x86_64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument -fmacro-prefix-map=./= -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=branch -fno-jump-tables -m64 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mstack-alignment=8 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mretpoline-external-thunk -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -mharden-sls=all -fpatchable-function-entry=11,11 -fno-delete-null-pointer-checks -O2 -fstack-protector-strong -ftrivial-auto-var-init=zero -fno-stack-clash-protection -pg -mfentry -DCC_USING_NOP_MCOUNT -DCC_USING_FENTRY -fno-lto -flto -fvisibility=hidden -fsanitize=kcfi -falign-functions=16 -fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=2048 -Wno-gnu -Wvla -Wno-pointer-sign -Wcast-function-type -Wimplicit-fallthrough -Werror=date-time -Werror=incompatible-pointer-types -Wenum-conversion -Wextra -Wunused -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-format-overflow -Wno-format-overflow-non-kprintf -Wno-format-truncation-non-kprintf -Wno-override-init -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -Wno-unaligned-access -Wno-enum-compare-conditional -Wno-enum-enum-conversion -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-sign-compare -Wno-unused-parameter -DRANDSTRUCT -frandomize-layout-seed-file=./scripts/basic/randstruct.seed -fsanitize=array-bounds -fsanitize=local-bounds -fsanitize-trap=undefined -DKBUILD_MODFILE=\"net/core/dev\" -DKBUILD_BASENAME=\"dev\" -DKBUILD_MODNAME=\"dev\" -D__KBUILD_MODNAME=kmod_dev -c -o net/core/dev.o net/core/dev.c
1.	net/core/dev.c:10568:1 &lt;Spelling=./include/linux/export.h:56:2&gt;: current parser token 'extern'
2.	net/core/dev.c:10558:6: LLVM IR generation of declaration 'init_dummy_netdev'
3.	net/core/dev.c:10558:6: Generating code for declaration 'init_dummy_netdev'
4.	net/core/dev.c:10565:2 &lt;Spelling=./include/linux/fortify-string.h:501:65&gt;: LLVM IR generation of compound statement ('{}')
 #<!-- -->0 0x00006627841c4d90 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/usr/lib/libLLVM.so.18.1+0x7c4d90)
 #<!-- -->1 0x00006627841c226d llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/libLLVM.so.18.1+0x7c226d)
 #<!-- -->2 0x00006627840a88e9 (/usr/lib/libLLVM.so.18.1+0x6a88e9)
 #<!-- -->3 0x000066278344c1d0 (/usr/lib/libc.so.6+0x3d1d0)
 #<!-- -->4 0x00006627834a53f4 (/usr/lib/libc.so.6+0x963f4)
 #<!-- -->5 0x000066278344c120 raise (/usr/lib/libc.so.6+0x3d120)
 #<!-- -->6 0x00006627834334c3 abort (/usr/lib/libc.so.6+0x244c3)
 #<!-- -->7 0x00006627836d3af0 std::chrono::_V2::system_clock::now() /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/chrono.cc:52:5
 #<!-- -->8 0x000066278d55d000 clang::CodeGen::CodeGenTypes::getCGRecordLayout(clang::RecordDecl const*) (/usr/lib/libclang-cpp.so.18.1+0x195d000)
 #<!-- -->9 0x000066278d3249b5 (/usr/lib/libclang-cpp.so.18.1+0x17249b5)
#<!-- -->10 0x000066278d324a7f (/usr/lib/libclang-cpp.so.18.1+0x1724a7f)
#<!-- -->11 0x000066278d354892 clang::CodeGen::CodeGenFunction::EmitCountedByFieldExpr(clang::Expr const*, clang::FieldDecl const*, clang::FieldDecl const*) (/usr/lib/libclang-cpp.so.18.1+0x1754892)
#<!-- -->12 0x000066278d178aca clang::CodeGen::CodeGenFunction::emitFlexibleArrayMemberSize(clang::Expr const*, unsigned int, llvm::IntegerType*) (/usr/lib/libclang-cpp.so.18.1+0x1578aca)
#<!-- -->13 0x000066278d17949d clang::CodeGen::CodeGenFunction::emitBuiltinObjectSize(clang::Expr const*, unsigned int, llvm::IntegerType*, llvm::Value*, bool) (/usr/lib/libclang-cpp.so.18.1+0x157949d)
#<!-- -->14 0x000066278d1891a1 clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::GlobalDecl, unsigned int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x15891a1)
#<!-- -->15 0x000066278d356b89 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x1756b89)
#<!-- -->16 0x000066278d370b32 (/usr/lib/libclang-cpp.so.18.1+0x1770b32)
#<!-- -->17 0x000066278d3a9ce3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/libclang-cpp.so.18.1+0x17a9ce3)
#<!-- -->18 0x000066278d3542af clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/libclang-cpp.so.18.1+0x17542af)
#<!-- -->19 0x000066278d356fe2 clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(clang::Expr const*) (/usr/lib/libclang-cpp.so.18.1+0x1756fe2)
#<!-- -->20 0x000066278d2a34c5 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&amp;, clang::Expr const*, clang::QualType) (/usr/lib/libclang-cpp.so.18.1+0x16a34c5)
#<!-- -->21 0x000066278d2a4283 clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&amp;, clang::CodeGen::CodeGenFunction::PrototypeWrapper, llvm::iterator_range&lt;clang::Stmt::CastIterator&lt;clang::Expr, clang::Expr const* const, clang::Stmt const* const&gt;&gt;, clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, clang::CodeGen::CodeGenFunction::EvaluationOrder) (/usr/lib/libclang-cpp.so.18.1+0x16a4283)
#<!-- -->22 0x000066278d35574f clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, clang::CodeGen::CGCallee const&amp;, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot, llvm::Value*) (/usr/lib/libclang-cpp.so.18.1+0x175574f)
#<!-- -->23 0x000066278d356abe clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x1756abe)
#<!-- -->24 0x000066278d370b32 (/usr/lib/libclang-cpp.so.18.1+0x1770b32)
#<!-- -->25 0x000066278d3a9ce3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/libclang-cpp.so.18.1+0x17a9ce3)
#<!-- -->26 0x000066278d3542af clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/libclang-cpp.so.18.1+0x17542af)
#<!-- -->27 0x000066278d3544d4 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/libclang-cpp.so.18.1+0x17544d4)
#<!-- -->28 0x000066278d39e970 (/usr/lib/libclang-cpp.so.18.1+0x179e970)
#<!-- -->29 0x000066278e396454 (/usr/lib/libclang-cpp.so.18.1+0x2796454)
#<!-- -->30 0x000066278d35975b clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(clang::Expr const*, clang::CodeGen::Address, clang::Qualifiers, bool) (/usr/lib/libclang-cpp.so.18.1+0x175975b)
#<!-- -->31 0x000066278d4a81b8 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&amp;, bool, clang::CodeGen::AggValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x18a81b8)
#<!-- -->32 0x000066278d4a841e clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&amp;, bool, clang::CodeGen::AggValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x18a841e)
#<!-- -->33 0x000066278d375127 (/usr/lib/libclang-cpp.so.18.1+0x1775127)
#<!-- -->34 0x000066278d3a9ce3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/lib/libclang-cpp.so.18.1+0x17a9ce3)
#<!-- -->35 0x000066278d3542af clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/lib/libclang-cpp.so.18.1+0x17542af)
#<!-- -->36 0x000066278d3544d4 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/lib/libclang-cpp.so.18.1+0x17544d4)
#<!-- -->37 0x000066278d4a6f92 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef&lt;clang::Attr const*&gt;) (/usr/lib/libclang-cpp.so.18.1+0x18a6f92)
#<!-- -->38 0x000066278d4a80ea clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&amp;, bool, clang::CodeGen::AggValueSlot) (/usr/lib/libclang-cpp.so.18.1+0x18a80ea)
#<!-- -->39 0x000066278d4e3c69 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/usr/lib/libclang-cpp.so.18.1+0x18e3c69)
#<!-- -->40 0x000066278d4f8721 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&amp;) (/usr/lib/libclang-cpp.so.18.1+0x18f8721)
#<!-- -->41 0x000066278d53649d clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/libclang-cpp.so.18.1+0x193649d)
#<!-- -->42 0x000066278d5334b9 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/libclang-cpp.so.18.1+0x19334b9)
#<!-- -->43 0x000066278d533dc3 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/lib/libclang-cpp.so.18.1+0x1933dc3)
#<!-- -->44 0x000066278d53c732 (/usr/lib/libclang-cpp.so.18.1+0x193c732)
#<!-- -->45 0x000066278d599853 (/usr/lib/libclang-cpp.so.18.1+0x1999853)
#<!-- -->46 0x000066278d4b2597 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/lib/libclang-cpp.so.18.1+0x18b2597)
#<!-- -->47 0x000066278c18d022 clang::ParseAST(clang::Sema&amp;, bool, bool) (/usr/lib/libclang-cpp.so.18.1+0x58d022)
#<!-- -->48 0x000066278dc58451 clang::FrontendAction::Execute() (/usr/lib/libclang-cpp.so.18.1+0x2058451)
#<!-- -->49 0x000066278dbf9097 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&amp;) (/usr/lib/libclang-cpp.so.18.1+0x1ff9097)
#<!-- -->50 0x000066278dcb07fd clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclang-cpp.so.18.1+0x20b07fd)
#<!-- -->51 0x00000d81c96ab3a4 cc1_main(llvm::ArrayRef&lt;char const*&gt;, char const*, void*) (/usr/bin/clang-18+0x133a4)
#<!-- -->52 0x00000d81c96af70a (/usr/bin/clang-18+0x1770a)
#<!-- -->53 0x000066278d92e485 (/usr/lib/libclang-cpp.so.18.1+0x1d2e485)
#<!-- -->54 0x00006627840a8d3a llvm::CrashRecoveryContext::RunSafely(llvm::function_ref&lt;void ()&gt;) (/usr/lib/libLLVM.so.18.1+0x6a8d3a)
#<!-- -->55 0x000066278d930e16 (/usr/lib/libclang-cpp.so.18.1+0x1d30e16)
#<!-- -->56 0x000066278d8ec039 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&amp;, clang::driver::Command const*&amp;, bool) const (/usr/lib/libclang-cpp.so.18.1+0x1cec039)
#<!-- -->57 0x000066278d8ec43c clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&amp;, llvm::SmallVectorImpl&lt;std::pair&lt;int, clang::driver::Command const*&gt;&gt;&amp;, bool) const (/usr/lib/libclang-cpp.so.18.1+0x1cec43c)
#<!-- -->58 0x000066278d90a864 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&amp;, llvm::SmallVectorImpl&lt;std::pair&lt;int, clang::driver::Command const*&gt;&gt;&amp;) (/usr/lib/libclang-cpp.so.18.1+0x1d0a864)
#<!-- -->59 0x00000d81c96b2045 clang_main(int, char**, llvm::ToolContext const&amp;) (/usr/bin/clang-18+0x1a045)
#<!-- -->60 0x00000d81c96a2fd5 main (/usr/bin/clang-18+0xafd5)
#<!-- -->61 0x0000662783434e08 (/usr/lib/libc.so.6+0x25e08)
#<!-- -->62 0x0000662783434ecc __libc_start_main (/usr/lib/libc.so.6+0x25ecc)
#<!-- -->63 0x00000d81c96a3035 _start (/usr/bin/clang-18+0xb035)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 18.1.8
Target: x86_64-unknown-linux-gnu
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/dev-8ea089.c
clang: note: diagnostic msg: /tmp/dev-8ea089.sh
clang: note: diagnostic msg: 

********************
make[4]: *** [scripts/Makefile.build:244: net/core/dev.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/core] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....

@EugeneZelenko
Copy link
Contributor

Could you please try 19 or main branch?

@AaronBallman
Copy link
Collaborator

Based on clang::CodeGen::CodeGenFunction::EmitCountedByFieldExpr in the stack trace, CC @bwendling @rapidsna for awareness

@DimitryAndric
Copy link
Collaborator

This regressed with llvmorg-18-init-17371-g00b6d03 for #76348, and was (likely) fixed again by llvmorg-19-init-18145-g1f6f97e, both by @bwendling. So this is a good candidate for backporting to release/19.x, but 18.x won't get any more updates.

@bwendling
Copy link
Collaborator

This was fixed in the 19.x branch:

commit 6db5f4f
Author: Bill Wendling [email protected]
Date: Tue Jul 23 07:49:46 2024 +0000

[Clang] Ignore empty FieldDecls when asking for the field number (#100040)

A FieldDecl that's an empty struct may not show up in CGRecordLayout. Go
ahead and ignore such a field as it shouldn't make a difference to these
calculations.

Fixes: 1f6f97e2b64a ("[Clang] Loop over FieldDecls instead of all Decls (#99574)")
Co-authored-by: Eli Friedman <[email protected]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

6 participants