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

sigchld_handler() doesn't restore errno

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.11.0
    • Fix Version/s: 5.11.1
    • Component/s: Core: I/O
    • Labels:
      None
    • Commits:
      28ab81158feced7122b1655cbe1418343fe5db68

      Description

      In qtbase/src/3rdparty/forkfd/forkfd.c a signal handler is registered for SIGCHLD. In a comment in the signal handler function there's a link to a web page (http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03) giving some guidance on what can be done in signal handlers.

      The page gives this advise:

      "Operations which obtain the value of errno and operations which assign a value to errno shall be async-signal-safe, provided that the signal-catching function saves the value of errno upon entry and restores it before it returns."

      sigchld_handler() in forkfd.c doesn't follow this. For example it calls waitid(), but doesn't save or restore errno in any way.

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            khuttun Kalle Huttunen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes