Closed R-Goc closed 3 weeks ago
It does that every time I tested
current ICX-cl does compile.
here is a stack trace from a debug build of llvm:
Assertion failed: !NodePtr->isKnownSentinel(), file C:\Users\rysza\lib\llvm-project\llvm\include\llvm/ADT/ilist_iterator.h, line 168
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: C:\\Users\\rysza\\bin\\LLVM-dbg\\bin\\clang-cl.exe -cc1 -triple x86_64-pc-windows-msvc19.42.34226 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name descriptor.cc -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -fms-volatile -funwind-tables=2 -target-cpu x86-64 -target-feature +sse3 -target-feature +ssse3 -target-feature +sse4.1 -target-feature +popcnt -target-feature +sse4.2 -target-feature +avx -target-feature +f16c -target-feature +avx2 -target-feature +fma -mllvm -x86-asm-syntax=intel -tune-cpu
generic -D_MT -D_DLL --dependent-lib=msvcrt --dependent-lib=oldnames --show-includes -sys-header-deps -stack-protector 2 -fcxx-exceptions -fexceptions -fasync-exceptions -fdiagnostics-format msvc -fdebug-compilation-dir=C:\\Users\\rysza\\lib\\opencv\\build -ffunction-sections -fcoverage-compilation-dir=C:\\Users\\rysza\\lib\\opencv\\build -D _CRT_SECURE_NO_WARNINGS=1 -D _VARIADIC_MAX=10 -D _WIN32_WINNT=0x0601 -D WIN32 -D _WINDOWS -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE -D _SCL_SECURE_NO_WARNINGS -D NDEBUG -D NDEBUG -O3 -Wall -W -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -Wno-long-long -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-parameter -fdeprecated-macro -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.42.34226 -std=c++14 -finline-functions -fskip-odr-check-in-gmf -fdelayed-template-parsing -vectorize-loops -vectorize-slp -faddrsig -x c++ descriptor-236805.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'descriptor-236805.cpp'.
4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@"?AddPackage@DescriptorBuilder@protobuf@google@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVMessage@23@PEAVFileDescriptor@23@@Z"'
Exception Code: 0xC000001D
#0 0x00007ff7a15112fc HandleAbort C:\Users\rysza\lib\llvm-project\llvm\lib\Support\Windows\Signals.inc:429:0
#1 0x00007ffafd6190ed (C:\Windows\SYSTEM32\ucrtbased.dll+0xa90ed)
#2 0x00007ffafd61ae49 (C:\Windows\SYSTEM32\ucrtbased.dll+0xaae49)
#3 0x00007ffafd621345 (C:\Windows\SYSTEM32\ucrtbased.dll+0xb1345)
#4 0x00007ffafd620bd7 (C:\Windows\SYSTEM32\ucrtbased.dll+0xb0bd7)
#5 0x00007ffafd61eba1 (C:\Windows\SYSTEM32\ucrtbased.dll+0xaeba1)
#6 0x00007ffafd6218af (C:\Windows\SYSTEM32\ucrtbased.dll+0xb18af)
#7 0x00007ff7a10e561c llvm::ilist_iterator<struct llvm::ilist_detail::node_options<class llvm::MachineInstr, 1, 1, void, 0, void>, 0, 0>::operator*(void) const C:\Users\rysza\lib\llvm-project\llvm\include\llvm\ADT\ilist_iterator.h:169:0
#8 0x00007ff7a18da8f3 llvm::MachineInstrBundleIterator<class llvm::MachineInstr, 0>::operator*(void) const C:\Users\rysza\lib\llvm-project\llvm\include\llvm\CodeGen\MachineInstrBundleIterator.h:178:0
#9 0x00007ff7a3ba5f93 llvm::SelectionDAGISel::reportIPToStateForBlocks(class llvm::MachineFunction *) C:\Users\rysza\lib\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:1479:0
#10 0x00007ff7a3ba1f27 llvm::SelectionDAGISel::SelectAllBasicBlocks(class llvm::Function const &) C:\Users\rysza\lib\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:1911:0
#11 0x00007ff7a3b9eed6 llvm::SelectionDAGISel::runOnMachineFunction(class llvm::MachineFunction &) C:\Users\rysza\lib\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:614:0
#12 0x00007ff7a1b2e019 `anonymous namespace'::X86DAGToDAGISel::runOnMachineFunction C:\Users\rysza\lib\llvm-project\llvm\lib\Target\X86\X86ISelDAGToDAG.cpp:190:0
#13 0x00007ff7a3b9d910 llvm::SelectionDAGISelLegacy::runOnMachineFunction(class llvm::MachineFunction &) C:\Users\rysza\lib\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:374:0
#14 0x00007ff7a1a5388d llvm::MachineFunctionPass::runOnFunction(class llvm::Function &) C:\Users\rysza\lib\llvm-project\llvm\lib\CodeGen\MachineFunctionPass.cpp:94:0
#15 0x00007ff7a113dbe1 llvm::FPPassManager::runOnFunction(class llvm::Function &) C:\Users\rysza\lib\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1408:0
#16 0x00007ff7a1142e0d llvm::FPPassManager::runOnModule(class llvm::Module &) C:\Users\rysza\lib\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1454:0
#17 0x00007ff7a113e635 `anonymous namespace'::MPPassManager::runOnModule C:\Users\rysza\lib\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1523:0
#18 0x00007ff7a113e105 llvm::legacy::PassManagerImpl::run(class llvm::Module &) C:\Users\rysza\lib\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:541:0
#19 0x00007ff7a1143131 llvm::legacy::PassManager::run(class llvm::Module &) C:\Users\rysza\lib\llvm-project\llvm\lib\IR\LegacyPassManager.cpp:1650:0
#20 0x00007ff7a2ae1527 `anonymous namespace'::EmitAssemblyHelper::RunCodegenPipeline C:\Users\rysza\lib\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1162:0
#21 0x00007ff7a2ada3c0 `anonymous namespace'::EmitAssemblyHelper::EmitAssembly C:\Users\rysza\lib\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1185:0
#22 0x00007ff7a2ad9314 clang::EmitBackendOutput(class clang::DiagnosticsEngine &, class clang::HeaderSearchOptions const &, class clang::CodeGenOptions const &, class clang::TargetOptions const &, class clang::LangOptions const &, class llvm::StringRef, class llvm::Module *, enum clang::BackendAction, class llvm::IntrusiveRefCntPtr<class llvm::vfs::FileSystem>, class std::unique_ptr<class llvm::raw_pwrite_stream, struct std::default_delete<class llvm::raw_pwrite_stream>>, class clang::BackendConsumer *) C:\Users\rysza\lib\llvm-project\clang\lib\CodeGen\BackendUtil.cpp:1347:0
#23 0x00007ff7a3473acb clang::BackendConsumer::HandleTranslationUnit(class clang::ASTContext &) C:\Users\rysza\lib\llvm-project\clang\lib\CodeGen\CodeGenAction.cpp:354:0
#24 0x00007ff7a65eed47 clang::ParseAST(class clang::Sema &, bool, bool) C:\Users\rysza\lib\llvm-project\clang\lib\Parse\ParseAST.cpp:184:0
#25 0x00007ff7a320d97d clang::ASTFrontendAction::ExecuteAction(void) C:\Users\rysza\lib\llvm-project\clang\lib\Frontend\FrontendAction.cpp:1194:0
#26 0x00007ff7a3478beb clang::CodeGenAction::ExecuteAction(void) C:\Users\rysza\lib\llvm-project\clang\lib\CodeGen\CodeGenAction.cpp:1146:0
#27 0x00007ff7a320d2a4 clang::FrontendAction::Execute(void) C:\Users\rysza\lib\llvm-project\clang\lib\Frontend\FrontendAction.cpp:1082:0
#28 0x00007ff7a178c962 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) C:\Users\rysza\lib\llvm-project\clang\lib\Frontend\CompilerInstance.cpp:1061:0
#29 0x00007ff7a18ab0bf clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) C:\Users\rysza\lib\llvm-project\clang\lib\FrontendTool\ExecuteCompilerInvocation.cpp:280:0
#30 0x00007ff7a0d3189a cc1_main(class llvm::ArrayRef<char const *>, char const *, void *) C:\Users\rysza\lib\llvm-project\clang\tools\driver\cc1_main.cpp:285:0
#31 0x00007ff7a0d22ce8 ExecuteCC1Tool C:\Users\rysza\lib\llvm-project\clang\tools\driver\driver.cpp:215:0
#32 0x00007ff7a0d2150e clang_main(int, char **, struct llvm::ToolContext const &) C:\Users\rysza\lib\llvm-project\clang\tools\driver\driver.cpp:256:0
#33 0x00007ff7a0d5b161 main C:\Users\rysza\lib\llvm-project\build\tools\clang\tools\driver\clang-driver.cpp:17:0
#34 0x00007ff7ab45f479 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0
#35 0x00007ff7ab45f5b2 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#36 0x00007ff7ab45f63e __scrt_common_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0
#37 0x00007ff7ab45f65e mainCRTStartup D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#38 0x00007ffb8574257d (C:\Windows\System32\KERNEL32.DLL+0x1257d)
#39 0x00007ffb86a8af28 (C:\Windows\SYSTEM32\ntdll.dll+0x5af28)
@llvm/issue-subscribers-backend-x86
Author: None (R-Goc)
In issue https://github.com/llvm/llvm-project/issues/105813 there is a simpler reproduction, though doesn't work for me exactly. Also there is more information there. The issue is that in the SelectionDAG::ReportIPToStateForBlocks in SelectionDAGISel.cpp:1479, which only runs when MF->getWinEHFuncInfo() returns non-null, the top-level machine instruction block returns a sentinel value when attempting to dereference, which triggers an assert in ilist_iterator.h:168
This is the crash report, as asked by the text. This was a local build of LLVM, from git, around a month ago. Most tests passed after the build, here are the few that didn't:
Crash text:
descriptor-236805.cpp.txt descriptor-236805.sh.txt