pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix memory leak in repeated SPGIST index scans. 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/82dd1c271492e7dc4d5b96825f7b29679c5dc33a Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/156a737a6b7387805633194d8549c0fa6cc900ed Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/696b0c5fd0a8765fe6dfd075a30be06b448fd615 Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 35 ++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/558571afc7c42c47243836c411ad86fc6c0577c5 Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/95015b1f8e8eef895ddbfe38697c6da5754ba1d4 Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/92e371f9b143dacd83ec14ef8c7caba9612d9294 Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix memory leak in repeated SPGIST index scans. @ 2018-10-31 21:05 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-31 21:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix memory leak in repeated SPGIST index scans. spgendscan neglected to pfree all the memory allocated by spgbeginscan. It's possible to get away with that in most normal queries, since the memory is allocated in the executor's per-query context which is about to get deleted anyway; but it causes severe memory leakage during creation or filling of large exclusion-constraint indexes. Also, document that amendscan is supposed to free what ambeginscan allocates. The docs' lack of clarity on that point probably caused this bug to begin with. (There is discussion of changing that API spec going forward, but I don't think it'd be appropriate for the back branches.) Per report from Bruno Wolff. It's been like this since the beginning, so back-patch to all active branches. In HEAD, also fix an independent leak caused by commit 2a6368343 (allocating memory during spgrescan instead of spgbeginscan, which might be all right if it got cleaned up, but it didn't). And do a bit of code beautification on that commit, too. Discussion: https://postgr.es/m/20181024012314.GA27428@wolff.to Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2493e2c2d167ce7ad7d034c7c7de17d79e806c7a Modified Files -------------- doc/src/sgml/indexam.sgml | 3 ++- src/backend/access/spgist/spgscan.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-10-31 21:05 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-31 21:05 pgsql: Fix memory leak in repeated SPGIST index scans. Tom Lane <tgl@sss.pgh.pa.us>
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