plpython tests fail against python 3.14 under Valgrind

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: plpython tests fail against python 3.14 under Valgrind
Date: 2026-07-28 05:00:01
Message-ID: f071e691-5930-4738-9dbd-43ed2da367fe@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers,

As buildfarm animal skink shows, upgrade to Python 3.14 breaks plpython
tests under Valgrind [1]:
 61/400 plpython - postgresql:plpython/regress ERROR             49.88s   exit status 1

pgsql.build/testrun/plpython/regress/log/postmaster.log
Fatal Python error: pycore_init_builtins: failed to add exceptions to builtins
Python runtime state: preinitialized
object address  : 0x139da4a0
object refcount : 1
object type     : 0x1388d020
object type name: RecursionError
object repr     :
lost sys.stderr

Current thread 0x0000000008c62ec0 [memcheck-amd64-] (most recent call first):
  <no Python frame>

I've reproduced this locally and confirmed that it's not reproduced with
PLPYTHON="python3.13" ./configure ...
It's also not reproduced on master, probably just because of a bit lesser
stack usage. I've bisected the anomaly and found what makes master pass
the tests: aeb07c55f.

AI suggests the offending change in Python 3.14 is [2]:
Use Py_EnterRecursiveCall() to guard against runaway recursion in C code

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2026-07-27%2013%3A09%3A55
[2] https://docs.python.org/3/whatsnew/3.14.html

Best regards,
Alexander

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-07-28 05:14:57 Re: aio tests failing on newer Linux kernels
Previous Message Peter Smith 2026-07-28 04:59:29 Missing list_free in publicationcmds.c:OpenTableList