Problem with LVVM symbols

Hi everyone, I need again your help
I’m making a project that uses both GLUT and ROOT and compiling with CMake. The compilation seems to go well, but as I execute the file I get this error:

Error in <UnknownClass::InitInterpreter()>: LLVM SYMBOLS ARE EXPOSED TO CLING! This will cause problems; please hide them or dlopen() them after the call to TROOT::InitInterpreter()!

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 2 (Thread 0x7f92561e3700 (LWP 6802)):
#0  pthread_cond_wait

GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f925a5d352b in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#2  0x00007f925a5d3257 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#3  0x00007f925fa9e6da in start_thread (arg=0x7f92561e3700) at pthread_create.c:456
#4  0x00007f925f7d817f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

Thread 1 (Thread 0x7f9261f95ac0 (LWP 6801)):
#0  0x00007f925f79c4aa in __GI___waitpid (pid=6816, stat_loc=stat_loc
entry=0x7ffc7c6e0640, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00007f925f7152cb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2  0x00007f9261a31999 in TUnixSystem::StackTrace() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#3  0x00007f9261a3405c in TUnixSystem::DispatchSignals(ESignals) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#4  <signal handler called>
#5  0x00007f9257003a82 in llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#6  0x00007f925700635c in llvm::PMTopLevelManager::schedulePass(llvm::Pass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#7  0x00007f92543c6708 in addPassesToGenerateCode(llvm::LLVMTargetMachine*, llvm::legacy::PassManagerBase&, bool, void const*, void const*, void const*, llvm::MachineFunctionInitializer*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#8  0x00007f92543c6cb5 in llvm::LLVMTargetMachine::addPassesToEmitMC(llvm::legacy::PassManagerBase&, llvm::MCContext*&, llvm::raw_pwrite_stream&, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#9  0x00007f9257de9d1a in std::_Function_handler<llvm::object::OwningBinary<llvm::object::ObjectFile> (llvm::Module&), llvm::orc::SimpleCompiler>::_M_invoke(std::_Any_data const&, llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#10 0x00007f925316ad88 in llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSetImpl<std::vector<llvm::Module*, std::allocator<llvm::Module*> >, std::unique_ptr<cling::Azog, std::default_delete<cling::Azog> >, std::unique_ptr<llvm::orc::LambdaResolver<cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}, cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}>, std::default_delete<{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}> > >::emitToBaseLayer(llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#11 0x00007f925316c2c8 in std::_Function_handler<unsigned long (), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSet::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#12 0x00007f9253155bf5 in cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#13 0x00007f92531335c3 in cling::Interpreter::executeTransaction(cling::Transaction&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#14 0x00007f92531d4b6e in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#15 0x00007f9253134223 in cling::Interpreter::Interpreter(int, char const* const*, char const*, bool, cling::Interpreter const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#16 0x00007f92530b1dd3 in TCling::TCling(char const*, char const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#17 0x00007f92530b2dee in CreateInterpreter () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#18 0x00007f9261978a4e in TROOT::InitInterpreter() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#19 0x00007f9261978d66 in ROOT::Internal::GetROOT2() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#20 0x00007f9261a089a5 in TInterpreter::Instance() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#21 0x00007f926195fa9c in TSystem::GetLibraries(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#22 0x00007f926196332e in TSystem::Load(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#23 0x00007f926197648a in ROOT::EnableThreadSafety() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#24 0x00005556f9442004 in main ()
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  0x00007f9257003a82 in llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#6  0x00007f925700635c in llvm::PMTopLevelManager::schedulePass(llvm::Pass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#7  0x00007f92543c6708 in addPassesToGenerateCode(llvm::LLVMTargetMachine*, llvm::legacy::PassManagerBase&, bool, void const*, void const*, void const*, llvm::MachineFunctionInitializer*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#8  0x00007f92543c6cb5 in llvm::LLVMTargetMachine::addPassesToEmitMC(llvm::legacy::PassManagerBase&, llvm::MCContext*&, llvm::raw_pwrite_stream&, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#9  0x00007f9257de9d1a in std::_Function_handler<llvm::object::OwningBinary<llvm::object::ObjectFile> (llvm::Module&), llvm::orc::SimpleCompiler>::_M_invoke(std::_Any_data const&, llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#10 0x00007f925316ad88 in llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSetImpl<std::vector<llvm::Module*, std::allocator<llvm::Module*> >, std::unique_ptr<cling::Azog, std::default_delete<cling::Azog> >, std::unique_ptr<llvm::orc::LambdaResolver<cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}, cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}>, std::default_delete<{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}> > >::emitToBaseLayer(llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#11 0x00007f925316c2c8 in std::_Function_handler<unsigned long (), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSet::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#12 0x00007f9253155bf5 in cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#13 0x00007f92531335c3 in cling::Interpreter::executeTransaction(cling::Transaction&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#14 0x00007f92531d4b6e in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#15 0x00007f9253134223 in cling::Interpreter::Interpreter(int, char const* const*, char const*, bool, cling::Interpreter const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#16 0x00007f92530b1dd3 in TCling::TCling(char const*, char const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#17 0x00007f92530b2dee in CreateInterpreter () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#18 0x00007f9261978a4e in TROOT::InitInterpreter() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#19 0x00007f9261978d66 in ROOT::Internal::GetROOT2() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#20 0x00007f9261a089a5 in TInterpreter::Instance() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#21 0x00007f926195fa9c in TSystem::GetLibraries(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#22 0x00007f926196332e in TSystem::Load(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#23 0x00007f926197648a in ROOT::EnableThreadSafety() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#24 0x00005556f9442004 in main ()
===========================================================


Segmentation fault (core dumped)

The CMakeLists.txt file is the following:


cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(parallel)

#Command for ROOT (taken from the guide on the ROOT guide).
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})

find_package(ROOT REQUIRED COMPONENTS RIO Net)

include(${ROOT_USE_FILE})

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
ROOT_GENERATE_DICTIONARY(G__Event Event.h LINKDEF EventLinkDef.h)

#---Find packaged for GLUT and OPENGL and add libraries
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS}  ${GLUT_INCLUDE_DIRS} )

#---Adding other libraries
set(G_LIBRARIES ~/...)
add_library( V_LIB ${G_LIBRARIES}/... )
add_library( G_LIB ${G_LIBRARIES}/... )
include_directories(${G_LIBRARIES})

#---Create the executing program using the libraries

add_executable(Parallel parallel.cpp ${G_LIBRARIES}/... ${G_LIBRARIES}/... )

target_link_libraries(G_LIB V_LIB)
target_link_libraries(Parallel ${ROOT_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} G_LIB )

I used to compile with a normal makefile, but since I got the previous error I thought that passing to CMake somehow could have fixed it.

I have found that it may be connected to linking libCling, but it doesn’t seem that the compilation links it.
If it could help: a friend of mine has tried to compile on his computer with a makefile he made (the one I had been using before) and it works: I think he has used Freeglut3 and ROOT 5.

My ROOT is 6.08/06 and as GLUT I use Freeglut 3.
Any kind of help is appreciated.

Hi,

It’s most probably the same issue that the one reported on this topic

Cheers, Bertrand.

First of all thank you for the answer.
I tried to follow what the topic said: I generate from souce the build files in a directory, from which I build ROOT with the options suggested (cmake --build . -Detc) but the problem persist. Maybe I’ve built ROOT in a wrong way, or maybe I should have erased everything and downloaded a new source.

Do you link against libCling? You must not.

It doesn’t seem to me that I’m linking against libCling: even if I compile with the standard cmake (using the root-config --cflags and root-config --glibs) the problem persists and if I type root-config --glibs in the shell libCling doesn’t appear among the linked libraries.

Very weird.

Thanks. Now I finally end up where Bertrand was a week ago :slight_smile: This could well be the Radeon driver issue (they expose llvm symbols, it’s a known bug that has been reported to freedesktop and RedHat). Do you use an AMD card? Using “the other driver” (I think there are two) will work around that issue.

Cheers, Axel.

Thanks for the answer.
I’ve looked for drivers on the AMD website but the ones for my card (an old HD 6870) are just for Ubuntu 14.04 and don’t seem to work on 16.04. It seems that installing AMD driver on Ubuntu 16.04 (especially for old cards) is a problem so I’ve followed what this link suggests and tried to install Oibaf’s drivers (installed as said on their website) but the problem persists.

Oibaf is just packaging newer versions of the same freedesktop drivers.

I think your current best option is to buy a cheap NVidia card. Sorry - these drivers are really a mess…

The only other way out it to disable the use of llvm in the AMD driver; setting the env vars LIBGL_ALWAYS_INDIRECT=1 or LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=swr before starting ROOT might help. See https://www.mesa3d.org/envvars.html

Cheers, Axel.

I’m sorry but everytime I change something a new problem appears.

I’ve set the env variables suggested by modifying the .profile file and logged out, but now I can’t log in anymore: if I enter the password and try to access the screen turns black for a second and jut returns to the log in area, without logging in.

That’s either because of a change to the dot-files in your home directory (e.g. .profile) which rendered that file broken, or (less likely) due to an X11 issue.

Try this: ssh to that machine, or use screen 1 (ctrl+alt+1 or ctrl+alt+F1 - I always forget) and look at ~/.xsession-errors. That might help you find the issue. Good luck!

Axel.

Unfortunately I have Ubuntu on dual boot with Windows (it’s installed on another internal hd on the same machine) so I can’t ssh to it. If I try, I get “Connection refused”: it’s possible that I haven’t enable ssh connection on Ubuntu but I can’t verify that since I can’t log in…
I’ve lost almost a month on this problem and I don’t think I can go anywhere, so probably I’ll unistall (or install again) Ubuntu and find another computer to work on.
Thanks for all the answers, you’ve helped me a lot and I’ve learnt a lot of knew things.

Sorry it was such a frustrating endeavor. Let us know if your next computer acts up again and we’ll try to help again!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.