# Problem with root Simulation

**URL:** <https://root-forum.cern.ch/t/problem-with-root-simulation/33477>\
**Category:** Newbie\
**Tags:** tree\
**Created:** [April 6, 2019, 12:54pm UTC](https://root-forum.cern.ch/t/problem-with-root-simulation/33477 "2019-04-06T12:54:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MicheleP](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@MicheleP](https://root-forum.cern.ch/u/MicheleP)\
**Post date:** [April 6, 2019, 12:54pm UTC](https://root-forum.cern.ch/t/problem-with-root-simulation/33477/1 "2019-04-06T12:54:12Z")

</div>

Hi everybody.  
I have a problem with my c++ code. For a physics exam I have to create a simulation of p-p collision inside a cylindrical detector. In this code I use a Ttree to save my data simulation, the problem is the following: my code run very well but if I want to simulate more than 200k event it stops running and it exit from root without any type of warning and error.  
Invece if I launch a small simulation, like a dozen of event a segmentation violation appears.  
I don’t have any sort of problem when compile my code and if I hadn’t launched a big simulation I never became aware of this.  
I use ROOT 6.14/04 version.  
Thank you for the support

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [April 6, 2019, 4:18pm UTC](https://root-forum.cern.ch/t/problem-with-root-simulation/33477/2 "2019-04-06T16:18:05Z")

</div>

Hi,

You can attach gdb to root.exe to see what happens. Or you share your code. It’s likely a memory leak.

Cheers, Axel

---

<div class="post-metadata">

**Author:** ![MicheleP](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@MicheleP](https://root-forum.cern.ch/u/MicheleP)\
**Post date:** [April 6, 2019, 5:45pm UTC](https://root-forum.cern.ch/t/problem-with-root-simulation/33477/3 "2019-04-06T17:45:50Z")

</div>

Hi,  
first of all thank you very much for your attention.  
I can’t share my code because it is formed by 16 file (7 .cxx, 7 .h and 2 .C ) and I’m a new user so I have a limit of file that I can attach.  
I don’t have gnp on my mac.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [April 8, 2019, 11:58am UTC](https://root-forum.cern.ch/t/problem-with-root-simulation/33477/4 "2019-04-08T11:58:15Z")

</div>

Hi,

If you cannot share your code and you cannot debug it then I don’t know how to help… Do you have someone near you who maybe even knows this code, your supervisor or more experienced colleagues?

Axel.
