Repository navigation
test(libkernel): remove a leftover kernel_fcntl_probe.bin before guest_kernel_fcntl opens it - #9425
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The pre-run cleanup is a focused fix for the stale-file failure you reproduced, and the Windows negative-control/repeat runs are useful. Two repository follow-ups remain:
-
The overlap report could not compare this test file with open #6044. I checked #6044's changed-file list: it moves
core/libs/tests/GuestKernelFcntl.cpptocore/libs/tests/files/GuestKernelFcntl.cpp. This change edits the old path, so the landing order determines whether the cleanup line survives. Please coordinate with #6044's author and declare the agreed order onDepends on, then refresh the overlap check. #9256 also touches this test file at the end of the same test, as your description notes; preserve both changes when coordinating. -
This branch compares 417 commits behind current
main, while the reported Windows test used0c6a5bd59. Please rebase onto currentmainand rerunguest_kernel_fcntlthere; no Linux, macOS, or current-base result is reported.
Hosted eligibility, conventions, intake, and labels pass; full Linux and Windows product jobs are skipped. I did not run the test locally because there is no matching checkout/build in the workspace.
…t_kernel_fcntl opens it FileFlagsRoundTrip opens kernel_fcntl_probe.bin with O_CREAT but without O_TRUNC and removes it only when every check passes. A run that aborts leaves the file behind, and every later run then fails at the FIONREAD check because the file is longer than the five bytes the test writes. The test now removes the file before opening it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
6c5d8fc to
84fc359
Compare
|
Rebased on d6e7ab4 (the branch was 417 commits behind). Order with #6044, which moves Not run: Linux and macOS, repeated runs on the rebased branch, and the full ctest. AI-assisted: yes |
|
Thanks. Rebased on d6e7ab4 (see my earlier comment). On #6044: it is open, conflicts with main and moves |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 84fc3594b8edd99c9468850381f1ec8df8e95f62 against author merge base d6e7ab42dfe191818721c6c5ad9aee4070b434aa.
Approve. No actionable findings in this single fixture-cleanup line.
The added remove targets the same fixed probe file created and already removed at the end of FileFlagsRoundTrip. It runs before the first open, so an interrupted earlier run cannot leave an existing file influencing creation-time flags. Ignoring a missing file is appropriate; the existing open/assertions still fail if cleanup or creation cannot proceed. Reviewed surrounding open/close ownership and later append checks.
Validation: exact head and baseline GuestKernelFcntl.cpp passed GCC C++23 syntax compilation. Conventions, whitespace and registration passed. This review covers the cleanup change; no linked guest fcntl runtime or hosted native pass is claimed (hosted native jobs were skipped).
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Checked that the added |
What
FileFlagsRoundTripinguest_kernel_fcntlopenskernel_fcntl_probe.binwithO_CREATbut withoutO_TRUNC, and removes it only at the end, after every check has passed. A run that aborts earlier leaves the file behind. Every later run then starts from that file and fails at theFIONREADcheck (readable == 3after writingabcdeand seeking to 2), because the file is longer than five bytes, until someone deletes it by hand. The test now removes the file before it opens it.I hit this while repeating the negative control of #9256: that run aborts after writing
abcdeandab, leaving 7 bytes, andmain'sguest_kernel_fcntlthen failed until the file was deleted.Tested
Windows 11 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0 r7, CMake + Ninja, Release,
-DBUILD_TESTING=ON, onmain0c6a5bd.kernel_fcntl_probe.bin(abcdeab) placed in the test's working directory,main'sguest_kernel_fcntlfails (exit 0xc0000409; a temporary line probe, not in this PR, showed the failing check at line 241).python tools/check_conventions.py --base origin/mainpasses.O_TRUNCapplies there;std::removeis already used at the end of this function), the full CTest run, and a title.tools/pr_overlap.pywas not run (it needsgh). fix(libkernel): change O_APPEND on a Windows file through fcntl #9256 edits the end of the same function, away from this line.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)