llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.89k stars 11.03k forks source link

Assertion `__n < this->size()` (computeRegionCounts) failed in `/usr/include/c++/11.2.0/bits/stl_vector.h` #54464

Open B1Z0N opened 2 years ago

B1Z0N commented 2 years ago
Error log

 PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.    Program arguments: /usr/bin/clang++ -DDEBUGGING_SUPPORTED -DDISABLE_CONTRACTS -DEnC_SUPPORTED -DFEATURE_ARRAYSTUB_AS_IL -DFEATURE_BASICFREEZE -DFEATURE_CODE_VERSIONING -DFEATURE_COLLECTIBLE_TYPES -DFEATURE_COMWRAPPERS -DFEATURE_CORECLR -DFEATURE_DBGIPC_TRANSPORT_DI -DFEATURE_DBGIPC_TRANSPORT_VM -DFEATURE_DEFAULT_INTERFACES -DFEATURE_EH_FUNCLETS -DFEATURE_EVENTSOURCE_XPLAT -DFEATURE_EVENT_TRACE -DFEATURE_HIJACK -DFEATURE_HW_INTRINSICS -DFEATURE_ICASTABLE -DFEATURE_INSTANTIATINGSTUB_AS_IL -DFEATURE_ISYM_READER -DFEATURE_MANAGED_ETW -DFEATURE_MANAGED_ETW_CHANNELS -DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES -DFEATURE_MULTICASTSTUB_AS_IL -DFEATURE_MULTICOREJIT -DFEATURE_MULTIREG_RETURN -DFEATURE_NO_HOST -DFEATURE_ON_STACK_REPLACEMENT -DFEATURE_PAL_ANSI -DFEATURE_PERFMAP -DFEATURE_PERFTRACING -DFEATURE_PGO -DFEATURE_PORTABLE_SHUFFLE_THUNKS -DFEATURE_PROFAPI_ATTACH_DETACH -DFEATURE_READYTORUN -DFEATURE_REJIT -DFEATURE_REMOTE_PROC_MEM -DFEATURE_SIMD -DFEATURE_STANDALONE_GC -DFEATURE_STUBS_AS_IL -DFEATURE_SVR_GC -DFEATURE_SYMDIFF -DFEATURE_TIERED_COMPILATION -DFEATURE_USE_ASM_GC_WRITE_BARRIERS -DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP -DHOST_64BIT -DHOST_AMD64 -DHOST_UNIX -DJIT_BUILD -DNDEBUG -DPROFILING_SUPPORTED -DSELF_NO_HOST -DTARGET_64BIT -DTARGET_AMD64 -DTARGET_UNIX -DUNICODE -DUNIX_AMD64_ABI -DUNIX_AMD64_ABI_ITF -DURTBLDENV_FRIENDLY=Retail -D_BLD_CLR -D_FILE_OFFSET_BITS=64 -D_SECURE_SCL=0 -D_UNICODE -Dclrjit_EXPORTS -I/home/b1z0n/Programming/dotnet/runtime/artifacts/obj/coreclr/Linux.x64.Release/jit -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit -I/home/b1z0n/Programming/dotnet/runtime/src/native -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/pal/prebuilt/inc -I/home/b1z0n/Programming/dotnet/runtime/artifacts/obj -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/pal/inc -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/pal/inc/rt -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/pal/src/safecrt -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/inc -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/debug/inc -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/debug/inc/amd64 -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/debug/inc/dump -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/md/inc -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/classlibnative/bcltype -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/classlibnative/cryptography -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/classlibnative/inc -I/home/b1z0n/Programming/dotnet/runtime/artifacts/obj/coreclr/Linux.x64.Release/inc -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/hosts/inc -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/minipal -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/pal/inc/rt/cpp -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/nativeresources -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit/./jitstd -I/home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit/../inc -O3 -DNDEBUG -fPIC -fPIC -O3 -g -Wall -Wno-null-conversion -fno-omit-frame-pointer -fms-extensions -fwrapv -fstack-protector-strong -Werror -Wno-unused-variable -Wno-unused-value -Wno-unused-function -Wno-tautological-compare -Wno-unknown-pragmas -Wimplicit-fallthrough -Wno-invalid-offsetof -Wno-unused-but-set-variable -ffp-contract=off -Wno-unknown-warning-option -ferror-limit=4096 -Wno-unused-private-field -Wno-constant-logical-operand -Wno-pragma-pack -Wno-incompatible-ms-struct -Wno-reserved-identifier -fsigned-char -fvisibility=hidden -nostdinc -flto -fprofile-instr-use=/home/b1z0n/.nuget/packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.22121.2/data/coreclr.profdata -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled -std=gnu++11 -Winvalid-pch -Xclang -include-pch -Xclang /home/b1z0n/Programming/dotnet/runtime/artifacts/obj/coreclr/Linux.x64.Release/jit/CMakeFiles/clrjit.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/b1z0n/Programming/dotnet/runtime/artifacts/obj/coreclr/Linux.x64.Release/jit/CMakeFiles/clrjit.dir/cmake_pch.hxx -MD -MT jit/CMakeFiles/clrjit.dir/codegencommon.cpp.o -MF CMakeFiles/clrjit.dir/codegencommon.cpp.o.d -o CMakeFiles/clrjit.dir/codegencommon.cpp.o -c /home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit/codegencommon.cpp
  1.    /home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit/codegencommon.cpp:687:1: current parser token 'template'
  2.    /home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit/codegencommon.cpp:592:21: LLVM IR generation of declaration 'Compiler::compHelperCallKillSet'
  3.    /home/b1z0n/Programming/dotnet/runtime/src/coreclr/jit/codegencommon.cpp:592:21: Generating code for declaration 'Compiler::compHelperCallKillSet'
  [ 50%] Building CXX object debug/di/CMakeFiles/cordbdi.dir/rsmda.cpp.o
   #0 0x00007feb43905ea7 (/usr/lib/libLLVM-13.so+0xba6ea7)
   #1 0x00007feb4390391c llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/libLLVM-13.so+0xba491c)
   #2 0x00007feb43809649 (/usr/lib/libLLVM-13.so+0xaaa649)
   #3 0x00007feb42971560 __restore_rt libc_sigaction.c:0:0
   #4 0x00007feb429be34c __pthread_kill_implementation pthread_kill.c:0:0
   #5 0x00007feb429714b8 gsignal (/usr/lib/libc.so.6+0x424b8)
   #6 0x00007feb4295b534 abort (/usr/lib/libc.so.6+0x2c534)
   #7 0x00007feb49f6123a (/usr/lib/libclang-cpp.so.13+0x8ea23a)
   #8 0x00007feb4b054779 (/usr/lib/libclang-cpp.so.13+0x19dd779)
   #9 0x00007feb4b04fe12 (/usr/lib/libclang-cpp.so.13+0x19d8e12)
  #10 0x00007feb4b055baa (/usr/lib/libclang-cpp.so.13+0x19debaa)
  #11 0x00007feb4b04fe12 (/usr/lib/libclang-cpp.so.13+0x19d8e12)
  #12 0x00007feb4b05af00 clang::CodeGen::CodeGenPGO::computeRegionCounts(clang::Decl const*) (/usr/lib/libclang-cpp.so.13+0x19e3f00)
  #13 0x00007feb4b079697 clang::CodeGen::CodeGenPGO::assignRegionCounters(clang::GlobalDecl, llvm::Function*) (/usr/lib/libclang-cpp.so.13+0x1a02697)
  #14 0x00007feb4b032cd1 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/libclang-cpp.so.13+0x19bbcd1)
  #15 0x00007feb4b03bd58 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/libclang-cpp.so.13+0x19c4d58)
  #16 0x00007feb4b039b43 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/libclang-cpp.so.13+0x19c2b43)
  #17 0x00007feb4b05a19f (/usr/lib/libclang-cpp.so.13+0x19e319f)
  #18 0x00007feb4b0a94f4 (/usr/lib/libclang-cpp.so.13+0x1a324f4)
  #19 0x00007feb4afc6408 (/usr/lib/libclang-cpp.so.13+0x194f408)
  #20 0x00007feb4a065124 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/libclang-cpp.so.13+0x9ee124)
  #21 0x00007feb4b5eef79 clang::FrontendAction::Execute() (/usr/lib/libclang-cpp.so.13+0x1f77f79)
  #22 0x00007feb4b5952cf clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/libclang-cpp.so.13+0x1f1e2cf)
  #23 0x00007feb4b63a5f0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclang-cpp.so.13+0x1fc35f0)
  #24 0x000055e4da68584c cc1_main(llvm::ArrayRef, char const*, void*) (/usr/bin/clang+++0x1684c)
  #25 0x000055e4da687c2d (/usr/bin/clang+++0x18c2d)
  #26 0x00007feb4b2fea99 (/usr/lib/libclang-cpp.so.13+0x1c87a99)
  #27 0x00007feb43809717 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref) (/usr/lib/libLLVM-13.so+0xaaa717)
  #28 0x00007feb4b305030 (/usr/lib/libclang-cpp.so.13+0x1c8e030)
  #29 0x00007feb4b31d694 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/usr/lib/libclang-cpp.so.13+0x1ca6694)
  #30 0x00007feb4b31dac9 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl >&) const (/usr/lib/libclang-cpp.so.13+0x1ca6ac9)
  #31 0x00007feb4b320a42 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl >&) (/usr/lib/libclang-cpp.so.13+0x1ca9a42)
  #32 0x000055e4da67d61b main (/usr/bin/clang+++0xe61b)
  #33 0x00007feb4295c310 __libc_start_call_main libc-start.c:0:0
  #34 0x00007feb4295c3c1 __libc_start_main@GLIBC_2.2.5 (/usr/lib/libc.so.6+0x2d3c1)
  #35 0x000055e4da67e485 _start (/usr/bin/clang+++0xf485)
  clang-13: error: clang frontend command failed with exit code 134 (use -v to see invocation)
  clang version 13.0.1
  Target: x86_64-pc-linux-gnu
  Thread model: posix
  InstalledDir: /usr/bin
  clang-13: note: diagnostic msg: 
  ********************

  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
  Preprocessed source(s) and associated run script(s) are located at:
  clang-13: note: diagnostic msg: /tmp/codegencommon-9351da.cpp
  clang-13: note: diagnostic msg: /tmp/codegencommon-9351da.sh
  clang-13: note: diagnostic msg: 

  ********************
  /usr/include/c++/11.2.0/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = long unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = long unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.
  make[2]: *** [jit/CMakeFiles/clrjit.dir/build.make:173: jit/CMakeFiles/clrjit.dir/codegencommon.cpp.o] Error 134
  make[1]: *** [CMakeFiles/Makefile2:3330: jit/CMakeFiles/clrjit.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....

Here is the codegencommon.sh and preprocessed codegencommon.cpp. For more see this discussion on dotnet/runtime repository.

My setup:

OS: Arch Linux x86_64
Host: HP Spectre x360 Convertible 13-ae0xx
Kernel: 5.16.13-arch1-1
CPU: Intel i7-8550U (8) @ 4.000GHz
GPU: Intel UHD Graphics 620
llvmbot commented 2 years ago

@llvm/issue-subscribers-clang-codegen