weixin_39663729
weixin_39663729
2021-01-11 10:21

Clang 10 ICE on Release build

Description

./build.sh clr -clang -rc Release -c Release -lc Release fails with

Build log

  [ 62%] Building CXX object src/vm/wks/CMakeFiles/cee_wks_core.dir/__/typectxt.cpp.o
  Stack dump:
  0.    Program arguments: /usr/bin/clang++-10 -DDEBUGGING_SUPPORTED -DDISABLE_CONTRACTS -DFEATURE_ARRAYSTUB_AS_IL -DFEATURE_BASICFREEZE -DFEATURE_CODE_VERSIONING -DFEATURE_COLLECTIBLE_TYPES -DFEATURE_CORECLR -DFEATURE_CORESYSTEM -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_READYTORUN_COMPILER -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 -DFEATURE_UTF8STRING -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_SECURE_SCL=0 -D_UNICODE -Dclrjit_EXPORTS -I/home/sergey/projs/runtime/artifacts/obj/coreclr/Linux.x64.Release/src/jit -I/home/sergey/projs/runtime/src/coreclr/src/jit -I/home/sergey/projs/runtime/src/coreclr/src/pal/prebuilt/inc -I/home/sergey/projs/runtime/src/coreclr/../../artifacts/obj/coreclr -I/home/sergey/projs/runtime/src/coreclr/src/pal/inc -I/home/sergey/projs/runtime/src/coreclr/src/pal/inc/rt -I/home/sergey/projs/runtime/src/coreclr/src/pal/src/safecrt -I/home/sergey/projs/runtime/src/coreclr/src/inc -I/home/sergey/projs/runtime/src/coreclr/src/debug/inc -I/home/sergey/projs/runtime/src/coreclr/src/debug/inc/amd64 -I/home/sergey/projs/runtime/src/coreclr/src/debug/inc/dump -I/home/sergey/projs/runtime/src/coreclr/src/md/inc -I/home/sergey/projs/runtime/src/coreclr/src/classlibnative/bcltype -I/home/sergey/projs/runtime/src/coreclr/src/classlibnative/cryptography -I/home/sergey/projs/runtime/src/coreclr/src/classlibnative/inc -I/home/sergey/projs/runtime/artifacts/obj/coreclr/Linux.x64.Release/src/inc -I/home/sergey/projs/runtime/src/coreclr/src/pal/inc/rt/cpp -I/home/sergey/projs/runtime/src/coreclr/src/nativeresources -I/home/sergey/projs/runtime/src/coreclr/src/jit/./jitstd -I/home/sergey/projs/runtime/src/coreclr/src/jit/../inc -O2 -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-invalid-offsetof -ferror-limit=4096 -Wno-unused-private-field -Wno-microsoft -Wno-constant-logical-operand -Wno-pragma-pack -Wno-unknown-warning-option -Wno-incompatible-ms-struct -fsigned-char -fvisibility=hidden -nostdinc -flto -fprofile-instr-use=/home/sergey/.nuget/packages/optimization.linux-x64.pgo.coreclr/99.99.99-master-20200806.6/data/clrjit.profdata -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled -std=gnu++11 -o CMakeFiles/clrjit.dir/importer.cpp.o -c /home/sergey/projs/runtime/src/coreclr/src/jit/importer.cpp 
  1.    /home/sergey/projs/runtime/src/coreclr/src/jit/importer.cpp:16377:1: current parser token 'void'
  2.    /home/sergey/projs/runtime/src/coreclr/src/jit/importer.cpp:10834:16: LLVM IR generation of declaration 'Compiler::impImportBlockCode'
  3.    /home/sergey/projs/runtime/src/coreclr/src/jit/importer.cpp:10834:16: Generating code for declaration 'Compiler::impImportBlockCode'
   #0 0x00007f9722f5d10e llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/lib64/libLLVM-10.so+0xa4a10e)
   #1 0x00007f9722f5b3e4 llvm::sys::RunSignalHandlers() (/lib64/libLLVM-10.so+0xa483e4)
   #2 0x00007f9722e9a4d8 (/lib64/libLLVM-10.so+0x9874d8)
   #3 0x00007f972217aa70 __restore_rt (/lib64/libc.so.6+0x3ca70)
   #4 0x00007f972217a9e5 raise (/lib64/libc.so.6+0x3c9e5)
   #5 0x00007f9722163895 abort (/lib64/libc.so.6+0x25895)
   #6 0x00007f9727afcb68 (/lib64/libclang-cpp.so.10+0x868b68)
   #7 0x00007f9728bf4087 (/lib64/libclang-cpp.so.10+0x1960087)
   #8 0x00007f9728bf6a04 (/lib64/libclang-cpp.so.10+0x1962a04)
   #9 0x00007f9728bf92ae (/lib64/libclang-cpp.so.10+0x19652ae)
  #10 0x00007f9728bf5a1f (/lib64/libclang-cpp.so.10+0x1961a1f)
  #11 0x00007f9728bf92ae (/lib64/libclang-cpp.so.10+0x19652ae)
  #12 0x00007f9728bf9d12 (/lib64/libclang-cpp.so.10+0x1965d12)
  #13 0x00007f9728bf92ae (/lib64/libclang-cpp.so.10+0x19652ae)
  #14 0x00007f9728c08c19 clang::CodeGen::CodeGenPGO::computeRegionCounts(clang::Decl const*) (/lib64/libclang-cpp.so.10+0x1974c19)
  #15 0x00007f9728c08eff clang::CodeGen::CodeGenPGO::assignRegionCounters(clang::GlobalDecl, llvm::Function*) (/lib64/libclang-cpp.so.10+0x1974eff)
  #16 0x00007f9728bb5a31 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/lib64/libclang-cpp.so.10+0x1921a31)
  #17 0x00007f9728be92a6 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/lib64/libclang-cpp.so.10+0x19552a6)
  #18 0x00007f9728be61fb clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/lib64/libclang-cpp.so.10+0x19521fb)
  #19 0x00007f9728bec85d clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/lib64/libclang-cpp.so.10+0x195885d)
  #20 0x00007f9728c505bf (/lib64/libclang-cpp.so.10+0x19bc5bf)
  #21 0x00007f9728b9678b (/lib64/libclang-cpp.so.10+0x190278b)
  #22 0x00007f9727c07984 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.10+0x973984)
  #23 0x00007f972923b139 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.10+0x1fa7139)
  #24 0x00007f97291f727d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.10+0x1f6327d)
  #25 0x00007f97292b112c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.10+0x201d12c)
  #26 0x0000558456e22440 cc1_main(llvm::ArrayRef<char const>, char const*, void*) (/usr/bin/clang++-10+0x17440)
  #27 0x0000558456e20a94 (/usr/bin/clang++-10+0x15a94)
  #28 0x00007f9728f20ec9 (/lib64/libclang-cpp.so.10+0x1c8cec9)
  #29 0x00007f9722e9a5e7 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void>) (/lib64/libLLVM-10.so+0x9875e7)
  #30 0x00007f9728f23537 clang::driver::CC1Command::Execute(llvm::ArrayRef<:optional> >, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> >*, bool*) const (/lib64/libclang-cpp.so.10+0x1c8f537)
  #31 0x00007f9728ef7bed clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/lib64/libclang-cpp.so.10+0x1c63bed)
  #32 0x00007f9728ef8156 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<:pair clang::driver::command const> >&) const (/lib64/libclang-cpp.so.10+0x1c64156)
  #33 0x00007f9728f00693 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<:pair clang::driver::command const> >&) (/lib64/libclang-cpp.so.10+0x1c6c693)
  #34 0x0000558456e1cb86 main (/usr/bin/clang++-10+0x11b86)
  #35 0x00007f9722165042 __libc_start_main (/lib64/libc.so.6+0x27042)
  #36 0x0000558456e1dc1e _start (/usr/bin/clang++-10+0x12c1e)
  clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
  clang version 10.0.1 (Fedora 10.0.1-2.fc32)
  Target: x86_64-unknown-linux-gnu
  Thread model: posix
  InstalledDir: /usr/bin
  clang-10: note: diagnostic msg: PLEASE submit a bug report to  and include the crash backtrace, preprocessed source, and associated run script.
  [ 62%] Building CXX object src/jit/CMakeFiles/clrjit_win_x64_x64.dir/importer.cpp.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/importer-749598.cpp
  clang-10: note: diagnostic msg: /tmp/importer-749598.sh
  clang-10: note: diagnostic msg: 

  ********************
  /usr/include/c++/10/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<long unsigned int>; std::vector<_tp _alloc>::reference = long unsigned int&; std::vector<_tp _alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
  gmake[2]: *** [src/jit/CMakeFiles/clrjit.dir/build.make:408: src/jit/CMakeFiles/clrjit.dir/importer.cpp.o] Error 254
  gmake[1]: *** [CMakeFiles/Makefile2:2620: src/jit/CMakeFiles/clrjit.dir/all] Error 2
  gmake[1]: *** Waiting for unfinished jobs....
  </_tp></_tp></long></_tp></_tp></_tp></:pair></:pair></char></char></:optional></void></char>

./build.sh clr -clang -rc Debug -c Debug -lc Debug does not

Configuration


❯ clang++ --version
clang version 10.0.1 (Fedora 10.0.1-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix

❯ uname -r       
5.8.15-201.fc32.x86_64

该提问来源于开源项目:dotnet/runtime

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39948442 weixin_39948442 4月前

    I use clang 10 on my Ubuntu 16.04 daily and never had a problem, but my version is 10.0.0, so maybe there is some problem introduced in 10.0.1. It seems this issue belongs to the LLVM repo rather than dotnet/runtime.

    点赞 评论 复制链接分享
  • weixin_39996739 weixin_39996739 4月前

    Not sure how to follow up on this - perhaps the task on the runtime infra team is to somehow try to communicate this issue with the LLVM repo - Jan, do you know how to go about that?

    点赞 评论 复制链接分享
  • weixin_39663729 weixin_39663729 4月前

    I will try with latest build of LLVM and in case issue would persist I will submit it to LLVM team. Just had no chance to log back to my Linux machine yet.

    点赞 评论 复制链接分享
  • weixin_39663729 weixin_39663729 4月前

    Using Clang 11 issue is gone.

    点赞 评论 复制链接分享
  • weixin_39948442 weixin_39948442 4月前

    thank you for checking and confirming that!

    点赞 评论 复制链接分享

相关推荐