Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKNR5-000uFD-0f for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2026 21:36:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKNR4-00E5Xs-07 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2026 21:36:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKNR3-00E5Xk-1z for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2026 21:36:09 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wKNR1-00000000ie4-0Fm8 for pgsql-hackers@postgresql.org; Tue, 05 May 2026 21:36:09 +0000 Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-8b5de17382cso35032296d6.1 for ; Tue, 05 May 2026 14:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20251104.gappssmtp.com; s=20251104; t=1778016965; x=1778621765; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=b1W9MCOm6mGNP7NDjfxXqRhrN7IiEaT25srx21QIBW8=; b=0cgn8eSqK+IZ5hL4GqCyuacdYAcj/0tQTIfNAO1556X+jAuZ7+IhrTSzGu75FZeE66 plGyNtOtDxQIc0Grq1iHPini+Gl3WnP32pcsTbtgvJ14/yMBUVeaYGd87xZ6Yzr1MTAx OUbfDmjtLaZsSb5Om7LJ8lUJCL4bnhY5LgT+46Boy28si9puPQHGImDS22TDQZtClQyW UIKD1zxOWPtrnjAI8DldMNlGPA8wgpbv5LKaQgZPILdEShM5yWu7kx8IaOXIyFfGv9DK a9kO2iRlXYY3Y8nS7dT1ry7kRRlW5TEiAMq1S58KoToCjIdiOfqS5iWosXX7wx7C7PIQ OayA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778016965; x=1778621765; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=b1W9MCOm6mGNP7NDjfxXqRhrN7IiEaT25srx21QIBW8=; b=Et8lv1CQnvRaRzpKOeb1pVYb5eotwLaREhUC1Thd7JrY7ySRwRZnYXKx4TX1vOf7BY Wf6UWd2tVaf6LoQeKm8/0Ald2i7PJRyGh9BVqh2LCgMlBQ0epDVcTe3ctdZNQxxWq4TY wgMDIY+jy/UyL4MUbifbjCq3uK0ar+elmQ0ASZz9pcOca/YPWW8IgAE7/RuBvPDLfDYW 3xU0dBR/aUHxReGqRpeoFR7KcRCjbvSp6jpLTRYPijQPq+d88mIUftShmvFL5iHA/N0G m5sNDe0Nnr2biauNCK/u3m51BkA00uZREmQltMTahl/jmJgu+sYG8pJYC0sinjt7Zjpq t/Bg== X-Forwarded-Encrypted: i=1; AFNElJ/uMbLouP802uY9SINoO9C2r7Dc7IUaAYPj89cRZ1I0LJlc6dqBqt3EsbePnmweUdXQdLPWn4ljMWhzBixk@postgresql.org X-Gm-Message-State: AOJu0YxJmthuSnh2bLWSzU7EAkpLdz37Zr1NxDrMjn+kDjBpxhH2OQso J0Coi9wJ13VnV8G3JOFtxCRodW3b5XqIj2ylwhoYuC6q3zQQZNDV29ZV7LeKwo8FuSclZDefn5l +HxQm X-Gm-Gg: AeBDiesom1H8mysVr8M9eMzzB9oBqimiW6rNOvgQDyTNJsHXIh2FYM5BjV2R4b/UQ/g 2+3pJtJ9MaDDfoJaBtW30gd2/i04DHP3brTVZU3nS0gc9XjFpjJkbg0jDEJ2GEsgU9Lhx4IhMbg enLg/L1hz/PoKQAJpi81hIF8K80Uu363KlU1WbFsIhgi6YejnYx9tKMq+YxmdnFZRxVH0W4JMH/ 7K6HoayyoL71bHo+94bi4NJYSGnwQj55EpW/V3ceWB/Jq2oFfqOv+zo4DROzvhWfkGzhByj0z2N qCUk9cuKvETflKUFqyY80QCPEFRb9kUsdnuckfVDUo542cBIU3mcOkOPcqPN2jcZfYW3jOg0i1o L/0Qbkn/EjcACI0uz4TqkEdt29uDbO/yUd8qcVsFhaCh5XcYjK3Mf6TKnapv5hYMDmFYfzj5hxv lXbH+zcSuN35bppu1htnr+OxDskn7gETDmqRqslIuY X-Received: by 2002:a0c:f003:0:b0:89c:a2c8:9432 with SMTP id 6a1803df08f44-8bc3ec26649mr9696006d6.0.1778016964615; Tue, 05 May 2026 14:36:04 -0700 (PDT) Received: from ?IPV6:2605:a601:a6b0:500::1cb? ([2605:a601:a6b0:500::1cb]) by smtp.googlemail.com with ESMTPSA id 6a1803df08f44-8b53c6b8398sm178693206d6.37.2026.05.05.14.36.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 May 2026 14:36:04 -0700 (PDT) Message-ID: Date: Tue, 5 May 2026 17:36:02 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL To: Tom Lane , Alexander Lakhin Cc: Nishant Sharma , Shruthi Gowda , Mahendra Singh Thalor , Fujii Masao , PostgreSQL Development References: <75460b3c-2! 55d-47eb-b889-d99de38e6758@gmail.com> <699623.1778013161@sss.pgh.pa.us> From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWF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jgna2Rk6e15kln4ZvFBWUg23p93w/pqXcxY6+k/8TEk+C4R+M6w7o2PLGOjdZ +kPiUcw5H85zf/yZJwQXzisXaNduwWB6Vads9YC9dj6kPR1c4VGRqAaYL++LAEOqrlvm2Tvq QqZRtnEAEQEAAcLAfAQYAQgAJgIbDBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ/DuBBQJoGNI2BQkd EODdAAoJEJn6f8tZ/DuBfw0IAKTsfD40teP/pp+bsLLMSxPXUYrrprTj7WFB5v61p6dkpSr/ qXmMlyahdxQFaPmfVgVirB1Vk/kHiWNnnGjfUV9nB2Zg9LI0Xb9/ts3LsUiRWXzG3tkMY6XL vsVOxW4XFRND9l2q+WW93aZ1DZl+fqWfYgMvsusFRhmGFOKTRfKPta2Pkv+AhA24N4+PrR5p bU4k2MO8PAGiK8eaYKGFG1bHKuAvoDoF7WXJ3FHxuWqLnKEt4dfOLm5pAe3zq1Lt6q8azT9i QWGpSAK5vQUWQHBHpiDjdPeqKZ6HiAXIIKfSmb+jrvXBqoP+D6/K7rUjG2aXiRtTIAXms9sm VRu7cmw= In-Reply-To: <699623.1778013161@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-05-05 Tu 4:32 PM, Tom Lane wrote: > Alexander Lakhin 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 > > > Ugh. I will do some digging. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com