Compiled program with libNew.so root 6.xx crash

In order to use TMapFile I link the application with “-lNew”
For example the simple program test.cpp

#include <stdio.h>
void test() 
{
  printf("Hello world\n");
}
#ifndef __CINT__
int main(int argc, char *argv[])
{
  test();
}
#endif

compiled with

$ g+  -o test  test.cpp -std=c+11  `root-config  --new --cflags --glibs`

The program work without any issue with rootn.exe

$ rootn.exe test.cpp

Using the compiled program, Immediately it break

$ ./test

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007fcba046ddbc in waitpid () from /lib64/libc.so.6
#1  0x00007fcba03f0cc2 in do_system () from /lib64/libc.so.6
#2  0x00007fcba43f522f in TUnixSystem::StackTrace() () from /home/daq/root/lib/libCore.so
#3  0x00007fcba43f797c in TUnixSystem::DispatchSignals(ESignals) () from /home/daq/root/lib/libCore.so
#4  <signal handler called>
#5  0x00007fcba04e5f5b in __strstr_sse42 () from /lib64/libc.so.6
#6  0x00007fcb9b6547dc in TCling::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**, bool) () from /home/daq/root/lib/libCling.so
#7  0x00007fcba427d05a in TROOT::InitInterpreter() () from /home/daq/root/lib/libCore.so
#8  0x00007fcba427d3e6 in ROOT::Internal::GetROOT2() () from /home/daq/root/lib/libCore.so
#9  0x00007fcba3d627ac in TMapFile::WhichMapFile(void*) () from /home/daq/root/lib/libRIO.so
#10 0x00007fcba3d6283e in (anonymous namespace)::FreeIfTMapFile(void*) () from /home/daq/root/lib/libRIO.so
#11 0x00007fcba4d56295 in operator delete(void*) () from /home/daq/root/lib/libNew.so
#12 0x00007fcba4281744 in TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**) () from /home/daq/root/lib/libCore.so
#13 0x00007fcba3a136c5 in (anonymous namespace)::TriggerDictionaryInitialization_libNet_Impl() () from /home/daq/root/lib/libNet.so
#14 0x00007fcba4f684c3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#15 0x00007fcba4f5a1aa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#16 0x0000000000000001 in ?? ()
#17 0x00007ffdae355ee0 in ?? ()
#18 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  0x00007fcba04e5f5b in __strstr_sse42 () from /lib64/libc.so.6
#6  0x00007fcb9b6547dc in TCling::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**, bool) () from /home/daq/root/lib/libCling.so
#7  0x00007fcba427d05a in TROOT::InitInterpreter() () from /home/daq/root/lib/libCore.so
#8  0x00007fcba427d3e6 in ROOT::Internal::GetROOT2() () from /home/daq/root/lib/libCore.so
#9  0x00007fcba3d627ac in TMapFile::WhichMapFile(void*) () from /home/daq/root/lib/libRIO.so
#10 0x00007fcba3d6283e in (anonymous namespace)::FreeIfTMapFile(void*) () from /home/daq/root/lib/libRIO.so
#11 0x00007fcba4d56295 in operator delete(void*) () from /home/daq/root/lib/libNew.so
#12 0x00007fcba4281744 in TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**) () from /home/daq/root/lib/libCore.so
#13 0x00007fcba3a136c5 in (anonymous namespace)::TriggerDictionaryInitialization_libNet_Impl() () from /home/daq/root/lib/libNet.so
#14 0x00007fcba4f684c3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#15 0x00007fcba4f5a1aa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#16 0x0000000000000001 in ?? ()
#17 0x00007ffdae355ee0 in ?? ()
#18 0x0000000000000000 in ?? ()
===========================================================


Fatal in <operator delete>: storage area overwritten
aborting
Aborted (core dumped)

without --new the program work without any issues
compiled with

>g++  -o test  test.cpp -std=c++11 `root-config  --cflags --glibs`
>./test
Hello world
>

Thanks
Federico

Which version of ROOT are you using? Can you try with a debug build?

In same post was said that starting from the 6.08/6 patched or the 6.10/00 the problem was solved.
I have compiled both version and others without any change on the result, except that all work for same version just using rootn.exe, but seems that this was compiled without using libNew.
I have tried to use the debug, but how it showed in the trace the problem is related to the “newdelete”
Federico

Can you show the new stacktrace?

I just like to inform that I have the same effect con Lxplus. The compiling is on Centos 7
However there are not any problem with root 5.34

The stack trace is

 ===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007f83fec51dbc in waitpid () from /lib64/libc.so.6
#1  0x00007f83febd4cc2 in do_system () from /lib64/libc.so.6
#2  0x00007f8402c2886f in TUnixSystem::StackTrace() () from /home/daq/root/lib/libCore.so
#3  0x00007f8402c2afbc in TUnixSystem::DispatchSignals(ESignals) () from /home/daq/root/lib/libCore.so
#4  <signal handler called>
#5  0x00007f83fecc9f5b in __strstr_sse42 () from /lib64/libc.so.6
#6  0x00007f83f99eae5c in TCling::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**, bool) () from /home/daq/root/lib/libCling.so
#7  0x00007f8402aa88ea in TROOT::InitInterpreter() () from /home/daq/root/lib/libCore.so
#8  0x00007f8402aa8c76 in ROOT::Internal::GetROOT2() () from /home/daq/root/lib/libCore.so
#9  0x00007f84025c035c in TMapFile::WhichMapFile(void*) () from /home/daq/root/lib/libRIO.so
#10 0x00007f84025c03ee in (anonymous namespace)::FreeIfTMapFile(void*) () from /home/daq/root/lib/libRIO.so
#11 0x00007f8402f7e175 in operator delete(void*) () from /home/daq/root/lib/libNew.so
#12 0x00007f8402aad5b4 in TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**) () from /home/daq/root/lib/libCore.so
#13 0x00007f83fdc2f87f in (anonymous namespace)::TriggerDictionaryInitialization_libImt_Impl() () from /home/daq/root/lib/libImt.so
#14 0x00007f840318f4c3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#15 0x00007f84031811aa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#16 0x0000000000000001 in ?? ()
#17 0x00007fffac003ee0 in ?? ()
#18 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  0x00007f83fecc9f5b in __strstr_sse42 () from /lib64/libc.so.6
#6  0x00007f83f99eae5c in TCling::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**, bool) () from /home/daq/root/lib/libCling.so
#7  0x00007f8402aa88ea in TROOT::InitInterpreter() () from /home/daq/root/lib/libCore.so
#8  0x00007f8402aa8c76 in ROOT::Internal::GetROOT2() () from /home/daq/root/lib/libCore.so
#9  0x00007f84025c035c in TMapFile::WhichMapFile(void*) () from /home/daq/root/lib/libRIO.so
#10 0x00007f84025c03ee in (anonymous namespace)::FreeIfTMapFile(void*) () from /home/daq/root/lib/libRIO.so
#11 0x00007f8402f7e175 in operator delete(void*) () from /home/daq/root/lib/libNew.so
#12 0x00007f8402aad5b4 in TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**) () from /home/daq/root/lib/libCore.so
#13 0x00007f83fdc2f87f in (anonymous namespace)::TriggerDictionaryInitialization_libImt_Impl() () from /home/daq/root/lib/libImt.so
#14 0x00007f840318f4c3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#15 0x00007f84031811aa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#16 0x0000000000000001 in ?? ()
#17 0x00007fffac003ee0 in ?? ()
#18 0x0000000000000000 in ?? ()
===========================================================


Fatal in <operator delete>: storage area overwritten
aborting
Aborted (core dumped)

Federico

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