The `build_proc` function in procinfo recursively walks the process
tree to build child process information. If a cycle exists in the
parent PID chain (which can happen on Windows in particular due to PID
reuse or race conditions during process snapshot enumeration),
the recursion never terminates and overflows the stack.
Add a `visited` HashSet to track already-visited PIDs and skip them,
preventing infinite recursion. Applied to all three platforms (Windows,
Linux, macOS)
Fixes#7705
Related: #6671