Problem 1839

Summary: GEANT4 10.2 patch 01 crashes with Qt
Product: Geant4 Reporter: Olivier Delaune <olivier.delaune>
Component: interfaces/commonAssignee: Laurent Garnier <laurent.garnier>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P5    
Version: 10.2   
Hardware: PC   
OS: Linux   

Description Olivier Delaune 2016-03-07 11:10:55 CET
Hello, I installed the latest GEANT4 10.2 patch1 version on Linux Mageia 5 64-bits. I tried to compile some simulation with it and I systematically get a crash (SIGFPE). I did not get similar crash with the previous version (GEANT4 10.2)
Here is the backtrace I have got with gdb

Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
OpenGLImmediateXm (OGLIXm, OGLIQt_FALLBACK)
OpenGLStoredXm (OGLSXm, OGLSQt_FALLBACK)
OpenGLImmediateX (OGLIX, OGLIQt_FALLBACK, OGLIXm_FALLBACK)
OpenGLStoredX (OGLSX, OGLSQt_FALLBACK, OGLSXm_FALLBACK)
RayTracerX (RayTracerX)

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByCharge
  drawByParticleID
  drawByOriginVolume
  drawByAttribute

Registered filter factories:
  chargeFilter
  particleFilter
  originVolumeFilter
  attributeFilter

You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.
Available colours:
  black, blue, brown, cyan, gray, green, grey, magenta, red, white, yellow

Available UI session types: [ Qt, Xm, GAG, tcsh, csh ]
[New Thread 0x7fffb334f700 (LWP 16275)]

Program received signal SIGFPE, Arithmetic exception.
0x00007fffdc1bc128 in QXcbConnection::touchDeviceForId (this=this@entry=0x1808c90, id=4)
    at qxcbconnection_xi2.cpp:401
401                         dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution);
(gdb) bt
#0  0x00007fffdc1bc128 in QXcbConnection::touchDeviceForId(int) (this=this@entry=0x1808c90, id=4)
    at qxcbconnection_xi2.cpp:401
#1  0x00007fffdc1bd3fd in QXcbConnection::xi2SetupDevices() (this=this@entry=0x1808c90)
    at qxcbconnection_xi2.cpp:241
#2  0x00007fffdc1bdc06 in QXcbConnection::initializeXInput2() (this=this@entry=0x1808c90)
    at qxcbconnection_xi2.cpp:92
#3  0x00007fffdc19cd8f in QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, char const*) (this=0x1808c90, nativeInterface=0x1808be0, canGrabServer=<optimized out>, displayName=0x0)
    at qxcbconnection.cpp:390
#4  0x00007fffdc1a04d4 in QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**) (this=
    0x17ff110, parameters=..., argc=@0x17fb350: 1, argv=0xffffffff) at qxcbintegration.cpp:174
#5  0x00007fffdc1b454b in QXcbIntegrationPlugin::create(QString const&, QStringList const&, int&, char**) (this=<optimized out>, system=..., parameters=..., argc=@0x17fb350: 1, argv=0x7fffffffd618)
    at qxcbmain.cpp:50
#6  0x00007fffeef70ec2 in QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&) (argv=0x7fffffffd618, argc=@0x17fb350: 1, parameters=..., key=..., loader=
    0x7fffef40ebd0 <_ZZN12_GLOBAL__N_112Q_QGS_loader13innerFunctionEvE6holder>)
    at kernel/qplatformintegrationfactory.cpp:56
#7  0x00007fffeef70ec2 in QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&) (platform=..., paramList=..., argc=@0x17fb350: 1, argv=argv@entry=0x7fffffffd618, platformPluginPath=...) at kernel/qplatformintegrationfactory.cpp:73
#8  0x00007fffeef7c008 in QGuiApplicationPrivate::createPlatformIntegration() (argv=0x7fffffffd618, argc=@0x17fb350: 1, platformThemeName=..., platformPluginPath=..., pluginArgument=...)
    at kernel/qguiapplication.cpp:1010
#9  0x00007fffeef7c008 in QGuiApplicationPrivate::createPlatformIntegration() (this=0x17fc750)
    at kernel/qguiapplication.cpp:1165
#10 0x00007fffeef7cd9d in QGuiApplicationPrivate::createEventDispatcher() (this=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at kernel/qguiapplication.cpp:1182
#11 0x00007fffeec5a30f in QCoreApplication::init() (this=this@entry=0x17fc730)
    at kernel/qcoreapplication.cpp:730
#12 0x00007fffeec5a376 in QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) (this=0x17fc730, p=...) at kernel/qcoreapplication.cpp:655
#13 0x00007fffeef7ebd9 in QGuiApplication::QGuiApplication(QGuiApplicationPrivate&) (this=0x17fc730, p=...) at kernel/qguiapplication.cpp:559
#14 0x00007fffef56e37d in QApplication::QApplication(int&, char**, int) (this=0x17fc730, argc=@0x17fb350: 1, argv=0x7fffffffd618, _internal=328706) at kernel/qapplication.cpp:562
#15 0x00007ffff6993223 in G4Qt::G4Qt(int, char**, char*) (this=
    0x17fc670, a_argn=1, a_args=0x7fffffffd618)
    at /home/delaune/geant4.10.02.p01/source/interfaces/common/src/G4Qt.cc:125
#16 0x00007ffff6993059 in G4Qt::getInstance(int, char**, char*) (a_argn=1, a_args=0x7fffffffd618, a_class=0x7ffff6994f18 "Qt") at /home/delaune/geant4.10.02.p01/source/interfaces/common/src/G4Qt.cc:67
#17 0x00007ffff6969458 in G4UIQt::G4UIQt(int, char**) (this=0x17fa810, argc=1, argv=0x7fffffffd618)
    at /home/delaune/geant4.10.02.p01/source/interfaces/basic/src/G4UIQt.cc:149
#18 0x00007ffff695fd82 in G4UIExecutive::G4UIExecutive(int, char**, G4String const&) (this=0x17f9850, argc=1, argv=0x7fffffffd618, type=...)
    at /home/delaune/geant4.10.02.p01/source/interfaces/basic/src/G4UIExecutive.cc:132
#19 0x0000000000418fa5 in main ()

It looks very related to Qt.

Please tell if I can provide more information
Comment 1 Olivier Delaune 2016-03-14 18:07:10 CET
Please note that I am able to reproduce this crash with examples/advanced/underground_physics/ but not with examples/basic/B1.
Comment 2 Olivier Delaune 2016-04-11 10:11:03 CEST
Is anyone using Linux able to reproduce this crash?
Comment 3 Laurent Garnier 2016-04-19 11:33:11 CEST
Hi Olivier

I'm not able to reproduce your crash, it seems to came from : QXcbConnection::touchDeviceForId

Which Qt version do you use?
Did you try with another Qt version?

Cheers, 
Laurent
Comment 4 Olivier Delaune 2016-04-19 15:48:43 CEST
Hi Laurent,
I am using Qt 5.4.2 that has been installed from the packages provided by my Linux distribution, Mageia 5 64-bits.
However, I also get this crash with Qt 5.4.1 that I installed myself from sources.
Comment 5 Olivier Delaune 2016-04-19 15:49:47 CEST
I forgot to mention that the Qt 5.4.1 version is installed on another computer running CentOS 6.6 64-bits.
Comment 6 Olivier Delaune 2016-04-20 23:09:49 CEST
FYI, this are the option I enabled during the compilation
cmake -DCMAKE_INSTALL_PREFIX=/opt/geant -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_INSTALL_DATA=OFF -DBUILD_STATIC_LIBS=ON -DGEANT4_USE_SYSTEM_ZLIB=ON -DGEANT4_USE_SYSTEM_EXPAT=ON -DGEANT4_USE_FREETYPE=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_GDML=ON -DCMAKE_BUILD_TYPE=Debug -DGEANT4_USE_XM=ON -DGEANT4_USE_RAYTRACER_X11=ON ..
Maybe, my problem comes from one of these options...
Comment 7 Olivier Delaune 2016-04-25 07:50:14 CEST
Hmmm, I installed the latest Qt version, 5.6.0, from sources and it solves the issue. So I guess something was wrong in the previous Qt version, 5.4.x

I will perform further test to be sure there is no crash anymore.
Comment 8 Laurent Garnier 2016-09-16 16:07:31 CEST
Not able to reproduce, only affected a specific version of Qt/Geant4/machine I guess