casaroli opened a new pull request, #3947:
URL: https://github.com/apache/nuttx-apps/pull/3947

   ## Summary
   
   `mqueue_test` wakes up its receiver thread with `pthread_kill(receiver, 
SIGUSR1)` and expects only that `mq_receive()` is interrupted. Nothing catches 
the signal. With `CONFIG_SIG_SIGUSR1_ACTION`, SIGUSR1 has its POSIX default 
action, which ends the whole process, so ostest ends in `mqueue_test` 
("mqueue_test: Killing receiver", exit status 256).
   
   The second commit installs a handler that does nothing for SIGUSR1 during 
the test (with `CONFIG_ENABLE_ALL_SIGNALS`, which `sigaction()` needs) and 
restores the old action at the end. The first commit fixes an nxstyle error in 
the same file (checkpatch checks the whole file).
   
   This happens on master in the flat build. In a kernel build the receiver 
does not get the signal on master, because of a kernel bug that 
apache/nuttx#NNNNN (`sched/signal: Release the signals pending for a thread 
when it exits.`) fixes; with that fix, the kernel build also ends in 
`mqueue_test`. Merge order: this PR first, then the NuttX PR, which has a 
`depends-on` line for this PR.
   
   ## Impact
   
   ostest only. Without `CONFIG_SIG_SIGUSR1_ACTION` the test behaves as before. 
Not a breaking change.
   
   ## Testing
   
   ostest exit status on QEMU with HVF, `CONFIG_SIG_SIGUSR1_ACTION`, 
`CONFIG_SCHED_CHILD_STATUS` and `CONFIG_CANCELLATION_POINTS`:
   
   | NuttX | apps | qemu-armv8a:knsh | qemu-armv8a:nsh | qemu-armv8a:nsh + 
`CONFIG_SIG_DEFAULT` |
   |---|---|---|---|---|
   | master | master | no end: assertion in `signest_test` (the kernel bug) | 0 
| 256: ends in `mqueue_test` |
   | master | this PR | 0 | 0 | 0 |
   | the NuttX PR | master | 256: ends in `mqueue_test` | 0 | 256: ends in 
`mqueue_test` |
   | the NuttX PR | this PR | 0 | 0 | 0 |
   
   NuttX master is 23f5a4f06df (7505b874722, #21072, does not build for arm64: 
`lib_libvsprintf.c`, `-Werror=shadow`; fixed by #21210); rows 2 and 3 are from 
the earlier NuttX base 3122150b1f1. `CONFIG_SIG_DEFAULT` gives SIGUSR1 its 
default action in the flat build; the knsh defconfig has it.
   
   Build: qemu-armv8a:nsh with `CONFIG_ENABLE_PARTIAL_SIGNALS` (no 
`sigaction()`) and with `CONFIG_SIG_SIGUSR1_ACTION`; qemu-armv8a:knsh; 
rv-virt:pnsh64; mps2-an500:knsh. All OK, no warning in `mqueue.c`.
   
   `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]

Reply via email to