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

Null pointer dereferene in QGLContextPrivate::contextGroup()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 4.8.0
    • Fix Version/s: 4.8.0
    • Component/s: GUI: OpenGL
    • Labels:
      None
    • Environment:
      windows 7 x64 sp1
      AMD radeon HD 5770
      vs2010 sp1
    • Commits:
      207fb45ce7bac66ab53a0770d2bfb50d8d1997d8

      Description

      Sometimes Qt will crash at QGLContextPrivate::contextGroup() due to NULL pointer dereference (ctx->d_ptr) when I call QPainter::drawText() to render text under GL2 painter engine in Qt-4.8.0, Qt-4.7.x is not affected by this problem. Below is the call stack at the time the crash occur:

      QtCored4.dll!qt_message_output(QtMsgType msgType, const char * buf) Line 2243 C++
      QtCored4.dll!qt_message(QtMsgType msgType, const char * msg, char * ap) Line 2301 + 0x19 bytes C++
      QtCored4.dll!qFatal(const char * msg, ...) Line 2485 C++
      QtCored4.dll!qt_assert(const char * assertion, const char * file, int line) Line 2000 C++
      QtOpenGLd4.dll!QScopedPointer<QGLContextPrivate,QScopedPointerDeleter<QGLContextPrivate> >::operator->() Line 112 + 0x25 bytes C++
      > QtOpenGLd4.dll!QGLContextPrivate::contextGroup(const QGLContext * ctx) Line 453 + 0x1a bytes C++
      QtOpenGLd4.dll!QGLContextGroupResourceBase::value(const QGLContext * context) Line 5688 + 0xa bytes C++
      QtOpenGLd4.dll!QGLContextGroupResource<QGLGlyphTexture>::value(const QGLContext * context) Line 763 + 0xf bytes C++
      QtOpenGLd4.dll!QGLTextureGlyphCache::width() Line 122 + 0x1f bytes C++
      QtOpenGLd4.dll!QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType, QStaticTextItem * staticTextItem) Line 1639 + 0xd bytes C++
      QtOpenGLd4.dll!QGL2PaintEngineEx::drawTextItem(const QPointF & p, const QTextItem & textItem) Line 1544 + 0x16 bytes C++
      QtGuid4.dll!QPainter::drawTextItem(const QPointF & p, const QTextItem & _ti) Line 6683 C++
      QtGuid4.dll!drawMenuText(QPainter * p, QFixed x, QFixed y, const QScriptItem & si, QTextItemInt & gf, QTextEngine * eng, int start, int glyph_start) Line 2042 C++
      QtGuid4.dll!QTextLine::draw(QPainter * p, const QPointF & pos, const QTextLayout::FormatRange * selection) Line 2417 C++
      QtGuid4.dll!qt_format_text(const QFont & fnt, const QRectF & _r, int tf, const QTextOption * option, const QString & str, QRectF * brect, int tabstops, int * ta, int tabarraylen, QPainter * painter) Line 8284 C++
      QtGuid4.dll!QPainter::drawText(const QRect & r, int flags, const QString & str, QRect * br) Line 6200 C++

      Unfortunately, I haven't found a way to write a simple program to reproduce this problem.

        Attachments

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

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            jianliang79 liang jian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes