Repository navigation
proc: skip TID 0 when listing /proc - #15327
Merged
Merged
Conversation
IDOfThreadGroup can return 0 after deleteTask at Zombie->Dead, which made readdir(/proc) emit a /proc/0 dirent. Linux has no such directory. Test: ProcTask.ProcRootNeverListsZeroTID fails if "0" appears during reap churn and passes after the skip. Assisted-by: Cortex Code
copybara-service
Bot
force-pushed
the
test/cl993932500
branch
3 times, most recently
from
October 6, 2026 03:18
ffb1f94 to
e98d386
Compare
PiperOrigin-RevId: 994106764
copybara-service
Bot
force-pushed
the
test/cl993932500
branch
from
October 6, 2026 04:47
e98d386 to
131e784
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
proc: skip TID 0 when listing /proc
Summary
Skip
IDOfThreadGroup == 0intasksInode.IterDirentsso readdir(/proc) never emits a/proc/0dirent.IDOfThreadGroupcan return 0 afterdeleteTaskat Zombie→Dead while a directory listing is in progress. Linux has no/proc/0.Linux Fidelity
proc_pid_readdir/next_tgidnever publish tgid 0. gVisor listed the thread group after the PID mapping was already gone.Test Plan
ProcTask.ProcRootNeverListsZeroTIDraces concurrentreaddir(/proc)against reap churn.listed_zero == true; failed 3/3.waitpidand passed stock; the rewritten test is the negative control.Made with Cursor
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15011 from hugelgupf:pr/procfs-iterdirents-skip-tid0 fd2e845