Repository navigation
testing/ostest: Catch the SIGUSR1 that wakes up the mqueue receiver. - #3947
Merged
Merged
Conversation
Align the printf() of a corrupt message in receiver_thread() and its arguments. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
mqueue_test wakes up its receiver thread with pthread_kill(SIGUSR1) and expects only that mq_receive() is interrupted. Nothing caught the signal. With CONFIG_SIG_SIGUSR1_ACTION, SIGUSR1 has its POSIX default action, and the default action ends the whole process: ostest stopped in mqueue_test. Install a handler that does nothing for SIGUSR1 during the test, and restore the old action at the end. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
xiaoxiang781216
approved these changes
Oct 31, 2026
acassis
approved these changes
Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mqueue_testwakes up its receiver thread withpthread_kill(receiver, SIGUSR1)and expects only thatmq_receive()is interrupted. Nothing catches the signal. WithCONFIG_SIG_SIGUSR1_ACTION, SIGUSR1 has its POSIX default action, which ends the whole process, so ostest ends inmqueue_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, whichsigaction()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#21216 (
sched/signal: Release the signals pending for a thread when it exits.) fixes; with that fix, the kernel build also ends inmqueue_test. Merge order: this PR first, then the NuttX PR, which has adepends-online for this PR.Impact
ostest only. Without
CONFIG_SIG_SIGUSR1_ACTIONthe test behaves as before. Not a breaking change.Testing
ostest exit status on QEMU with HVF,
CONFIG_SIG_SIGUSR1_ACTION,CONFIG_SCHED_CHILD_STATUSandCONFIG_CANCELLATION_POINTS:CONFIG_SIG_DEFAULTsignest_test(the kernel bug)mqueue_testmqueue_testmqueue_testNuttX 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_DEFAULTgives SIGUSR1 its default action in the flat build; the knsh defconfig has it.Build: qemu-armv8a:nsh with
CONFIG_ENABLE_PARTIAL_SIGNALS(nosigaction()) and withCONFIG_SIG_SIGUSR1_ACTION; qemu-armv8a:knsh; rv-virt:pnsh64; mps2-an500:knsh. All OK, no warning inmqueue.c.tools/checkpatch.sh -c -u -m -gpasses.