Edgy mod_python (version 3.2.8) memory leak

Bug #132520 reported by Ashwin
6
Affects Status Importance Assigned to Milestone
libapache2-mod-python (Ubuntu)
Fix Released
Undecided
Unassigned
Feisty
Fix Released
Undecided
Matthias Klose

Bug Description

Binary package hint: libapache2-mod-python

Hello,
__repr__ leaks only under mod_python. The problem seems to be related to a mod_python bug:
http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200610.mbox/%3c004901c6f379$e5c0fba0$<email address hidden>%3e

Can you please backport this bug fix to Edgy/Feisty. The mod_python devs fixed it in 3.3.x and that will only get into Gutsy.

It is a one liner fix:

--- mod_python.c 2007-08-13 12:46:19.000000000 -0400
+++ mod_python2.c 2007-08-13 12:46:08.000000000 -0400
@@ -213,6 +213,10 @@
 static void release_interpreter(void)
{
     PyThreadState *tstate = PyThreadState_Get();
+ /* Ashwin see
+ * http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200610.mbox/%3c004901c6f379$e5c0fba0$<email address hidden>%3e
+ */
+ PyThreadState_Clear(tstate);
#ifdef WITH_THREAD
     PyEval_ReleaseThread(tstate);
#else

Thanks,
Ashwin

Matthias Klose (doko)
Changed in libapache2-mod-python:
status: New → Fix Released
assignee: nobody → doko
status: New → In Progress
Revision history for this message
Matthias Klose (doko) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Approved, please upload. Is there an easy recipe for demonstrating/reproducing the issue?

Revision history for this message
Ashwin (cybernytrix) wrote : Re: [Bug 132520] Re: Edgy mod_python (version 3.2.8) memory leak

It has been a while, but I think this will show a leak:

while 1:
    d = {'a': 1}

Via regular Python, it works without a leak, but with mod_python, it leaks (buggy version).
Reference counting is supposed to take care of this (and I don't see any cycles).

-Ashwin

----- Original Message ----
From: Martin Pitt <email address hidden>
To: <email address hidden>
Sent: Monday, April 14, 2008 2:18:29 AM
Subject: [Bug 132520] Re: Edgy mod_python (version 3.2.8) memory leak

Approved, please upload. Is there an easy recipe for
demonstrating/reproducing the issue?

--
Edgy mod_python (version 3.2.8) memory leak
https://bugs.launchpad.net/bugs/132520
You received this bug notification because you are a direct subscriber
of the bug.

Status in Source Package "libapache2-mod-python" in Ubuntu: Fix Released
Status in libapache2-mod-python in Ubuntu Feisty: In Progress

Bug description:
Binary package hint: libapache2-mod-python

Hello,
__repr__ leaks only under mod_python. The problem seems to be related to a mod_python bug:
http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200610.mbox/%3c004901c6f379$e5c0fba0$<email address hidden>%3e

Can you please backport this bug fix to Edgy/Feisty. The mod_python devs fixed it in 3.3.x and that will only get into Gutsy.

It is a one liner fix:

--- mod_python.c 2007-08-13 12:46:19.000000000 -0400
+++ mod_python2.c 2007-08-13 12:46:08.000000000 -0400
@@ -213,6 +213,10 @@
 static void release_interpreter(void)
{
     PyThreadState *tstate = PyThreadState_Get();
+ /* Ashwin see
+ * http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200610.mbox/%3c004901c6f379$e5c0fba0$<email address hidden>%3e
+ */
+ PyThreadState_Clear(tstate);
#ifdef WITH_THREAD
     PyEval_ReleaseThread(tstate);
#else

Thanks,
Ashwin

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into feisty-proposed. Please test and give feedback here.

Changed in libapache2-mod-python:
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Copied to Feisty-updates, see bug 107149.

Changed in libapache2-mod-python:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.