# Segmentation Fault depending on linux distribution

**URL:** <https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020>\
**Category:** ROOT\
**Created:** [August 5, 2014, 1:29pm UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020 "2014-08-05T13:29:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aperez](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@aperez](https://root-forum.cern.ch/u/aperez)\
**Post date:** [August 5, 2014, 1:29pm UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/1 "2014-08-05T13:29:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [August 5, 2014, 1:34pm UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/2 "2014-08-05T13:34:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pamputt](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pamputt/32/12526_2.png) [@pamputt](https://root-forum.cern.ch/u/pamputt)\
**Post date:** [August 5, 2014, 1:36pm UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/3 "2014-08-05T13:36:07Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![Otto\_Schaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/90ced4/32.png) [@Otto\_Schaile](https://root-forum.cern.ch/u/Otto_Schaile)\
**Post date:** [August 6, 2014, 7:54am UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/4 "2014-08-06T07:54:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aperez](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@aperez](https://root-forum.cern.ch/u/aperez)\
**Post date:** [August 6, 2014, 12:24pm UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/5 "2014-08-06T12:24:48Z")

</div>

Hi all,

I will try all this suggestions.

Thank you,

Alejandro

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 6, 2014, 12:28pm UTC](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/6 "2014-08-06T12:28:27Z")

</div>

Try something like (note: some [Valgrind](http://valgrind.org/) functionality requires that the source code, that you want to analyse, is compiled with debug symbols):

```auto
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:

```auto
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.)
