Repository navigation
Close most of the Linux gaps go-stdtest finds - #366
Merged
Merged
Conversation
go-stdtest runs Go's time, syscall, os, and runtime tests on hcpu, and failed 9, 36, and 1 to 2 top-level tests on every host. These were gaps in the Linux personality, not hypervisor bugs or regressions: the skip list PR 348 emptied only ever held tests that stop a whole package. Now 1, 4, and 2 fail (the 2 in runtime are timing tests that flake under load). syscall and runtime: - setrlimit and prlimit64 keep limits per thread group (Group.rlims), inherited by fork and kept by execve, and prlimit reaches another process by pid (Host.prlimitOf). setrlimit was a no-op and prlimit on another pid was EPERM (TestPrlimitFileLimit, TestPrlimitOtherProcess). - mincore reports mapped pages resident, with EINVAL and ENOMEM as Linux's (TestMincoreErrorSign); it was ENOSYS. - faccessat2 checks its flags, and access its mode (TestFaccessat). - capget answers for root, capset succeeds, and prctl keeps PR_SET_KEEPCAPS per thread (TestAllThreadsSyscall*). - clone3 with CLONE_NEWTIME is EPERM, as the other namespaces are (TestCloneTimeNamespace now skips). - recvmsg sets MSG_CMSG_CLOEXEC in msg_flags when asked, as Linux does. - /dev/tty is ENXIO with no pty and a console that isn't a terminal, so programs see no controlling terminal (TestForeground skips). os: - getcwd of a path of 4096 bytes or more is ENAMETOOLONG; it was cut short, and Go's Getwd trusted it (TestGetwdDeep*). - overlay: utimensat sets the access time, and an overlay's own file keeps both times' nanoseconds (Node.atimens, mtimens, ovsetattr), as the union's member does (TestChtimes*, TestRootChtimes). - fchmodat2 is served (TestRootChmod); chown, lchown, and fchownat fail where the walk does instead of always succeeding. - A path ending in / or /. follows a link at its end even for lstat and lchown and has to be a directory, and a link target ending in / is ENOTDIR on a file (followlink), as on Linux (TestSymlinkWithTrailingSlash, TestRootConsistency*). - A name over NAME_MAX is ENAMETOOLONG; rename of . or .. is EBUSY; rmdir of . is EINVAL and of .. ENOTEMPTY; rmdir through a file is ENOTDIR; an O_CREAT open of a dangling link creates its target; a directory opened without O_DIRECTORY reads as EISDIR; and a link of a symbolic link is a new link with its target, where the overlay's copy took the target's contents (TestRoot*). - epoll_ctl refuses a file or directory in a host tree or an overlay with EPERM, as Linux does a regular file, so Go's poller does blocking I/O and SetDeadline is ErrNoDeadline (TestNonpollableDeadline). Still failing: TestHardLink and TestLongPath (the overlay copies on link, by design), TestRootRenameAfterOpen (an *at call names its dirfd by path), TestMkdirStickyUmask (no sticky bit), and TestSCMCredentials (a zero-length datagram isn't sent). Two [linux-personality] cases, rlimits and path_edges, cover these, and spec/abi-linux.md says what changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LLcnT2gLNBWB16tLexq4N6
Owner
Author
|
Test results, from a Linux amd64 container on hcpu with a ReleaseSafe build. The container has no KVM.
Still to check: go-stdtest and the KVM, HVF, WHP, and sud integration on the AWS hosts, and the arm64 and 386 roots. The Generated by Claude Code |
7 tasks
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.
Requested by Jeff · project thread
zig build go-stdtest -Doptimize=ReleaseSafefailed on h9-linux-amd and h9-mac. The cause wasn't KVM or HVF, and it wasn't a regression. go-stdtest runs on hcpu, and the skip list that PR 348 emptied only ever held tests that stop a whole package. Every other failure was counted and left in the output. The failing tests were the same on both hosts and in a Linux container: 9 in syscall, 36 top-level tests in os, and 1 or 2 in runtime. With this PR, 1, 4, and 2 fail, and the 2 in runtime are timing tests that flake under load.syscall and runtime
setrlimitandprlimit64keep limits per thread group (Group.rlims). A fork inherits them, andexecvekeeps them.prlimitreaches another process by pid through a newHost.prlimitOf. Before this,setrlimitdid nothing, andprlimiton another pid was EPERM.mincorereports mapped pages as resident, with Linux's EINVAL and ENOMEM. It used to be ENOSYS.faccessat2checks its flags, and access checks its mode.capgetanswers for root, andcapsetsucceeds.prctlkeepsPR_SET_KEEPCAPSper thread, andexecveclears it.clone3withCLONE_NEWTIMEis EPERM, like the other namespaces.recvmsgsetsMSG_CMSG_CLOEXECinmsg_flagswhen the caller asks for it./dev/ttyis ENXIO when there's no pty and the console isn't a terminal, so the program sees no controlling terminal. This changes behavior for runs whose console isn't a tty.os
getcwdof a path of 4096 bytes or more is ENAMETOOLONG. It used to cut the path short silently.utimensatsets the access time, and a file in the overlay itself keeps both times' nanoseconds (Node.atimensandmtimens, through a newovsetattr). A write or truncate still sets whole seconds.fchmodat2is served.chown,lchown, andfchownatnow fail where the walk to the name fails, instead of always succeeding./or/.follows a link at its end, even forlstatandlchown, and has to name a directory. A link target that ends in/and resolves to a file is ENOTDIR (followlinkin chan.zig).renameof.or..is EBUSY.rmdirof.is EINVAL,rmdirof..is ENOTEMPTY, andrmdirthrough a file is ENOTDIR.O_CREATopen of a dangling link creates the link's target. A directory opened withoutO_DIRECTORYreads as EISDIR.linkof a symbolic link makes a new link with the same target. The overlay's copy used to take the target's contents instead.epoll_ctlrefuses a file or directory in a host tree or an overlay with EPERM, the way Linux refuses a regular file. Go's poller then does blocking I/O on it.Still failing
linkinstead of linking it, by design.*atcall names its dirfd by path.Threads sharing the working directory, which TestProgWideChdir checks, came in through #363.
There are two new [linux-personality] cases,
rlimitsandpath_edges, andspec/abi-linux.mddescribes the changes.Generated by Claude Code