Re: Commented: (MODPYTHON-172) Memory leak with util.fieldstorage using mod_python 3.2
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Re: Commented: (MODPYTHON-172) Memory leak with util.fieldstorage using mod_python 3.2




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Commented: (MODPYTHON-172) Memory leak with util.fieldstorage using mod_python 3.2  
Graham Dumpleton


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-08-06 06: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







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:38 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register