Segmentation Fault depending on linux distribution

Dear all,

I am having a problem with some code developed by my working group. The code uses several root libraries. It works pretty well in a server of our group using Debian GNU/Linux 6.0, with root 5.34/14, and gcc/g++ versions gcc (Debian 4.4.5-8) 4.4.5.

On the other hand, in my laptop with Ubuntu 14.04 LTS, root 5.34/18, and gcc/g++ versions gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, the code crashes with a segmentation fault, even though I use the same configurations and inputs.

I know that I am not being very specific, but It is too complicated to give you a way to reproduce the problem. I only want a hint to pursue the reason of this difference in execution. I already tried to install the same root version and using the same version of the compiler but the error persists.

Many thanks,

Alejandro

Hi,

there should be no issue with these platforms: are they all x86_64 architectures?
In any case, I think that a reproducer is needed to go forward.

Danilo

Strange behaviour…
You can try to compile ROOT on your Ubuntu laptop with the debug mode (./configure --build=debug). It could say you the line where your program is crashing. Maybe, there is a bug in your code which is not “interpreted” on the Debian machine for some reasons :confused:

Hi,

run your program with “valgrind” (on both archs),( you may need to install it first)
to find/exclude non initialized variables, index errors etc.
Of course try to find the place of the seg viol with “gdb”

Cheers
Otto

Hi all,

I will try all this suggestions.

Thank you,

Alejandro

Try something like (note: some Valgrind functionality requires that the source code, that you want to analyse, is compiled with debug symbols):

valgrind --tool=memcheck --leak-check=full [--show-reachable=yes] [--track-origins=yes] [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'YourMacro.cxx[++g][(Any, Parameters, You, Need)]'
valgrind --tool=exp-sgcheck [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'YourMacro.cxx[++g][(Any, Parameters, You, Need)]'

or:

valgrind --tool=memcheck --leak-check=full [--show-reachable=yes] [--track-origins=yes] [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp YourExecutable [Any Options You Need]
valgrind --tool=exp-sgcheck [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp YourExecutable [Any Options You Need]

and especially carefully study messages that appear in the beginning of the output.
(Note: the --show-reachable=yes option will give you too many warnings, I believe.)