# Segmentation Fault in Garfield++ using ROOT v6.16/00

**URL:** <https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859>\
**Category:** Garfield++\
**Tags:** garfield\
**Created:** [June 27, 2019, 7:34am UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859 "2019-06-27T07:34:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aritra](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/dec6dc/32.png) [@Aritra](https://root-forum.cern.ch/u/Aritra)\
**Post date:** [June 27, 2019, 7:34am UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/1 "2019-06-27T07:34:39Z")

</div>

Hello everyone,

I am using garfield++ and it uses ROOT for plotting. The portion of the simulation that doesn’t use ROOT completes just fine, but whenever I try to call any ROOT method for plotting, here’s the error I get -

```auto
 ` ***Break*** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00002b072d42427c in waitpid () from /lib64/libc.so.6
#1 0x00002b072d3a7c72 in do_system () from /lib64/libc.so.6
#2 0x00002b072821b7c4 in TUnixSystem::StackTrace() () from /home/officer/akd/root/lib/libCore.so.6.16
#3 0x00002b072821defc in TUnixSystem::DispatchSignals(ESignals) () from /home/officer/akd/root/lib/libCore.so.6.16
#4 <signal handler called>
#5 0x00002b0728138241 in TString::operator=(char const*) () from /home/officer/akd/root/lib/libCore.so.6.16
#6 0x00002b072811ded1 in TNamed::SetNameTitle(char const*, char const*) () from /home/officer/akd/root/lib/libCore.so.6.16
#7 0x000000000042bf52 in Garfield::ViewFEMesh::ViewFEMesh() ()
#8 0x000000000041df42 in main (argc=1, argv=<optimized out>) at avalanche1.cc:276
===========================================================

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5 0x00002b0728138241 in TString::operator=(char const*) () from /home/officer/akd/root/lib/libCore.so.6.16
#6 0x00002b072811ded1 in TNamed::SetNameTitle(char const*, char const*) () from /home/officer/akd/root/lib/libCore.so.6.16
#7 0x000000000042bf52 in Garfield::ViewFEMesh::ViewFEMesh() ()
#8 0x000000000041df42 in main (argc=1, argv=<optimized out>) at avalanche1.cc:276
===========================================================

```

Can someone please help me out?  
ROOT Version: 6.16/00  
Operating System - CentOS Linux release 7.3.1611 (Core)  
$ROOTSYS = /home/officer/akd/root

---

<div class="post-metadata">

**Author:** ![OSchaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/e495f1/32.png) [@OSchaile](https://root-forum.cern.ch/u/OSchaile)\
**Post date:** [June 27, 2019, 1:15pm UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/2 "2019-06-27T13:15:54Z")

</div>

Hi,  
I suspect you use a different ROOT version during  
building and running time  
Otto

---

<div class="post-metadata">

**Author:** ![Aritra](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/dec6dc/32.png) [@Aritra](https://root-forum.cern.ch/u/Aritra)\
**Post date:** [July 1, 2019, 7:44am UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/3 "2019-07-01T07:44:01Z")

</div>

Hello,  
Thanks for helping out.This program is running on a Grid which has both v6.08 and v6.16 installed on it. But I ran the **thisroot.sh** script from my user area which had the v6.16 files. Is there anything else I should do to avoid this clash between versions?  
Regards, Aritra.

---

<div class="post-metadata">

**Author:** ![OSchaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/e495f1/32.png) [@OSchaile](https://root-forum.cern.ch/u/OSchaile)\
**Post date:** [July 1, 2019, 8:48am UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/4 "2019-07-01T08:48:31Z")

</div>

Hi Aritra,  
the question is with which ROOT was used when building  
$GARFIELD\_HOME/Library/libGarfield.a  
A hint may give the following command

```auto
strings $GARFIELD_HOME/Library/libGarfield.a | grep -i root | grep include
/software/opt/xenial/x86_64/root/6.14.04/include/TMatrixT.h

```

you see I get 6.14.04, but this need not be that simple  
in your case

Cheers  
Otto

---

<div class="post-metadata">

**Author:** ![Aritra](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/dec6dc/32.png) [@Aritra](https://root-forum.cern.ch/u/Aritra)\
**Post date:** [July 1, 2019, 10:04am UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/5 "2019-07-01T10:04:40Z")

</div>

Hello Otto,  
I think that’s the issue. This is what I get:

> /usr/include/root/TMatrixT.h

Garfield seems to have been built using the global installation of ROOT (v6.08) located at “/usr/include/root” rather than the v6.16 I had unzipped in my user area. (/home/officer/akd/root). I think I must build it again from scratch.

Is there anything else I can do apart from running thisroot.sh to set all environment variables to **ensure** that Garfield++ uses my version of ROOT?  
Thanks for helping out.

Regards,  
Aritra

---

<div class="post-metadata">

**Author:** ![OSchaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/e495f1/32.png) [@OSchaile](https://root-forum.cern.ch/u/OSchaile)\
**Post date:** [July 1, 2019, 3:10pm UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/6 "2019-07-01T15:10:10Z")

</div>

Hello Aritra,

```auto
source $ROOTSYS/bin/thisroot.sh

```

should be enough.  
However before that check that no other ROOTSYS has been set:

```auto
echo $ROOTSYS
echo $PATH

```

and better check afterwards if the desired ROOTSYS is really set

Cheers  
Otto

---

<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:** [July 15, 2019, 3:10pm UTC](https://root-forum.cern.ch/t/segmentation-fault-in-garfield-using-root-v6-16-00/34859/7 "2019-07-15T15:10:15Z")

</div>

Closed on July 15, 2019, 3:10pm UTC

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