Thread: pltcl and plpython memory leak revisited (fwd)
I don't remember seeing any acknowledgement or comments on this. It isn't on the unapplied patches list either so I'm assuming it got lost somewhere. ---------- Forwarded message ---------- Date: Fri, 4 Oct 2002 11:50:46 +0100 (BST) From: Nigel J. Andrews <nandrews@investsystems.co.uk> To: pgsql-patches@postgresql.org Subject: pltcl and plpython memory leak revisited I have attached two patches as per: 1) pltcl: Add SPI_freetuptable() calls to avoid memory leaks (Me + Neil Conway) Change sprintf()s to snprintf()s (Neil Conway) Remove header files included elsewhere (Neil Conway) 2)plpython: Add SPI_freetuptable() calls to avoid memory leaks Cosemtic change to remove a compiler warning Notes: I have tested pltcl.c for a) the original leak problem reported for the repeated call of spi_exec in a TCL fragment and b) the subsequent report resulting from the use of spi_exec -array in a TCL fragment. The plpython.c patch is exactly the same as that applied to make revision 1.23, the plpython_schema.sql and feature.expected sections of the patch are also the same as last submited, applied and subsequently reversed out. It remains untested by me (other than via make check). However, this should be safe provided PyString_FromString() _copies_ the given string to make a PyObject. -- Nigel J. Andrews Director --- Logictree Systems Limited Computer Consultants
Attachment
I thought you were still working on a fix for all languages. Your patch has been added to the PostgreSQL unapplied patches list at: http://candle.pha.pa.us/cgi-bin/pgpatches I will try to apply it within the next 48 hours. --------------------------------------------------------------------------- Nigel J. Andrews wrote: > > > I don't remember seeing any acknowledgement or comments on this. It isn't on > the unapplied patches list either so I'm assuming it got lost somewhere. > > > ---------- Forwarded message ---------- > Date: Fri, 4 Oct 2002 11:50:46 +0100 (BST) > From: Nigel J. Andrews <nandrews@investsystems.co.uk> > To: pgsql-patches@postgresql.org > Subject: pltcl and plpython memory leak revisited > > > > I have attached two patches as per: > > 1) pltcl: > Add SPI_freetuptable() calls to avoid memory leaks (Me + Neil Conway) > Change sprintf()s to snprintf()s (Neil Conway) > Remove header files included elsewhere (Neil Conway) > > 2)plpython: > Add SPI_freetuptable() calls to avoid memory leaks > Cosemtic change to remove a compiler warning > > > Notes: > > I have tested pltcl.c for > a) the original leak problem reported for the repeated call of spi_exec in a > TCL fragment > and b) the subsequent report resulting from the use of spi_exec -array in a TCL > fragment. > > The plpython.c patch is exactly the same as that applied to make revision 1.23, > the plpython_schema.sql and feature.expected sections of the patch are also the > same as last submited, applied and subsequently reversed out. It remains > untested by me (other than via make check). However, this should be safe > provided PyString_FromString() _copies_ the given string to make a PyObject. > > > -- > Nigel J. Andrews > Director > > --- > Logictree Systems Limited > Computer Consultants Content-Description: [ Attachment, skipping... ] Content-Description: [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Patch applied. Thanks. --------------------------------------------------------------------------- Nigel J. Andrews wrote: > > > I don't remember seeing any acknowledgement or comments on this. It isn't on > the unapplied patches list either so I'm assuming it got lost somewhere. > > > ---------- Forwarded message ---------- > Date: Fri, 4 Oct 2002 11:50:46 +0100 (BST) > From: Nigel J. Andrews <nandrews@investsystems.co.uk> > To: pgsql-patches@postgresql.org > Subject: pltcl and plpython memory leak revisited > > > > I have attached two patches as per: > > 1) pltcl: > Add SPI_freetuptable() calls to avoid memory leaks (Me + Neil Conway) > Change sprintf()s to snprintf()s (Neil Conway) > Remove header files included elsewhere (Neil Conway) > > 2)plpython: > Add SPI_freetuptable() calls to avoid memory leaks > Cosemtic change to remove a compiler warning > > > Notes: > > I have tested pltcl.c for > a) the original leak problem reported for the repeated call of spi_exec in a > TCL fragment > and b) the subsequent report resulting from the use of spi_exec -array in a TCL > fragment. > > The plpython.c patch is exactly the same as that applied to make revision 1.23, > the plpython_schema.sql and feature.expected sections of the patch are also the > same as last submited, applied and subsequently reversed out. It remains > untested by me (other than via make check). However, this should be safe > provided PyString_FromString() _copies_ the given string to make a PyObject. > > > -- > Nigel J. Andrews > Director > > --- > Logictree Systems Limited > Computer Consultants Content-Description: [ Attachment, skipping... ] Content-Description: [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
PL/Python documentation updates? Bruce Momjian writes: > > Patch applied. Thanks. > > --------------------------------------------------------------------------- > > > Nigel J. Andrews wrote: > > > > > > I don't remember seeing any acknowledgement or comments on this. It isn't on > > the unapplied patches list either so I'm assuming it got lost somewhere. > > > > > > ---------- Forwarded message ---------- > > Date: Fri, 4 Oct 2002 11:50:46 +0100 (BST) > > From: Nigel J. Andrews <nandrews@investsystems.co.uk> > > To: pgsql-patches@postgresql.org > > Subject: pltcl and plpython memory leak revisited > > > > > > > > I have attached two patches as per: > > > > 1) pltcl: > > Add SPI_freetuptable() calls to avoid memory leaks (Me + Neil Conway) > > Change sprintf()s to snprintf()s (Neil Conway) > > Remove header files included elsewhere (Neil Conway) > > > > 2)plpython: > > Add SPI_freetuptable() calls to avoid memory leaks > > Cosemtic change to remove a compiler warning > > > > > > Notes: > > > > I have tested pltcl.c for > > a) the original leak problem reported for the repeated call of spi_exec in a > > TCL fragment > > and b) the subsequent report resulting from the use of spi_exec -array in a TCL > > fragment. > > > > The plpython.c patch is exactly the same as that applied to make revision 1.23, > > the plpython_schema.sql and feature.expected sections of the patch are also the > > same as last submited, applied and subsequently reversed out. It remains > > untested by me (other than via make check). However, this should be safe > > provided PyString_FromString() _copies_ the given string to make a PyObject. > > > > > > -- > > Nigel J. Andrews > > Director > > > > --- > > Logictree Systems Limited > > Computer Consultants > > Content-Description: > > [ Attachment, skipping... ] > > Content-Description: > > [ Attachment, skipping... ] > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 3: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > -- Peter Eisentraut peter_e@gmx.net