Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10005

ROOT crashes when generating hsimple.root if compiled without SSE2 support

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Won't Fix
    • Affects Version/s: 6.18/00
    • Fix Version/s: None
    • Component/s: Other
    • Labels:
      None
    • Environment:

      Linux

    • Development:

      Description

      I compiled ROOT passing -DCMAKE_CXX_FLAGS='-g -ggdb -Og -fno-omit-frame-pointer -mno-sse2 -mno-avx -mno-avx2' to measure the difference compared with -march=native, and ROOT crashed when generating hsimple at the end with the following stack trace:

      epsft-53 nosimd $ ninja
      [6/6] Generating tutorials/hsimple.root
      FAILED: tutorials/hsimple.root 
      cd /home/amadio/build/nosimd/tutorials && LD_LIBRARY_PATH=/home/amadio/build/nosimd/lib:/usr/bin/../lib: ROOTIGNOREPREFIX=1 /home/amadio/build/nosimd/bin/root.exe -l -q -b -n -x hsimple.C -e returnProcessing hsimple.C... *** Break *** segmentation violation===========================================================
      There was a crash.
      This is the entire stack trace of all threads:
      ===========================================================
      #0  0x00007f48fd262f5b in __GI___waitpid (pid=17668, stat_loc=stat_loc
      entry=0x7fff5f3dea98, options=options
      entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
      #1  0x00007f48fd1d8bdf in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
      #2  0x00007f48fdb34d82 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x5587614d27c0) at /home/amadio/src/root/core/unix/src/TUnixSystem.cxx:2099
      #3  TUnixSystem::StackTrace (this=0x5587614d27c0) at /home/amadio/src/root/core/unix/src/TUnixSystem.cxx:2393
      #4  0x00007f48fdb378cc in TUnixSystem::DispatchSignals (this=0x5587614d27c0, sig=kSigSegmentationViolation) at /home/amadio/src/root/core/unix/src/TUnixSystem.cxx:3624
      #5  <signal handler called>
      #6  (anonymous namespace)::FPS::handleSpecialFP (this=this
      entry=0x558761ac9c20, Inst=...) at /home/amadio/src/root/interpreter/llvm/src/lib/Target/X86/X86FloatingPoint.cpp:1456
      #7  0x00007f48fa32a0ef in (anonymous namespace)::FPS::processBasicBlock (this=this
      entry=0x558761ac9c20, BB=..., MF=...) at /home/amadio/src/root/interpreter/llvm/src/lib/Target/X86/X86FloatingPoint.cpp:455
      #8  0x00007f48fa32cdfe in (anonymous namespace)::FPS::runOnMachineFunction (this=this
      entry=0x558761ac9c20, MF=...) at /home/amadio/src/root/interpreter/llvm/src/lib/Target/X86/X86FloatingPoint.cpp:368
      #9  0x00007f48fa32d47c in (anonymous namespace)::FPS::runOnMachineFunction (this=0x558761ac9c20, MF=...) at /home/amadio/src/root/interpreter/llvm/src/lib/Target/X86/X86FloatingPoint.cpp:379
      #10 0x00007f48fa7ef4a0 in llvm::MachineFunctionPass::runOnFunction (this=0x558761ac9c20, F=...) at /home/amadio/src/root/interpreter/llvm/src/lib/CodeGen/MachineFunctionPass.cpp:62
      #11 0x00007f48fbcbfc60 in llvm::FPPassManager::runOnFunction (this=this
      entry=0x5587623b08f0, F=...) at /home/amadio/src/root/interpreter/llvm/src/lib/IR/LegacyPassManager.cpp:1514
      #12 0x00007f48fbcbfd46 in llvm::FPPassManager::runOnFunction (F=..., this=0x5587623b08f0) at /home/amadio/src/root/interpreter/llvm/src/lib/IR/LegacyPassManager.cpp:1493
      #13 llvm::FPPassManager::runOnModule (this=0x5587623b08f0, M=...) at /home/amadio/src/root/interpreter/llvm/src/lib/IR/LegacyPassManager.cpp:1535
      #14 0x00007f48fbcbebfb in (anonymous namespace)::MPPassManager::runOnModule (M=..., this=0x558761ab9f00) at /home/amadio/src/root/interpreter/llvm/src/lib/IR/LegacyPassManager.cpp:1591
      #15 llvm::legacy::PassManagerImpl::run (this=0x5587622f7960, M=...) at /home/amadio/src/root/interpreter/llvm/src/lib/IR/LegacyPassManager.cpp:1694
      #16 0x00007f48fbcbf05e in llvm::legacy::PassManager::run (this=this
      entry=0x7fff5f3e1c80, M=...) at /home/amadio/src/root/interpreter/llvm/src/lib/IR/LegacyPassManager.cpp:1725
      #17 0x00007f48f9aec901 in llvm::orc::SimpleCompiler::operator() (M=..., this=0x5587615a3470) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/CompileUtils.h:65
      #18 llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler>::addModule (Resolver=..., M=..., this=0x5587615a3468) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h:57
      #19 llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler> >::EmissionDeferredModule::emitToBaseLayer (BaseLayer=..., this=<optimized out>) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h:142
      #20 llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler> >::EmissionDeferredModule::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler>&)::{lambda()#1}::operator()() const (__closure=0x5587622a6610) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h:68
      #21 0x00007f48f9aed1f3 in std::_Function_handler<llvm::Expected<unsigned long> (), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler> >::EmissionDeferredModule::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/7.4.0/include/g++-v7/bits/std_function.h:302
      #22 0x00007f48f9aebf3a in std::function<llvm::Expected<unsigned long> ()>::operator()() const (this=0x7fff5f3e1e60) at /usr/lib/gcc/x86_64-pc-linux-gnu/7.4.0/include/g++-v7/bits/std_function.h:706
      #23 llvm::JITSymbol::getAddress (this=0x7fff5f3e1e60) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/JITSymbol.h:201
      #24 cling::IncrementalJIT::<lambda(const string&)>::operator() (Name="_Z7hsimplei", __closure=<optimized out>) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/IncrementalJIT.cpp:415
      #25 llvm::orc::LambdaResolver<cling::IncrementalJIT::addModule(const std::shared_ptr<llvm::Module>&)::<lambda(const string&)>, cling::IncrementalJIT::addModule(const std::shared_ptr<llvm::Module>&)::<lambda(const string&)> >::findSymbol(const std::(char, long long, long long, ::string &)) (this=this
      entry=0x558762434020, Name="_Z7hsimplei") at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/LambdaResolver.h:38
      #26 0x00007f48fa2b2982 in llvm::RuntimeDyldImpl::resolveExternalSymbols (this=this
      entry=0x5587622aedf0) at /home/amadio/src/root/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:989
      #27 0x00007f48fa2b2d0b in llvm::RuntimeDyldImpl::resolveRelocations (this=0x5587622aedf0) at /home/amadio/src/root/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:131
      #28 0x00007f48fa2b31ef in llvm::RuntimeDyld::resolveRelocations (this=<optimized out>) at /home/amadio/src/root/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:1140
      #29 llvm::RuntimeDyld::finalizeWithMemoryManagerLocking (this=this
      entry=0x7fff5f3e2170) at /home/amadio/src/root/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:1158
      #30 0x00007f48f9ae2c58 in llvm::orc::RTDyldObjectLinkingLayer::addObject(std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> >, std::shared_ptr<llvm::JITSymbolResolver>)::{lambda(std::_List_iterator<std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject, std::default_delete<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject> > >, llvm::RuntimeDyld&, std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> > const&, std::function<void ()>)#1}::operator()(std::_List_iterator<std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject, std::default_delete<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject> > >, llvm::RuntimeDyld&, std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> > const&, std::function<void ()>) const (LOSHandleLoad=..., ObjToLoad=std::shared_ptr<class llvm::object::OwningBinary<llvm::object::ObjectFile>> (use count 1, weak count 0) = {...}, RTDyld=..., H=Python Exception <class 'ValueError'> Cannot find type llvm::orc::RTDyldObjectLinkingLayerBase::ObjHandleT::_Node: 
      #31 llvm::orc::RTDyldObjectLinkingLayer::ConcreteLinkedObject<std::shared_ptr<llvm::RuntimeDyld::MemoryManager>, std::shared_ptr<llvm::JITSymbolResolver>, llvm::orc::RTDyldObjectLinkingLayer::addObject(std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> >, std::shared_ptr<llvm::JITSymbolResolver>)::{lambda(std::_List_iterator<std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject, std::default_delete<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject> > >, llvm::RuntimeDyld&, std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> > const&, std::function<void ()>)#1}>::finalize() (this=0x5587622b9200) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:143
      #32 llvm::orc::RTDyldObjectLinkingLayer::ConcreteLinkedObject<std::shared_ptr<llvm::RuntimeDyld::MemoryManager>, std::shared_ptr<llvm::JITSymbolResolver>, llvm::orc::RTDyldObjectLinkingLayer::addObject(std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> >, std::shared_ptr<llvm::JITSymbolResolver>)::{lambda(std::_List_iterator<std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject, std::default_delete<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject> > >, llvm::RuntimeDyld&, std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> > const&, std::function<void ()>)#1}>::getSymbolMaterializer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda()#1}::operator()() const (__closure=0x55876238b210) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:158
      #33 std::_Function_handler<llvm::Expected<unsigned long> (), llvm::orc::RTDyldObjectLinkingLayer::ConcreteLinkedObject<std::shared_ptr<llvm::RuntimeDyld::MemoryManager>, std::shared_ptr<llvm::JITSymbolResolver>, llvm::orc::RTDyldObjectLinkingLayer::addObject(std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> >, std::shared_ptr<llvm::JITSymbolResolver>)::{lambda(std::_List_iterator<std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject, std::default_delete<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject> > >, llvm::RuntimeDyld&, std::shared_ptr<llvm::object::OwningBinary<llvm::object::ObjectFile> > const&, std::function<void ()>)#1}>::getSymbolMaterializer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/7.4.0/include/g++-v7/bits/std_function.h:302
      #34 0x00007f48f9aecf72 in std::function<llvm::Expected<unsigned long> ()>::operator()() const (this=0x7fff5f3e2420) at /usr/lib/gcc/x86_64-pc-linux-gnu/7.4.0/include/g++-v7/bits/std_function.h:706
      #35 llvm::JITSymbol::getAddress (this=0x7fff5f3e2420) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/JITSymbol.h:201
      #36 llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler> >::EmissionDeferredModule::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler>&)::{lambda()#1}::operator()() const (__closure=<optimized out>) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h:75
      #37 0x00007f48f9aed1f3 in std::_Function_handler<llvm::Expected<unsigned long> (), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler> >::EmissionDeferredModule::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/7.4.0/include/g++-v7/bits/std_function.h:302
      #38 0x00007f48f9a76a77 in std::function<llvm::Expected<unsigned long> ()>::operator()() const (this=0x7fff5f3e25c0) at /usr/lib/gcc/x86_64-pc-linux-gnu/7.4.0/include/g++-v7/bits/std_function.h:706
      #39 llvm::JITSymbol::getAddress (this=0x7fff5f3e25c0) at /home/amadio/src/root/interpreter/llvm/src/include/llvm/ExecutionEngine/JITSymbol.h:201
      #40 cling::IncrementalJIT::getSymbolAddress (AlsoInProcess=false, Name="_Z15__cling_Un1Qu30Pv", this=0x5587615a31d0) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/IncrementalJIT.h:194
      #41 cling::IncrementalExecutor::jitInitOrWrapper<void (*)(void*)> (fun=<synthetic pointer>: <optimized out>, funcname=..., this=0x558761553b70) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:281
      #42 cling::IncrementalExecutor::executeWrapper (returnValue=0x7fff5f3e2b00, function=..., this=0x558761553b70) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:192
      #43 cling::Interpreter::RunFunction (this=<optimized out>, FD=<optimized out>, res=0x7fff5f3e2b00) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:1086
      #44 0x00007f48f9a76fdf in cling::Interpreter::EvaluateInternal (this=0x558761546a00, input="hsimple() /* invoking function corresponding to '.x' */", CO=..., V=V
      entry=0x7fff5f3e2b00, T=T
      entry=0x0, wrapPoint=<optimized out>, wrapPoint
      entry=0) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:1341
      #45 0x00007f48f9a770f4 in cling::Interpreter::echo (this=<optimized out>, input="hsimple() /* invoking function corresponding to '.x' */", V=V
      entry=0x7fff5f3e2b00) at /home/amadio/src/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:988
      #46 0x00007f48f9b42f16 in cling::MetaSema::actOnxCommand (this=0x55876169d890, file=..., args=..., result=result
      entry=0x7fff5f3e2b00) at /home/amadio/src/root/interpreter/cling/lib/MetaProcessor/MetaSema.cpp:145
      #47 0x00007f48f9b5322d in cling::MetaParser::isXCommand (this=this
      entry=0x558761b126c0, actionResult=
      0x7fff5f3e2980: cling::MetaSema::AR_Success, resultValue=resultValue
      entry=0x7fff5f3e2b00) at /home/amadio/src/root/interpreter/cling/lib/MetaProcessor/MetaParser.cpp:288
      #48 0x00007f48f9b54576 in cling::MetaParser::isCommand (this=0x558761b126c0, actionResult=
      0x7fff5f3e2980: cling::MetaSema::AR_Success, resultValue=0x7fff5f3e2b00) at /home/amadio/src/root/interpreter/cling/lib/MetaProcessor/MetaParser.cpp:124
      #49 0x00007f48f9b3bbb8 in cling::MetaProcessor::process (this=this
      entry=0x558761b0d9e0, input_line=..., compRes=
      0x7fff5f3e2aec: cling::Interpreter::kSuccess, result=result
      entry=0x7fff5f3e2b00, disableValuePrinting=disableValuePrinting
      entry=false) at /home/amadio/src/root/interpreter/cling/lib/MetaProcessor/MetaProcessor.cpp:317
      #50 0x00007f48f99f1191 in HandleInterpreterException (metaProcessor=0x558761b0d9e0, input_line=<optimized out>, compRes=
      0x7fff5f3e2aec: cling::Interpreter::kSuccess, result=result
      entry=0x7fff5f3e2b00) at /home/amadio/src/root/core/metacling/src/TCling.cxx:2132
      #51 0x00007f48f9a06c8d in TCling::ProcessLine (this=0x558761546250, line=<optimized out>, error=0x7fff5f3e3c7c) at /home/amadio/src/root/core/metacling/src/TCling.cxx:2274
      #52 0x00007f48f99f8c88 in TCling::ProcessLineSynch (this=0x558761546250, line=0x558761ac5980 ".X  /home/amadio/build/nosimd/tutorials/./hsimple.C", error=0x7fff5f3e3c7c) at /home/amadio/src/root/core/metacling/src/TCling.cxx:3151
      #53 0x00007f48fd9db46a in TApplication::ExecuteFile (file=<optimized out>, error=0x7fff5f3e3c7c, keep=<optimized out>) at /home/amadio/src/root/core/base/src/TApplication.cxx:1160
      #54 0x00007f48fd9dabdf in TApplication::ProcessLine (this=0x5587615318a0, line=<optimized out>, sync=<optimized out>, err=0x7fff5f3e3c7c) at /home/amadio/src/root/core/base/src/TApplication.cxx:1005
      #55 0x00007f48fdc61593 in TRint::ProcessLineNr (this=this
      entry=0x5587615318a0, filestem=filestem
      entry=0x7f48fdc745af "ROOT_cli_", line=line
      entry=0x7fff5f3e3c80 ".x hsimple.C", error=error
      entry=0x7fff5f3e3c7c) at /home/amadio/src/root/core/rint/src/TRint.cxx:761
      #56 0x00007f48fdc62f06 in TRint::Run (this=0x5587615318a0, retrn=<optimized out>) at /home/amadio/src/root/core/rint/src/TRint.cxx:421
      #57 0x000055875fc9011c in main (argc=<optimized out>, argv=0x7fff5f3e5e08) at /home/amadio/src/root/main/src/rmain.cxx:30
      ===========================================================
      

      There may be a mismatch between JIT and compiled code. To be further investigated. For now I re-enable SSE2 (already default), since in that case the problem goes away.

        Attachments

          Activity

            People

            • Assignee:
              amadio Guilherme Amadio
              Reporter:
              amadio Guilherme Amadio
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                PlannedEnd:
                PlannedStart:
                Actual End: