-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Linux][PATCH] IndexError in psutil/_pslinux.py when handling /proc/meminfo in LXC on AArch64 #2319
Comments
Please paste the output of:
|
Run through
|
This is 2 years old. Did you try with latest version? |
This code path is unchanged in the current version so this problem will occur: Line 416 in 8eb2930
with open_binary('%s/meminfo' % get_procfs_path()) as f:
for line in f:
fields = line.split()
mems[fields[0]] = int(fields[1]) * 1024 |
Summary
Description
When using psutil in a Proxmox (or to be more specific, Pimox, the Raspberry Pi port of Proxmox) hosted LXC container a crash occurs in
_pslinux.py
line 435 when reading/proc/meminfo
caused by an IndexError: list index out of range. This error occurs when/proc/meminfo
returns trailing zero bytes as it does in the described situation:This results in the following error:
The same construction is used around line 544.
The following patch fixes this problem by ignoring the IndexError - this can be done since the error occurs only once all relevant data have been read:
The text was updated successfully, but these errors were encountered: