# Segmentation Violation Error in ROOT version 6.08/06

**URL:** <https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478>\
**Category:** ROOT\
**Created:** [January 8, 2018, 1:56am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478 "2018-01-08T01:56:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DolceVita](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@DolceVita](https://root-forum.cern.ch/u/DolceVita)\
**Post date:** [January 8, 2018, 1:56am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478/1 "2018-01-08T01:56:43Z")

</div>

Hi guys!

I am using ROOT for certain analyses (linked with FastJet). The issue arises when I tried to read some events stored from a ROOT file. The compilation went just fine but at the execution, I got the segmentation violation error (which is attached to this message).  
I am using version 6.08/06 on Linux Ubuntu 16.06. I installed and built the package using the old method. The necessary files are attached.

Thanks a lot for your help,  
Cheers,

[ROOT\_jets.tar](https://root-forum.cern.ch/uploads/default/original/2X/5/5ef58416647cc6a464c3dff5a7c9df116436b281.tar) (1.7 MB)

---

<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:** [January 8, 2018, 7:58am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478/2 "2018-01-08T07:58:19Z")

</div>

Hi,

what is the actual stacktrace?  
The code you attached does not say much since we have no information about the “ReadEvent” function.

Cheers,  
D

---

<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:** [January 8, 2018, 8:06am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478/3 "2018-01-08T08:06:00Z")

</div>

[Analysis.h](https://root-forum.cern.ch/uploads/default/original/2X/e/eb8cd504eb0e00b04089206d8617635e750faa55.h) (6.8 KB)  
[Analysis.C](https://root-forum.cern.ch/uploads/default/original/2X/9/92e83c71a3ec7ff9061729a9890c10b54b4a0235.C) (1.4 KB)

> [@Header files for Trees](https://root-forum.cern.ch/t/header-files-for-trees/16308/2):
>
> “Most recent” documentation about how to generate and use an “analysis skeleton”: [TTree::MakeClass](http://root.cern.ch/root/html534/TTree.html#TTree:MakeClass) (see also [“ROOT User’s Guide” → “Trees” → “Using TTree::MakeClass”](http://root.cern.ch/root/html534/guides/users-guide/Trees.html#using-ttreemakeclass)) [TTree::MakeSelector](http://root.cern.ch/root/html534/TTree.html#TTree:MakeSelector) (see also [“ROOT Primer” → “File I/O and Parallel Analysis” → “N-tuples in ROOT” → “For the advanced user: Processing trees with a selector script”](http://root.cern.ch/root/htmldoc/guides/primer/ROOTPrimer.html#for-the-advanced-user-processing-trees-with-a-selector-script) and [“ROOT User’s Guide” → “Trees” → “Using TTree::MakeSelector”](http://root.cern.ch/root/html534/guides/users-guide/Trees.html#using-ttreemakeselector) and [“ROOT User’s Guide” → “Example Analysis”](http://root.cern.ch/root/html534/guides/users-guide/ExampleAnalysis.html)) [TTree::MakeProxy](http://root.cern.ch/root/html534/TTree.html#TTree:MakeProxy)[ROOT::RDataFrame](https://root.cern.ch/doc/master/classROOT_1_1RDataFrame.html) (uses the [T…](https://root.cern.ch/doc/master/classTTreeReader.html)

---

<div class="post-metadata">

**Author:** ![DolceVita](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@DolceVita](https://root-forum.cern.ch/u/DolceVita)\
**Post date:** [January 8, 2018, 8:37am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478/4 "2018-01-08T08:37:21Z")

</div>

Hi,

Thanks a lot for your answer.

@Danilo  
Here is the stack trace that I got

#0 0x00007fad56f7e07a in \_\_GI\_\_\_waitpid (pid=26134, stat\_loc=stat\_loc  
entry=0x7ffe0012d1c0, options=options  
entry=0) at …/sysdeps/unix/sysv/linux/waitpid.c:29  
#1 0x00007fad56ef6fbb in do\_system (line=) at …/sysdeps/posix/system.c:148  
#2 0x00007fad58ab3e94 in TUnixSystem::StackTrace() () from /media/adil/70aa4125-8ea2-43be-afcf-88b43c0b7507/adil/parent//lib/root/libCore.so  
#3 0x00007fad58ab64ac in TUnixSystem::DispatchSignals(ESignals) () from /media/adil/70aa4125-8ea2-43be-afcf-88b43c0b7507/adil/parent//lib/root/libCore.so  
#4  
#5 0x000000000040d53a in Analysis::ReadEvent (this=0x1b368c0, jentry=0) at Analysis.h:117  
#6 0x000000000040f189 in Analysis::Loop (this=0x1b368c0) at Analysis.cpp:22  
#7 0x000000000040ef87 in main (argc=1, argv=0x7ffe00130088) at Analysis.h:324

@Wile E. Coyote  
I have generated .h and .C files similar to what you attached to your reply. I did minor modifications to include FastJet.

Cheers,  
D.

---

<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:** [January 8, 2018, 8:56am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478/5 "2018-01-08T08:56:20Z")

</div>

Your version of “Analysis.h” (the “leaf types”) does not correspond to your “Analysis” tree.  
I guess you get a SIGSEGV because you try to access a NULL pointer.

> [@Segmentation Fault depending on linux distribution](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/6):
>
> 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): 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…

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [January 22, 2018, 8:56am UTC](https://root-forum.cern.ch/t/segmentation-violation-error-in-root-version-6-08-06/27478/6 "2018-01-22T08:56:31Z")

</div>

Closed on January 22, 2018, 8:56am UTC

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