Crash when running over root files, using a C++ macro

Yes, indeed ! I found the solution just after answering to you (thanks to the help of the person that produced the root files and told me to be careful with these vectors that are sometimes empty) :slight_smile:
So no need anymore to bother you with the root files, thanks in any case for your help !
Best,
N.LM

1 Like

Cool, all’s well that ends well. As an advice, if I may: it should not take so long to debug issues like these, which are very common simple bugs that sneak in all the time. Compiling your macro into an executable and running the executable withing gdb would have pointed you to the problem in minutes. For example, you can add a main at the bottom of the macro that only calls the MakeTemplates function with the right arguments, and then compile it like a normal C++ program with:

g++ -g -o MakeTemplates MakeTemplates.C $(root-config --libs --cflags)

At this point,

gdb ./MakeTemplates

followed by run should execute the program until it crashes and you should be able to see the exact line at which the crash happens with where.

Cheers,
Enrico

1 Like

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