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

QPainter::drawPixmap crash on QGLPixelBuffer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.6.2
    • 4.6.1
    • GUI: OpenGL, GUI: Painting
    • None
    • 092cfe31463146c17f99543e36cdd7da85961afc

    Description

      Here is a backtrace of the crash:

      QX11Info::screen (this=0x0) at kernel/qx11info_x11.cpp:476
      476

      { return x11data ? x11data->screen : QX11Info::appScreen(); }

      #0 QX11Info::screen (this=0x0) at kernel/qx11info_x11.cpp:476
      #1 0x00007fea6905a4fe in qt_resolveTextureFromPixmap (paintDevice=0x21fef30) at qgl_x11.cpp:1612
      #2 0x00007fea6905a62d in QGLContextPrivate::bindTextureFromNativePixmap (this=<value optimized out>, pmd=0x3263ed0,
      key=72057714297012224, options=

      {i = 1964533744}

      ) at qgl_x11.cpp:1634
      #3 0x00007fea69006e48 in QGLContextPrivate::bindTexture (this=0x21f8660, pixmap=@0x3281420, target=3553, format=6408,
      options=

      {i = 1964533904}

      ) at qgl.cpp:2326
      #4 0x00007fea69050820 in QGL2PaintEngineEx::drawPixmap (this=0x7fea44db0c60, dest=@0x7fff75186910, pixmap=@0x3281420,
      src=@0x7fff751868f0) at gl2paintengineex/qpaintengineex_opengl2.cpp:1433
      #5 0x00007fea6866812c in QPaintEngineEx::drawPixmap (this=0x7fea44db0c60, pos=@0x7fff75186ad0, pm=@0x3281420)
      at painting/qpaintengineex.cpp:948
      #6 0x00007fea6867aa3d in QPainter::drawPixmap (this=0x7fff75188430, p=@0x7fff75186ad0, pm=@0x3281420)
      at painting/qpainter.cpp:5238

      It looks like the issue is in qt_resolveTextureFromPixmap in opengl/qgl_x11.cpp. The return value from qt_x11Info() is 0 but it is never checked:

      const QX11Info *xinfo = qt_x11Info(paintDevice);
      QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen()));

      This has changed from 4.6.0 where QGLExtentionMatcher (and thus QX11Info) is not used.

      I assume qt_x11Info returns 0 because QPaintDevice::devType() isn't QInternal::Widget or QInternal::Pixmap. The devType() for the current painter is 6:

      (gdb) up
      #1 0x00007fea6905a4fe in qt_resolveTextureFromPixmap (paintDevice=0x21fef30) at qgl_x11.cpp:1612
      1612 QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen()));
      (gdb) print paintDevice
      $1 = (class QPaintDevice *) 0x21fef30
      (gdb) print paintDevice->devType()
      $2 = 6

      Attachments

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

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            stephenmdangelo Stephen D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes