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

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: 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 00:55:31
Message-ID: CAGRkXqTwEWgw_Shnp9zbhGBwUM5MiMWg2icTVidGhPAOTywm9g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Attachment Content-Type Size
v2-0001-Fix-PL-Python-crashes-when-a-value-can-t-be-conve.patch application/octet-stream 5.6 KB
v2-0002-plpython-Check-for-failures-while-setting-up-func.patch application/octet-stream 8.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Andres Freund 2026-11-16 23:57:55 Re: BUG #19903: ALTER COLUMN TYPE: "unexpected object depending on column" internal error via partition key