[C-API] Weird sys.exc_info reference segfault

Antoine Pitrou solipsis at pitrou.net
Sun Oct 3 17:52:30 EDT 2010


On Sun, 03 Oct 2010 16:33:48 +0200
"Jonas H." <jonas at lophus.org> wrote:
> 
> Humm. Now the behaviour is as follows:
> 
> with assignment to local variable
> ----------------------------------
> * start_response = PyObject_NEW(...) -> start_response->ob_refcnt=1
> * wsgiapp(environ, start_response)   ->                 ob_refcnt=2
> * Py_DECREF(start_response)          ->                 ob_refcnt=1
> 
> 
> without assignment
> ------------------
> * start_response = PyObject_NEW(...) -> start_respinse->ob_refcnt=1
> * wsgiapp(environ, start_response)   ->                 ob_refcnt=1
> * Py_DECREF(start_response): CRASH
> 
> I think I'll compile Python with debug support to check out what's going 
> wrong in the second case.

You probably have a problem in your tp_dealloc implementation.

Antoine.





More information about the Python-list mailing list