From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Avoid ecpglib core dump with out-of-order operations. |
Date: | 2022-06-14 22:17:13 |
Message-ID: | E1o1EqX-0004yF-3O@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2022-06-15 00:00:00 | Re: pgsql: Force run of pg_upgrade in the build directory in its TAP test |
Previous Message | Tom Lane | 2022-06-14 21:47:29 | pgsql: Doc: clarify the default collation behavior of domains. |