kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

"TypeError: argument 2 to map() must support iteration" in process.memory_maps #502

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Got the following stacktrace in a production application:

  File "thermos_executor/twitter/aurora/executor/executor_vars.py", line 91, in aggregate_memory
    return sum(getattr(mmap, attribute) for mmap in process.get_memory_maps())
  File "/root/.pex/install/psutil-1.1.2-py2.6-linux-x86_64.egg/psutil/__init__.py", line 790, in get_memory_maps
    d[path] = map(lambda x, y: x+y, d[path], nums)
TypeError: argument 2 to map() must support iteration

What version of psutil are you using? What Python version?
psutil 1.1.2
Python 2.6.8

On what operating system? Is it 32bit or 64bit version?
Linux x86_64 2.6.50 custom kernel on EL5

Please provide any additional information below.

This has happened once after running in production for quite a while, so it 
seems extremely rare.  I check psutil 2.1.1 and the code is still there roughly 
unchanged, so I figure it might still happen in production.  It seems it's 
possible for "path" to repeat multiple times in the loop such that d[path] is 
no longer an iterable.

Original issue reported on code.google.com by wick...@gmail.com on 8 May 2014 at 1:57

GoogleCodeExporter commented 9 years ago
Mmmm this is gonna be hard to figure out without knowing what "path" was.
In order to get that error "path" should be something different than a string 
(e.g. None) but acccording to the source code "path" is always supposed to be a 
string: 
https://code.google.com/p/psutil/source/browse/psutil/_pslinux.py?name=release-1
.1.2#673
...so I really have no idea how that can happen without further inputs on your 
part.
I'd say try to upgrade to latest psutil version (1.1.2 is way too old) but for 
this specific problem I guess that wouldn't help either as apparently that part 
of the code is identical.

Original comment by g.rodola on 8 May 2014 at 3:55

GoogleCodeExporter commented 9 years ago
psutil has been migrated from Google Code to Github (see: 
http://grodola.blogspot.com/2014/05/goodbye-google-code-im-moving-to-github.html
).
Please do NOT reply here but use this instead:
https://github.com/giampaolo/psutil/issues/502

Original comment by g.rodola on 26 May 2014 at 3:05