test/syscalls: add recvfrom restart regression test#13211
Merged
copybara-service[bot] merged 1 commit intoMay 22, 2026
Conversation
Signed-off-by: Zi Li <zi.li@linux.dev> Signed-off-by: Amaindex <amaindex@outlook.com>
9a0093a to
9fe6941
Compare
Contributor
Author
Contributor
|
thanks a lot! |
copybara-service Bot
pushed a commit
that referenced
this pull request
May 22, 2026
This adds regression coverage for the `recvfrom` restart behavior fixed by #13212. The test covers this syscall shape on a Unix `SOCK_SEQPACKET` socket: ```c recvfrom(fd, nullptr, 0, MSG_TRUNC | MSG_PEEK, nullptr, nullptr) ``` Linux restarts this syscall when the blocking thread receives a signal whose handler was installed with `SA_RESTART`. The test installs a `SIGURG` handler with `SA_RESTART`, interrupts the blocked `recvfrom`, then sends one packet and expects `recvfrom` to return the packet length. This syscall shape is relevant to runc's sync socket packet-length probe, which is the path mentioned in #13179. Related to #13179. Regression coverage for #13212. **Local verification** ```bash make test TARGETS=//test/syscalls:socket_non_stream_blocking_local_test_native \ OPTIONS="--test_output=errors --nocache_test_results" ``` Result: **PASS** ```bash make syscall-tests TARGETS=//test/syscalls:socket_non_stream_blocking_local_test_runsc_systrap_directfs \ OPTIONS="--test_output=errors --nocache_test_results" ``` Result: **PASS** FUTURE_COPYBARA_INTEGRATE_REVIEW=#13211 from Amaindex:issue13179-recvfrom-restart 9fe6941 PiperOrigin-RevId: 919831639
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.
This adds regression coverage for the
recvfromrestart behavior fixed by #13212.The test covers this syscall shape on a Unix
SOCK_SEQPACKETsocket:Linux restarts this syscall when the blocking thread receives a signal whose handler was installed with
SA_RESTART. The test installs aSIGURGhandler withSA_RESTART, interrupts the blockedrecvfrom, then sends one packet and expectsrecvfromto return the packet length.This syscall shape is relevant to runc's sync socket packet-length probe, which is the path mentioned in #13179.
Related to #13179.
Regression coverage for #13212.
Local verification
Result: PASS
make syscall-tests TARGETS=//test/syscalls:socket_non_stream_blocking_local_test_runsc_systrap_directfs \ OPTIONS="--test_output=errors --nocache_test_results"Result: PASS