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

Crash on X11 when painting QGraphicsTextItem with huge font, using Qt without FontConfig support

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.3.0
    • GUI: Painting
    • None

    Description

      On X11, a crash may occur in QFontEngineXLFD::addOutlineToPath() if the font size is huge and when using Qt without FontConfig support. For example, rendering a QGraphicsScene which uses a very large coordinate system, and consequently setting a very large pixel size (~37000) on a QGraphicsTextItem's font, may result in the crash.

      Following is the last few frames from a trace from the crash:

      Breakpoint 2, QFontEngineXLFD::addOutlineToPath (this=0x80c4730, x=2, y=29091, glyphs=0x80c3c30, numGlyphs=15, path=0xbf8514ec, flags=@0xbf8514f0)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qfontengine_x11.cpp:579
      579 addBitmapFontToPath(x, y, glyphs, numGlyphs, path, flags);
      (gdb) bt
      #0 QFontEngineXLFD::addOutlineToPath (this=0x80c4730, x=2, y=29091, glyphs=0x80c3c30, numGlyphs=15, path=0xbf8514ec, flags=@0xbf8514f0)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qfontengine_x11.cpp:579
      #1 0xb78bea71 in QPaintEngine::drawTextItem (this=0x80b19f8, p=@0xbf852380, textItem=@0xbf852298)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/painting/qpaintengine.cpp:640
      #2 0xb7952e8f in QX11PaintEngine::drawXLFD (this=0x80b19f8, p=@0xbf852380, ti=@0xbf852298)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/painting/qpaintengine_x11.cpp:1927
      #3 0xb7953563 in QX11PaintEngine::drawTextItem (this=0x80b19f8, p=@0xbf852380, textItem=@0xbf852298)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/painting/qpaintengine_x11.cpp:1882
      #4 0xb78d0d4b in QPainter::drawTextItem (this=0xbf853f20, p=@0xbf852b40, _ti=@0xbf852a90)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/painting/qpainter.cpp:4926
      #5 0xb79c0af0 in QTextLine::draw (this=0xbf852d48, p=0xbf853f20, pos=@0xbf852d58, selection=0x0)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextlayout.cpp:1985
      #6 0xb79c1277 in QTextLayout::draw (this=0x80d1548, p=0xbf853f20, pos=@0xbf853660, selections=@0xbf852ed0, clip=@0xbf853850)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextlayout.cpp:1097
      #7 0xb79faf79 in QTextDocumentLayoutPrivate::drawBlock (this=0x80a0d88, offset=@0xbf853660, painter=0xbf853f20, context=@0xbf853844, bl=@0xbf853050)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextdocumentlayout.cpp:1161
      #8 0xb7a06a84 in QTextDocumentLayoutPrivate::drawFlow (this=0x80a0d88, offset=@0xbf853660, painter=0xbf853f20, context=@0xbf853844, it=@0xbf85373c,
      floats=@0xbf8535fc, cursorBlockNeedingRepaint=0xbf853658) at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextdocumentlayout.cpp:1068
      #9 0xb7a065c4 in QTextDocumentLayoutPrivate::drawFrame (this=0x80a0d88, offset=@0xbf8537f8, painter=0xbf853f20, context=@0xbf853844, frame=0x80cbc00)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextdocumentlayout.cpp:933
      #10 0xb7a067ef in QTextDocumentLayout::draw (this=0x8083a58, painter=0xbf853f20, context=@0xbf853844)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextdocumentlayout.cpp:2554
      #11 0xb79a022b in QTextControl::drawContents (this=0x80bd128, p=0xbf853f20, rect=@0xbf853908, widget=0x0)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/text/qtextcontrol.cpp:2668
      #12 0xb7d96965 in QGraphicsTextItem::paint (this=0x809e360, painter=0xbf853f20, option=0x80c3b70, widget=0x80974a8)
      at /home/sthomassen/dev/qt-x11-commercial-src-4.3.0/src/gui/graphicsview/qgraphicsitem.cpp:5712
      ...

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes