Repository navigation
feat(libkernel_sys): implement profil argument checks - #11026
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Requesting changes for an unrelated implementation included in this profil PR. The diff also removes the swapon stub from Export.Discovery.cpp, adds a four-argument swapon declaration, implements path validation and host filesystem checks for swapon in Export.cpp, and adds GuestEnotblk. None of this is described in the PR's What/Test sections, has no tests here, and is a separate API topic. This conflicts with the repository's one-topic-per-PR rule.
Please remove the swapon changes from this branch; if that behavior is still wanted, submit it as a separate change after checking overlap and documenting/testing its contract. The profil portion itself follows FreeBSD 11.4's scale limit and scale-zero behavior (sys_profil): https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/kern/subr_prof.c#L1988-L2025. The local and hosted product jobs are skipped, so I have not independently run the reported Windows test.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
708eff4 to
69ead78
Compare
|
Thanks, you're right: the |
|
Tested head
AI-assisted: yes (Claude Code); results above were run on this machine. |
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 against FreeBSD 11.4 |
What
profilwas a throwing stub in libkernel_sys. FreeBSD 11.4'ssys_profilfails withEINVALwhenscaleis above1 << 16, stops profiling and returns 0 whenscaleis 0, and otherwise records the buffer and starts the profiling clock. It never reads thesamplespointer at call time; the clock does that on each tick.profilin libkernel_sys now returnsEINVALfor ascaleabove1 << 16and 0 for ascaleof 0 (profiling is never on, so there is nothing to stop). A non-zeroscalestill throwsNotImplemented_nid_no_patch, because the profiling clock that fills the sample buffer is not modelled. The declaration inApi.hppnow carries the real four arguments.Tested
Windows 11 (10.0.26200), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
-DBUILD_TESTING=ON.guest_kernel_sys:scaleof(1 << 16) + 1and0xFFFFFFFFgive-1withEINVAL;scale0 returns 0 with a null buffer and with the unreadable address0x10(the pointer is not dereferenced). Onmainthe test does not build against the stub, which takes no arguments; with this change it passes 3 runs out of 3. The non-zeroscalethrow is not asserted.main: the same tests fail on both under load (pr_overlap_encoding,public_headers,agc_import_settle_initial_dcc,agc_host_import_cut_lifetime,agc_driver_depth_plane_partial_store,audio_out2_timing,guest_job_manager_failures,guest_pthread_start,guest_pthread_rwlock,guest_select,guest_mutex_contention,guest_named_shm_windows_short_temp);guest_ampr_threadsfails intermittently on both (0 of 4 onmain, 3 of 4 here). No build failures on either.python tools/check_conventions.py --base upstream/main: passes.Overlaps
tools/pr_overlap.py: feat(libkernel): implement four pthread_attr forms #9156 (neighbouring stub inExport.Discovery.cpp), feat(libkernel_sys): implement sigqueue #9389 (Export.cppL335) and feat(libkernel_sys): implement is_in_sandbox #10421 (GuestKernelSys.cppL532). Proposed on each that it goes first and this PR rebases.swaponimplementation by mistake. That is removed;swaponis only in feat(libkernel_sys): implement swapon #11034.Checklist
main; no other open PR implements the same functionNotImplemented_nid_no_patch); no silent stubs added.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code