pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid ecpglib core dump with out-of-order operations. 6+ messages / 1 participants [nested] [flat]
* pgsql: Avoid ecpglib core dump with out-of-order operations. @ 2022-06-14 22:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-06-14 22:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid ecpglib core dump with out-of-order operations. If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ba412c905af14699a128a7bcd8ce5234adb93ceb Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid ecpglib core dump with out-of-order operations. @ 2022-06-14 22:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-06-14 22:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid ecpglib core dump with out-of-order operations. If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7bc21ed8c8e755ef6fe41dae60c198fcc9c9ee56 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid ecpglib core dump with out-of-order operations. @ 2022-06-14 22:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-06-14 22:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid ecpglib core dump with out-of-order operations. If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/12b8fb34a933456ca762c98bc2047e608b7a1079 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid ecpglib core dump with out-of-order operations. @ 2022-06-14 22:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-06-14 22:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid ecpglib core dump with out-of-order operations. If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9a3aab0f2a5b2467470282a7c9d5b285ed383261 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid ecpglib core dump with out-of-order operations. @ 2022-06-14 22:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-06-14 22:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid ecpglib core dump with out-of-order operations. If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f7797747fc8fa6e5d5513e6871ee56f7cf91c51c Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid ecpglib core dump with out-of-order operations. @ 2022-06-14 22:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-06-14 22:17 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid ecpglib core dump with out-of-order operations. If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/86258f083aad4e0900e912598790ffb0570bec17 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-06-14 22:17 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-06-14 22:17 pgsql: Avoid ecpglib core dump with out-of-order operations. Tom Lane <tgl@sss.pgh.pa.us> 2022-06-14 22:17 pgsql: Avoid ecpglib core dump with out-of-order operations. Tom Lane <tgl@sss.pgh.pa.us> 2022-06-14 22:17 pgsql: Avoid ecpglib core dump with out-of-order operations. Tom Lane <tgl@sss.pgh.pa.us> 2022-06-14 22:17 pgsql: Avoid ecpglib core dump with out-of-order operations. Tom Lane <tgl@sss.pgh.pa.us> 2022-06-14 22:17 pgsql: Avoid ecpglib core dump with out-of-order operations. Tom Lane <tgl@sss.pgh.pa.us> 2022-06-14 22:17 pgsql: Avoid ecpglib core dump with out-of-order operations. 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