Details
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
For Gerrit Dashboard: QTBUG-68472 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
230434,4 | forkfd: Restore errno on exit from the SIGCHLD handler | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |
230931,1 | forkfd: Restore errno on exit from the SIGCHLD handler | 5.9 | qt/qtbase | Status: ABANDONED | +2 | 0 |