From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17416: Server crashes due to python3 stack overflow on executing multiple plpy.rollback() calls
Date: Wed, 23 Feb 2022 11:27:30 -0500
Message-ID: <1048491.1645633650@sss.pgh.pa.us> (raw)
In-Reply-To: <17416-ed8fe5d7213d6c25@postgresql.org>
References: <17416-ed8fe5d7213d6c25@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> When executing the following script:
> psql -c "
> CREATE EXTENSION plpython3u;
> CREATE FUNCTION plpy_xact_test() RETURNS int
> LANGUAGE plpython3u
> AS '
> plpy.rollback()
> return 1
> '"
> for i in `seq 500`; do echo "SELECT plpy_xact_test();"; done | psql
> I get the server crash with the following stack trace:
Interesting. For me, 500 repetitions won't crash it, but 1000 will.
Apparently, each escape out of plpy.rollback leaves an open frame
on Python's internal control stack, and eventually it barfs.
So this is a different way to reach the problems already under
investigation at [1]. You don't really need a bleeding-edge
Python at all.
regards, tom lane
[1] https://www.postgresql.org/message-id/flat/3375ffd8-d71c-2565-e348-a597d6e739e3@enterprisedb.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, peter.eisentraut@enterprisedb.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17416: Server crashes due to python3 stack overflow on executing multiple plpy.rollback() calls
In-Reply-To: <1048491.1645633650@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox