forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7bc21ed
committed
Avoid ecpglib core dump with out-of-order operations.
If an application executed operations like EXEC SQL PREPAREwithout having first established a database connection, it couldget a core dump instead of the expected clean failure. Thisoccurred 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 leaston Linux it often leads to a crash.To fix, add calls to ecpg_pthreads_init() in the code paths thatmight 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, soback-patch to all supported branches.Discussion:https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org1 parentbe35a64 commit7bc21ed
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
51 | | - | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
89 | | - | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
0 commit comments
Comments
(0)