Autovacuum worker SIGSEGV after PostgreSQL 13→14 upgrade when extension is loaded via shared_preload_libraries
Environment
PostgreSQL upgraded in-place from 13.5 to 14.2 on Ubuntu 20.04 LTS. A third-party C extension (installed from distro package and also a site-built variant) is listed in shared_preload_libraries and the cluster runs on a 16-core VM with 64GB RAM. Autovacuum runs concurrently on several large tables with high update churn.
Symptoms
Random autovacuum worker processes crash with SIGSEGV while performing VACUUM operations on large tables. Crashes occur a few minutes after autovacuum starts for a given table; normal client sessions remain connected but some background maintenance stops running. The pattern started immediately after the PostgreSQL upgrade and affects tables with frequent updates.
Observations
Postgres log shows process terminated by signal 11 (Segmentation fault) with a backtrace pointing into a symbol exported by the third-party extension (the backtrace includes extension functions called from a background worker/autovacuum stack). core dumps were collected from the host. Restarting the server clears immediate crash activity; removing the extension name from shared_preload_libraries and restarting the cluster prevents further autovacuum SIGSEGVs. Loading the extension into a database session (CREATE EXTENSION) and invoking extension functions manually in a normal backend does not reproduce the crash.
Already attempted
Collected core dumps and matching server symbols. Disabled the extension by removing it from shared_preload_libraries and restarted PostgreSQL — autovacuum no longer crashes. Rebuilt the extension from source against PostgreSQL 14 headers and reinstalled; when present in shared_preload_libraries the crash returned on staging under load. Ran vacuum manually as superuser with the extension loaded (but not preloaded at server start) — manual vacuums complete without segfault. Enabled extra logging and ran with log_min_messages=DEBUG5 to capture initialization order; no additional errors recorded prior to crashes.
Question
What causes autovacuum workers to segfault only when this extension is preloaded at server start, and what are safe remediation steps to restore background maintenance without removing the extension entirely?
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
- Databases25% match
PostgreSQL plperl functions crash server backend with SIGSEGV after system Perl upgrade
Open0 answers - Databases24% match
PostgreSQL replica falls behind and reports WAL streaming delay when frequent autovacuum runs on primary
Open0 answers - Databases21% match
PostgreSQL 14: Rapid table bloat after nightly batch UPDATEs despite autovacuum enabled
Open0 answers - Databases21% match
Logical backups hang waiting for locks when VACUUM FULL is running on large PostgreSQL tables
Open0 answers - Databases21% match
PostgreSQL 14: lo_export/large object operations intermittently fail with 'could not open large object' when keepalives drop during long client transactions
Open0 answers