casaroli opened a new pull request, #20766: URL: https://github.com/apache/nuttx/pull/20766
## Summary `nxsig_tcbdispatch()` woke a task that waited on a semaphore or a message queue with `EINTR` for any unmasked signal, also for one that is ignored, as `SIGCHLD` and `SIGWINCH` are by default. A `read()` from a pipe failed with `EINTR` when a child of the reader exited. POSIX discards an ignored signal: it does not interrupt a function. This PR discards an unmasked signal that has no action: the task is not woken, and the signal is not added to the pending signals. This includes the system call path, where the signal was added to the pending list before. A masked signal is pended as before. The second commit adds one sentence to the signals guide. ## Impact Blocking calls are no longer interrupted by ignored signals. Signals with an action interrupt them as before. ## Testing A test program on `qemu-armv8a:knsh` (QEMU 11 with HVF on an Apple M4, with `CONFIG_PIPES`): | Check | master | this PR | |---|---|---| | `read()` on a pipe while a child exits (`SIGCHLD` ignored); another child writes 1 s later | `-1`, `EINTR` | returns the byte | | `read()` on a pipe, `SIGUSR1` with a handler | `-1`, `EINTR` | `-1`, `EINTR` | `signest` in `ostest` passes on `qemu-armv8a:knsh` and `qemu-armv8a:nsh`. A first version of this change only skipped the wake-up and still pended the ignored signal: then a `SIGCHLD` from an earlier ostest step stayed pending until `signest` installed a handler for it, and `signest` lost one signal. `ostest` otherwise gives the same result as master (it stops only at `rr_test`, which fails on master too when the host is busy). `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
