Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL

From: Shruthi Gowda <gowdashru(at)gmail(dot)com>
To: Nishant Sharma <nishant(dot)sharma(at)enterprisedb(dot)com>
Cc: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL
Date: 2026-04-18 16:20:37
Message-ID: CAASxf_OkeXLZy6r7f05-LjwxgHEXJymQgifU27CAvWEYfY7uVA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 16, 2026 at 12:34 PM Nishant Sharma <
nishant(dot)sharma(at)enterprisedb(dot)com> wrote:

> Thanks Shruthi for the new patches!
>
> I can apply v5 on all active branches (i.e master, REL_18, REL_17, REL_16,
> REL_15, REL_14).
> I checked PG's ECPG regression with v5 and v2_test on master, REL_18,
> REL_17, and REL_16 using both make and meson.
>
> The v5 patch looks good to me now. I only have a few observations on
> v2_test patch.
>
> Review comments on v2_test:
> 1. Not able to apply the v2 test patch on PG15 and PG14 branch, appears
> meson.build for test is not there on these branches. Need to remove all
> meson related changes for these branches.
> 2. char val2[5] = "data1"; --> val2's size will not be able to fit '\0'
> for the string. As size of val2 and number of characters in "data1" are
> exactly same?
> 3. "exec sql disconnect;" - Do we need this at the end as we have already
> disconnected before Test 2.
> 3. Minor - Do we need "printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);"? I
> see all others have it, but not Test 4?
>
>
> Regards,
> Nishant Sharma,
> Pune, EDB.
> https://www.enterprisedb.com/
>

Thanks Nishant for the review on the latest patch. I have taken care of all
the review comments for the test patch. Please find the latest test patches
for master to REL_16 (v3_test) and V15 to v14 (v3_test_v15) respectively.

Thanks & Regards,

Shruthi K C

EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v3_test-0001-Tests-for-NULL-connection-validation.patch application/octet-stream 12.6 KB
v3_test_v15-0001-Tests-for-NULL-connection-validation-for.patch application/octet-stream 12.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-04-18 16:25:48 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Previous Message Tom Lane 2026-04-18 15:09:31 Re: Add bms_offset_members() function for bitshifting Bitmapsets