Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62442

QML text controls always crash on Windows when running with debugger

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.9.0, 5.9.1
    • None
    • Windows 7 SP1 64-bit

      Qt 5.9.1 & Qt 5.9.0

      Visual Studio 2017 (VC14.1)

      QML/QtQuick 2

    Description

      I've ran into an issue last week that I now believe is an actual bug in the Qt.

       

      I've described it on the Qt forums (link) but I'll elaborate in this issue as well since they're separate fora and I believe it's necessary to make it part of the issue tracker.

       

      To make the long story short, I'm running Windows 7 SP1 64-bit using Qt 5.9.1 and MSVS 2017 (VC 14.1). Running any QtQuick/QML application that renders any text whatsoever leads to crash on startup when starting the application through the debugger. It happens regardless of the fact whether the project is built in Release or Debug mode. When running the application (without a debugger), in either Release or Debug mode, the application will either crash on startup, work for a bit, or work until I move the mouse cursor around in the application window area. I've been unable to determine what causes it to behave differently when running without a debugger but nonetheless the issue is there. I have also tried downgrading to Qt 5.9.0 but the issue persists in that version as well. I had not tried any earlier version (5.8.x) because only 5.9.x ships with precompiled libraries for MSVS 2017 64-bit.

       

      The issue occurs with programs as simple as (loaded via QQmlApplicationEngine):

       

      import QtQuick 2.8
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.4
      
      
      Window {
          id: root
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
      
          Button {
              id: testButton
              text: "Test"
      
      
              anchors.left: parent.left
              anchors.top: parent.top
      
      
              width: 150
              height: 30
          }
      }
      

       

      The issue also occurs when running any QML example that's shipped with Qt (accessible through Welcome -> Examples menu in Qt Creator).

       

      The backtrace is always more or less the same as the following:

      .  0  Id: 254.1da8 Suspend: 1 Teb: 000007ff`fffde000 Unfrozen
      Child-SP          RetAddr           Call Site
      00000000`00287c90 000007fe`ff58ab87 KERNELBASE!RaiseException+0x3d
      00000000`00287d60 000007fe`ec6a865d msvcrt!CxxThrowException+0x87
      00000000`00287dd0 000007fe`e715ef00 dwrite!DWriteCreateFactory+0x3f51
      00000000`00287e50 000007fe`e715fecb qwindowsd!createDirectWriteFactory(struct IDWriteFactory ** factory = 0x00000000`06028bc8)+0x90 [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 103]
      00000000`00287e90 000007fe`e715ce92 qwindowsd!initDirectWrite(class QWindowsFontEngineData * d = 0x00000000`060287b0)+0x2b [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 653]
      00000000`00287ee0 000007fe`e715b060 qwindowsd!QWindowsFontDatabase::createEngine(struct QFontDef * request = 0x00000000`00288460, class QString * faceName = 0x00000000`00288340, int dpi = 96, class QSharedPointer<QWindowsFontEngineData> * data = 0x00000000`00288378)+0x1d2 [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 1888]
      00000000`00288300 000007fe`e768dedc qwindowsd!QWindowsFontDatabase::fontEngine(struct QFontDef * fontDef = 0x00000000`00288460, void * handle = 0x00000000`00000000)+0x60 [c:\users\qt\work\qt\qtbase\src\platformsupport\fontdatabases\windows\qwindowsfontdatabase.cpp @ 1247]
      00000000`002883c0 000007fe`e768e0f8 Qt5Guid!loadSingleEngine(int script = 2, struct QFontDef * request = 0x00000000`002888a0, struct QtFontFamily * family = 0x00000000`06027540, struct QtFontFoundry * foundry = 0x00000000`06027870, struct QtFontStyle * style = 0x00000000`0602ad30, struct QtFontSize * size = 0x00000000`0602b050)+0x3dc [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 971]
      00000000`00288520 000007fe`e7689704 Qt5Guid!loadEngine(int script = 2, struct QFontDef * request = 0x00000000`002888a0, struct QtFontFamily * family = 0x00000000`06027540, struct QtFontFoundry * foundry = 0x00000000`06027870, struct QtFontStyle * style = 0x00000000`0602ad30, struct QtFontSize * size = 0x00000000`0602b050)+0x58 [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 1000]
      00000000`002885d0 000007fe`e7689fd1 Qt5Guid!QFontDatabase::findFont(struct QFontDef * request = 0x00000000`002888a0, int script = 2)+0x2e4 [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 2686]
      00000000`00288860 000007fe`e764be28 Qt5Guid!QFontDatabase::load(class QFontPrivate * d = 0x00000000`0048afe0, int script = 2)+0x3c1 [c:\users\qt\work\qt\qtbase\src\gui\text\qfontdatabase.cpp @ 2803]
      00000000`00288960 000007fe`e769fa47 Qt5Guid!QFontPrivate::engineForScript(int script = 2)+0xf8 [c:\users\qt\work\qt\qtbase\src\gui\text\qfont.cpp @ 218]
      00000000`002889c0 000007fe`e76a4502 Qt5Guid!QTextEngine::fontEngine(struct QScriptItem * si = 0x00000000`05a330e8, struct QFixed * ascent = 0x00000000`05a330f4, struct QFixed * descent = 0x00000000`05a330f0, struct QFixed * leading = 0x00000000`05a330f8)+0x667 [c:\users\qt\work\qt\qtbase\src\gui\text\qtextengine.cpp @ 2134]
      00000000`00288ac0 000007fe`e769d7e1 Qt5Guid!QTextEngine::shapeText(int item = 0)+0x3b2 [c:\users\qt\work\qt\qtbase\src\gui\text\qtextengine.cpp @ 1006]
      00000000`00288cd0 000007fe`e76c6a3f Qt5Guid!QTextEngine::shape(int item = 0)+0x261 [c:\users\qt\work\qt\qtbase\src\gui\text\qtextengine.cpp @ 1568]
      00000000`00288d80 000007fe`e76c3b73 Qt5Guid!QTextLine::layout_helper(int maxGlyphs = 2147483647)+0x3ff [c:\users\qt\work\qt\qtbase\src\gui\text\qtextlayout.cpp @ 1838]
      00000000`00289170 000007fe`e6a7c875 Qt5Guid!QTextLine::setLineWidth(double width = 8388607)+0x153 [c:\users\qt\work\qt\qtbase\src\gui\text\qtextlayout.cpp @ 1601]
      00000000`002891d0 000007fe`e6a7f0d9 Qt5Quickd!QQuickTextPrivate::setLineGeometry(class QTextLine * line = 0x00000000`00289410, double lineWidth = 3.4028234663852886e+038, double * height = 0x00000000`00289420)+0x45 [c:\users\qt\work\qt\qtdeclarative\src\quick\items\qquicktext.cpp @ 1110]
      00000000`00289380 000007fe`e6a7b565 Qt5Quickd!QQuickTextPrivate::setupTextLayout(double * baseline = 0x00000000`002899d8)+0xcd9 [c:\users\qt\work\qt\qtdeclarative\src\quick\items\qquicktext.cpp @ 751]
      00000000`00289940 000007fe`e6a7c46c Qt5Quickd!QQuickTextPrivate::updateSize(void)+0x355 [c:\users\qt\work\qt\qtdeclarative\src\quick\items\qquicktext.cpp @ 401]
      
      
         1  Id: 254.1510 Suspend: 1 Teb: 000007ff`fffdc000 Unfrozen "QQmlThread"
      Child-SP          RetAddr           Call Site
      00000000`021bc298 000007fe`fd5f1430 ntdll!NtWaitForMultipleObjects+0xa
      00000000`021bc2a0 00000000`77492ce3 KERNELBASE!GetCurrentProcess+0x40
      *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\USER32.dll - 
      00000000`021bc3a0 00000000`7738bc3d kernel32!WaitForMultipleObjectsEx+0xb3
      00000000`021bc430 00000000`7738905a USER32!PeekMessageW+0x1cd
      00000000`021bc4d0 00000000`66904761 USER32!MsgWaitForMultipleObjectsEx+0x2a
      00000000`021bc510 00000000`66842bc8 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`021bf8c0 00000000`66842e0e 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`021bf900 00000000`6647fcaf 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`021bf9b0 00000000`65d2258a Qt5Cored!QThread::exec(void)+0xbf [c:\users\qt\work\qt\qtbase\src\corelib\thread\qthread.cpp @ 515]
      00000000`021bfa20 00000000`6648c50d Qt5Qmld!QQmlThreadPrivate::run(void)+0x4a [c:\users\qt\work\qt\qtdeclarative\src\qml\qml\ftw\qqmlthread.cpp @ 148]
      00000000`021bfa50 00000000`7748652d Qt5Cored!QThreadPrivate::start(void * arg = 0x00000000`0048ded0)+0x19d [c:\users\qt\work\qt\qtbase\src\corelib\thread\qthread_win.cpp @ 380]
      00000000`021bfae0 00000000`775bc541 kernel32!BaseThreadInitThunk+0xd
      00000000`021bfb10 00000000`00000000 ntdll!RtlUserThreadStart+0x21
      

      I believe this is Qt related bug because it happens with stock Qt installation with even the simplest QML code that displays text or any example project.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            kach kach
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes