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

QML QtWebEngine file descriptor leak if using OpenGL context sharing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0
    • WebEngine
    • None
    • Raspberry Pi 4 / Raspbian 10 / Xcb
    • Linux/X11

    Description

      My application extensively uses QML WebEngineView components (and various other) to be instantiated on demand using `Loader`. On a long run application (actually less then 1 day on certain circumstances) crashes with:

       

      [25627:25742:0613/181714.743607:FATAL:zygote_communication_linux.cc(91)] : Too many open files (24)
      Trace/breakpoint trap (core dumped)

       

      Following analysis reveals the fact that QML WebEngineView component doesn't clean up open file descriptors on destruction. I have prepared minimal test case to reproduce the issue, test case have 3 cases (switched via variable in `webleaks.qml` file) producing various scenarios and file descriptor leak patterns.

       

      In order to run test, please use `qmlscene` utility because `qml` utility have no option to set AA_ShareOpenGLContext. Which in turn results into performance degradation. On the other hand descritors are not leaked (at least no so dramatically). Same behavior (poor performance/no leaks) could be achieved with `-disable-context-sharing` or `-software` options for `qmlscene` utility.

       

      How to test:

      1. Modify `webleaks.qml` to set testcase.
      2. Run `qmlscene ./webleaks.qml`
      3. Check filedescriptors with: `ls -l /proc/$(pgrep -f webleaks)/fd`

       

      There are various descriptor leaks but most of them introduced only once per application, however 2 types of descriptors leaked over time:

       

      1. /dev/shm/.org.chromium.Chromium.XXXXXX (deleted)
      2. anon_inode:sync_file

       

       

      Attachments

        1. webleaks.qml
          1 kB
        2. webvideo.qml
          0.8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            michal Michal Klocek
            romanvalov Roman Valov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes