Re: [BUG] ECPG crash with union type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG] ECPG crash with union type
Date: 2026-06-25 20:46:05
Message-ID: 1103650.1782420365@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com> writes:
> One of our customer hit a sigsev with ecpg lately. Their team created a simple
> scenario and point us the origin of the crash in ECPG code. The credit goes to
> them (iMSA) for that work.
> ...
> If setting "$$.type_sizeof = NULL;" is legit for unions (I didn't try to wrap
> my head around this code), maybe this change should be:

> - ne->struct_sizeof = struct_sizeof;
> + ne->struct_sizeof = struct_sizeof ? mm_strdup(struct_sizeof):NULL;

Yeah, I agree. Will fix, thanks for the report!

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2026-06-25 21:05:10 Re: pg_stat_statements: Remove (errcode...) framing parentheses in erport(...)
Previous Message Bharath Rupireddy 2026-06-25 20:44:28 Re: Make pg_prewarm, autoprewarm yield for waiting DDL