pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). @ 2015-01-26 17:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-01-26 17:19 UTC (permalink / raw) To: pgsql-committers Fix volatile-safety issue in pltcl_SPI_execute_plan(). The "callargs" variable is modified within PG_TRY and then referenced within PG_CATCH, which is exactly the coding pattern we've now found to be unsafe. Marking "callargs" volatile would be problematic because it is passed by reference to some Tcl functions, so fix the problem by not modifying it within PG_TRY. We can just postpone the free() till we exit the PG_TRY construct, as is already done elsewhere in this same file. Also, fix failure to free(callargs) when exiting on too-many-arguments error. This is only a minor memory leak, but a leak nonetheless. In passing, remove some unnecessary "volatile" markings in the same function. Those doubtless are there because gcc 2.95.3 whinged about them, but we now know that its algorithm for complaining is many bricks shy of a load. This is certainly a live bug with compilers that optimize similarly to current gcc, so back-patch to all active branches. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/599d00aa68cf444c7ddc5c10fe55a07b6b79e1f0 Modified Files -------------- src/pl/tcl/pltcl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). @ 2015-01-26 17:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-01-26 17:19 UTC (permalink / raw) To: pgsql-committers Fix volatile-safety issue in pltcl_SPI_execute_plan(). The "callargs" variable is modified within PG_TRY and then referenced within PG_CATCH, which is exactly the coding pattern we've now found to be unsafe. Marking "callargs" volatile would be problematic because it is passed by reference to some Tcl functions, so fix the problem by not modifying it within PG_TRY. We can just postpone the free() till we exit the PG_TRY construct, as is already done elsewhere in this same file. Also, fix failure to free(callargs) when exiting on too-many-arguments error. This is only a minor memory leak, but a leak nonetheless. In passing, remove some unnecessary "volatile" markings in the same function. Those doubtless are there because gcc 2.95.3 whinged about them, but we now know that its algorithm for complaining is many bricks shy of a load. This is certainly a live bug with compilers that optimize similarly to current gcc, so back-patch to all active branches. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/dd9d78f595a124591eadb97d71813fc71fd767a5 Modified Files -------------- src/pl/tcl/pltcl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). @ 2015-01-26 17:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-01-26 17:19 UTC (permalink / raw) To: pgsql-committers Fix volatile-safety issue in pltcl_SPI_execute_plan(). The "callargs" variable is modified within PG_TRY and then referenced within PG_CATCH, which is exactly the coding pattern we've now found to be unsafe. Marking "callargs" volatile would be problematic because it is passed by reference to some Tcl functions, so fix the problem by not modifying it within PG_TRY. We can just postpone the free() till we exit the PG_TRY construct, as is already done elsewhere in this same file. Also, fix failure to free(callargs) when exiting on too-many-arguments error. This is only a minor memory leak, but a leak nonetheless. In passing, remove some unnecessary "volatile" markings in the same function. Those doubtless are there because gcc 2.95.3 whinged about them, but we now know that its algorithm for complaining is many bricks shy of a load. This is certainly a live bug with compilers that optimize similarly to current gcc, so back-patch to all active branches. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/22967ed5b457e9a8646c5960856fca79b7d1de36 Modified Files -------------- src/pl/tcl/pltcl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). @ 2015-01-26 17:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-01-26 17:19 UTC (permalink / raw) To: pgsql-committers Fix volatile-safety issue in pltcl_SPI_execute_plan(). The "callargs" variable is modified within PG_TRY and then referenced within PG_CATCH, which is exactly the coding pattern we've now found to be unsafe. Marking "callargs" volatile would be problematic because it is passed by reference to some Tcl functions, so fix the problem by not modifying it within PG_TRY. We can just postpone the free() till we exit the PG_TRY construct, as is already done elsewhere in this same file. Also, fix failure to free(callargs) when exiting on too-many-arguments error. This is only a minor memory leak, but a leak nonetheless. In passing, remove some unnecessary "volatile" markings in the same function. Those doubtless are there because gcc 2.95.3 whinged about them, but we now know that its algorithm for complaining is many bricks shy of a load. This is certainly a live bug with compilers that optimize similarly to current gcc, so back-patch to all active branches. Branch ------ REL9_2_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/3dd084c7fe4a2596ddb695d52e2d65910ac9206e Modified Files -------------- src/pl/tcl/pltcl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). @ 2015-01-26 17:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-01-26 17:19 UTC (permalink / raw) To: pgsql-committers Fix volatile-safety issue in pltcl_SPI_execute_plan(). The "callargs" variable is modified within PG_TRY and then referenced within PG_CATCH, which is exactly the coding pattern we've now found to be unsafe. Marking "callargs" volatile would be problematic because it is passed by reference to some Tcl functions, so fix the problem by not modifying it within PG_TRY. We can just postpone the free() till we exit the PG_TRY construct, as is already done elsewhere in this same file. Also, fix failure to free(callargs) when exiting on too-many-arguments error. This is only a minor memory leak, but a leak nonetheless. In passing, remove some unnecessary "volatile" markings in the same function. Those doubtless are there because gcc 2.95.3 whinged about them, but we now know that its algorithm for complaining is many bricks shy of a load. This is certainly a live bug with compilers that optimize similarly to current gcc, so back-patch to all active branches. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/61fb800bf09d5389c592339ee61bc2f83983b3ef Modified Files -------------- src/pl/tcl/pltcl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). @ 2015-01-26 17:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-01-26 17:19 UTC (permalink / raw) To: pgsql-committers Fix volatile-safety issue in pltcl_SPI_execute_plan(). The "callargs" variable is modified within PG_TRY and then referenced within PG_CATCH, which is exactly the coding pattern we've now found to be unsafe. Marking "callargs" volatile would be problematic because it is passed by reference to some Tcl functions, so fix the problem by not modifying it within PG_TRY. We can just postpone the free() till we exit the PG_TRY construct, as is already done elsewhere in this same file. Also, fix failure to free(callargs) when exiting on too-many-arguments error. This is only a minor memory leak, but a leak nonetheless. In passing, remove some unnecessary "volatile" markings in the same function. Those doubtless are there because gcc 2.95.3 whinged about them, but we now know that its algorithm for complaining is many bricks shy of a load. This is certainly a live bug with compilers that optimize similarly to current gcc, so back-patch to all active branches. Branch ------ REL9_0_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/8c418fbd9ba0227f9089b17d437d97d293772c76 Modified Files -------------- src/pl/tcl/pltcl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2015-01-26 17:19 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-01-26 17:19 pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). Tom Lane <tgl@sss.pgh.pa.us> 2015-01-26 17:19 pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). Tom Lane <tgl@sss.pgh.pa.us> 2015-01-26 17:19 pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). Tom Lane <tgl@sss.pgh.pa.us> 2015-01-26 17:19 pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). Tom Lane <tgl@sss.pgh.pa.us> 2015-01-26 17:19 pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). Tom Lane <tgl@sss.pgh.pa.us> 2015-01-26 17:19 pgsql: Fix volatile-safety issue in pltcl_SPI_execute_plan(). 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