# \*\*\* Break \*\*\* segmentation violation closing root

**URL:** <https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873>\
**Category:** Newbie\
**Created:** [June 11, 2020, 9:35am UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873 "2020-06-11T09:35:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![coburn](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/bc8723/32.png) [@coburn](https://root-forum.cern.ch/u/coburn)\
**Post date:** [June 11, 2020, 9:35am UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873/1 "2020-06-11T09:35:21Z")

</div>

Hi everyone,  
first of all I use this version:  
_ROOT Version: 6.20/04_  
_Built for linuxx8664gcc on Apr 01 2020, 08:28:48_  
_From tags/v6-20-04@v6-20-04_

I’m trying to do a program using 3D libraries. I decided to try to compile a root macro to learn how to do it, so I decided to compile the macro named  
_csgdemo.C_  
contained in the directory  
_/root/tutorials/eve_

To do it I just followed some instructions I found on some papers I found:  
-include header files  
-add the main function where the commands are the following:

```auto
int main()
{
 TApplication theApp("Dynamic System", 0, 0);
 csgdemo();
 theApp.Run(kTRUE);
 return 0;
}

```

Everything works correctly, but when I select QUIT ROOT occures the following error:

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

*===========================================================*
*There was a crash.*
*This is the entire stack trace of all threads:*
*===========================================================*

*Thread 5 (Thread 0x7f683d864700 (LWP 19852)):*
*#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5616e95f0168) at ../sysdeps/nptl/futex-internal.h:183*
*#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5616e95f0118, cond=0x5616e95f0140) at pthread_cond_wait.c:508*
*#2 __pthread_cond_wait (cond=0x5616e95f0140, mutex=0x5616e95f0118) at pthread_cond_wait.c:638*
*#3 0x00007f684396c3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#4 0x00007f684396bfeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#5 0x00007f6858d27609 in start_thread (arg=<optimized out>) at pthread_create.c:477*
*#6 0x00007f6858f14103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95*

*Thread 4 (Thread 0x7f683e065700 (LWP 19851)):*
*#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5616e95f0168) at ../sysdeps/nptl/futex-internal.h:183*
*#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5616e95f0118, cond=0x5616e95f0140) at pthread_cond_wait.c:508*
*#2 __pthread_cond_wait (cond=0x5616e95f0140, mutex=0x5616e95f0118) at pthread_cond_wait.c:638*
*#3 0x00007f684396c3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#4 0x00007f684396bfeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#5 0x00007f6858d27609 in start_thread (arg=<optimized out>) at pthread_create.c:477*
*#6 0x00007f6858f14103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95*

*Thread 3 (Thread 0x7f683e866700 (LWP 19850)):*
*#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5616e95f0168) at ../sysdeps/nptl/futex-internal.h:183*
*#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5616e95f0118, cond=0x5616e95f0140) at pthread_cond_wait.c:508*
*#2 __pthread_cond_wait (cond=0x5616e95f0140, mutex=0x5616e95f0118) at pthread_cond_wait.c:638*
*#3 0x00007f684396c3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#4 0x00007f684396bfeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#5 0x00007f6858d27609 in start_thread (arg=<optimized out>) at pthread_create.c:477*
*#6 0x00007f6858f14103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95*

*Thread 2 (Thread 0x7f683f067700 (LWP 19849)):*
*#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5616e95f0168) at ../sysdeps/nptl/futex-internal.h:183*
*#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5616e95f0118, cond=0x5616e95f0140) at pthread_cond_wait.c:508*
*#2 __pthread_cond_wait (cond=0x5616e95f0140, mutex=0x5616e95f0118) at pthread_cond_wait.c:638*
*#3 0x00007f684396c3db in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#4 0x00007f684396bfeb in ?? () from /usr/lib/x86_64-linux-gnu/dri/iris_dri.so*
*#5 0x00007f6858d27609 in start_thread (arg=<optimized out>) at pthread_create.c:477*
*#6 0x00007f6858f14103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95*

*Thread 1 (Thread 0x7f6856d09b40 (LWP 19821)):*
*#0 0x00007f6858ed7c6f in __GI___ wait4 (pid=19855, stat_loc=stat_loc*
*entry=0x7ffda42e39a8, options=options*
*entry=0, usage=usage*
*entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27*
*#1 0x00007f6858ed7beb in __GI___ waitpid (pid=<optimized out>, stat_loc=stat_loc*
*entry=0x7ffda42e39a8, options=options*
*entry=0) at waitpid.c:38*
*#2 0x00007f6858e470e7 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:172*
*#3 0x00007f685a1af55e in TUnixSystem::StackTrace() () from /home/harem/root/root/lib/libCore.so.6.20*
*#4 0x00007f685a1ac27c in TUnixSystem::DispatchSignals(ESignals) () from /home/harem/root/root/lib/libCore.so.6.20*
*#5 <signal handler called>*
*#6 0x0000000000000000 in ?? ()*
*#7 0x00007f6857eb783b in TGMenuBar::~TGMenuBar() () from /home/harem/root/root/lib/libGui.so.6.20*
*#8 0x00007f6857eb79ed in TGMenuBar::~TGMenuBar() () from /home/harem/root/root/lib/libGui.so.6.20*
*#9 0x00007f685a1044a0 in THashList::Delete(char const*) () from /home/harem/root/root/lib/libCore.so.6.20*
*#10 0x00007f6857e22d2d in TGClient::~TGClient() () from /home/harem/root/root/lib/libGui.so.6.20*
*#11 0x00007f6857e22dcd in TGClient::~TGClient() () from /home/harem/root/root/lib/libGui.so.6.20*
*#12 0x00007f6857f39d93 in TRootApplication::~TRootApplication() () from /home/harem/root/root/lib/libGui.so.6.20*
*#13 0x00007f6857f39dad in TRootApplication::~TRootApplication() () from /home/harem/root/root/lib/libGui.so.6.20*
*#14 0x00007f685a05e01e in TApplication::~TApplication() () from /home/harem/root/root/lib/libCore.so.6.20*
*#15 0x00005616e60c9d24 in main ()*
*===========================================================*

*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.*
*===========================================================*
*#6 0x0000000000000000 in ?? ()*
*#7 0x00007f6857eb783b in TGMenuBar::~TGMenuBar() () from /home/harem/root/root/lib/libGui.so.6.20*
*#8 0x00007f6857eb79ed in TGMenuBar::~TGMenuBar() () from /home/harem/root/root/lib/libGui.so.6.20*
*#9 0x00007f685a1044a0 in THashList::Delete(char const*) () from /home/harem/root/root/lib/libCore.so.6.20*
*#10 0x00007f6857e22d2d in TGClient::~TGClient() () from /home/harem/root/root/lib/libGui.so.6.20*
*#11 0x00007f6857e22dcd in TGClient::~TGClient() () from /home/harem/root/root/lib/libGui.so.6.20*
*#12 0x00007f6857f39d93 in TRootApplication::~TRootApplication() () from /home/harem/root/root/lib/libGui.so.6.20*
*#13 0x00007f6857f39dad in TRootApplication::~TRootApplication() () from /home/harem/root/root/lib/libGui.so.6.20*
*#14 0x00007f685a05e01e in TApplication::~TApplication() () from /home/harem/root/root/lib/libCore.so.6.20*
*#15 0x00005616e60c9d24 in main ()*
*===========================================================*

```

Can someone help me? I cannot understand what I’m doing wrong.  
Maybe the execution of the macro calls a destructor I have to call explicitly… no idea

thank you!

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 11, 2020, 9:58am UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873/2 "2020-06-11T09:58:13Z")

</div>

You’re not doing anything wrong, it seems that the csgdemo.C macro simply doesn’t work when it is compiled. We will investigate

---

<div class="post-metadata">

**Author:** ![coburn](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/bc8723/32.png) [@coburn](https://root-forum.cern.ch/u/coburn)\
**Post date:** [June 11, 2020, 10:23am UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873/3 "2020-06-11T10:23:51Z")

</div>

thank you a lot,  
but the fact is that this problem occurs even in other macros, for example  
_lineset.C_  
which is in the same directory  
_root/tutorials/eve_  
These for sure are not the only two programs because I tried with several macro using 3D libraries but every time the error in closure was the same. For this reason I thought it is a problem of a library, but maybe I’m wrong

Thank you a lot!

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [June 11, 2020, 10:57am UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873/4 "2020-06-11T10:57:31Z")

</div>

Well, maybe the underlying issue is coming from Eve/OpenGL, we will have to investigate.

---

<div class="post-metadata">

**Author:** ![coburn](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/bc8723/32.png) [@coburn](https://root-forum.cern.ch/u/coburn)\
**Post date:** [July 19, 2020, 5:05pm UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873/5 "2020-07-19T17:05:48Z")

</div>

I was asking myself if there can be a way to avoid this error. Maybe can I somehow explicitly delete the TGMenuBar? Or maybe is there an alternative way to execute the program avoiding this error in closure? For example in a way that the system automatically forces program closure?

---

<div class="post-metadata">

**Author:** ![coburn](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/bc8723/32.png) [@coburn](https://root-forum.cern.ch/u/coburn)\
**Post date:** [October 8, 2020, 5:06pm UTC](https://root-forum.cern.ch/t/break-segmentation-violation-closing-root/39873/6 "2020-10-08T17:06:45Z")

</div>

We’ve found a solution: an easy way to avoid the problem is defining in the heap the tApplication instead of in the stuck. This way everything is automaticly destructed and the problem of the destructor is avoided
