pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Alex Hunsaker <badalex@gmail.com>
Cc: Sergey Burladyan <eshkinkot@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: BUG #9223: plperlu result memory leak
Date: Wed, 5 Mar 2014 16:22:25 -0300
Message-ID: <20140305192224.GR4759@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <CAFaPBrSpM+uhbe4J1ayQMAqj_Q0rvup=j0Y76WsSdfxpy_E7xw@mail.gmail.com>
References: <20140214163125.24620.66179@wrigleys.postgresql.org>
	<87ppmbmh3i.fsf@seb.koffice.internal>
	<CAFaPBrSpM+uhbe4J1ayQMAqj_Q0rvup=j0Y76WsSdfxpy_E7xw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Alex Hunsaker escribió:
> On Tue, Feb 25, 2014 at 6:56 AM, Sergey Burladyan <eshkinkot@gmail.com> wrote:
> 
> > It looks like I found the problem, Perl use reference count and something that
> > is called "Mortal" for memory management.  As I understand it, mortal is free
> > after FREETMPS. Plperl call FREETMPS in plperl_call_perl_func() but after it,
> > plperl ask perl interpreter again for new mortal SV variables, for example, in
> > hek2cstr from plperl_sv_to_datum, and this new SV is newer freed.
> 
> So I think hek2cstr is the only place we leak (its the only place I
> can see that allocates a mortal sv without being wrapped in
> ENTER/SAVETMPS/FREETMPS/LEAVE).
> 
> Does the attached fix it for you?

Can I bug you into verifying what supported releases need this patch,
and to which does it backpatch cleanly?  And if there's any to which it
doesn't, can I further bug you into providing one that does?

Thanks,

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <20140305192224.GR4759@eldon.alvh.no-ip.org>
Permalink:  ../20140305192224.GR4759@eldon.alvh.no-ip.org/
Also on:    postgresql.org/message-id/20140305192224.GR4759@eldon.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@2ndquadrant.com, badalex@gmail.com, eshkinkot@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: BUG #9223: plperlu result memory leak
  In-Reply-To: <20140305192224.GR4759@eldon.alvh.no-ip.org>
  References: <20140214163125.24620.66179@wrigleys.postgresql.org> <87ppmbmh3i.fsf@seb.koffice.internal> <CAFaPBrSpM+uhbe4J1ayQMAqj_Q0rvup=j0Y76WsSdfxpy_E7xw@mail.gmail.com> <20140305192224.GR4759@eldon.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