PyObject sanitizer (CPython 2.4.4)

S

sndive

I get this from valgrind (no suppression file but thgis probably is
not covered by the suppressor anyway):
==6108== Invalid read of size 4
==6108== at 0x48D19F4: lookdict_string (dictobject.c:359)
==6108== by 0x48D1B59: PyDict_GetItem (dictobject.c:554)
==6108== by 0x48B1657: instance_getattr2 (classobject.c:741)
==6108== by 0x48B701D: instance_getattr1 (classobject.c:725)
==6108== by 0x48B2670: instance_getattr (classobject.c:764)
==6108== by 0x48D6500: PyObject_GetAttr (object.c:1088)
==6108== by 0x48D6355: PyObject_GetAttrString (object.c:1031)

so i wonder if the PyObject i gave to PyObject_GetAttrString to gnaw
on is in good shape.
is assert(obj->ob_refcnt>0); a good way to check if i'm dealing with a
valid PyObject
or there is a helper that can do this for me?
 
D

Diez B. Roggisch

I get this from valgrind (no suppression file but thgis probably is
not covered by the suppressor anyway):
==6108== Invalid read of size 4
==6108== at 0x48D19F4: lookdict_string (dictobject.c:359)
==6108== by 0x48D1B59: PyDict_GetItem (dictobject.c:554)
==6108== by 0x48B1657: instance_getattr2 (classobject.c:741)
==6108== by 0x48B701D: instance_getattr1 (classobject.c:725)
==6108== by 0x48B2670: instance_getattr (classobject.c:764)
==6108== by 0x48D6500: PyObject_GetAttr (object.c:1088)
==6108== by 0x48D6355: PyObject_GetAttrString (object.c:1031)

so i wonder if the PyObject i gave to PyObject_GetAttrString to gnaw
on is in good shape.
is assert(obj->ob_refcnt>0); a good way to check if i'm dealing with a
valid PyObject
or there is a helper that can do this for me?

google: python valgrind

First link:

http://svn.python.org/projects/python/trunk/Misc/README.valgrind

Diez
 

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top