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

QProcess::UnixProcessFlag::CloseFileDescriptors takes too long

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.8.3
    • Core: I/O
    • None
    • Ubuntu 25.04. with docker container
    • Linux/X11
    • Linux/X11

    Description

      We are running an application on a docker container, the host system is using Ubuntu 25.04. The application launches a Linux command periodically, with QProcess. To avoid issues with the open file handles, we pass QProcess::UnixProcessParameters.lowestFileDescriptorToClose parameter with the value 3.

      Expected result: Launch the external application without an additional wait.

      Actual result: The startup of the new process takes about 2 minutes.

      Suspected root cause: The docker container reports a maximum of 1073741816 file descriptor through the getrlimit(RLIMIT_NOFILE, &limit) function call, and the applyProcessParameters has a loop to iterate between [3, 1073741816[ range, and tries to close all filedescriptors in between.

      Recommended solution: List open file descriptors for the newly forked process, then call close() on them, instead of iterating through the whole range.

      Article about the issue can be found here

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            el_noir Ede Bittner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes