Skip to content
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

libstore/gc.cc: ignore ESRCH when reading /proc #2223

Merged
merged 1 commit into from Jun 11, 2018

Conversation

symphorien
Copy link
Member

When running nix-store --gc --print-roots, nix walks /proc/ which is inherently racy. When unlucky (this happened to me on travis) nix-store fails with error: reading from file: No such process. It seems the reason is that if a process disappears between the time /proc/[pid]/maps is opened and
the time it is read, the read() syscall will return ESRCH. This should be ignored.

I tried to run the testsuite, but some test failed before my commit. So I can only claim that no new failing test are introduced. Also, nix-du's test suite seems to pass more reliably.

If a process disappears between the time /proc/[pid]/maps is opened and
the time it is read, the read() syscall will return ESRCH. This should be ignored.
@edolstra edolstra merged commit 27d1c05 into NixOS:master Jun 11, 2018
@edolstra
Copy link
Member

Thanks!

@symphorien symphorien deleted the esrch branch June 11, 2018 17:09
symphorien added a commit to symphorien/nix-du that referenced this pull request Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants