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

Out-of-memory during Process32NextW returns no error and truncated process list #55

Open
mappu opened this issue Jul 29, 2021 · 0 comments

Comments

@mappu
Copy link

mappu commented Jul 29, 2021

Hi,

The loop in https://github.com/mitchellh/go-ps/blob/master/process_windows.go#L112 can return false for (A) successfully reaching the end of the list, or (B) some other error.

As per https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32nextw we must check GetLastError() for ERROR_NO_MORE_FILES after exiting this loop.

I encountered this problem today, on a PC under memory pressure, where this function returned a truncated process list.

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

No branches or pull requests

1 participant