Build with segfault(latest commit)(gcc error..)

I encounter segfault in the lastest commit(d6d6367b0105bc5f155a963ea11e59c7913a2cf0).

My options

  • USE_LLVM ON
  • USE_CUDA ON

My environments

  • Ubuntu 20.04
  • GCC9.3(I also met the same error when using the GCC 7.5)
  • Ubuntu 20.04
  • CUDA 10.2
  • LLVM 12

version

d6d6367b0105bc5f155a963ea11e59c7913a2cf0 tvm
ddeb264880a1fa7e7be238ab3901a810324fbe5f 3rdparty/dlpack (v0.5) 21cc7de0dc9fd6acb796e1be6181fa8e6b6c8f41 3rdparty/dmlc-core (v0.4-8-g21cc7de) 08f7c7e69f8ea61a0c4151359bc8023be8e9217b 3rdparty/libbacktrace (heads/master) cabe04d6d6b05356fa8f9741704924788f0dd762 3rdparty/rang (v3.1.0-5-gcabe04d) dfe9f572a43d41e0c1ecdf036cea97042a0febfe 3rdparty/vta-hw (remotes/origin/master-14-gdfe9f57)

LOG

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/gcc-9
-- Check for working C compiler: /usr/bin/gcc-9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-9
-- Check for working CXX compiler: /usr/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Forbidding undefined symbols in shared library, using -Wl,--no-undefined on platform Linux
-- Build with RPC support...
-- Build with Graph Executor support...
-- Build with profiler...
-- VTA build with VTA_HW_PATH=/home/jaehun/tvm-test/3rdparty/vta-hw
-- Build VTA runtime with target: sim
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2
-- Found CUDA_CUDA_LIBRARY=/usr/local/cuda-10.2/targets/x86_64-linux/lib/stubs/libcuda.so
-- Found CUDA_CUDART_LIBRARY=/usr/local/cuda-10.2/lib64/libcudart.so
-- Found CUDA_NVRTC_LIBRARY=/usr/local/cuda-10.2/lib64/libnvrtc.so
-- Found CUDA_CUDNN_INCLUDE_DIRS=
-- Found CUDA_CUDNN_LIBRARY=
-- Found CUDA_CUBLAS_LIBRARY=/usr/local/cuda-10.2/lib64/libcublas.so
-- Found CUDA_CUBLASLT_LIBRARY=/usr/local/cuda-10.2/lib64/libcublasLt.so
-- Build with CUDA 10.2 support
-- Not found - LLVM_LIBS
-- Fall back to using llvm-config
-- Use llvm-config=/home/jaehun/.local/bin/llvm-config
-- Found LLVM_INCLUDE_DIRS=/home/jaehun/.local/include
-- Found LLVM_DEFINITIONS=-D_GNU_SOURCE;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS
-- Found LLVM_LIBS=/home/jaehun/.local/lib/libLLVMWindowsManifest.a;/home/jaehun/.local/lib/libLLVMXRay.a;/home/jaehun/.local/lib/libLLVMLibDriver.a;/home/jaehun/.local/lib/libLLVMDlltoolDriver.a;/home/jaehun/.local/lib/libLLVMCoverage.a;/home/jaehun/.local/lib/libLLVMLineEditor.a;/home/jaehun/.local/lib/libLLVMXCoreDisassembler.a;/home/jaehun/.local/lib/libLLVMXCoreCodeGen.a;/home/jaehun/.local/lib/libLLVMXCoreDesc.a;/home/jaehun/.local/lib/libLLVMXCoreInfo.a;/home/jaehun/.local/lib/libLLVMX86Disassembler.a;/home/jaehun/.local/lib/libLLVMX86AsmParser.a;/home/jaehun/.local/lib/libLLVMX86CodeGen.a;/home/jaehun/.local/lib/libLLVMX86Desc.a;/home/jaehun/.local/lib/libLLVMX86Info.a;/home/jaehun/.local/lib/libLLVMWebAssemblyDisassembler.a;/home/jaehun/.local/lib/libLLVMWebAssemblyAsmParser.a;/home/jaehun/.local/lib/libLLVMWebAssemblyCodeGen.a;/home/jaehun/.local/lib/libLLVMWebAssemblyDesc.a;/home/jaehun/.local/lib/libLLVMWebAssemblyInfo.a;/home/jaehun/.local/lib/libLLVMSystemZDisassembler.a;/home/jaehun/.local/lib/libLLVMSystemZAsmParser.a;/home/jaehun/.local/lib/libLLVMSystemZCodeGen.a;/home/jaehun/.local/lib/libLLVMSystemZDesc.a;/home/jaehun/.local/lib/libLLVMSystemZInfo.a;/home/jaehun/.local/lib/libLLVMSparcDisassembler.a;/home/jaehun/.local/lib/libLLVMSparcAsmParser.a;/home/jaehun/.local/lib/libLLVMSparcCodeGen.a;/home/jaehun/.local/lib/libLLVMSparcDesc.a;/home/jaehun/.local/lib/libLLVMSparcInfo.a;/home/jaehun/.local/lib/libLLVMRISCVDisassembler.a;/home/jaehun/.local/lib/libLLVMRISCVAsmParser.a;/home/jaehun/.local/lib/libLLVMRISCVCodeGen.a;/home/jaehun/.local/lib/libLLVMRISCVDesc.a;/home/jaehun/.local/lib/libLLVMRISCVInfo.a;/home/jaehun/.local/lib/libLLVMPowerPCDisassembler.a;/home/jaehun/.local/lib/libLLVMPowerPCAsmParser.a;/home/jaehun/.local/lib/libLLVMPowerPCCodeGen.a;/home/jaehun/.local/lib/libLLVMPowerPCDesc.a;/home/jaehun/.local/lib/libLLVMPowerPCInfo.a;/home/jaehun/.local/lib/libLLVMNVPTXCodeGen.a;/home/jaehun/.local/lib/libLLVMNVPTXDesc.a;/home/jaehun/.local/lib/libLLVMNVPTXInfo.a;/home/jaehun/.local/lib/libLLVMMSP430Disassembler.a;/home/jaehun/.local/lib/libLLVMMSP430AsmParser.a;/home/jaehun/.local/lib/libLLVMMSP430CodeGen.a;/home/jaehun/.local/lib/libLLVMMSP430Desc.a;/home/jaehun/.local/lib/libLLVMMSP430Info.a;/home/jaehun/.local/lib/libLLVMMipsDisassembler.a;/home/jaehun/.local/lib/libLLVMMipsAsmParser.a;/home/jaehun/.local/lib/libLLVMMipsCodeGen.a;/home/jaehun/.local/lib/libLLVMMipsDesc.a;/home/jaehun/.local/lib/libLLVMMipsInfo.a;/home/jaehun/.local/lib/libLLVMLanaiDisassembler.a;/home/jaehun/.local/lib/libLLVMLanaiCodeGen.a;/home/jaehun/.local/lib/libLLVMLanaiAsmParser.a;/home/jaehun/.local/lib/libLLVMLanaiDesc.a;/home/jaehun/.local/lib/libLLVMLanaiInfo.a;/home/jaehun/.local/lib/libLLVMHexagonDisassembler.a;/home/jaehun/.local/lib/libLLVMHexagonCodeGen.a;/home/jaehun/.local/lib/libLLVMHexagonAsmParser.a;/home/jaehun/.local/lib/libLLVMHexagonDesc.a;/home/jaehun/.local/lib/libLLVMHexagonInfo.a;/home/jaehun/.local/lib/libLLVMBPFDisassembler.a;/home/jaehun/.local/lib/libLLVMBPFAsmParser.a;/home/jaehun/.local/lib/libLLVMBPFCodeGen.a;/home/jaehun/.local/lib/libLLVMBPFDesc.a;/home/jaehun/.local/lib/libLLVMBPFInfo.a;/home/jaehun/.local/lib/libLLVMAVRDisassembler.a;/home/jaehun/.local/lib/libLLVMAVRAsmParser.a;/home/jaehun/.local/lib/libLLVMAVRCodeGen.a;/home/jaehun/.local/lib/libLLVMAVRDesc.a;/home/jaehun/.local/lib/libLLVMAVRInfo.a;/home/jaehun/.local/lib/libLLVMARMDisassembler.a;/home/jaehun/.local/lib/libLLVMARMAsmParser.a;/home/jaehun/.local/lib/libLLVMARMCodeGen.a;/home/jaehun/.local/lib/libLLVMARMDesc.a;/home/jaehun/.local/lib/libLLVMARMUtils.a;/home/jaehun/.local/lib/libLLVMARMInfo.a;/home/jaehun/.local/lib/libLLVMAMDGPUDisassembler.a;/home/jaehun/.local/lib/libLLVMAMDGPUAsmParser.a;/home/jaehun/.local/lib/libLLVMAMDGPUCodeGen.a;/home/jaehun/.local/lib/libLLVMAMDGPUDesc.a;/home/jaehun/.local/lib/libLLVMAMDGPUUtils.a;/home/jaehun/.local/lib/libLLVMAMDGPUInfo.a;/home/jaehun/.local/lib/libLLVMAArch64Disassembler.a;/home/jaehun/.local/lib/libLLVMAArch64AsmParser.a;/home/jaehun/.local/lib/libLLVMAArch64CodeGen.a;/home/jaehun/.local/lib/libLLVMAArch64Desc.a;/home/jaehun/.local/lib/libLLVMAArch64Utils.a;/home/jaehun/.local/lib/libLLVMAArch64Info.a;/home/jaehun/.local/lib/libLLVMOrcJIT.a;/home/jaehun/.local/lib/libLLVMMCJIT.a;/home/jaehun/.local/lib/libLLVMJITLink.a;/home/jaehun/.local/lib/libLLVMOrcTargetProcess.a;/home/jaehun/.local/lib/libLLVMOrcShared.a;/home/jaehun/.local/lib/libLLVMInterpreter.a;/home/jaehun/.local/lib/libLLVMExecutionEngine.a;/home/jaehun/.local/lib/libLLVMRuntimeDyld.a;/home/jaehun/.local/lib/libLLVMSymbolize.a;/home/jaehun/.local/lib/libLLVMDebugInfoPDB.a;/home/jaehun/.local/lib/libLLVMDebugInfoGSYM.a;/home/jaehun/.local/lib/libLLVMOption.a;/home/jaehun/.local/lib/libLLVMObjectYAML.a;/home/jaehun/.local/lib/libLLVMMCA.a;/home/jaehun/.local/lib/libLLVMMCDisassembler.a;/home/jaehun/.local/lib/libLLVMLTO.a;/home/jaehun/.local/lib/libLLVMPasses.a;/home/jaehun/.local/lib/libLLVMCFGuard.a;/home/jaehun/.local/lib/libLLVMCoroutines.a;/home/jaehun/.local/lib/libLLVMObjCARCOpts.a;/home/jaehun/.local/lib/libLLVMHelloNew.a;/home/jaehun/.local/lib/libLLVMipo.a;/home/jaehun/.local/lib/libLLVMVectorize.a;/home/jaehun/.local/lib/libLLVMLinker.a;/home/jaehun/.local/lib/libLLVMInstrumentation.a;/home/jaehun/.local/lib/libLLVMFrontendOpenMP.a;/home/jaehun/.local/lib/libLLVMFrontendOpenACC.a;/home/jaehun/.local/lib/libLLVMExtensions.a;/home/jaehun/.local/lib/libLLVMDWARFLinker.a;/home/jaehun/.local/lib/libLLVMGlobalISel.a;/home/jaehun/.local/lib/libLLVMMIRParser.a;/home/jaehun/.local/lib/libLLVMAsmPrinter.a;/home/jaehun/.local/lib/libLLVMDebugInfoDWARF.a;/home/jaehun/.local/lib/libLLVMSelectionDAG.a;/home/jaehun/.local/lib/libLLVMCodeGen.a;/home/jaehun/.local/lib/libLLVMIRReader.a;/home/jaehun/.local/lib/libLLVMAsmParser.a;/home/jaehun/.local/lib/libLLVMInterfaceStub.a;/home/jaehun/.local/lib/libLLVMFileCheck.a;/home/jaehun/.local/lib/libLLVMFuzzMutate.a;/home/jaehun/.local/lib/libLLVMTarget.a;/home/jaehun/.local/lib/libLLVMScalarOpts.a;/home/jaehun/.local/lib/libLLVMInstCombine.a;/home/jaehun/.local/lib/libLLVMAggressiveInstCombine.a;/home/jaehun/.local/lib/libLLVMTransformUtils.a;/home/jaehun/.local/lib/libLLVMBitWriter.a;/home/jaehun/.local/lib/libLLVMAnalysis.a;/home/jaehun/.local/lib/libLLVMProfileData.a;/home/jaehun/.local/lib/libLLVMObject.a;/home/jaehun/.local/lib/libLLVMTextAPI.a;/home/jaehun/.local/lib/libLLVMMCParser.a;/home/jaehun/.local/lib/libLLVMMC.a;/home/jaehun/.local/lib/libLLVMDebugInfoCodeView.a;/home/jaehun/.local/lib/libLLVMDebugInfoMSF.a;/home/jaehun/.local/lib/libLLVMBitReader.a;/home/jaehun/.local/lib/libLLVMCore.a;/home/jaehun/.local/lib/libLLVMRemarks.a;/home/jaehun/.local/lib/libLLVMBitstreamReader.a;/home/jaehun/.local/lib/libLLVMBinaryFormat.a;/home/jaehun/.local/lib/libLLVMTableGen.a;/home/jaehun/.local/lib/libLLVMSupport.a;/home/jaehun/.local/lib/libLLVMDemangle.a;-lrt;-ldl;-lpthread;-lm
-- Found TVM_LLVM_VERSION=120
-- Build with LLVM 12.0.0
-- Set TVM_LLVM_VERSION=120
-- Build with contrib.random
-- Build with contrib.sort
-- Build with contrib.hybriddump
-- Git found: /usr/bin/git
-- Found TVM_GIT_COMMIT_HASH=d6d6367b0105bc5f155a963ea11e59c7913a2cf0
-- Found TVM_GIT_COMMIT_TIME=2021-08-21 22:13:08 -0700
-- Performing Test SUPPORT_CXX14
-- Performing Test SUPPORT_CXX14 - Success
-- Autoset: USE_LIBBACKTRACE=ON in Linux
-- Building with libbacktrace...
-- Building with TVM Map...
-- Build with thread support...
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found the path to ccache, enabling ccache
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jaehun/tvm-test/build
[46/435] Building CXX object CMakeFiles/tvm_objs.dir/src/printer/relay_text_printer.cc.o
FAILED: CMakeFiles/tvm_objs.dir/src/printer/relay_text_printer.cc.o 
/usr/bin/g++-9  -DDMLC_USE_FOPEN64=0 -DDMLC_USE_LOGGING_LIBRARY="<tvm/runtime/logging.h>" -DNDEBUG -DNDEBUG=1 -DTVM_INDEX_DEFAULT_I64=1 -DTVM_LLVM_VERSION=120 -DTVM_THREADPOOL_USE_OPENMP=0 -DTVM_USE_LIBBACKTRACE=1 -DUSE_FALLBACK_STL_MAP=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I../include -Ilibbacktrace/include -I../topi/include -I../3rdparty/libcrc/include -isystem ../3rdparty/dlpack/include -isystem ../3rdparty/dmlc-core/include -isystem ../3rdparty/rang/include -isystem ../3rdparty/compiler-rt -isystem ../3rdparty/picojson -isystem /usr/local/cuda-10.2/include -isystem /home/jaehun/.local/include -std=c++14 -faligned-new -O2 -Wall -fPIC -MD -MT CMakeFiles/tvm_objs.dir/src/printer/relay_text_printer.cc.o -MF CMakeFiles/tvm_objs.dir/src/printer/relay_text_printer.cc.o.d -o CMakeFiles/tvm_objs.dir/src/printer/relay_text_printer.cc.o -c ../src/printer/relay_text_printer.cc
In file included from /usr/include/c++/9/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/9/memory:82,
                 from ../3rdparty/dmlc-core/include/dmlc/logging.h:15,
                 from ../include/tvm/node/functor.h:26,
                 from ../include/tvm/node/structural_equal.h:26,
                 from ../include/tvm/node/reflection.h:26,
                 from ../include/tvm/node/node.h:37,
                 from ../include/tvm/ir/span.h:27,
                 from ../include/tvm/ir/expr.h:27,
                 from ../include/tvm/ir/adt.h:30,
                 from ../include/tvm/ir/module.h:27,
                 from ../src/printer/relay_text_printer.cc:35:
/usr/include/c++/9/bits/atomic_base.h: In member function ‘std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator&=(std::__atomic_base<_IntTp>::__int_type) volatile’:
/usr/include/c++/9/bits/atomic_base.h:355:51: internal compiler error: 세그멘테이션 오류
  355 |       { return __atomic_and_fetch(&_M_i, __i, int(memory_order_seq_cst)); }
      |                                                   ^~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
[53/435] Building CXX object CMakeFiles/tvm_objs.dir/src/printer/model_library_format_printer.cc.o
FAILED: CMakeFiles/tvm_objs.dir/src/printer/model_library_format_printer.cc.o 
/usr/bin/g++-9  -DDMLC_USE_FOPEN64=0 -DDMLC_USE_LOGGING_LIBRARY="<tvm/runtime/logging.h>" -DNDEBUG -DNDEBUG=1 -DTVM_INDEX_DEFAULT_I64=1 -DTVM_LLVM_VERSION=120 -DTVM_THREADPOOL_USE_OPENMP=0 -DTVM_USE_LIBBACKTRACE=1 -DUSE_FALLBACK_STL_MAP=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I../include -Ilibbacktrace/include -I../topi/include -I../3rdparty/libcrc/include -isystem ../3rdparty/dlpack/include -isystem ../3rdparty/dmlc-core/include -isystem ../3rdparty/rang/include -isystem ../3rdparty/compiler-rt -isystem ../3rdparty/picojson -isystem /usr/local/cuda-10.2/include -isystem /home/jaehun/.local/include -std=c++14 -faligned-new -O2 -Wall -fPIC -MD -MT CMakeFiles/tvm_objs.dir/src/printer/model_library_format_printer.cc.o -MF CMakeFiles/tvm_objs.dir/src/printer/model_library_format_printer.cc.o.d -o CMakeFiles/tvm_objs.dir/src/printer/model_library_format_printer.cc.o -c ../src/printer/model_library_format_printer.cc
In file included from ../3rdparty/dmlc-core/include/dmlc/./logging.h:132,
                 from ../3rdparty/dmlc-core/include/dmlc/io.h:15,
                 from ../include/tvm/runtime/module.h:29,
                 from ../src/printer/model_library_format_printer.cc:20:
../include/tvm/tir/stmt.h: In function ‘const char* tvm::tir::ForKind2String(tvm::tir::ForKind)’:
../include/tvm/tir/stmt.h:1377:3: internal compiler error: 세그멘테이션 오류
 1377 |   LOG(FATAL) << "Unknown ForKind" << t;
      |   ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
[63/435] Building CXX object CMakeFiles/tvm_objs.dir/src/parser/parser.cc.o
ninja: build stopped: subcommand failed.

Looks like a GCC bug, so shall we switch to another version?

1 Like

Oh, I am sorry, this problem is about my system. I overclocked my ram one month ago. it made the above error. I resolved the error by tune off overclocking.

1 Like