Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

"Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed" when compiling arch/x86/kernel/kprobes/opt.o #22

Open
connorkuehl opened this issue Nov 28, 2019 · 0 comments
Labels
bug Something isn't working
Projects

Comments

@connorkuehl
Copy link
Owner

Linux kernel commit SHA: a6ed68d6468bd5a3da78a103344ded1435fed57a

clang-10: /home/connor/src/llvm-project/llvm/include/llvm/Support/Casting.h:264: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Instruction; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Instruction*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.	Program arguments: /home/connor/src/llvm-project/build/bin/clang-10 -cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name opt.c -mrelocation-model static -mthread-model posix -fno-delete-null-pointer-checks -mllvm -warn-stack-size=1024 -mframe-pointer=all -relaxed-aliasing -mdisable-tail-calls -fmath-errno -masm-verbose -no-integrated-as -mconstructor-aliases -fuse-init-array -mcode-model kernel -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -target-feature -sse -target-feature -mmx -target-feature -sse2 -target-feature -3dnow -target-feature -avx -target-feature -x87 -target-feature +retpoline-external-thunk -disable-red-zone -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -nostdsysteminc -nobuiltininc -resource-dir /home/connor/src/llvm-project/build/lib/clang/10.0.0 -dependency-file arch/x86/kernel/kprobes/.opt.o.d -MT arch/x86/kernel/kprobes/opt.o -sys-header-deps -isystem /home/connor/src/llvm-project/build/lib/clang/10.0.0/include -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -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 -D __KERNEL__ -D CONFIG_X86_X32_ABI -D CONFIG_AS_CFI=1 -D CONFIG_AS_CFI_SIGNAL_FRAME=1 -D CONFIG_AS_CFI_SECTIONS=1 -D CONFIG_AS_SSSE3=1 -D CONFIG_AS_AVX=1 -D CONFIG_AS_AVX2=1 -D CONFIG_AS_AVX512=1 -D CONFIG_AS_SHA1_NI=1 -D CONFIG_AS_SHA256_NI=1 -D CC_USING_FENTRY -D KBUILD_BASENAME="opt" -D KBUILD_MODNAME="opt" -O2 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -Werror=unknown-warning-option -Wno-sign-compare -Wno-address-of-packed-member -Wno-format-invalid-specifier -Wno-gnu -Wno-tautological-compare -Wno-unused-const-variable -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Werror=date-time -Werror=incompatible-pointer-types -Wno-initializer-overrides -Wno-format -Wno-sign-compare -Wno-format-zero-length -std=gnu89 -fno-dwarf-directory-asm -fdebug-compilation-dir /home/connor/src/kernels/linux -ferror-limit 19 -fmessage-length 0 -pg -mfentry -fwrapv -stack-protector 2 -mstack-alignment=8 -fcf-protection=none -fwchar-type=short -fno-signed-wchar -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fno-common -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/opt-3c3bf0.s -x c arch/x86/kernel/kprobes/opt.c 
1.	<eof> parser at end of file
2.	Per-module optimization passes
3.	Running pass 'Function Pass Manager' on module 'arch/x86/kernel/kprobes/opt.c'.
4.	Running pass 'Simplify the CFG' on function '@kmalloc_index'
  CC [M]  fs/afs/super.o
  CC      mm/early_ioremap.o
 #0 0x000055a91e8644f9 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:548:22
 #1 0x000055a91e864590 PrintStackTraceSignalHandler(void*) /home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:609:1
 #2 0x000055a91e862377 llvm::sys::RunSignalHandlers() /home/connor/src/llvm-project/llvm/lib/Support/Signals.cpp:68:20
 #3 0x000055a91e863e41 SignalHandler(int) /home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:390:1
 #4 0x00007fe0e78d9540 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x15540)
 #5 0x00007fe0e736e3eb raise /build/glibc-4WA41p/glibc-2.30/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007fe0e734d899 abort /build/glibc-4WA41p/glibc-2.30/stdlib/abort.c:81:7
 #7 0x00007fe0e734d769 get_sysdep_segment_value /build/glibc-4WA41p/glibc-2.30/intl/loadmsgcat.c:509:8
 #8 0x00007fe0e734d769 _nl_load_domain /build/glibc-4WA41p/glibc-2.30/intl/loadmsgcat.c:970:34
 #9 0x00007fe0e735f006 (/lib/x86_64-linux-gnu/libc.so.6+0x37006)
#10 0x000055a91d1a41fe llvm::cast_retty<llvm::Instruction, llvm::Value*>::ret_type llvm::cast<llvm::Instruction, llvm::Value>(llvm::Value*) /home/connor/src/llvm-project/llvm/include/llvm/Support/Casting.h:264:3
#11 0x000055a91d5f3378 llvm::parseWidenableBranch(llvm::User*, llvm::Use*&, llvm::Use*&, llvm::BasicBlock*&, llvm::BasicBlock*&) /home/connor/src/llvm-project/llvm/lib/Analysis/GuardUtils.cpp:87:32
#12 0x000055a91d5f3173 llvm::parseWidenableBranch(llvm::User const*, llvm::Value*&, llvm::Value*&, llvm::BasicBlock*&, llvm::BasicBlock*&) /home/connor/src/llvm-project/llvm/lib/Analysis/GuardUtils.cpp:49:3
#13 0x000055a91e97d851 tryWidenCondBranchToCondBranch(llvm::BranchInst*, llvm::BranchInst*) /home/connor/src/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3240:7
#14 0x000055a91e97debd SimplifyCondBranchToCondBranch(llvm::BranchInst*, llvm::BranchInst*, llvm::DataLayout const&, llvm::TargetTransformInfo const&) /home/connor/src/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3326:3
#15 0x000055a91e9897f0 (anonymous namespace)::SimplifyCFGOpt::SimplifyCondBranch(llvm::BranchInst*, llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>&) /home/connor/src/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6008:9
#16 0x000055a91e98a302 (anonymous namespace)::SimplifyCFGOpt::simplifyOnce(llvm::BasicBlock*) /home/connor/src/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6148:7
#17 0x000055a91e98a559 (anonymous namespace)::SimplifyCFGOpt::run(llvm::BasicBlock*) /home/connor/src/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6183:13
#18 0x000055a91e98a5f1 llvm::simplifyCFG(llvm::BasicBlock*, llvm::TargetTransformInfo const&, llvm::SimplifyCFGOptions const&, llvm::SmallPtrSetImpl<llvm::BasicBlock*>*) /home/connor/src/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6195:1
#19 0x000055a91e7817c4 iterativelySimplifyCFG(llvm::Function&, llvm::TargetTransformInfo const&, llvm::SimplifyCFGOptions const&) /home/connor/src/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp:164:7
#20 0x000055a91e7818ab simplifyFunctionCFG(llvm::Function&, llvm::TargetTransformInfo const&, llvm::SimplifyCFGOptions const&) /home/connor/src/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp:178:15
#21 0x000055a91e781e35 (anonymous namespace)::CFGSimplifyPass::runOnFunction(llvm::Function&) /home/connor/src/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp:270:47
#22 0x000055a91e004758 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/connor/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1481:20
#23 0x000055a91e004a19 llvm::FPPassManager::runOnModule(llvm::Module&) /home/connor/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1517:13
#24 0x000055a91e004e8b (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/connor/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1582:20
#25 0x000055a91e0056bc llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/connor/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1694:13
#26 0x000055a91e0058cd llvm::legacy::PassManager::run(llvm::Module&) /home/connor/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1726:1
#27 0x000055a91ebaa187 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /home/connor/src/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:910:68
#28 0x000055a91ebaea10 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) /home/connor/src/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1546:27
#29 0x000055a91fc4b048 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:307:24
#30 0x000055a9214c2f0b clang::ParseAST(clang::Sema&, bool, bool) /home/connor/src/llvm-project/clang/lib/Parse/ParseAST.cpp:178:14
#31 0x000055a91f35b9cf clang::ASTFrontendAction::ExecuteAction() /home/connor/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1043:11
#32 0x000055a91fc48c2c clang::CodeGenAction::ExecuteAction() /home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1089:1
#33 0x000055a91f35b326 clang::FrontendAction::Execute() /home/connor/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:940:38
#34 0x000055a91f2edee8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/connor/src/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:964:42
#35 0x000055a91f4cd928 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/connor/src/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:38
#36 0x000055a91d1156de cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/connor/src/llvm-project/clang/tools/driver/cc1_main.cpp:250:40
#37 0x000055a91d10a615 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/connor/src/llvm-project/clang/tools/driver/driver.cpp:309:64
#38 0x000055a91d10ad0a main /home/connor/src/llvm-project/clang/tools/driver/driver.cpp:382:26
#39 0x00007fe0e734f1e3 __libc_start_main /build/glibc-4WA41p/glibc-2.30/csu/../csu/libc-start.c:342:3
#40 0x000055a91d108dfe _start (/home/connor/src/llvm-project/build/bin/clang-10+0x23b4dfe)
clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 10.0.0 (git@github.com:connorkuehl/llvm-project.git 10bb4c357453a9fb2995dd48aecbfa32ccc7677c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/connor/src/llvm-project/build/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  CC      mm/cma.o
clang-10: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/opt-53ebaa.c
clang-10: note: diagnostic msg: /tmp/opt-53ebaa.sh
clang-10: note: diagnostic msg: 

********************
make[3]: *** [scripts/Makefile.build:266: arch/x86/kernel/kprobes/opt.o] Error 254
make[2]: *** [scripts/Makefile.build:509: arch/x86/kernel/kprobes] Error 2
make[1]: *** [scripts/Makefile.build:509: arch/x86/kernel] Error 2
make: *** [Makefile:1652: arch/x86] Error 2
make: *** Waiting for unfinished jobs....
@connorkuehl connorkuehl added the bug Something isn't working label Nov 28, 2019
@connorkuehl connorkuehl added this to To do in Randstruct via automation Nov 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Randstruct
  
To do
Development

No branches or pull requests

1 participant