Skip site navigation (1) Skip section navigation (2)

Re: BUG #5842: Memory leak in PL/Python when taking slices of results

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Daniel Popowich <danielpopowich(at)gmail(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5842: Memory leak in PL/Python when taking slices of results
Date: 2011-03-17 18:31:08
Message-ID: 1300386599-sup-6152@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Excerpts from Daniel Popowich's message of mar ene 18 13:30:04 -0300 2011:

> I traced the bug to PLy_result_slice() in src/pl/plpython/plpython.c.  That
> function calls the python API function PyList_GetSlice() and erroneously
> increments the reference count before returning the result to the caller. 
> PyList_GetSlice returns a *new* reference, not a borrowed one, so it should
> just return the object as-is.
> 
> A patch is attached below.

Thanks, applied and backpatched all the way back to 8.2.

-- 
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-03-17 18:38:17
Subject: Re: Flex output missing from 9.1a4 tarballs?
Previous:From: Peter EisentrautDate: 2011-03-17 18:25:51
Subject: Re: why is max standby delay only 35 minutes?

pgsql-bugs by date

Next:From: Brad NicholsonDate: 2011-03-17 19:36:27
Subject: BUG #5935: Log lotation not working for default log format
Previous:From: Alvaro HerreraDate: 2011-03-17 15:15:30
Subject: Re: Re: [BUGS] BUG #5842: Memory leak in PL/Python when taking slices of results

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group