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

Crash in recursive compilation / new autoloading

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 6.20/00
    • Component/s: Cling
    • Labels:
      None
    • Environment:

      Linux

      Description

      $ cat something.cxx
      // g++ -shared -olibSomething.so `root-config --cflags --libs` -fPIC something.cxx
       
      #include "TROOT.h"
       
      auto TriggerStaticInit = gROOT->GetListOfGlobals(true);
       
      int AutoloadMe() { return 42; }
      

      $ g++ -shared -oROOTSYS/lib/libSomething.so `root-config --cflags --libs` -fPIC something.cxx
      $ root.exe -l -b -q -e '.rawInput' -e 'int AutoloadMe();' -e '.rawInput' -e ' AutoloadMe()'
      

      crashes in

      #9  <signal handler called>
      #10 0x00007f151e659120 in ?? ()
      #11 0x00007f1514d69f32 in cling::IncrementalExecutor::executeInit (this=0x564bc08ddfd0, function=...) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:263
      #12 0x00007f1514d68810 in cling::IncrementalExecutor::runStaticInitializersOnce (this=0x564bc08ddfd0, T=...) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp:262
      #13 0x00007f1514c4fbf1 in cling::Interpreter::executeTransaction (this=0x564bc08d0880, T=...) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/Interpreter.cpp:1568
      #14 0x00007f1514d8f8fe in cling::IncrementalParser::commitTransaction (this=0x564bc087ef20, PRT=..., ClearDiagClient=true) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:641
      #15 0x00007f1514c49738 in cling::Interpreter::PushTransactionRAII::pop (this=0x7ffd9f158020) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/Interpreter.cpp:116
      #16 0x00007f1514c4966c in cling::Interpreter::PushTransactionRAII::~PushTransactionRAII (this=0x7ffd9f158020, __in_chrg=<optimized out>) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/Interpreter.cpp:108
      #17 0x00007f1514bbf017 in TClingDataMemberInfo::TClingDataMemberInfo (this=0x564bc223b5c0, interp=0x564bc08d0880, ci=0x564bc223e110) at /home/axel/build/root/github/src/core/metacling/src/TClingDataMemberInfo.cxx:65
      #18 0x00007f1514af8a7e in TCling::DataMemberInfo_Factory (this=0x564bc08cfe10, clinfo=0x564bc223e110) at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:8359
      #19 0x00007f151e1abbc6 in TListOfDataMembers::Load (this=0x564bc222cc90) at /home/axel/build/root/github/src/core/meta/src/TListOfDataMembers.cxx:478
      #20 0x00007f151e05873c in TROOT::GetListOfGlobals (this=0x7f151e449cc0 <ROOT::Internal::GetROOT1()::alloc>, load=true) at /home/axel/build/root/github/src/core/base/src/TROOT.cxx:1798
      #21 0x00007f151e655785 in __static_initialization_and_destruction_0(int, int) () from /home/axel/build/root/github/cmake/lib/libSomething.so
      #22 0x00007f151e6557a8 in _GLOBAL__sub_I_something.cxx () from /home/axel/build/root/github/cmake/lib/libSomething.so
      #23 0x00007f151e48e733 in call_init (env=0x564bc21d5940, argv=0x7ffd9f15c0d8, argc=12, l=<optimized out>) at dl-init.c:72
      #24 _dl_init (main_map=0x564bc224dd20, argc=12, argv=0x7ffd9f15c0d8, env=0x564bc21d5940) at dl-init.c:119
      #25 0x00007f151e4931ff in dl_open_worker (a=a
      entry=0x7ffd9f1583f0) at dl-open.c:522
      #26 0x00007f151d56a2df in __GI__dl_catch_exception (exception=exception
      entry=0x7ffd9f1583d0, operate=operate
      entry=0x7f151e492dc0 <dl_open_worker>, args=args
      entry=0x7ffd9f1583f0) at dl-error-skeleton.c:196
      #27 0x00007f151e4927ca in _dl_open (file=0x564bc223d5e0 "/home/axel/build/root/github/cmake/lib/libSomething.so", mode=-2147483391, caller_dlopen=0x7f1514e8f808 <cling::utils::platform::DLOpen(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)+41>, nsid=<optimized out>, argc=12, argv=<optimized out>, env=0x564bc21d5940) at dl-open.c:605
      #28 0x00007f151c92ef96 in dlopen_doit (a=a
      entry=0x7ffd9f158620) at dlopen.c:66
      #29 0x00007f151d56a2df in __GI__dl_catch_exception (exception=exception
      entry=0x7ffd9f1585c0, operate=operate
      entry=0x7f151c92ef40 <dlopen_doit>, args=args
      entry=0x7ffd9f158620) at dl-error-skeleton.c:196
      #30 0x00007f151d56a36f in __GI__dl_catch_error (objname=objname
      entry=0x564bc0863530, errstring=errstring
      entry=0x564bc0863538, mallocedp=mallocedp
      entry=0x564bc0863528, operate=operate
      entry=0x7f151c92ef40 <dlopen_doit>, args=args
      entry=0x7ffd9f158620) at dl-error-skeleton.c:215
      #31 0x00007f151c92f735 in _dlerror_run (operate=operate
      entry=0x7f151c92ef40 <dlopen_doit>, args=args
      entry=0x7ffd9f158620) at dlerror.c:162
      #32 0x00007f151c92f051 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
      #33 0x00007f1514e8f808 in cling::utils::platform::DLOpen (Path="/home/axel/build/root/github/cmake/lib/libSomething.so", Err=0x7ffd9f158740) at /home/axel/build/root/github/src/interpreter/cling/lib/Utils/PlatformPosix.cpp:118
      #34 0x00007f1514c44f98 in cling::DynamicLibraryManager::loadLibrary (this=0x564bc08d2dd0, libStem="/home/axel/build/root/github/cmake/lib/libSomething.so", permanent=true, resolved=false) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/DynamicLibraryManager.cpp:186
      #35 0x00007f1514ae35af in TCling::Load (this=0x564bc08cfe10, filename=0x564bc17ed540 "/home/axel/build/root/github/cmake/lib/libSomething.so", system=true) at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:3247
      #36 0x00007f151e0e47d1 in TSystem::Load (this=0x564bc085c7c0, module=0x564bc18ad960 "/home/axel/build/root/github/cmake/lib/libSomething.so", entry=0x7f1518405d09 "", system=true) at /home/axel/build/root/github/src/core/base/src/TSystem.cxx:1937
      #37 0x00007f151e1f9483 in TUnixSystem::Load (this=0x564bc085c7c0, module=0x564bc18ad960 "/home/axel/build/root/github/cmake/lib/libSomething.so", entry=0x7f1518405d09 "", system=false) at /home/axel/build/root/github/src/core/unix/src/TUnixSystem.cxx:2775
      #38 0x00007f1514af17ee in LazyFunctionCreatorAutoloadForModule (mangled_name="_Z10AutoloadMev", interp=0x564bc08d0880) at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:6390
      #39 0x00007f1514af18fb in TCling::LazyFunctionCreatorAutoload (this=0x564bc08cfe10, mangled_name="_Z10AutoloadMev") at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:6403
      #40 0x00007f1514ad5c60 in llvmLazyFunctionCreator (mangled_name="_Z10AutoloadMev") at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:704
      #41 0x00007f1514d68499 in cling::IncrementalExecutor::NotifyLazyFunctionCreators (this=0x564bc08ddfd0, mangled_name="_Z10AutoloadMev") at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp:166
      #42 0x00007f1514d750bd in cling::IncrementalJIT::<lambda(const string&)>::operator()(const std::__cxx11::string &) const (__closure=0x564bc222cfa0, Name="_Z10AutoloadMev") at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalJIT.cpp:436
      #43 0x00007f1514d7750e in 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=0x564bc222cf90, Name="_Z10AutoloadMev") at /home/axel/build/root/github/src/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/LambdaResolver.h:38
      #44 0x00007f1515b29de8 in llvm::RuntimeDyldImpl::resolveExternalSymbols (this=0x564bc225b1f0) at /home/axel/build/root/github/src/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:989
      #45 0x00007f1515b24a11 in llvm::RuntimeDyldImpl::resolveRelocations (this=0x564bc225b1f0) at /home/axel/build/root/github/src/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:131
      #46 0x00007f1515b2a8ea in llvm::RuntimeDyld::resolveRelocations (this=0x7ffd9f1590b0) at /home/axel/build/root/github/src/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:1140
      #47 0x00007f1515b2a9d5 in llvm::RuntimeDyld::finalizeWithMemoryManagerLocking (this=0x7ffd9f1590b0) at /home/axel/build/root/github/src/interpreter/llvm/src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:1158
      #48 0x00007f1514d78ffa 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 (__closure=0x564bc225cb70, H=std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject> = {
      #49 0x00007f1514d8bf85 in 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=0x564bc225fc80) at /home/axel/build/root/github/src/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:143
      #50 0x00007f1514d8c027 in 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=0x564bc224f440) at /home/axel/build/root/github/src/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:158
      #51 0x00007f1514d8c96e in 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/include/c++/7/bits/std_function.h:302
      #52 0x00007f1514d6a56c in std::function<llvm::Expected<unsigned long> ()>::operator()() const (this=0x7ffd9f1592b0) at /usr/include/c++/7/bits/std_function.h:706
      #53 0x00007f1514d69690 in llvm::JITSymbol::getAddress (this=0x7ffd9f1592b0) at /home/axel/build/root/github/src/interpreter/llvm/src/include/llvm/ExecutionEngine/JITSymbol.h:201
      #54 0x00007f1514d8057a in 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=0x564bc1b59ff0) at /home/axel/build/root/github/src/interpreter/llvm/src/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h:75
      #55 0x00007f1514d8657a 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/include/c++/7/bits/std_function.h:302
      #56 0x00007f1514d6a56c in std::function<llvm::Expected<unsigned long> ()>::operator()() const (this=0x7ffd9f159430) at /usr/include/c++/7/bits/std_function.h:706
      #57 0x00007f1514d69690 in llvm::JITSymbol::getAddress (this=0x7ffd9f159430) at /home/axel/build/root/github/src/interpreter/llvm/src/include/llvm/ExecutionEngine/JITSymbol.h:201
      #58 0x00007f1514d69c92 in cling::IncrementalJIT::getSymbolAddress (this=0x564bc0b72a60, Name="_ZN11__cling_N5015__cling_Un1Qu30EPv", AlsoInProcess=false) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalJIT.h:194
      #59 0x00007f1514d6bc19 in cling::IncrementalExecutor::jitInitOrWrapper<void (*)(void*)> (this=0x564bc08ddfd0, funcname=..., fun=
      0x7ffd9f159548: 0x0) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:269
      #60 0x00007f1514d68ae5 in cling::IncrementalExecutor::executeWrapper (this=0x564bc08ddfd0, function=..., returnValue=0x7ffd9f159960) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp:335
      #61 0x00007f1514c4dafc in cling::Interpreter::RunFunction (this=0x564bc08d0880, FD=0x564bc21c3128, res=0x7ffd9f159960) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/Interpreter.cpp:1022
      #62 0x00007f1514c4e79b in cling::Interpreter::EvaluateInternal (this=0x564bc08d0880, input="#line 1 \"ROOT_cli_3\"\n AutoloadMe()", CO=..., V=0x7ffd9f159960, T=0x0, wrapPoint=44) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/Interpreter.cpp:1277
      #63 0x00007f1514c4c6dc in cling::Interpreter::process (this=0x564bc08d0880, input="#line 1 \"ROOT_cli_3\"\n AutoloadMe()", V=0x7ffd9f159960, T=0x0, disableValuePrinting=false) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/Interpreter.cpp:730
      #64 0x00007f1514e65310 in cling::MetaProcessor::process (this=0x564bc111b440, input_line=..., compRes=
      0x7ffd9f159914: cling::Interpreter::kSuccess, result=0x7ffd9f159960, disableValuePrinting=false) at /home/axel/build/root/github/src/interpreter/cling/lib/MetaProcessor/MetaProcessor.cpp:341
      #65 0x00007f1514adf208 in HandleInterpreterException (metaProcessor=0x564bc111b440, input_line=0x564bc1b58c60 "#line 1 \"ROOT_cli_3\"\n AutoloadMe()", compRes=
      0x7ffd9f159914: cling::Interpreter::kSuccess, result=0x7ffd9f159960) at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:2276
      #66 0x00007f1514adfe54 in TCling::ProcessLine (this=0x564bc08cfe10, line=0x564bc21bc2e0 "#line 1 \"ROOT_cli_3\"\n AutoloadMe()", error=0x7ffd9f159f00) at /home/axel/build/root/github/src/core/metacling/src/TCling.cxx:2434
      #67 0x00007f151e06a37a in TApplication::ProcessLine (this=0x564bc08b4050, line=0x564bc21bc2e0 "#line 1 \"ROOT_cli_3\"\n AutoloadMe()", sync=false, err=0x7ffd9f159f00) at /home/axel/build/root/github/src/core/base/src/TApplication.cxx:1471
      #68 0x00007f151e687875 in TRint::ProcessLineNr (this=0x564bc08b4050, filestem=0x7f151e697b02 "ROOT_cli_", line=0x7ffd9f159f60 " AutoloadMe()", error=0x7ffd9f159f00) at /home/axel/build/root/github/src/core/rint/src/TRint.cxx:748
      #69 0x00007f151e6862eb in TRint::Run (this=0x564bc08b4050, retrn=false) at /home/axel/build/root/github/src/core/rint/src/TRint.cxx:423
      #70 0x0000564bbf9dab0e in main (argc=1, argv=0x7ffd9f15c0d8) at /home/axel/build/root/github/src/main/src/rmain.cxx:30
      

      This is a reproducer of the PyROOT-experimental crash with modules in roottest/python/cling/runPyClassTest.C.

        Attachments

          Activity

            People

            • Assignee:
              axel Axel Naumann
              Reporter:
              axel Axel Naumann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: