Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>,
Nishant Sharma <nishant.sharma@enterprisedb.com>,
Shruthi Gowda <gowdashru@gmail.com>,
Mahendra Singh Thalor <mahi6run@gmail.com>,
Fujii Masao <masao.fujii@gmail.com>,
PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2026-05-05T20:32:41Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add missing connection validation in ECPG
- f0e3f9732d41 14.23 landed
- 6916f4410051 15.18 landed
- 7e4c871f4181 16.14 landed
- 5d67549d9412 17.10 landed
- e2688ea5e411 18.4 landed
- c34a280c85b3 19 (unreleased) landed
Alexander Lakhin <exclusion@gmail.com> writes: > There is no other useful information in the log, so it's not clear what's > wrong with that animal (no other gives us such failures), but I could > produce something similar (on FreeBSD and Linux) with: > echo "max_connections = 10" >/tmp/temp.config; TEMP_CONFIG=/tmp/temp.config gmake -s check -C src/interfaces/ecpg/test Yes, I can also reproduce problems with the ecpg tests at max_connections = 10. For me, thread/prep segfaults but thread/alloc just seems to hang indefinitely. (thread/prep sometimes does too.) These issues are not new; v18 does the same. The reporting is a bit different but I think that's from pg_regress changes not ecpg. Looking at the postmaster log, I see 2026-05-05 16:11:06.509 EDT [682116] FATAL: sorry, too many clients already which is unsurprising in this situation, but apparently these tests don't handle a connection failure well at all. There's no such message in dikkop's log, so that may be an unrelated problem. BTW, reducing max_connections to 5 causes several other tests to fail, but in unsurprising ways, like # +SQL error: could not connect to database "ecpg1_regression" on line 107 # +SQL error: could not connect to database "ecpg1_regression" on line 107 # +SQL error: could not connect to database "ecpg1_regression" on line 107 # +SQL error: could not connect to database "ecpg1_regression" on line 107 regards, tom lane