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

Almost all opengl programs crash with Wayland on Mali

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0, 6.2.2
    • QPA: Wayland
    • Linux/Wayland

    Description

      This problem has been bugging me for a long time, and I don't know if it's a driver EGL implementation problem or a Qt problem.

      This issue occurs with one specific graphics card, Mali-G76, whose driver is also vendor specific.

      Any quick program and qopenglwidget qopenglwindow will crash.

      Its stack is as follows:

       

          #0  0x0000007fb6bd7bw94 in get_next_argument (signature=0x0, details=details@entry=0x7fd828fd88) at src/connection.c:445
      #1  0x0000007fb6bd8340 in wl_argument_from_va_list (signature=<optimized out>, args=<optimized out>, count=<optimized out>, ap=...) at src/connection.c:508
      #2  0x0000007fb6bd6268 in wl_proxy_marshal (proxy=0x376b15f0, opcode=1) at src/wayland-client.c:850
      #3  0x0000007faee98b9c in window_surface_delete () at /lib/aarch64-linux-gnu/libmali.so.0
      #4  0x0000007faee8f200 in eglp_window_surface_specific_deinitialization () at /lib/aarch64-linux-gnu/libmali.so.0
      #5  0x0000007faee89760 in eglp_delete_surface () at /lib/aarch64-linux-gnu/libmali.so.0
      #6  0x0000007faee8de6c in eglMakeCurrent () at /lib/aarch64-linux-gnu/libmali.so.0
      #7  0x0000007fb4480880 in QtWaylandClient::QWaylandGLContext::makeCurrent(QPlatformSurface*) (this=this@entry=0x3770edc0, surface=<optimized out>)
          at /home/wugang/Desktop/qtwayland/qtwayland-opensource-src/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp:415
      #8  0x0000007fbabc4cb0 in QOpenGLContext::makeCurrent(QSurface*) (this=0x37741330, surface=0x3771a480) at kernel/qopenglcontext.cpp:984
      #9  0x0000007fbb297ce0 in QOpenGLWidget::makeCurrent() (this=this@entry=0x376233a0) at kernel/qopenglwidget.cpp:1161
      #10 0x0000007fbb297f60 in QOpenGLWidgetPrivate::reset() (this=0x375fb080) at kernel/qopenglwidget.cpp:704
      #11 0x0000007fbb297fa0 in QOpenGLWidget::~QOpenGLWidget() (this=0x376233a0, __in_chrg=<optimized out>) at kernel/qopenglwidget.cpp:1020
      #12 0x00000000004061a8 in GLWidget::~GLWidget() (this=0x376233a0, __in_chrg=<optimized out>) at ../2dpainting/glwidget.h:59
      

      As you can see, there is a crash when calling eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) . Because before it, wl_surface has been destory.

      But eglMakeCurrent is still using wl_surface.

       

      Another thing to say is that in this driver, eglDestorySurface has the same problem, https://bugreports.qt.io/browse/QTBUG-92249  has fixed it.

       

      A similar question has been raised on gnome, but it doesn't seem to be resolved

      https://gitlab.gnome.org/GNOME/gtk/-/issues/795  

      But it is mentioned here that ARM engineers do not think this is a problem in the driver.

       

       

      One fix is:

      Call eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) before destroying the surface.

       

       

       

       

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-100262
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              tanghaixiang haixiang tang
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes