PostgreSQL plperl functions crash server backend with SIGSEGV after system Perl upgrade
Environment
PostgreSQL 13.8 on CentOS 7 hosts, plperl installed and used for several stored procedures. System Perl recently upgraded from 5.16 to 5.30 via vendor-supplied package; perl-modules and shared libraries updated. PostgreSQL installed from RPMs and plperl linked against system Perl.
Symptoms
Invoking plperl function causes backend to crash (segfault). PostgreSQL logs show 'server process (PID) exited with exit code 1' and core dump generated. After crash, clients attempting to call plperl get 'could not connect to server: Connection refused' until postmaster restarts. Non-plperl functions continue to work.
Observations
gdb backtrace from core shows crash inside XS call into Perl interpreter (e.g., sv_magicext, perl_alloc). reinstalling PostgreSQL server package without changing Perl does not help. Running perl -v shows new version 5.30. plpython and other procedural languages unaffected. ldconfig shows multiple libperl.so.* versions in /usr/lib64.
Already attempted
Rebuilt plperl from source against current Perl headers (attempt in staging) which prevented crash in that build, indicating ABI mismatch. On production, attempted to yum downgrade Perl packages but package manager held other dependent packages. Did not alter database binaries in production environment; created new test database on staging to confirm rebuild resolves segfault.
Question
What reversible steps can I take on production to restore plperl stability without risking data, and how should I decide between rebuilding plperl, downgrading system Perl, or isolating plperl use?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags