Stack trace missing line numbers

Hello,

I have just reinstalled my system and built my new root. I did everything according to the guide, but my new root does not show line number where my code fails in stack trace. For instance, this is what I see:
*** Break *** segmentation violation
Generating stack trace…
0x000055c62de7628b in main + 0x36 from ./a.out
0x00007f90227aa09b in __libc_start_main + 0xeb from /lib/x86_64-linux-gnu/libc.so.6
0x000055c62de7619a in _start + 0x2a from ./a.out

I remember that before, there was always information with the line in the code, where the program crashed.
Compile command I use: g++ `root-config --cflags --libs` -g3 ReweightMC.cpp

I tried without -g3, also other options like -g, -g1, -g2 nothing works.
The code and command is exactly the same as in my previous root installations.

This new root is 6.24, before I had version 6.21 and the stack trace had much more information.

I have also tried to rebuild the root with cmake option CMAKE_BUILD_TYPE with Release or Debug → No effect. (Old root was Release).

Please is there any way to turn this on again?


ROOT Version: 6.24/06
Platform: Debian
Compiler: g++ (Debian 8.3.0-6) 8.3.0


Hi @Martin1512 ,
-g should be enough, and if you don’t have line number information even for the part of the stacktrace in your own code, the problem (or that part of the problem) is not related to ROOT (but just out of curiosity what does root-config --cflags --libs print?)

To have line numbers in stacktraces for parts of the callstack inside ROOT you need CMAKE_BUILD_TYPE=RelWithDebInfo or Debug.

Cheers,
Enrico

Hi Enrico,

thank you for your fast reply.
For the command I get:

root-config --cflags --libs
-pthread -std=c++11 -m64 -I/home/martin/software/root6/build/include -L/home/martin/software/root6/build/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -pthread -lm -ldl -rdynamic

Cheers,
Martin

Ok,
root-config --cflags --libs is not messing with optimization or debug flags.

The problem must be somewhere else and it does not seem to be ROOT-related for the reason mentioned above (even non-ROOT code is missing line number information).

I suggest you try the same thing on another system or in a Docker container. If you can reproduce the problem in a Docker container, and only for ROOT, I can take a look (but I compile ROOT with debug symbols routinely, also on Debian, and stacktraces usually come out fine, so I suspect there is something unusual in your setup).

Cheers,
Enrico

I guess the problem was yet again between the chair and the keyboard :slight_smile: . My system was missing gdb… After its installation -g works smoothly and I see lines in stack trace:
#5 0x000055750a249bb7 in Configuration::Configuration (this=0x55750c1323d0, logFileRank=“1”, projectPath="/home/martin/cern/analysis/scripts/…", programVersion=“3.7”, datasetCode=“D”, configurationCode=“M3”, inputTree=“DFAntiKt4HI”) at /home/martin/cern/analysis/src/shared/Configuration.cpp:38

Thank you Enrico!

Cheers,
Martin

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