-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading child /proc/<pid>/stat after exec #1353
Comments
Thanks for reporting the issue. This is a known issue where procfs in WSL does not handle zombie processes correctly. Can you please let us know what scenario this is blocking so we can prioritize? |
I linked the scenario in it exists above. It's how the chromium base library gets the parent process id of a given process id, independent of parent/child relationship of the caller. [There's no explicit posix construct for such a thing.] |
This should work better starting in Insider Build 17713 |
Brian - #2786 too then probably (it was almost duped) |
@therealkenc -- agreed, added a comment there as well. |
fwiw, indeed it isn't dumb luck that the process entry is still around after the process exits. Until a call to |
MSFT addressed this in Windows 10 build 17713, but that's not included in any public releases yet, so keep that around for a little while longer. ref microsoft/WSL#2786 ref microsoft/WSL#1353
This one is painful to look at. The test case below tries to open
/proc/<pid>/stat
on a process that is just about to die. I'd call the whole construct "broken", but it exists.You can make an awfully strong case that the child process isn't guaranteed to be alive at the point the
stat
file is opened in the parent, but for reasons, this always seems to be the case on Real Linux™. WSL strace here and Linux strace here. Don't dwell on the straces though; the error isNo such file or directory
on/proc/pid/stat
because that process is gone.[edit- delete poor speculation]. Whatever the reason, it isn't dumb luck; you can uncomment the
sleep()
call after theelse
, but no matter how long you hang around, theproc/<pid>
entry is still there long after the child/bin/echo
process has had a chance to finish. 14959.The text was updated successfully, but these errors were encountered: