Skip to content

test/syscalls: add recvfrom restart regression test#13211

Open
Amaindex wants to merge 1 commit into
google:masterfrom
Amaindex:issue13179-recvfrom-restart
Open

test/syscalls: add recvfrom restart regression test#13211
Amaindex wants to merge 1 commit into
google:masterfrom
Amaindex:issue13179-recvfrom-restart

Conversation

@Amaindex
Copy link
Copy Markdown
Contributor

@Amaindex Amaindex commented May 19, 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:

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

make test TARGETS=//test/syscalls:socket_non_stream_blocking_local_test_native \
  OPTIONS="--test_output=errors --nocache_test_results"

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

Signed-off-by: Zi Li <zi.li@linux.dev>
Signed-off-by: Amaindex <amaindex@outlook.com>
@Amaindex Amaindex force-pushed the issue13179-recvfrom-restart branch from 9a0093a to 9fe6941 Compare May 21, 2026 05:41
@Amaindex Amaindex marked this pull request as ready for review May 21, 2026 05:41
@Amaindex
Copy link
Copy Markdown
Contributor Author

Quick update: #13212 has landed, so I rebased this onto the fixed baseline and marked it ready for review.

This is now just regression coverage for the reduced recvfrom case from #13179/#13212. I re-ran the native and runsc systrap/directfs targets locally after the rebase, and both pass.

@milantracy
Copy link
Copy Markdown
Contributor

thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants