Repository navigation
test(issue2793): expand /dev/tcp|udp delivery pins; UDP reply cell locked to GNU byte-wise read (Refs #2793) - #3361
Merged
Merged
Conversation
Two extension cells for the Linux face: a foreign child (python3) reading its inherited fd 3 directly, and the /dev/udp persistent-fd form (exec 3<> + printf >&3 + read -u 3). The UDP reply expectation is locked to GNU's byte-wise read: builtins/read.def:736 calls zread (fd, &c, 1) on the plain line path, so the first 1-byte recv consumes the whole datagram and the kernel discards the rest; the read then blocks until -t expires and returns 142 with line holding just "p". GNU bash 5.3.20 oracle measured this shape at -t 5 and -t 1 (rc 142, line:[p]); rubash is byte-identical. The previous whole-line expectation was never GNU-measured. -t is 1 so the cell costs ~1s. Test-only change; the Windows delivery face of the issue is out of scope for this commit.
caomengxuan666
marked this pull request as ready for review
November 11, 2026 13:48
This was referenced Nov 12, 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.
Refs #2793
内容
tests/issue2793_devtcp_external_delivery.rs扩钉(单文件):茎内原 4 格不动,新增两格,其中一格的期望按 GNU 实测订正。issue2793_foreign_child_reads_inherited_devtcp_fd3:真外来子进程(python3)直接读继承的 fd 3(非 stdin dup 形),锁 socket fd 按号交付。issue2793_udp_fd_sends_datagram_and_reads_reply:/dev/udp 持久 fd 形(exec 3<>+printf >&3+read -u 3)。发送方向锁服务端收包逐字一致;回复读回的期望按下节订正。UDP 格期望的 GNU 出处与定界结论
原期望
line:[pong-udp](整行读回)从未在 GNU 上跑出过。定界探针(GNU bash 5.3.20 oracle,同形脚本文件)实测:UDP 形rc:142、line:[p];fifo 字节流对照形才整行读回。机制在 GNU 源码:builtins/read.def:736普通行读路径逐字zread (fd, &c, 1)——一次 read(2) 只取 1 字节;数据报 socket 上首读整包消费、余字节被内核丢弃,其后读阻塞至-t超时,返回已得的p与 rc 142。rubash 与 GNU 逐字同形,属钉期望缺陷,产品零改动。本格期望改为实测形(脚本加印rc:$?,期望rc:142+line:[p]),read -t 10缩为-t 1(-t 1 形已在 oracle 与 rubash 双边重测,测得值不变,整格约 1s),保留作「数据报逐字节读」回归锁。性质与口径
f5f65d35全绿(box 复跑,逐格结果见车道报告续节)。本 PR 删除了什么
无。
验证
cargo fmt --checkrc=0(数字见车道报告续节)。rc:142、line:[p])。