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
Graham Dumpleton

2006-07-08, 1:12 am

On first look I would agree there is possibly a problem. There also
would appear to be
similar issues in other parts of mod_python. For example in
cfgtree_walk() of util.c it has:

PyObject *t = Py_BuildValue("(s, s)", dir->directive, dir-
>args);

if (!t)
return PyErr_NoMemory();

PyList_Append(list, t);

with "t" not being DECREF'd either.

Also, in req_readlines() of requestobject.c, we have:

line = req_readline(self, rlargs);
while (line && (PyString_Size(line)>0)) {
PyList_Append(result, line);
size += PyString_Size(line);
if ((sizehint != -1) && (size >= size))
break;
line = req_readline(self, args);
}

No DECREF for item added to list.

I can't see any others in relation to dictionaries yet, but we
probably need to do a good
audit of all the code for such things as I have only check
PyList_Append() and
PyDict_SetItem() and not the other ways stuff can be added to such
data structures.

Anyway, still need to run some tests yet to confirm memory leak. :-)

Graham

On 08/07/2006, at 1:05 AM, Harold Ship (JIRA) wrote:

> [ http://issues.apache.org/jira/browse/MODPYTHON-172?
> page=comments#action_12419728 ]
>
> Harold Ship commented on MODPYTHON-172:
> ---------------------------------------
>
> Please look at lines 202-205 of the same file, in parse_qs() :
>
> PyObject *list;
> list = Py_BuildValue("[O]", val);
> PyDict_SetItem(dict, key, list);
> Py_DECREF(list);
>
>
>
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the
> administrators:
> http://issues.apache.org/jira/secur...nistrators.jspa
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com