Apache Mod-Python - Re: Commented: (MODPYTHON-172) Memory leak with util.fieldstorage using mod_python 3.2

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > July 2006 > Re: Commented: (MODPYTHON-172) Memory leak with util.fieldstorage using mod_python 3.2





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Commented: (MODPYTHON-172) Memory leak with util.fieldstorage using mod_python 3.2
Harold Ship

2006-07-06, 7:11 pm

Hi Nicolas

Howcome I didn't see this post in JIRA? I added my comment there. I also didn't
get email. I just found it in Google.

Anyway, I have an application that was started over a year ago with 3.1.3. We
switched to 3.2.8 because we had a requirement to upload files and there was a
problem that was fixed in that version.

I observed a memory leak in our application under 3.2.8, and found MODPYTHON-172
on Google. I ran the test program in my first comment on 3.2.8, then tried going
back to 3.1.3 to see if the leak was there too.

This leak seems to be in both 3.1.3 and 3.2.8.

I have added another comment regarding _apachemodule.c, which I include below.

Thanks for your help,
Harold



### ============ Begin Code ==============
Excuse me if this is a dumb question, but I don't know anything about the
Python-C interface.

Is it possible that the code in line 319 of _apachemodule.c (from 3.2.8) is the
problem?

The code is:

if (key && val)
PyList_Append(pairs, Py_BuildValue("(O,O)", key, val));

Does the object returned by Py_BuildValue() need to be dereferenced?
Something like:

if (key && val) {
PyObject * list_elem = Py_BuildValue("(O,O)", key, val);
if (list_elem)
PyList_Append(pairs, list_elem);
Py_XDECREF(list_elem);
}

========================================





Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com