Qt5 opengl segmentation fault

Hi,
when i upgrade ubuntu to 20.04 and geant4 to geant4 10.6 (delete and install new version of both) i encounter with following problem.

if i run exampleB1 with this command :
./exampleB1 run1.mac
the simulation will successfully be done.

if i use openGL interface(just run ./exampleB1) and then close the opengl window (or /run/beamOn n) the result will be :

Available UI session types: [ Qt, Xm, GAG, tcsh, csh ]
G4WT1 > /control/saveHistory
G4WT0 > /control/saveHistory
G4WT0 > /run/verbose 2
G4WT1 > /run/verbose 2
G4WT0 > /run/initialize
G4WT1 > /run/initialize
G4WT0 > /run/physicsModified
G4WT1 > /run/physicsModified
Segmentation fault (core dumped)

or if i run AnaEx02 with this command :
./AnaEx02 run.mac
simulation will successfully be done.

if i use openGL interface (just run ./exampleB1) and then close the opengl window (or /run/beamOn n) the result will be :
*** Break *** segmentation violation

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

Thread 9 (Thread 0x7fb8e6ffd700 (LWP 13939)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x556a5ed42378) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x556a5ed42328, cond=0x556a5ed42350) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x556a5ed42350, mutex=0x556a5ed42328) at pthread_cond_wait.c:638
#3  0x00007fb8f523797b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fb8f523758b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 8 (Thread 0x7fb8e77fe700 (LWP 13938)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x556a5ed42378) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x556a5ed42328, cond=0x556a5ed42350) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x556a5ed42350, mutex=0x556a5ed42328) at pthread_cond_wait.c:638
#3  0x00007fb8f523797b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fb8f523758b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 7 (Thread 0x7fb8e7fff700 (LWP 13937)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x556a5ed42378) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x556a5ed42328, cond=0x556a5ed42350) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x556a5ed42350, mutex=0x556a5ed42328) at pthread_cond_wait.c:638
#3  0x00007fb8f523797b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fb8f523758b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 6 (Thread 0x7fb8f4ae6700 (LWP 13936)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x556a5ed42378) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x556a5ed42328, cond=0x556a5ed42350) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x556a5ed42350, mutex=0x556a5ed42328) at pthread_cond_wait.c:638
#3  0x00007fb8f523797b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fb8f523758b in  () at /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 5 (Thread 0x7fb8f6758700 (LWP 13935)):
#0  0x00007fb908ab096f in poll () at /usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fb9010b21ae in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fb9010b22e3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fb90287b565 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fb9028224db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fb90265a785 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fb8fdce9efa in  () at /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007fb90265b9d2 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 4 (Thread 0x7fb8f71be700 (LWP 13934)):
#0  0x00007fb908ab096f in poll () at /usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fb9010b21ae in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fb9010b2533 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fb8f7f3deda in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007fb9010db931 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 3 (Thread 0x7fb8f79bf700 (LWP 13933)):
#0  0x00007fb908ab096f in poll () at /usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fb9010b21ae in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fb9010b22e3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fb9010b2331 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fb9010db931 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 2 (Thread 0x7fb8fd546700 (LWP 13932)):
#0  0x00007fb908ab096f in poll () at /usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fb901fa6c1a in  () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fb901fa890a in xcb_wait_for_event () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fb8fdde6298 in  () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007fb90265b9d2 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fb902583609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#6  0x00007fb908abd103 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7fb8feebbc40 (LWP 13931)):
#0  0x00007fb908a80c6f in wait4 () at /usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fb9089f00e7 in  () at /usr/lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fb90a493d8e in TUnixSystem::StackTrace() () at /home/k1/k1-Files/Apps/ROOT/install/lib/libCore.so
#3  0x00007fb90a490c15 in TUnixSystem::DispatchSignals(ESignals) () at /home/k1/k1-Files/Apps/ROOT/install/lib/libCore.so
#4  0x00007fb9089e1210 in <signal handler called> () at /usr/lib/x86_64-linux-gnu/libc.so.6
#5  0x00007fb902c4ad88 in QOpenGLContext::makeCurrent(QSurface*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#6  0x00007fb9039f764d in QGLContext::makeCurrent() () at /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#7  0x00007fb9039fd685 in QGLWidgetPrivate::makeCurrent() () at /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#8  0x00007fb90a9eb06f in G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4OpenGL.so
#9  0x00007fb90a9eb9b4 in non-virtual thunk to G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4OpenGL.so
#10 0x00007fb90284d01e in QObjectPrivate::deleteChildren() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007fb9034e4c29 in QWidget::~QWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007fb90365b05d in QStackedWidget::~QStackedWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007fb90284d01e in QObjectPrivate::deleteChildren() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007fb9034e4c29 in QWidget::~QWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007fb90a92ad15 in G4QTabWidget::~G4QTabWidget() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4interfaces.so
#16 0x00007fb90284d01e in QObjectPrivate::deleteChildren() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fb9034e4c29 in QWidget::~QWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007fb9035fc4bd in QMainWindow::~QMainWindow() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fb90284fb74 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007fb9034e925d in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007fb9035fe148 in QMainWindow::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007fb9034a6a66 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007fb9034b00f0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007fb90282393a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007fb9028265b8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007fb90287bf67 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007fb9010b1fbd in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fb9010b2240 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fb9010b22e3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fb90287b565 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007fb9028224db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007fb90282a246 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007fb90a923b5d in G4UIQt::SessionStart() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4interfaces.so
#34 0x0000556a5b9b59f6 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.
===========================================================
#5  0x00007fb902c4ad88 in QOpenGLContext::makeCurrent(QSurface*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#6  0x00007fb9039f764d in QGLContext::makeCurrent() () at /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#7  0x00007fb9039fd685 in QGLWidgetPrivate::makeCurrent() () at /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#8  0x00007fb90a9eb06f in G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4OpenGL.so
#9  0x00007fb90a9eb9b4 in non-virtual thunk to G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4OpenGL.so
#10 0x00007fb90284d01e in QObjectPrivate::deleteChildren() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007fb9034e4c29 in QWidget::~QWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007fb90365b05d in QStackedWidget::~QStackedWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007fb90284d01e in QObjectPrivate::deleteChildren() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007fb9034e4c29 in QWidget::~QWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007fb90a92ad15 in G4QTabWidget::~G4QTabWidget() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4interfaces.so
#16 0x00007fb90284d01e in QObjectPrivate::deleteChildren() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fb9034e4c29 in QWidget::~QWidget() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007fb9035fc4bd in QMainWindow::~QMainWindow() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fb90284fb74 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007fb9034e925d in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007fb9035fe148 in QMainWindow::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007fb9034a6a66 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007fb9034b00f0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007fb90282393a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007fb9028265b8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007fb90287bf67 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007fb9010b1fbd in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fb9010b2240 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fb9010b22e3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fb90287b565 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007fb9028224db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007fb90282a246 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007fb90a923b5d in G4UIQt::SessionStart() () at /home/k1/k1-Files/Apps/GEANT4/install/lib/libG4interfaces.so
#34 0x0000556a5b9b59f6 in main ()
===========================================================

i built Geant4 with these options :
cmake -DCMAKE_INSTALL_PREFIX=/home/k1/k1-Files/Apps/GEANT4/install -DGEANT4_USE_GDML=ON -DCMAKE_BUILD_TYPE=Release -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_XM=ON -DGEANT4_USE_QT=ON -DGEANT4_BUILD_MULTITHREADED=ON /home/k1/k1-Files/Apps/GEANT4/geant4.10.06.p02

and this is exampleB1’s build output:

– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found suitable version β€œ2.2.9”, minimum required is β€œ2.2.9”)
– Found XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version β€œ3.2.2”, minimum required is β€œ3.2.2”)
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
– Found Motif: /usr/lib/x86_64-linux-gnu/libXm.so
– Configuring done
– Generating done
– Build files have been written to: /home/k1/k1-Files/Apps/GEANT4/geant4.10.06.p02/examples/basic/B1/build

Thanks you,
Keyvan Tabaei

linux platform: ubuntu 20.04
geant4 version : 10.6
ROOT version : 6.22.02

I’ve moved this to the Visualization forum as the application appears to be running correctly, and the Vis experts can help better with the segfault.

Quick response…(not fully digested your post)…

Not sure we correctly handle the situation when a user closes a window . Do you need to do that? Just leave it open, and if you want to proceed to run lots of events, /vis/disable.

Let me know if this comment helps, and if not, I/we will look into it further.

Hello! I have exactly the same problem: same version of Ubuntu, same version of Geant4.
I am not running the B1 example but our experiment own simulation. However the problem is identical.
Here is the stack trace when the segfault happens. Hope it might be helpful:

QOpenGLContext::makeCurrent(QSurface*) 0x00007f76d1bcad88
QGLContext::makeCurrent() 0x00007f76d297764d
QGLWidgetPrivate::makeCurrent() 0x00007f76d297d685
G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer G4OpenGLStoredQtViewer.cc:68
G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer G4OpenGLStoredQtViewer.cc:67
QObjectPrivate::deleteChildren() 0x00007f76d8bfc01e
QWidget::~QWidget() 0x00007f76d2464c29
QStackedWidget::~QStackedWidget() 0x00007f76d25db05d
QObjectPrivate::deleteChildren() 0x00007f76d8bfc01e
QWidget::~QWidget() 0x00007f76d2464c29
G4QTabWidget::~G4QTabWidget G4UIQt.hh:86
G4QTabWidget::~G4QTabWidget G4UIQt.hh:86
QObjectPrivate::deleteChildren() 0x00007f76d8bfc01e
QWidget::~QWidget() 0x00007f76d2464c29
QMainWindow::~QMainWindow() 0x00007f76d257c4bd
QObject::event(QEvent*) 0x00007f76d8bfeb74
QWidget::event(QEvent*) 0x00007f76d246925d
QMainWindow::event(QEvent*) 0x00007f76d257e148
QApplicationPrivate::notify_helper(QObject*, QEvent*) 0x00007f76d2426a66
QApplication::notify(QObject*, QEvent*) 0x00007f76d24300f0
QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x00007f76d8bd293a
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) 0x00007f76d8bd55b8
0x00007f76d8c2af67
g_main_context_dispatch 0x00007f76d12defbd
0x00007f76d12df240
g_main_context_iteration 0x00007f76d12df2e3
QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) 0x00007f76d8c2a565
QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) 0x00007f76d8bd14db
QCoreApplication::exec() 0x00007f76d8bd9246
G4UIQt::SessionStart G4UIQt.cc:1910
main B2MC.cc:121
__libc_start_main 0x00007f76d35030b3
_start 0x0000558c2d6848be

If you compare the stack trace of the OP with mine, you will notice that the segfault happens at exactly the same point.

If you need further info on my side, let me know.

i’m sorry for explaining problem unclearly
application apear to be run correctly. but after visualization it faces segfault problem.
for example,after runing example AnaEx02/B1 β€œsegmentation violation”/β€œsegfault” will be appear.
Many Thanks for your help

In my case the segfault happens when I click the X button (close button) in the GUI window … is it the same for you?

yes, it is same for me.
and in both situation, with gui and without gui, application run correctly.

Like I say above, avoid clicking the close button.

Confirm that the same things occure for 10.07.p02 on LinuxMint 20.1, Ubuntu 20.04 and even on Windows, when i run projects with VS 2019.

Like I say above, do not close your GUI windows with the X button (close button). Wait for end-of -job, when (hopefully) all windows will be deleted naturally.

John

1 Like

Thank you, John.
I just wrote in case if someone also stuck with this behavior of the projects.
Also it is pretty good to end with command β€œexit” in the command line. In that case project closing with code 0 and with a classic β€œsmile”)