Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant