Details
Description
QtWebEngine on 6.9 uses much more X11 resources that 6.8. Over very long amounts of time this can make the system sluggish, but the primary symptom over meduim amounts of time is that the Xorg server locks up in a busy loop while freeing resources. For me, an hour of watching a video will cause Xorg to lock up for 10+ minutes when I close the browser.
The easiest way to see the difference between the two versions is to look at `xrestop` while a video is playing in the browser and watch the "Pxm mem" column. On 6.8 (and 6.9 on Wayland or Vulkan) the value stays steady, but on 6.9 on X11 it grows pretty fast. It also starts a lot lower on 6.8 and Wayland.
Here's a screenshot of `xrestop` where simplebrowser has been playing the 1080 Big Buck Bunny test video on loop (from the right click context menu option) for 10 minutes or so. On 6.8 the value in that column is several orders of magnitude less.
The debug text on stdout from simplebrowser is:
Chromium GL Backend: angle Chromium ANGLE Backend: gl-egl Chromium Vulkan Backend: disabled QSG RHI Backend: OpenGL QSG RHI Backend Supported: yes GPU Vendor: AMD Using GLX: yes Using EGL: no Using Shared GL: no Init Parameters: * application-name simplebrowser * browser-subprocess-path /usr/local/Qt-6.9.0/libexec/QtWebEngineProcess * disable-blink-features WebOTP * disable-features EyeDropper,BackgroundFetch,InstalledApp,WebOTP,WebPayments,WebUSB,StandardCompliantNonSpecialSchemeURLParsing * disable-setuid-sandbox * disable-speech-api * enable-features NetworkServiceInProcess2,TracingServiceInProcess * in-process-gpu * touch-events auto * use-angle gl-egl * use-gl angle
I've had this issue lock up my system for a significant amount of time while testing 6.9, upon closing the browser. So I had the opportunity to SSH into my desktop from another machine and get a stack trace from Xorg when it was stuck in a busy loop (this is all inlibEGL_mesa.so.0.0.0) :
#0 _eglCheckResource (res=res@entry=0x562480243850, type=type@entry=_EGL_RESOURCE_IMAGE, disp=disp@entry=0x562460f71250) at ../src/egl/main/egldisplay.c:381 #1 0x00007f160c2839fa in _eglLookupImage (image=0x562480243850, disp=0x562460f71250) at ../src/egl/main/eglimage.h:148 #2 eglDestroyImageKHR (dpy=<optimized out>, image=0x562480243850) at ../src/egl/main/eglapi.c:1916 #3 0x00007f160c2e5042 in glamor_egl_destroy_pixmap (pixmap=0x562480244af0) at ../../../../../../glamor/glamor_egl.c:736 #4 0x00007f1617017e88 in amdgpu_glamor_destroy_pixmap (pixmap=0x562480244af0) at ../../src/amdgpu_glamor.c:191 #5 0x000056244e4ed023 in damageDestroyPixmap (pPixmap=0x562480244af0) at ../../../../../miext/damage/damage.c:1504 #6 0x000056244e4a5962 in XvDestroyPixmap (pPix=<optimized out>) at ../../../../Xext/xvmain.c:369 #7 0x000056244e4a430c in ShmDestroyPixmap (pPixmap=<optimized out>) at ../../../../Xext/shm.c:260 #8 0x000056244e42f59b in doFreeResource (res=0x562480243740, skip=skip@entry=0) at ../../../../dix/resource.c:888 #9 0x000056244e43087c in FreeClientResources (client=0x56246215f8e0) at ../../../../dix/resource.c:1154 #10 FreeClientResources (client=client@entry=0x56246215f8e0) at ../../../../dix/resource.c:1117 #11 0x000056244e406c1b in CloseDownClient (client=0x56246215f8e0) at ../../../../dix/dispatch.c:3550 #12 0x000056244e5874b4 in ospoll_wait (ospoll=0x562460d129d0, timeout=<optimized out>) at ../../../../os/ospoll.c:657 #13 0x000056244e57fccb in WaitForSomething (are_ready=0) at ../../../../os/WaitFor.c:208 #14 0x000056244e407707 in Dispatch () at ../../../../dix/dispatch.c:492 #15 0x000056244e40bbd4 in dix_main (argc=8, argv=<optimized out>, envp=<optimized out>) at ../../../../dix/main.c:274 #16 0x00007f161739aca8 in __libc_start_call_main (main=main@entry=0x56244e3f4380 <main>, argc=argc@entry=8, argv=argv@entry=0x7fff45f030b8) at ../sysdeps/nptl/libc_start_call_main.h:58 #17 0x00007f161739ad65 in __libc_start_main_impl (main=0x56244e3f4380 <main>, argc=8, argv=0x7fff45f030b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff45f030a8) at ../csu/libc-start.c:360 #18 0x000056244e3f43b1 in _start ()
This looks like the same stack trace as on this (fixed) chrome issue: https://issues.chromium.org/issues/40924506
Also discussed on these two mesa issues: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9220 and https://gitlab.freedesktop.org/mesa/mesa/-/issues/9426
They talk about the `VaapiVideoDecodeLinuxGL` feature being the culprit. But explicitly disabling that (and other vaapi features like `VaapiVideoDecoder` and `VaapiIgnoreDriverChecks`) doesn't help at all.
I'm on commit `98424c0f68de` in the qtwebengine repo (`a2620ffd1f76` in the qt repo) but I had this problem back on
Attachments
For Gerrit Dashboard: QTBUG-135047 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
634877,2 | NativeSkiaOutputDeviceOpenGL: Fix leaking X11 Pixmap | 6.8 | qt/qtwebengine | Status: NEW | 0 | 0 |
634033,2 | NativeSkiaOutputDeviceOpenGL: Fix leaking X11 Pixmap | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
634655,2 | NativeSkiaOutputDeviceOpenGL: Fix leaking X11 Pixmap | 6.9 | qt/qtwebengine | Status: MERGED | +2 | 0 |