Repository navigation
Conversation
Map freebsd/x64 to Ghidra's freebsd_x86_64 native directory (found under build/os in FreeBSD packages), expect ELF native tools, and accept a JVM reporting os.name=FreeBSD.
BSD ps treats everything after the first '=' in -o as the column header, so pass one -o per column. FreeBSD has no 'sess' keyword; use 'sid' there. Without procfs, read process identities on FreeBSD from one ps snapshot: lstart as the start identity, plus parent, process group, effective UID and zombie/exiting state. FreeBSD ps exits 1 without output when none of the requested PIDs exists; report those PIDs as absent. This lets owned-process baselines and cleanup revalidation work, which the Ghidra provider requires to launch Java.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR changes FreeBSD host recognition and shared process workflows. Fix the existing process finalization tests before merging; the new FreeBSD paths bypass their fake commands.
|
| if (platform === "darwin" || platform === "freebsd") | ||
| return { command: "/bin/ps", source: "system" }; |
There was a problem hiding this comment.
Cancellation tests bypass their fixtures
The existing tests in processObservationCommandFinalization.test.ts use freebsd to select a fake ps from PATH. The sampler and freebsd-list cases now run the real /bin/ps, so the fake command never writes its ready marker and the tests fail on non-Windows hosts. The freebsd-environment case also fails because the read now rejects before starting the fake command.
Update these tests to inject the subprocess boundary, and test the environment refusal separately. Keep the assertions that cancellation waits for the child to exit.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/process/systemPs.ts
Line: 66-67
Comment:
**Cancellation tests bypass their fixtures**
The existing tests in `processObservationCommandFinalization.test.ts` use `freebsd` to select a fake `ps` from `PATH`. The sampler and `freebsd-list` cases now run the real `/bin/ps`, so the fake command never writes its ready marker and the tests fail on non-Windows hosts. The `freebsd-environment` case also fails because the read now rejects before starting the fake command.
Update these tests to inject the subprocess boundary, and test the environment refusal separately. Keep the assertions that cancellation waits for the child to exit.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
Builds on #7174 by @ocochard (Olivier Cochard-Labbé). This branch preserves his original commits,
4cbbed0667and74d78d6f72, and brings the proposal forward to currentmain. The goal is Ghidra analysis on FreeBSD/amd64 with the same ownership and cleanup guarantees expected on existing hosts.This draft stages Ghidra installation recognition and process inspection. Owned launches are refused on FreeBSD while the process authority questions below are open. This draft requests a scope decision and FreeBSD validation, including which shared process entry points are in scope.
Changes
/bin/ps, separate output columns, and thesidkeyword. Preserve current Linux and macOS command selection, Linux tracing arguments, and typed cancellation.ps ewwoutput combines argv with environment and cannot authenticateREA_PROCESS_RUN_ID.Scope and proof still needed
lstartis formatted at one-second precision, and FreeBSD PID allocation can use randomized increments. A nativekinfo_procreader can expose subsecond start time, but visibility failures still need an explicit unavailable state. Start time formatting · PID allocation · Process visibilityrea doctorand Ghidra decompilation with a supported Node, JDK, and Ghidra. Exercise cleanup with live children, hidden or unreadable PIDs, exit, cancellation during finalization, and retry before declaring support.Evidence
npm run check:fastpassed. The focused macOS/arm64 run passed 552 tests across 30 files with 2 skips.