Re: BUG #19899: PL/Python backend crashes (SIGSEGV) when converting a column value to a Python object fails

From: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, marcos(dot)castedo(at)anachronics(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19899: PL/Python backend crashes (SIGSEGV) when converting a column value to a Python object fails
Date: 2026-11-17 07:39:23
Message-ID: CAB8bMit2Dh8x6qOgrGM1_OJmT++oa5y5j85BWo5O+r_q=+9baA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

вт, 17 нояб. 2026 г. в 05:55, shihao zhong <zhong950419(at)gmail(dot)com>:

> Hi Robert,
>
> Thanks for the patch.
>
> > Every case then fails with an ordinary ERROR and the session survives
>
> I tested your patch and triggers and function calls can still crash.
>
> PLy_trigger_build_args() puts unchecked results into the TD
> dictionary. PLy_procedure_call() crashes when building the argument
> list fails.
>
> V1-0001 is your patch without change
> V2-0002 adds checks for those spots and it fixed ^^^
>
> Thanks,
> Shihao
>

I also found quite a few more places where fixes can be made and I'm
attaching v3. Reworked the error handling somewhat in 0001, introduced
shared functions, and fixed plpy_typeio. In 0002 I fixed other problematic
spots in pl_python. In my view, the code has become much better.

Attachment Content-Type Size
v3-0002-Check-the-remaining-Python-API-failures-in-PL-Pyt.patch text/x-patch 12.1 KB
v3-0001-Fix-unchecked-NULL-returns-in-PL-Python-object-co.patch text/x-patch 27.7 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message surya poondla 2026-11-17 05:36:41 Re: Two issues with REFRESH MATERIALIZED VIEW CONCURRENTLY