luigimarmo / psutil

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

not checking for errors? #306

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Some of the code I'm looking at in _psutil_bsd.c isn't doing error checking at 
all. MemoryError's can happen.

Original issue reported on code.google.com by james....@gmail.com on 17 Jul 2012 at 9:04

GoogleCodeExporter commented 8 years ago
Please provide a patch or tell where exactly the error checking is missing, 
otherwise it doesn't help. =)

Original comment by g.rodola on 17 Jul 2012 at 9:08

GoogleCodeExporter commented 8 years ago
=)

get_system_users function in _psutil_bsd.c

Original comment by james....@gmail.com on 17 Jul 2012 at 9:11

GoogleCodeExporter commented 8 years ago
Ok... but *WHERE*? fread()? And what change are you proposing?

Original comment by g.rodola on 17 Jul 2012 at 9:23

GoogleCodeExporter commented 8 years ago
Pretty much anywhere you allocate a Python object, it can return NULL. The code 
assumes that it doesn't...apparently everywhere.

In low memory situations, this has a pretty good chance of segfaulting out.

Original comment by james....@gmail.com on 17 Jul 2012 at 9:27

GoogleCodeExporter commented 8 years ago
I see now. You're right.

Original comment by g.rodola on 17 Jul 2012 at 9:57

GoogleCodeExporter commented 8 years ago
I consider this one fixed as of r1458, r1459, r1460 and r1463.

Original comment by g.rodola on 19 Jul 2012 at 8:52

GoogleCodeExporter commented 8 years ago
Fixed in version 0.6.0, released just now.

Original comment by g.rodola on 13 Aug 2012 at 4:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1458 == revision 676085a259ed

Original comment by g.rodola on 2 Mar 2013 at 12:11