Repository navigation
testing/ostest: Add a test of close() during poll(). - #3980
Merged
Merged
Conversation
Another thread closes the read end of a pipe while the main thread is in poll() on it. When poll() ends the read end must be gone, so the write end reports POLLERR, and no driver may keep a pointer to the entry of that poll(). Option TESTING_OSTEST_POLL_CLOSE selects the test. It is on unless DEFAULT_SMALL is set. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
xiaoxiang781216
approved these changes
Nov 5, 2026
casaroli
marked this pull request as ready for review
November 6, 2026 07:45
acassis
approved these changes
Nov 6, 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
A test of
close()duringpoll()for apache/nuttx#21490.poll_close_test()in ostest: another thread closes the read end of a pipe while the main thread is inpoll()on it. Whenpoll()ends the read end must be gone, so the write end reportsPOLLERR, and no driver may keep a pointer to the entry of thatpoll().Impact
A new file in ostest and the option
CONFIG_TESTING_OSTEST_POLL_CLOSE. It depends onPIPESand on pthreads, and it is on unlessDEFAULT_SMALLis set. No change to any other code.This test fails on NuttX master until apache/nuttx#21490 merges, so this PR must merge after it.
Testing
ostest under QEMU:
qemu-armv8a:knsh(kernel)POLLERR, then kernel panicqemu-armv8a:nsh(flat)POLLERR, status 256rv-virt:knsh64(kernel)mps2-an500:knsh(protected)Make builds only; CMake was not built.
tools/checkpatch.sh -c -u -m -gpasses.