I run my code as a standalone executable linked against the root libraries.
I would greatly appreciate if somebody could tell me how to stop root trapping a segmentation fault and preventing a core dump when I have a bug in my code. Currently root attempts to do a stack trace itself but this is usually useless and things would be easier if I could just work with the core file myself.
I link against root 5.14.00f.
in your system.rootrc file or $HOME/.rootrc change the line
# Global debug mode. When >0 turns on progressively more details debugging.
from yes to no.
Otherwise simply use gdb.
Thanks Rene for the fast response. Unfortunately this doesnt seem to do exactly what I want it to do.
This turned off the stack trace but what I really actually want is the program to dump a core file so I can use gdb et. al.
I created an example program to test this which just creates a seg fault which is in a file test.cc
double nullPointer =0;
*nullPointer = 4;
Now when I do gcc test.cc and then ./a.out I get the following
Segmentation fault (core dumped)
and I get a nice core file in my working directory. When I link the same code with the root libraries by
gcc test.cc -L/opt/ppd/scratch/harper/5.14.00f-CMS3q//lib -lCore -ldl
when I run ./a.out I get
*** Break *** segmentation violation
and no core file. Is there a setting for it to just dump a core file.
I figured out what I have to do.
disabling roots attempts to catch the SEGV signal.