View Issue Details

IDProjectCategoryView StatusLast Update
0002540FreeCADBugpublic2017-07-11 20:06
ReporterdemaAssigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformOSLinuxOS VersionGentoo
Product Version 
Target VersionFixed in Version0.17 
Summary0002540: Crash on startup
DescriptionLatest version from git "FreeCAD 0.17, Libs: 0.17R7475 (Git)"
crashes on startup. Under gdb it shows blank splash screen and crashes.
gdb's "bt full" dump is in the attachment
Steps To ReproduceJust launch it.
Additional InformationI have following relevant packages installed:

dev-qt/qtgui-4.8.7
dev-qt/qtopengl-4.8.7
dev-qt/qtcore-4.8.7-r2
TagsNo tags attached.

Activities

wmayer

2016-05-06 16:02

administrator   ~0007063

To me it looks like a problem with Qt because there is a long cascade of Qt function calls. Did it work with older FreeCAD versions but using the exact same Qt version? When starting it from the console are there any output messages that are not FreeCAD-related?

dema

2016-05-12 06:44

reporter   ~0007084

Yep, this is what I'm getting in the debugger:

(gdb) run
Starting program: /home/dema/tmp/freecad-build/bin/FreeCAD
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
FreeCAD 0.17, Libs: 0.17R7518 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

using visual class 4, id b1
Attach observer 0xaea7c0
Attach observer 0xafa110
Attach observer 0x1f504b0
Attach observer 0x1fbeb88
Attach observer 0x1fd35b8
Attach observer 0x1fd35b8
Attach observer 0x1fdd210
hijackWindow() context created for Gui::SplashScreen(0x25e5b50) 1

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff1980808 in QWidgetPrivate::drawWidget (this=0x260b5b0, pdev=0x0, rgn=..., offset=..., flags=flags@entry=5, sharedPainter=sharedPainter@entry=0x0, backingStore=0x25ed950)
    at /var/tmp/portage/dev-qt/qtgui-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/gui/kernel/qwidget.cpp:5555
5555 QPaintEngine *paintEngine = pdev->paintEngine();
(gdb) p pdev
$1 = (QPaintDevice *) 0x0
(gdb) up
#1 0x00007ffff1b506e2 in QWidgetBackingStore::sync (this=0x25ed950) at /var/tmp/portage/dev-qt/qtgui-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/gui/painting/qbackingstore.cpp:1373
1373 tlw->d_func()->drawWidget(windowSurface->paintDevice(), dirtyCopy, tlwOffset, flags, 0, this);
(gdb) p windowSurface
$2 = (QWindowSurface *) 0x20782e0
(gdb) p windowSurface->paintDevice()
warning: RTTI symbol not found for class 'QGLWindowSurface'
warning: RTTI symbol not found for class 'QGLWindowSurface'
warning: RTTI symbol not found for class 'QGLWindowSurface'
$3 = (QPaintDevice *) 0x0
(gdb)

Looks like some error in qtgl code.

Kunda1

2017-01-09 19:16

manager   ~0007583

@dema is this still reproducible for you with Qt5 ?

dema

2017-01-12 06:30

reporter   ~0007661

I'm sorry, I'm unable to compile latest FreeCAD due to missing libmed library on Gentoo.

wmayer

2017-01-12 08:46

administrator   ~0007662

You can disable the FEM and MeshPart modules in order to avoid building the smesh library.

Kunda1

2017-01-13 22:07

manager   ~0007735

dema, do you know how to do that ?

Kunda1

2017-01-23 20:33

manager   ~0007921

@dema ping

dema

2017-01-24 11:29

reporter   ~0007950

Looks like I unable to build FreeCAD with qt5 on gentoo yet. Gentoo doesn't have shiboken2 library yet. There is only 1.2.2 version. qt4 build is still failing.

Kunda1

2017-01-24 12:31

manager  

freecad_gdb.txt (Attachment missing)

Kunda1

2017-01-24 12:34

manager   ~0007952

@dema I apologize but my question about qt5 was misleading. I don't think FC is ready to be built with Qt5 yet. Instead can you check building the way @wmayer asked in 0002540:0007662 ?
> You can disable the FEM and MeshPart modules in order to avoid building the smesh library.

Kunda1

2017-01-24 12:35

manager   ~0007954

Also moving forward please also include the Help > About FreeCAD > 'Copy to clipboard' data in your tickets

dema

2017-01-24 13:59

reporter   ~0007959

Sorry, I meant that freecad built with qt4 is crashing in the same spot.

If I comment out this line, it works.
Index: freecad-9999/src/Gui/Splashscreen.cpp
===================================================================
--- freecad-9999.orig/src/Gui/Splashscreen.cpp
+++ freecad-9999/src/Gui/Splashscreen.cpp
@@ -134,7 +134,7 @@ public:
                 return;
         }

- splash->showMessage(msg.replace(QLatin1String("\n"), QString()), alignment, textColor);
+ //splash->showMessage(msg.replace(QLatin1String("\n"), QString()), alignment, textColor);
         QMutex mutex;
         QMutexLocker ml(&mutex);
         QWaitCondition().wait(&mutex, 50);

Here is there info from About screen:

OS: "Gentoo Base System release 2.3"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9795 (Git)
Build type: Debug
Branch: master
Hash: d9dda3fa1d26915bef1508c4bc31f3a7ef270dfe
Python version: 2.7.12
Qt version: 4.8.6
Coin version: 3.1.3
OCC version: 6.9.0

dema

2017-01-24 14:00

reporter   ~0007960

Here is the "bt" log from gdb debugger

Attach observer 0xc45768
Attach observer 0xc9ab10
hijackWindow() context created for Gui::SplashScreen(0xbe4030) 1

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff03f93e8 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
(gdb) bt
#0 0x00007ffff03f93e8 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib64/qt4/libQtGui.so.4
#1 0x00007ffff05c8fdd in QWidgetBackingStore::sync() () from /usr/lib64/qt4/libQtGui.so.4
0000002 0x00007ffff03ed9c0 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/qt4/libQtGui.so.4
0000003 0x00007ffff03ff050 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000004 0x00007ffff07fe932 in QSplashScreen::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000005 0x00007ffff03aad5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000006 0x00007ffff03b197b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000007 0x00007ffff72151f0 in Gui::GUIApplication::notify (this=0x7fffffffc160, receiver=0xbe4030, event=0x7fffffff8cc0) at /home/dema/tmp/FreeCAD/src/Gui/GuiApplication.cpp:91
0000008 0x00007fffef8e766d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
0000009 0x00007ffff05ca8d4 in QWidgetBackingStore::markDirty(QRect const&, QWidget*, bool, bool) () from /usr/lib64/qt4/libQtGui.so.4
0000010 0x00007ffff03ee055 in QWidget::repaint(QRect const&) () from /usr/lib64/qt4/libQtGui.so.4
0000011 0x00007ffff03ee0a3 in QWidget::repaint() () from /usr/lib64/qt4/libQtGui.so.4
0000012 0x00007ffff07fe1b9 in QSplashScreen::repaint() () from /usr/lib64/qt4/libQtGui.so.4
0000013 0x00007ffff758d304 in Gui::SplashObserver::Log (this=0x12dea20, s=0x7fffffff8ee0 "hijackWindow() context created for Gui::SplashScreen(0xbe4030) 1 \n")
    at /home/dema/tmp/FreeCAD/src/Gui/Splashscreen.cpp:143
0000014 0x00007ffff758d0c4 in Gui::SplashObserver::Message (this=0x12dea20, s=0x7fffffff8ee0 "hijackWindow() context created for Gui::SplashScreen(0xbe4030) 1 \n")
    at /home/dema/tmp/FreeCAD/src/Gui/Splashscreen.cpp:112
0000015 0x00007ffff5f2e4bb in Base::ConsoleSingleton::NotifyMessage (this=0x6a13d0, sMsg=0x7fffffff8ee0 "hijackWindow() context created for Gui::SplashScreen(0xbe4030) 1 \n")
    at /home/dema/tmp/FreeCAD/src/Base/Console.cpp:317
0000016 0x00007ffff5f2dff5 in Base::ConsoleSingleton::Message (this=0x6a13d0, pMsg=0x7ffff7659978 "%s\n") at /home/dema/tmp/FreeCAD/src/Base/Console.cpp:177
0000017 0x00007ffff71a4f63 in messageHandler (type=QtDebugMsg, msg=0x238e708 "hijackWindow() context created for Gui::SplashScreen(0xbe4030) 1 ")
    at /home/dema/tmp/FreeCAD/src/Gui/Application.cpp:1321
0000018 0x00007fffef7ceb96 in qt_message_output(QtMsgType, char const*) () from /usr/lib64/qt4/libQtCore.so.4
0000019 0x00007ffff2b5feed in QDebug::~QDebug (this=0x7fffffff9fc0, __in_chrg=<optimized out>) at ../../include/QtCore/../../../qt-everywhere-opensource-src-4.8.6/src/corelib/io/qdebug.h:85
0000020 QGLWindowSurface::hijackWindow (this=this@entry=0xd057e0, widget=<optimized out>)
    at /var/tmp/portage/dev-qt/qtopengl-4.8.6-r1/work/qt-everywhere-opensource-src-4.8.6/src/opengl/qwindowsurface_gl.cpp:478
0000021 0x00007ffff2b61773 in QGLWindowSurface::updateGeometry (this=this@entry=0xd057e0)
    at /var/tmp/portage/dev-qt/qtopengl-4.8.6-r1/work/qt-everywhere-opensource-src-4.8.6/src/opengl/qwindowsurface_gl.cpp:926
0000022 0x00007ffff2b626b8 in QGLWindowSurface::beginPaint (this=0xd057e0)
    at /var/tmp/portage/dev-qt/qtopengl-4.8.6-r1/work/qt-everywhere-opensource-src-4.8.6/src/opengl/qwindowsurface_gl.cpp:514
0000023 0x00007ffff05c8c81 in QWidgetBackingStore::sync() () from /usr/lib64/qt4/libQtGui.so.4
0000024 0x00007ffff03ed9c0 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/qt4/libQtGui.so.4
0000025 0x00007ffff03ff050 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000026 0x00007ffff07fe932 in QSplashScreen::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000027 0x00007ffff03aad5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000028 0x00007ffff03b197b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
0000029 0x00007ffff72151f0 in Gui::GUIApplication::notify (this=0x7fffffffc160, receiver=0xbe4030, event=0x7fffffffaa40) at /home/dema/tmp/FreeCAD/src/Gui/GuiApplication.cpp:91
0000030 0x00007fffef8e766d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
0000031 0x00007ffff05ca924 in QWidgetBackingStore::markDirty(QRect const&, QWidget*, bool, bool) () from /usr/lib64/qt4/libQtGui.so.4
0000032 0x00007ffff03ee055 in QWidget::repaint(QRect const&) () from /usr/lib64/qt4/libQtGui.so.4
0000033 0x00007ffff03ee0a3 in QWidget::repaint() () from /usr/lib64/qt4/libQtGui.so.4
0000034 0x00007ffff07fe1b9 in QSplashScreen::repaint() () from /usr/lib64/qt4/libQtGui.so.4
0000035 0x00007ffff758d304 in Gui::SplashObserver::Log (this=0x12dea20, s=0x7fffffffac40 "Run Gui init script\n") at /home/dema/tmp/FreeCAD/src/Gui/Splashscreen.cpp:143
0000036 0x00007ffff5f2e6f5 in Base::ConsoleSingleton::NotifyLog (this=0x6a13d0, sMsg=0x7fffffffac40 "Run Gui init script\n") at /home/dema/tmp/FreeCAD/src/Base/Console.cpp:341
---Type <return> to continue, or q <return> to quit---q


"Run Gui init script\n" is a pretty innocent line :)

Kunda1

2017-01-24 15:16

manager   ~0007961

Posted to forum: https://forum.freecadweb.org/viewtopic.php?f=4&t=20187

Kunda1

2017-01-25 12:14

manager   ~0007975

@wmayer writes in https://forum.freecadweb.org/viewtopic.php?f=4&t=20187&p=155831#p155831
> Thanks for the log file. When looking into it I found a suspicious line

hijackWindow() context created for Gui::SplashScreen

> which apparently comes from Qt and is raised when trying to create a GL context. I wonder why Qt tries to that for a normal widget.

According to http://stackoverflow.com/questions/8793303/hijackwindow-context-created-for you should pass

-graphicssystem=raster

> on the command line when starting FreeCAD.

dema

2017-01-25 12:29

reporter   ~0007977

Yep, my default graphics system was set to opengl. If I run FC with QT_GRAPHICSSYSTEM=raster it works flawlessly! That's why FC was not crashing on my other computer, because it was set to default there.

wmayer

2017-01-27 11:34

administrator   ~0008019

I don't know what we can do on this since IMO it looks like a Qt bug.

Kunda1

2017-01-27 11:55

manager   ~0008023

@wmayer I'm resolving since this seems to be a Qt4 issue and we have a workaround.
Resolved as 'no change required'
Thanks for all the work!

wmayer

2017-01-27 18:15

administrator   ~0008030

FYI, when I set

export QT_GRAPHICSSYSTEM=opengl

under Ubuntu 14.04 then FreeCAD crashes for me too. Qt is 4.8.6.

wmayer

2017-01-27 23:19

administrator   ~0008033

There was a bug that you couldn't set the graphic system from command line. This is fixed now and can be done with

-graphicssystem raster


I also looked for a way to read out which graphic system Qt uses to disable "showMessage" if it's OpenGL but the API doesn't offer a direct way. However, since it's OpenGL it creates a context and this can be used to distinguish between raster, native or opengl mode. So, now FreeCAD doesn't crash at startup any more.

But also note that opengl mode may cause other problems. But the Qt doc clearly says that this mode is experimental:
http://doc.qt.io/qt-4.8/qapplication.html#setGraphicsSystem

Related Changesets

FreeCAD: master a240f5dd

2017-01-27 22:53:48

wmayer

Details Diff
issue 0002540: Crash on startup Affected Issues
0002540
mod - src/App/Application.cpp Diff File

FreeCAD: master 0df4af4b

2017-01-27 23:14:15

wmayer

Details Diff
issue 0002540: Crash on startup Affected Issues
0002540
mod - src/Gui/Splashscreen.cpp Diff File

Issue History

Date Modified Username Field Change
2016-05-06 12:24 dema New Issue
2016-05-06 12:24 dema File Added: freecad_gdb.log
2016-05-06 16:02 wmayer Note Added: 0007063
2016-05-12 06:44 dema Note Added: 0007084
2017-01-09 19:16 Kunda1 Note Added: 0007583
2017-01-11 18:43 Kunda1 Status new => feedback
2017-01-12 06:30 dema Note Added: 0007661
2017-01-12 06:30 dema Status feedback => new
2017-01-12 08:46 wmayer Note Added: 0007662
2017-01-12 15:48 Kunda1 Status new => feedback
2017-01-13 22:07 Kunda1 Note Added: 0007735
2017-01-23 20:33 Kunda1 Note Added: 0007921
2017-01-24 11:29 dema Note Added: 0007950
2017-01-24 11:29 dema Status feedback => new
2017-01-24 12:31 Kunda1 File Added: freecad_gdb.txt
2017-01-24 12:31 Kunda1 File Deleted: freecad_gdb.log
2017-01-24 12:34 Kunda1 Note Added: 0007952
2017-01-24 12:34 Kunda1 Status new => feedback
2017-01-24 12:35 Kunda1 Note Added: 0007954
2017-01-24 13:59 dema Note Added: 0007959
2017-01-24 13:59 dema Status feedback => new
2017-01-24 14:00 dema Note Added: 0007960
2017-01-24 15:16 Kunda1 Note Added: 0007961
2017-01-24 15:28 Kunda1 Tag Attached: #pending
2017-01-25 12:14 Kunda1 Note Added: 0007975
2017-01-25 12:14 Kunda1 Status new => feedback
2017-01-25 12:29 dema Note Added: 0007977
2017-01-25 12:29 dema Status feedback => new
2017-01-27 11:34 wmayer Note Added: 0008019
2017-01-27 11:55 Kunda1 Note Added: 0008023
2017-01-27 11:55 Kunda1 Status new => resolved
2017-01-27 11:55 Kunda1 Resolution open => no change required
2017-01-27 11:55 Kunda1 Assigned To => Kunda1
2017-01-27 11:55 Kunda1 Assigned To Kunda1 =>
2017-01-27 18:15 wmayer Note Added: 0008030
2017-01-27 22:54 wmayer Changeset attached => FreeCAD Master master a240f5dd
2017-01-27 23:14 wmayer Changeset attached => FreeCAD Master master 0df4af4b
2017-01-27 23:19 wmayer Note Added: 0008033
2017-01-27 23:19 wmayer Status resolved => closed
2017-01-27 23:19 wmayer Resolution no change required => fixed
2017-01-27 23:19 wmayer Fixed in Version => 0.17
2017-07-11 20:06 Kunda1 Tag Detached: #pending