pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Daniel Popowich <danielpopowich@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #5842: Memory leak in PL/Python when taking slices of results
Date: Thu, 17 Mar 2011 15:31:08 -0300
Message-ID: <1300386599-sup-6152@alvh.no-ip.org> (raw)
In-Reply-To: <201101181630.p0IGU45v047971@wwwmaster.postgresql.org>
References: <201101181630.p0IGU45v047971@wwwmaster.postgresql.org>

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@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (6+ messages)

Message-ID: <1300386599-sup-6152@alvh.no-ip.org>
Permalink:  ../1300386599-sup-6152@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1300386599-sup-6152@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@commandprompt.com, danielpopowich@gmail.com
  Subject: Re: BUG #5842: Memory leak in PL/Python when taking slices of results
  In-Reply-To: <1300386599-sup-6152@alvh.no-ip.org>
  References: <201101181630.p0IGU45v047971@wwwmaster.postgresql.org> <1300386599-sup-6152@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox