[Pkg-salt-team] Bug#922064: Bug#922064: Bug#922064: Please restore previous version

Benjamin Drung benjamin.drung at cloud.ionos.com
Thu Mar 14 09:51:36 GMT 2019


Am Mittwoch, den 13.03.2019, 17:41 +0100 schrieb Dirk Heinrichs:
> Am 13.03.19 um 13:38 schrieb Benjamin Drung:
> 
> > and let me know the output?
> 
> Sure. Here you are:
> 
> [...]
> Mär 13 17:36:28 salt salt-master[20006]: line: b'PageTables:  ',
> fields:
> [b'PageTables:']
> [...]

Thanks. That output is surprising. According to the log, /proc/meminfo
is parsed completely the first the time. The second time, it is only
parsed to this partial line. Was this file closed or what went wrong?

Can you try this:

diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index 41be6665..aa0a7940 100644
--- a/usr/lib/python3/dist-packages/psutil/_pslinux.py
+++ b/usr/lib/python3/dist-packages/psutil/_pslinux.py
@@ -401,7 +401,11 @@ def virtual_memory():
     with open_binary('%s/meminfo' % get_procfs_path()) as f:
         for line in f:
             fields = line.split()
-            mems[fields[0]] = int(fields[1]) * 1024
+            print("line: %r, fields: %r" % (line, fields))
+            if len(fields) != 2:
+                print("remaining: %r" % (f.read()))
+            if fields:
+                mems[fields[0]] = int(fields[1]) * 1024
 
     # /proc doc states that the available fields in /proc/meminfo vary
     # by architecture and compile options, but these 3 values are also

If the file was closed, a read() should produce a ValueError. If the
remaining file content is empty, it will look like a kernel bug to me.

-- 
Benjamin Drung
System Developer
Debian & Ubuntu Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Email: benjamin.drung at profitbricks.com
URL:  http://www.profitbricks.com

Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506B.
Geschäftsführer: Andreas Gauger, Achim Weiss.



More information about the pkg-salt-team mailing list