Hello,
linking unnecessary libraries might be a bad idea anyways, but I would like to find out why it is a bad idea.
When building stand-alone ROOT applications, it is necessary to explicitly link some libraries in addition to the ones provided by “root-config --glibs”, for example the ASImage library when using TASImages. Consequently, I tried to simply link all installed ROOT libraries, which did work using root 5.34.12.
However, running root 6.08.02 under archlinux, building with gcc 6.2.1 and linking the “New” library (libNew.so) produces the following floating point exception on startup of the compiled excecutable:
[code] *** Break *** floating point exception
===========================================================
There was a crash.
This is the entire stack trace of all threads:
#0 0x00007fb359ccfd6a in waitpid () from /lib/libc.so.6
#1 0x00007fb359c570fb in do_system () from /lib/libc.so.6
#2 0x00007fb35dca7f91 in TUnixSystem::StackTrace() () from /usr/lib/root/libCore.so
#3 0x00007fb35dcaa8fc in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib/root/libCore.so
#4
#5 0x00007fb35dc5b641 in TClass::TDeclNameRegistry::AddQualifiedName(char const*) () from /usr/lib/root/libCore.so
#6 0x00007fb35dc5d62b in TClass::Init(char const*, short, std::type_info const*, TVirtualIsAProxy*, char const*, char const*, int, int, ClassInfo_t*, bool) () from /usr/lib/root/libCore.so
#7 0x00007fb35dc6760f in TClass::TClass(char const*, short, bool) () from /usr/lib/root/libCore.so
#8 0x00007fb354e11dfd in TCling::GenerateTClass(char const*, bool, bool) () from /usr/lib/root/libCling.so
#9 0x00007fb35dc612f5 in TClass::AddRule(char const*) () from /usr/lib/root/libCore.so
#10 0x00007fb35dc61445 in ?? () from /usr/lib/root/libCore.so
#11 0x00007fb35dc616f3 in TClass::ReadRules() () from /usr/lib/root/libCore.so
#12 0x00007fb35db21663 in TROOT::InitInterpreter() () from /usr/lib/root/libCore.so
#13 0x00007fb35db21836 in ROOT::Internal::GetROOT2() () from /usr/lib/root/libCore.so
#14 0x00007fb35aa791c6 in operator delete(void*) () from /usr/lib/root/libNew.so
#15 0x00007fb35dc22438 in TClassTable::Add(char const*, short, std::type_info const&, TClass* ()(), int) () from /usr/lib/root/libCore.so
#16 0x00007fb35dc730b6 in ROOT::TGenericClassInfo::TGenericClassInfo(char const, int, char const*, int, ROOT::Internal::TInitBehavior const*, TClass* (*)(), int) () from /usr/lib/root/libCore.so
#17 0x00007fb35db880ba in ROOT::GenerateInitInstance() () from /usr/lib/root/libCore.so
#18 0x00007fb35db1aa00 in ?? () from /usr/lib/root/libCore.so
#19 0x00007fb35e5c74fa in call_init.part () from /lib64/ld-linux-x86-64.so.2
#20 0x00007fb35e5c760b in _dl_init () from /lib64/ld-linux-x86-64.so.2
#21 0x00007fb35e5b8daa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#22 0x0000000000000001 in ?? ()
#23 0x00007fff3dd57d6f in ?? ()
#24 0x0000000000000000 in ?? ()
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 0x00007fb35dc5b641 in TClass::TDeclNameRegistry::AddQualifiedName(char const*) () from /usr/lib/root/libCore.so
#6 0x00007fb35dc5d62b in TClass::Init(char const*, short, std::type_info const*, TVirtualIsAProxy*, char const*, char const*, int, int, ClassInfo_t*, bool) () from /usr/lib/root/libCore.so
#7 0x00007fb35dc6760f in TClass::TClass(char const*, short, bool) () from /usr/lib/root/libCore.so
#8 0x00007fb354e11dfd in TCling::GenerateTClass(char const*, bool, bool) () from /usr/lib/root/libCling.so
#9 0x00007fb35dc612f5 in TClass::AddRule(char const*) () from /usr/lib/root/libCore.so
#10 0x00007fb35dc61445 in ?? () from /usr/lib/root/libCore.so
#11 0x00007fb35dc616f3 in TClass::ReadRules() () from /usr/lib/root/libCore.so
#12 0x00007fb35db21663 in TROOT::InitInterpreter() () from /usr/lib/root/libCore.so
#13 0x00007fb35db21836 in ROOT::Internal::GetROOT2() () from /usr/lib/root/libCore.so
#14 0x00007fb35aa791c6 in operator delete(void*) () from /usr/lib/root/libNew.so
#15 0x00007fb35dc22438 in TClassTable::Add(char const*, short, std::type_info const&, TClass* ()(), int) () from /usr/lib/root/libCore.so
#16 0x00007fb35dc730b6 in ROOT::TGenericClassInfo::TGenericClassInfo(char const, int, char const*, int, ROOT::Internal::TInitBehavior const*, TClass* (*)(), int) () from /usr/lib/root/libCore.so
#17 0x00007fb35db880ba in ROOT::GenerateInitInstance() () from /usr/lib/root/libCore.so
#18 0x00007fb35db1aa00 in ?? () from /usr/lib/root/libCore.so
#19 0x00007fb35e5c74fa in call_init.part () from /lib64/ld-linux-x86-64.so.2
#20 0x00007fb35e5c760b in _dl_init () from /lib64/ld-linux-x86-64.so.2
#21 0x00007fb35e5b8daa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#22 0x0000000000000001 in ?? ()
#23 0x00007fff3dd57d6f in ?? ()
#24 0x0000000000000000 in ?? ()
=========================================================== [/code]
I compiled an “empty” cxx file:
int main(int argc, char **argv)
{
return 0;
}[/code]
Compiling:
[code]g++ -I/usr/include/root -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"LibraryDebugProject.d" -MT"LibraryDebugProject.o" -o "LibraryDebugProject.o" "../LibraryDebugProject.cxx"
Linking:
g++ -L/usr/lib/root `root-config --glibs` -o "LibraryDebugProject" ./LibraryDebugProject.o -lNew;
So what exactly is causing this problem?