Skip to content
  • 0 Votes
    2 Posts
    1k Views
    K

    I've been digging around for the last couple of days trying to find the root cause of the issue and then it turned out that even the simplest Qt Quick application will crash with the same stack trace as long as it displays some text. Likewise none of the examples that are shipped with Qt (accessible through the Welcome -> Examples screen in Qt Creator) work, they simply crash on startup.

    Would it be safe to assume it's a bug with Qt 5.9.1 built using MSVS 2017 (VC14.1)?
    How do I even proceed now? Do I report it on the issue tracker?

    Here's the relevant backtrace:

    . 0 Id: 24f8.dac Suspend: 1 Teb: 000007ff`fffde000 Unfrozen Child-SP RetAddr Call Site 00000000`0029df90 000007fe`ff58ab87 KERNELBASE!RaiseException+0x3d 00000000`0029e060 000007fe`ec6a865d msvcrt!CxxThrowException+0x87 00000000`0029e0d0 000007fe`e658ef00 dwrite!DWriteCreateFactory+0x3f51 00000000`0029e150 000007fe`e658fecb qwindowsd!createDirectWriteFactory(struct IDWriteFactory ** factory = 0x00000000`040a7428)+0x90 [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 103] 00000000`0029e190 000007fe`e658ce92 qwindowsd!initDirectWrite(class QWindowsFontEngineData * d = 0x00000000`040a7010)+0x2b [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 653] 00000000`0029e1e0 000007fe`e658b060 qwindowsd!QWindowsFontDatabase::createEngine(struct QFontDef * request = 0x00000000`0029e760, class QString * faceName = 0x00000000`0029e640, int dpi = 96, class QSharedPointer<QWindowsFontEngineData> * data = 0x00000000`0029e678)+0x1d2 [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 1888] 00000000`0029e600 000007fe`e6d4dedc qwindowsd!QWindowsFontDatabase::fontEngine(struct QFontDef * fontDef = 0x00000000`0029e760, void * handle = 0x00000000`00000000)+0x60 [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 1247] 00000000`0029e6c0 000007fe`e6d4e0f8 Qt5Guid!loadSingleEngine(int script = 2, struct QFontDef * request = 0x00000000`0029eba0, struct QtFontFamily * family = 0x00000000`04117820, struct QtFontFoundry * foundry = 0x00000000`0411b790, struct QtFontStyle * style = 0x00000000`0411b8c0, struct QtFontSize * size = 0x00000000`0411b950)+0x3dc [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 971] 00000000`0029e820 000007fe`e6d49704 Qt5Guid!loadEngine(int script = 2, struct QFontDef * request = 0x00000000`0029eba0, struct QtFontFamily * family = 0x00000000`04117820, struct QtFontFoundry * foundry = 0x00000000`0411b790, struct QtFontStyle * style = 0x00000000`0411b8c0, struct QtFontSize * size = 0x00000000`0411b950)+0x58 [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 1000] 00000000`0029e8d0 000007fe`e6d49fd1 Qt5Guid!QFontDatabase::findFont(struct QFontDef * request = 0x00000000`0029eba0, int script = 2)+0x2e4 [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 2686] 00000000`0029eb60 000007fe`e6d0be28 Qt5Guid!QFontDatabase::load(class QFontPrivate * d = 0x00000000`040a3960, int script = 2)+0x3c1 [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 2803] 00000000`0029ec60 000007fe`e6d0ae88 Qt5Guid!QFontPrivate::engineForScript(int script = 2)+0xf8 [c:\users\qt\work\qt\qtbase\src\gui\text\qfont.cpp @ 218] 00000000`0029ecc0 000007fe`e8961328 Qt5Guid!QFontInfo::family(void)+0x28 [c:\users\qt\work\qt\qtbase\src\gui\text\qfont.cpp @ 2456] 00000000`0029ed00 000007fe`e8962424 qtquickcontrols2materialstyleplugind!QQuickMaterialTheme::QQuickMaterialTheme(class QPlatformTheme * theme = 0x00000000`00000000)+0x148 [c:\users\qt\work\qt\qtquickcontrols2\src\imports\controls\material\qquickmaterialtheme.cpp @ 50] 00000000`0029ee20 000007fe`f62e30f6 qtquickcontrols2materialstyleplugind!QtQuickControls2MaterialStylePlugin::createTheme(void)+0x24 [c:\users\qt\work\qt\qtquickcontrols2\src\imports\controls\material\qtquickcontrols2materialstyleplugin.cpp @ 115] 00000000`0029ee60 000007fe`e8961d40 Qt5QuickControls2d!QQuickStylePlugin::initializeEngine(class QQmlEngine * engine = 0x00000000`0029f590, char * uri = 0x00000000`040a35b8 "QtQuick.Controls.Material")+0xf6 [c:\users\qt\work\qt\qtquickcontrols2\src\quickcontrols2\qquickstyleplugin.cpp @ 70] 00000000`0029eec0 00000000`65d9ce00 qtquickcontrols2materialstyleplugind!QtQuickControls2MaterialStylePlugin::initializeEngine(class QQmlEngine * engine = 0x00000000`0029f590, char * uri = 0x00000000`040a35b8 "QtQuick.Controls.Material")+0x40 [c:\users\qt\work\qt\qtquickcontrols2\src\imports\controls\material\qtquickcontrols2materialstyleplugin.cpp @ 89] 00000000`0029f010 00000000`65db3737 Qt5Qmld!QQmlTypeLoaderThread::initializeEngineMain(class QQmlExtensionInterface * iface = 0x00000000`040a00e0, char * uri = 0x00000000`040a35b8 "QtQuick.Controls.Material")+0xa0 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 916] 00000000`0029f060 00000000`65e61fb2 Qt5Qmld!`QQmlThread::callMethodInMain<QQmlExtensionInterface * __ptr64,char const * __ptr64,QQmlExtensionInterface * __ptr64,char const * __ptr64,QQmlTypeLoaderThread>'::`2'::I::call(class QQmlThread * thread = 0x00000000`00356790)+0x37 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\ftw\qqmlthread_p.h @ 224] 00000000`0029f0a0 00000000`65da6865 Qt5Qmld!QQmlThread::internalCallMethodInThread(struct QQmlThread::Message * message = 0x00000000`01ca50f0)+0x162 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\ftw\qqmlthread.cpp @ 322] 1 Id: 24f8.201c Suspend: 1 Teb: 000007ff`fffdc000 Unfrozen "QQmlThread" Child-SP RetAddr Call Site 00000000`0253aeb8 000007fe`fd5f10dc ntdll!NtWaitForSingleObject+0xa 00000000`0253aec0 00000000`665d372e KERNELBASE!WaitForSingleObjectEx+0x9c 00000000`0253af60 00000000`665d3307 Qt5Cored!QWaitConditionPrivate::wait(class QWaitConditionEvent * wce = 0x00000000`04072c90, unsigned long time = 0xffffffff)+0x2e [c:\users\qt\work\qt\qtbase\src\corelib\thread\qwaitcondition_win.cpp @ 118] 00000000`0253afa0 00000000`65e635fa Qt5Cored!QWaitCondition::wait(class QMutex * mutex = 0x00000000`0034fd00, unsigned long time = 0xffffffff)+0x97 [c:\users\qt\work\qt\qtbase\src\corelib\thread\qwaitcondition_win.cpp @ 179] 00000000`0253b000 00000000`65e6221f Qt5Qmld!QQmlThreadPrivate::wait(void)+0x2a [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\ftw\qqmlthread.cpp @ 62] 00000000`0253b030 00000000`65da67ef Qt5Qmld!QQmlThread::internalCallMethodInMain(struct QQmlThread::Message * message = 0x00000000`040a3650)+0x18f [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\ftw\qqmlthread.cpp @ 359] 00000000`0253b080 00000000`65d9cb1e Qt5Qmld!QQmlThread::callMethodInMain<QQmlExtensionInterface * __ptr64,char const * __ptr64,QQmlExtensionInterface * __ptr64,char const * __ptr64,QQmlTypeLoaderThread>(<function> * Member = 0x00000000`6592115c, class QQmlExtensionInterface ** arg = 0x00000000`0253b0f8, char ** arg2 = 0x00000000`0253b100)+0x5f [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\ftw\qqmlthread_p.h @ 227] 00000000`0253b0c0 00000000`65d93b7e Qt5Qmld!QQmlTypeLoaderThread::initializeEngine(class QQmlExtensionInterface * iface = 0x00000000`040a00e0, char * uri = 0x00000000`040a35b8 "QtQuick.Controls.Material")+0x2e [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 861] 00000000`0253b0f0 00000000`65e03e38 Qt5Qmld!QQmlTypeLoader::initializeEngine(class QQmlExtensionInterface * iface = 0x00000000`040a00e0, char * uri = 0x00000000`040a35b8 "QtQuick.Controls.Material")+0xae [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 1239] 00000000`0253b140 00000000`65e09df7 Qt5Qmld!QQmlImportDatabase::importDynamicPlugin(class QString * filePath = 0x00000000`0253b368, class QString * uri = 0x00000000`0253b870, class QString * typeNamespace = 0x00000000`0253b328, int vmaj = 2, class QList<QQmlError> * errors = 0x00000000`0253ba98)+0x668 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmlimport.cpp @ 2104] 00000000`0253b2c0 00000000`65e06e23 Qt5Qmld!QQmlImportsPrivate::importExtension(class QString * qmldirFilePath = 0x00000000`0253b6a8, class QString * uri = 0x00000000`0253b870, int vmaj = 2, int vmin = 1, class QQmlImportDatabase * database = 0x00000000`00356a80, class QQmlTypeLoaderQmldirContent * qmldir = 0x00000000`0407bd60, class QList<QQmlError> * errors = 0x00000000`0253ba98)+0x507 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmlimport.cpp @ 1073] 00000000`0253b610 00000000`65e02560 Qt5Qmld!QQmlImportsPrivate::addLibraryImport(class QString * uri = 0x00000000`0253b870, class QString * prefix = 0x00000000`0253b868, int vmaj = 2, int vmin = 1, class QString * qmldirIdentifier = 0x00000000`0253b860, class QString * qmldirUrl = 0x00000000`0253b858, bool incomplete = false, class QQmlImportDatabase * database = 0x00000000`00356a80, class QList<QQmlError> * errors = 0x00000000`0253ba98)+0x273 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmlimport.cpp @ 1402] 00000000`0253b730 00000000`65d9055e Qt5Qmld!QQmlImports::addLibraryImport(class QQmlImportDatabase * importDb = 0x00000000`00356a80, class QString * uri = 0x00000000`0253b870, class QString * prefix = 0x00000000`0253b868, int vmaj = 2, int vmin = 1, class QString * qmldirIdentifier = 0x00000000`0253b860, class QString * qmldirUrl = 0x00000000`0253b858, bool incomplete = false, class QList<QQmlError> * errors = 0x00000000`0253ba98)+0x280 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmlimport.cpp @ 1628] 00000000`0253b7f0 00000000`65d97f4c Qt5Qmld!QQmlTypeLoader::Blob::addImport(struct QV4::CompiledData::Import * import = 0x00000000`01cc9380, class QList<QQmlError> * errors = 0x00000000`0253ba98)+0x4ee [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 1403] 00000000`0253ba60 00000000`65d966a3 Qt5Qmld!QQmlTypeData::continueLoadFromIR(void)+0x47c [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 2481] 00000000`0253bbc0 00000000`65d9489a Qt5Qmld!QQmlTypeData::dataReceived(class QQmlDataBlob::SourceCodeData * data = 0x00000000`0253bc88)+0xb3 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 2399] 00000000`0253bc00 00000000`65d947f1 Qt5Qmld!QQmlTypeLoader::setData(class QQmlDataBlob * blob = 0x00000000`01c9aa70, class QQmlDataBlob::SourceCodeData * d = 0x00000000`0253bc88)+0x8a [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 1271] 00000000`0253bc50 00000000`65d93ff7 Qt5Qmld!QQmlTypeLoader::setData(class QQmlDataBlob * blob = 0x00000000`01c9aa70, class QString * fileName = 0x00000000`0253bcf0)+0x81 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 1260] 00000000`0253bcb0 00000000`65d9cc11 Qt5Qmld!QQmlTypeLoader::loadThread(class QQmlDataBlob * blob = 0x00000000`01c9aa70)+0x297 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 1136] 00000000`0253bde0 00000000`65db377e Qt5Qmld!QQmlTypeLoaderThread::loadThread(class QQmlDataBlob * b = 0x00000000`01c9aa70)+0x21 [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\qqmltypeloader.cpp @ 876] 2 Id: 24f8.16d0 Suspend: 1 Teb: 000007ff`fffda000 Unfrozen "QQmlDebugServerThread" Child-SP RetAddr Call Site 00000000`032ac128 000007fe`fd5f1430 ntdll!NtWaitForMultipleObjects+0xa 00000000`032ac130 00000000`77492ce3 KERNELBASE!GetCurrentProcess+0x40 00000000`032ac230 00000000`7738bc3d kernel32!WaitForMultipleObjectsEx+0xb3 00000000`032ac2c0 00000000`7738905a USER32!PeekMessageW+0x1cd 00000000`032ac360 00000000`66a44761 USER32!MsgWaitForMultipleObjectsEx+0x2a 00000000`032ac3a0 00000000`66982bc8 Qt5Cored!QEventDispatcherWin32::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x7b1 [c:\users\qt\work\qt\qtbase\src\corelib\kernel\qeventdispatcher_win.cpp @ 648] 00000000`032af750 00000000`66982e0e Qt5Cored!QEventLoop::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x68 [c:\users\qt\work\qt\qtbase\src\corelib\kernel\qeventloop.cpp @ 135] 00000000`032af790 00000000`665bfcaf Qt5Cored!QEventLoop::exec(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x18e [c:\users\qt\work\qt\qtbase\src\corelib\kernel\qeventloop.cpp @ 212] 00000000`032af840 000007fe`f60f4cc2 Qt5Cored!QThread::exec(void)+0xbf [c:\users\qt\work\qt\qtbase\src\corelib\thread\qthread.cpp @ 515] 00000000`032af8b0 00000000`665cc50d qmldbg_serverd!QQmlDebugServerThread::run(void)+0x2a2 [c:\users\qt\work\qt\qtdeclarative\src\plugins\qmltooling\qmldbg_server\qqmldebugserver.cpp @ 259] 00000000`032af970 00000000`7748652d Qt5Cored!QThreadPrivate::start(void * arg = 0x00000000`003f0e18)+0x19d [c:\users\qt\work\qt\qtbase\src\corelib\thread\qthread_win.cpp @ 380] 00000000`032afa00 00000000`775bc541 kernel32!BaseThreadInitThunk+0xd 00000000`032afa30 00000000`00000000 ntdll!RtlUserThreadStart+0x21
  • 0 Votes
    4 Posts
    4k Views
    kshegunovK

    If you have the .pdb you can add it to Creator. I don't have windows on hand, but it was somewhere in the Tools > Options ... > Debugger > CDB configuration.

  • 0 Votes
    2 Posts
    1k Views
    FlotisableF

    @CAD_coding
    form the official document, I think you can do it

  • 0 Votes
    4 Posts
    2k Views
    SGaistS

    From the C++ side, QNetworkReply is not local in the sense that you get a pointer to a heap allocated object that lifetime you must handle yourself while outFile would a stack allocated object that would be destroyed at the end of the function.

  • Finding GUI Event-Handling Crashes

    Unsolved General and Desktop
    21
    0 Votes
    21 Posts
    8k Views
    J

    Final update on this...unless I learn more about why my changes worked and believe it could help others...

    Today I deployed a (seemingly) fixed version after almost two months' testing. I made many changes including most of those @SGaist had suggested -- thanks for the super helpful feedback and suggestions!

    This was a difficult bug to fix. The program is a really, really large in-house application used by hundreds of people every day. Some of the source files were written in the late 90's and are still used today; it uses MFC; it uses the QMfcApp class; it uses Qt; it uses Boost; and I'm skeptical of the smooth integration of these frameworks into a cohesive unit. In fact, I'm not sure QMfcApp was intended to be a long-term solution...it looks more like a bridge for moving from MFC to Qt...

    At any rate, I made several changes that led to a fix. First, I moved the vector into the Model rather than injecting a pointer to a vector anchored in the dialog as the original author had done. I also disable UI controls while the data is acquired, then disable updates ( setUpdatesEnabled(false) ) to the TableView and TableModel while major changes are made, remove events (removePostedEvents(Table, 0) & removePostedEvents(Model, 0)) before clearing the vector, and I changed the app from emitting a restart-event after N items are processed and then exited knowing that when the restart bubbles off the queue it can pickup where it left off, to simply processing every item and issuing a qApp->processEvents() periodically to keep the UI responsive. I created a state variable to control when the app is busy or idle.

    I don't know if all of this is in line with the standard Qt rules of engagement, particularly disabling controls and flushing their event queues, but it has been working after hours and hours of testing. Before I disabled updates and removed enqueued pending update events, I would get intermittent update events for stale data. I thought the documentation said if you emptied your Model's container between a beginModelReset() and endModelReset() the framework would recognize that data requests were stale and would purge them. Either I misunderstood how this works, failed some other necessary step, or there's just a bug in Qt or our code or the commingling of both that allowed UI updates after the table was emptied.

    If something illuminating happens that provides greater understanding as to why these changes "fixed" the crashes, I'll come back here and update this thread. But I do want to say thanks to @SGaist for your input and suggestions. It helped a lot.

    john
  • 0 Votes
    10 Posts
    4k Views
    J

    A little more info after starting a 2nd debug session.

    I set a breakpoint so that I could walk through the first call to QAbstractItemView::event -> QAbstractScrollArea::event -> QPainter::QPainter -> QPainter::begin

    The first call to redirected has the redirectedDev pointer in the QPaintDevice pointing to a valid QPaintDevice with a QImage, 7 slots in the __vfptr that look valid, and both the painters and reserved member variables set to 0 (zero):

    redirectDev 0x0d3ea70c {d=0x0d3ea760 } QPaintDevice * [QImage] {d=0x0d3ea760 } QImage __vfptr 0x0551c988 const QImage::`vftable' * [0x0] 0x050113fa QImage::`vector deleting destructor'(unsigned int) * [0x1] 0x04ff8ae9 QImage::devType(void) * [0x2] 0x04ffe27d QImage::paintEngine(void) * [0x3] 0x0500b077 QImage::metric(enum QPaintDevice::PaintDeviceMetric) * [0x4] 0x05001757 QPaintDevice::initPainter(class QPainter *) * [0x5] 0x04ff570e QPaintDevice::redirected(class QPoint *) * [0x6] 0x04ff9246 QPaintDevice::sharedPainter(void) * painters 0x0000 unsigned short reserved 0x00000000 QPaintDevicePrivate *

    The redirectDev is a QTableView member variable that's already been populated. I will run through a few cycles to see if this value is changing.

  • 0 Votes
    2 Posts
    1k Views
    P

    Hello Sebastian,

    I am seeing the same problem. The last frame on the stack after a crash points to qwebengine core

    qt5\qtwebengine\src\3rdparty\chromium\base\process\memory_win.cc @ 41 but its actually capturing various other exceptions from our application.

    Were you able to solve the problem?

    Thanks!

  • 0 Votes
    3 Posts
    4k Views
    BerzegerB

    Okay, after four days of research, turns out the specific DLL - Qt5WebEngineCore.dll doesn't like being compressed by UPX. It's not noticeable immediately, but on approx. 10 % of PCs the QtWebEngineProcess simply crashes.

  • 0 Votes
    2 Posts
    2k Views
    kshegunovK

    @judb
    Hello,
    It's possible it's a bug with timer dispatching. Can you prepare a minimal bare-bone example that'd reproduce this? What I mean to understand is if the problem might be connected to something in your code, although the stack trace doesn't suggest it. Also you could look at the bugtracker if something is known.

    Kind regards.

  • 0 Votes
    9 Posts
    5k Views
    mrjjM

    @mrjj said:

    this->ui->personComboBox

    then pointer must be corrupt?

  • 0 Votes
    3 Posts
    2k Views
    TommyXT

    @Wieland

    Thank you so much! I added QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); when the object was created, and this apparently solves the problem :)

  • 0 Votes
    6 Posts
    3k Views
    kshegunovK

    @Thynome
    Hi,
    Well, you're stuck with C when working with the WinApi. It sucks, I know, but you need to transfer the context (the object) through a global variable. You can look here for some inspiration - WindowsCtrlDispatcher::instance is the context that's transferred to the VOID WINAPI ServiceMain(DWORD, LPTSTR *) function. I hope that helps.

    Kind regards.

  • 0 Votes
    4 Posts
    3k Views
    JohnLeeJ

    @Keyos I meet the same problem,and when i launch my app,the memory usage become 50% even the dialog is not actived,maybe the next release will be better.

  • Crash when closing application

    Solved General and Desktop
    22
    0 Votes
    22 Posts
    10k Views
    kshegunovK

    @Joel-Bodenmann

    The reason I added those virtual destructors there is because Qt documenation adviced me to do so

    Right, it's not an error by any means. However, I advise not using substandard compilers instead. ;)

  • 0 Votes
    1 Posts
    820 Views
    No one has replied
  • 0 Votes
    8 Posts
    4k Views
    A

    thanks for your help, I have tried to edit my odbc.ini the Mac refused to save the file... That's why I gave up.
    As an intern, it's my tutor training who said to me to look at a native component. But if I can't find any solution I will come back to the first idea :)

  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    5 Posts
    2k Views
    Chris KawaC

    It's not very well exposed, but this is actually documented in QPainter::begin():

    Warning: A paint device can only be painted by one painter at a time.

  • 0 Votes
    16 Posts
    5k Views
    SGaistS

    Good !

    Since everything is working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)