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

Using `QProcess::startDetached()` keeps Zygote processes around after application quits

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.5.2
    • WebEngine
    • None
    • Linux/X11
    • daf13fea1 (112-based), 96a787417 (122-based)

      With something like:

      #include <QtWidgets/QApplication>
      #include <QtWebEngineWidgets/QWebEngineView>
      #include <QtCore/QProcess>
      #include <QtCore/QTimer>
      
      int main(int argc, char *argv[]) {
          QApplication app(argc, argv);
          QWebEngineView view;
          view.load(QUrl("https://qt.io"));
          view.show();
      
          QProcess::startDetached("qtcreator");
          QTimer::singleShot(5000, &app, &QApplication::quit);
          return app.exec();
      }
      

      The following processes will stick around after the application has exited:

      /usr/lib/qt6/QtWebEngineProcess --type=zygote --no-zygote-sandbox --application-name=qtbug-zygote --webengine-schemes=qrc:sV --lang=en
      /usr/lib/qt6/QtWebEngineProcess --type=zygote --application-name=qtbug-zygote --webengine-schemes=qrc:sV --lang=en
      

      Only when the subprocess (e.g. Qt Creator) quits, those stray Zygote processes exit as well.

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

            pvarga Peter Varga
            the compiler Florian Bruhin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes