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

51 views
Skip to first unread message

psu...@googlecode.com

unread,
May 7, 2014, 9:57:16 PM5/7/14
to psutil-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 502 by wick...@gmail.com: "TypeError: argument 2 to map() must
support iteration" in process.memory_maps
http://code.google.com/p/psutil/issues/detail?id=502

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.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

psu...@googlecode.com

unread,
May 8, 2014, 11:55:49 AM5/8/14
to psutil-...@googlegroups.com
Updates:
Labels: OpSys-Linux

Comment #1 on issue 502 by g.rodola: "TypeError: argument 2 to map() must
support iteration" in process.memory_maps
http://code.google.com/p/psutil/issues/detail?id=502

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.

psu...@googlecode.com

unread,
May 26, 2014, 11:07:04 AM5/26/14
to psutil-...@googlegroups.com

Comment #2 on issue 502 by g.rodola: "TypeError: argument 2 to map() must
support iteration" in process.memory_maps
http://code.google.com/p/psutil/issues/detail?id=502

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
Reply all
Reply to author
Forward
0 new messages