Version: SVN trunk (using KDE 4.6.3) OS: OS X I build the QT libraries in their debug version to be able to hunt another bug on MacOSX (http://trac.macports.org/ticket/28410) and found another issue with KMyMoney4 when running it in gdb: --- (gdb) continue QWidget: Must construct a QApplication before a QPaintDevice Program received signal: “SIGABRT”. (gdb) --- It looks like KMM somehow tries to draw without having the application object up and running at the time. I am wondering whether this might be related to https://bugs.kde.org/show_bug.cgi?id=256913 Reproducible: Always Steps to Reproduce: install QT4-mac debug version (4.7.3) run KMM4 in dbg Actual Results: SIGABRT
The crash is happening in setupGUI() at the end of KMyMoneyApp::initActions(void): (gdb) bt f #0 0x0000000102083da2 in __kill () No symbol table info available. #1 0x0000000102083d94 in kill () No symbol table info available. #2 0x0000000102149520 in raise () No symbol table info available. #3 0x00000001021730f3 in abort () No symbol table info available. #4 0x000000011d14e0d6 in qt_message_output (msgType=QtFatalMsg, buf=0x104ed94c8 "QWidget: Must construct a QApplication before a QPaintDevice") at global/qglobal.cpp:2282 No locals. #5 0x000000011d14e2ae in qt_message (msgType=QtFatalMsg, msg=0x11c5fc388 "QWidget: Must construct a QApplication before a QPaintDevice", ap=0x7fff5fbfc6e0) at global/qglobal.cpp:2328 buf = { static shared_null = { ref = { _q_value = 754 }, alloc = 0, size = 0, data = 0x10367d2b8 "", array = "" }, static shared_empty = { ref = { _q_value = 1 }, alloc = 0, size = 0, data = 0x11d482758 "", array = "" }, d = 0x104ed94b0 } #6 0x000000011d14e3c4 in qFatal (msg=0x11c5fc388 "QWidget: Must construct a QApplication before a QPaintDevice") at global/qglobal.cpp:2511 ap = {{ gp_offset = 8, fp_offset = 48, overflow_arg_area = 0x7fff5fbfc7c0, reg_save_area = 0x7fff5fbfc700 }} #7 0x000000011bdf2ed1 in QWidgetPrivate::QWidgetPrivate (this=0x104ed6d40, version=263939) at kernel/qwidget.cpp:310 No locals. #8 0x000000011be038eb in QWidget::QWidget (this=0x104ed6c00, parent=0x0, f=@0x7fff5fbfc8a0) at kernel/qwidget.cpp:1135 No locals. #9 0x000000011bd1c605 in QDesktopWidget::QDesktopWidget (this=0x104ed6c00) at kernel/qdesktopwidget_mac.mm:157 No locals. #10 0x000000011bd87bb8 in QApplication::desktop () at kernel/qapplication.cpp:3228 No locals. #11 0x000000011bd0de02 in flipYCoordinate (y=819) at qt_cocoa_helpers_mac_p.h:175 No locals. #12 0x000000011bd17588 in flipPoint (p=@0x7fff5fbfcaa0) at kernel/qt_cocoa_helpers_mac.mm:735 No locals. #13 0x000000011bd1115a in -[QCocoaWindowDelegate windowDidMove:] (self=0x10593d900, _cmd=0x7fff8077f7c1, notification=0x104ed6610) at kernel/qcocoawindowdelegate_mac.mm:229 window = (NSWindow *) 0x11dc27850 newRect = { origin = { x = 586, y = 697 }, size = { width = 1387, height = 122 } } qwidget = (QWidget *) 0x105979b70 qtPoint = { yp = 0, xp = 0 } oldRect = (const QRect &) @0x7fff87eb625d: { y1 = -1319355008, x1 = 1946216721, y2 = 2105755671, x2 = -2079391584 } #14 0x00007fff871708ea in _nsnote_callback () No symbol table info available. #15 0x00007fff87f0c000 in __CFXNotificationPost () No symbol table info available. #16 0x00007fff87ef8578 in _CFXNotificationPostNotification () No symbol table info available. #17 0x00007fff8716784e in -[NSNotificationCenter postNotificationName:object:userInfo:] () No symbol table info available. #18 0x00007fff800285c8 in -[NSWindow _setFrameCommon:display:stashSize:] () No symbol table info available. #19 0x00007fff8016e733 in -[NSWindow setFrameOrigin:] () No symbol table info available. #20 0x00000001037bcb2e in QWidgetPrivate::setGeometry_sys () No symbol table info available. #21 0x000000010386ea43 in QWidget::resize () No symbol table info available. #22 0x000000010386eb67 in QWidget::adjustSize () No symbol table info available. #23 0x0000000101803523 in KXmlGuiWindow::setupGUI () No symbol table info available. #24 0x00000001018036db in KXmlGuiWindow::setupGUI () No symbol table info available. #25 0x000000010003f71b in KMyMoneyApp::initActions (this=0x105979b70) at /opt/macports-test/var/macports/build/_Users_marko_WC_MacPorts_ports_kde_kmymoney4-devel/work/kmymoney/kmymoney/kmymoney.cpp:1050
Could it be that this is a KDE issue, since the crash actually happens in KXmlGuiWindow()???? Looks like this needs to be communicated upstream...
Reported upstream as https://bugs.kde.org/show_bug.cgi?id=275460
My upstream bug report has been dismissed as invalid, since the error message tells clearly enough what went wrong. So, this means that KMyMoney itself misbehaves! (Perhaps the warning messages described in https://bugs.kde.org/show_bug.cgi?id=256913 are already an indication of the real problem here.)
Is this due to Apple' system frameworks? (http://developer.qt.nokia.com/wiki/Mac_OS_X_Troubleshooting)
It looks like this could be a compiler issue as hinted out in http://developer.qt.nokia.com/forums/viewthread/6748/ which could also be explained why all the warnings during startup (https://bugs.kde.org/show_bug.cgi?id=256913) only seem to pop up on MacOSX but not on Linux. I wonder whether somewhere in KMM's startup procedure QIcons or something similar get created, which could be the culprit for this crash...
I saw only now that the above mentioned warnings pop up only after the application has already appeared on the screen. The data is already read from the file: --- KMyMoney iCalendar plugin loaded reading file start parsing file startDocument reading accounts reading transactions reading securities reading currencies reading prices reading reports endDocument QPainter::begin: Widget painting can only begin as a result of a paintEvent QPainter::translate: Painter not active QPainter::setClipRect: Painter not active QPainter::font: Painter not active QPainter::setFont: Painter not active QPainter::setPen: Painter not active QPainter::font: Painter not active
Finally I was able to debug into KDE's libs. There I've found that the crash gets triggered when KDE goes into QT's adjustSize() (because the window is hidden): --- void KXmlGuiWindow::setupGUI( const QSize & defaultSize, StandardWindowOptions options, const QString & xmlfile ) { . . . if (initialGeometrySet()) { // Do nothing... } else if (d->defaultSize.isValid()) { resize(d->defaultSize); } else if (isHidden()) { > adjustSize(); } --- (See '>' in first column above for execution pointer at crash.)
This bug seems to be due to a peculiarity regarding QT debugging on Mac OSX. See also http://stackoverflow.com/questions/1136734/installing-debug-version-of-qt-on-mac-osx http://developer.qt.nokia.com/doc/qt-4.7/debug.html http://developer.qt.nokia.com/wiki/Mac_OS_X_Troubleshooting
Improvements of MacPorts' port qt4-mac now allows proper debugging also on Mac OS X.