# Strange problem with TF1

**URL:** <https://root-forum.cern.ch/t/strange-problem-with-tf1/18291>\
**Category:** ROOT\
**Created:** [October 6, 2014, 2:26pm UTC](https://root-forum.cern.ch/t/strange-problem-with-tf1/18291 "2014-10-06T14:26:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca89](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/d26b3c/32.png) [@luca89](https://root-forum.cern.ch/u/luca89)\
**Post date:** [October 6, 2014, 2:26pm UTC](https://root-forum.cern.ch/t/strange-problem-with-tf1/18291/1 "2014-10-06T14:26:09Z")

</div>

Dear experts,

I have a very strange problem with TF1 and I am a little bit confused about it. (I am using root v.5.34.00)

I have this code (here: [https://github.com/lbrianza/iMCP\_TB/blob/master/TB/bin/analyzer.cpp](https://github.com/lbrianza/iMCP_TB/blob/master/TB/bin/analyzer.cpp) ) that works perfectly, except for this fact: at the return(0), it gives me a “break: segmentation violation”.  
(no other errors: the terminal simply remains stuck).

After a lot of debug, I have found the problematic line: (line 162)

```auto

```

The strange thing is that, if I change this line with:

```auto

```

everything goes right, and the segmentation violation diseappears. But, when I call the TF1 constructor with the name, the problem appears again. I have also tried different names/functions:

```auto

```

```auto

```

or similar, but the “break: segmentation violation” is still there.

any ideas about this issue?  
thank you very much for the help,  
Luca

---

<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:** [October 6, 2014, 2:55pm UTC](https://root-forum.cern.ch/t/strange-problem-with-tf1/18291/2 "2014-10-06T14:55:02Z")

</div>

Try to replace: `gSystem->Load("libTree");` with: `TApplication a("a", 0, 0);
if (argc < 7) return 1;`

---

<div class="post-metadata">

**Author:** ![luca89](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/d26b3c/32.png) [@luca89](https://root-forum.cern.ch/u/luca89)\
**Post date:** [October 6, 2014, 3:01pm UTC](https://root-forum.cern.ch/t/strange-problem-with-tf1/18291/3 "2014-10-06T15:01:01Z")

</div>

Hi,

[quote=“Wile E. Coyote”]Try to replace: `gSystem->Load("libTree");` with: `TApplication a("a", 0, 0);
if (argc < 7) return 1;`[/quote]  
done, but I still get the “segmentation violation”. The only difference now is that the terminal is not stuck anymore.

Luca

---

<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:** [October 6, 2014, 3:06pm UTC](https://root-forum.cern.ch/t/strange-problem-with-tf1/18291/4 "2014-10-06T15:06:28Z")

</div>

[[root.cern.ch/phpBB3/viewtopic.p](http://root.cern.ch/phpBB3/viewtopic.p) … 623#p78623]([Segmentation Fault depending on linux distribution](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/6)
