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

UB in QProcessPrivate::startDetached()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.6.0 FF
    • Core: I/O
    • None
    • Linux/X11
    • e71c226d6 (dev), 0dc6ccbc5 (6.6), bd32c7d70 (dev)

    Description

      Following commit c5c7712910f5de454ee0d9a30b9a848d023bb543, CodeChecker complains (report-ID: 1330341), about the code run in the child process immediately after the doFork() call, including a signal() call, that

      This function call is prohibited after a successful vfork

      Indeed, we're in the child process here and the vfork man-page says, explicitly:

      (From POSIX.1) The vfork() function has the same effect as
      fork(2), except that the behavior is undefined if the process
      created by vfork() either modifies any data other than a variable
      of type pid_t used to store the return value from vfork(), or
      returns from the function in which vfork() was called, or calls
      any other function before successfully calling _exit(2) or one of
      the exec(3) family of functions.

      It is possible this UB is more nominal than actual, but the code should at least contain a justification for ignoring the fact that it's UB.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            Eddy Edward Welbourne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes