Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

segfault grabbing attributes off of objects that implement __getattribute__ #6

Open
teepark opened this issue Dec 8, 2010 · 2 comments

Comments

@teepark
Copy link

teepark commented Dec 8, 2010

_namemapper.c:PyNamemapper_valueForName calls PyObject_GetAttrString and doesn't check its return value for NULL. It does check PyErr_Occurred(), but that isn't being triggered in this case (which looks like a bug in the python c api -- I was getting this sporadically on a live service running python 2.4.6).

It should be checking for NULL as well and setting a python error and returning NULL in that case.

We worked around this by overriding getattr instead of getattribute (which should have been done in the first place), but the python issue, not protected against by cheetah, is still there.

@rtyler
Copy link
Owner

rtyler commented Dec 13, 2010

Mind checking out SHA: e835293 to see if that's sufficient?

@teepark
Copy link
Author

teepark commented Dec 14, 2010

the only place I've seen it happen was at work, and we got rid of our getattribute usage there (and I'm not sure how folks would feel about reintroducing it to test cheetah), but on my own time I'll try and write up a repro script.

rtyler pushed a commit that referenced this issue Apr 23, 2011
…non-NULL value

Should resolve issue: #6

Change-Id: Ie1fd42a9719d50e0baa600e3563ac50159201dc9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants