Re: [PATCH] Fix segmentation fault and infinite loop in jsonb_{plperl,plpython}

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Fix segmentation fault and infinite loop in jsonb_{plperl,plpython}
Date: 2026-06-16 21:10:16
Message-ID: 967540.1781644216@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aleksander Alekseev <aleksander(at)tigerdata(dot)com> writes:
>> We could instead add a CHECK_FOR_INTERRUPTS, so that you can at
>> least break out of the infinite loop. I'm not sure if the case
>> is worth more effort than that.

> Alternatively I could implement a check for the loops, if you feel
> like this is worth the effort.

I thought about that, but I'm not sure how to build a bulletproof
check at reasonable (ie, near zero) cost. We could detect the example
case where an object refers directly to itself, by noticing that "in"
doesn't change in one iteration. But I'm pretty sure it's possible to
build reference loops involving two or more Perl objects, and those
would fool such a check.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2026-06-16 21:25:18 Re: [PATCH] Fix segmentation fault and infinite loop in jsonb_{plperl,plpython}
Previous Message Aleksander Alekseev 2026-06-16 21:03:12 Re: [PATCH] Fix segmentation fault and infinite loop in jsonb_{plperl,plpython}