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

QProcessPrivate::waitForDeadChild() doesn't check forkfd_wait's return code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • dev
    • Core: I/O
    • None
    • 635774fc3 (dev), 6710ec26d (6.6), c81a9e4ed (tqtc/lts-6.5)

    Description

      GCC 13 in unity-builds sees this and complains:

      qprocess_unix.cpp:1256:42: error: ‘info.forkfd_info::code’ may be used uninitialized [-Werror=maybe-uninitialized]
       1256 |     exitStatus = info.code == CLD_EXITED ? QProcess::NormalExit : QProcess::CrashExit;
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      qprocess_unix.cpp:1251:17: note: ‘info.forkfd_info::code’ was declared here
       1251 |     forkfd_info info;
            |                 ^~~~
      qprocess_unix.cpp:1255:14: error: ‘info.forkfd_info::status’ may be used uninitialized [-Werror=maybe-uninitialized]
       1255 |     exitCode = info.status;
            |     ~~~~~~~~~^~~~~~~~~~~~~
      qprocess_unix.cpp:1251:17: note: ‘info.forkfd_info::status’ was declared here
       1251 |     forkfd_info info;
            |                 ^~~~
      

      Indeed, EINTR does not appear to be the only possible error code. I'd fix it myself, but I have no idea what we should set exitCode and exitStatus to if forkfd_wait fails.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes