[Bug 294039] databases/postgresql14-server: crashes triggered by autovacuum
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Mar 2026 11:11:51 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294039
Bug ID: 294039
Summary: databases/postgresql14-server: crashes triggered by
autovacuum
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: pgsql@FreeBSD.org
Reporter: martin@lispworks.com
Flags: maintainer-feedback?(pgsql@FreeBSD.org)
Assignee: pgsql@FreeBSD.org
After updating from FreeBSD 14.3-RELEASE-p7 to 14.3-RELEASE-p8, autovacuum has
been causing crashes in the postgres processes about once a week during heavy
usage. The postgresql14-server versions were 14.20_1 and 14.21.
This has happened on two different machines, which run completely different
database applications (the only common thing is that they do lots of inserts).
The applications haven't changed and have been running 100% reliably every day
since 14.3-RELEASE-p5 in Nov 2025 (and prior to that with FreeBSD 13.x with
various versions of postgresql14-server and for years with previous versions).
I've not seen any other problems on these machines. Machine 1 is physical
hardware with root on zfs. Machine 2 is a VM in the cloud with root on ufs and
no zfs.
I've not seen any crashes since setting autovacuum = off at the beginning on
March.
It started crashing on machine 1 after these upgrades:
freebsd-update:
FreeBSD 14.3-RELEASE-p7 to 14.3-RELEASE-p8
pkg upgrade:
ImageMagick7: 7.1.2.11 -> 7.1.2.11_1 [FreeBSD]
colord: 1.4.8 -> 1.4.8_1 [FreeBSD]
emacs: 30.2,3 -> 30.2_1,3 [FreeBSD]
expat: 2.7.3 -> 2.7.4 [FreeBSD]
ffmpeg: 8.0.1_3,1 -> 8.0.1_4,1 [FreeBSD]
ghostscript10: 10.06.0_1 -> 10.06.0_2 [FreeBSD]
git: 2.52.0 -> 2.53.0 [FreeBSD]
libjxl: 0.11.1_2 -> 0.11.1_3 [FreeBSD]
libplacebo: 7.351.0_1 -> 7.351.0_2 [FreeBSD]
libraw: 0.21.5 -> 0.21.5_1 [FreeBSD]
lmdb: 0.9.33,1 -> 0.9.35,1 [FreeBSD]
openjpeg: 2.5.4_1 -> 2.5.4_2 [FreeBSD]
p11-kit: 0.26.1 -> 0.26.2 [FreeBSD]
pango: 1.56.4 -> 1.56.4_1 [FreeBSD]
py311-cryptography: 46.0.3_1,1 -> 46.0.4,1 [FreeBSD]
py311-packaging: 25.0 -> 26.0 [FreeBSD]
python311: 3.11.14_1 -> 3.11.14_2 [FreeBSD]
shaderc: 2025.5_1 -> 2026.1 [FreeBSD]
It started crashing on machine 2 after these upgrades:
freebsd-update:
FreeBSD 14.3-RELEASE-p7 to 14.3-RELEASE-p8
pkg upgrade:
pkg: 2.4.2 -> 2.5.1 [FreeBSD]
apr: 1.7.5.1.6.3_5 -> 1.7.6.1.6.3 [FreeBSD]
bind-tools: 9.20.17 -> 9.20.18_2 [FreeBSD]
boost-libs: 1.88.0_2 -> 1.89.0_2 [FreeBSD]
brotli: 1.1.0,1 -> 1.2.0,1 [FreeBSD]
ca_root_nss: 3.115_4 -> 3.117_2 [FreeBSD]
curl: 8.16.0 -> 8.17.0 [FreeBSD]
gdb: 15.1_3 -> 15.1_4 [FreeBSD]
gettext-runtime: 0.23.1 -> 0.26 [FreeBSD]
libedit: 3.1.20250104,1 -> 3.1.20251016_1,1 [FreeBSD]
libiconv: 1.17_1 -> 1.18_1 [FreeBSD]
liblz4: 1.10.0,1 -> 1.10.0_2,1 [FreeBSD]
libnghttp2: 1.67.0 -> 1.68.0 [FreeBSD]
libsodium: 1.0.19 -> 1.0.21 [FreeBSD]
libxml2: 2.14.5 -> 2.15.1 [FreeBSD]
p5-CGI: 4.70 -> 4.71 [FreeBSD]
p5-HTTP-Message: 7.00 -> 7.01 [FreeBSD]
p5-URI: 5.32_1 -> 5.34 [FreeBSD]
pcre2: 10.46 -> 10.47_1 [FreeBSD]
postgresql14-client: 14.20_1 -> 14.20_2 [FreeBSD]
postgresql14-server: 14.20 -> 14.20_1 [FreeBSD]
proftpd: 1.3.8c_1 -> 1.3.8c_2 [FreeBSD]
python311: 3.11.14 -> 3.11.14_1 [FreeBSD]
readline: 8.2.13_2 -> 8.3.3 [FreeBSD]
rsync: 3.4.1_4 -> 3.4.1_5 [FreeBSD]
source-highlight: 3.1.9_13 -> 3.1.9_14 [FreeBSD]
zstd: 1.5.7 -> 1.5.7_1 [FreeBSD]
There are three backtraces below.
This is a backtrace in an autovacuum worker process on machine 1 with
postgresql14-server-14.20_1:
Program terminated with signal SIGBUS, Bus error.
#0 0x0000000826fbfa93 in extent_try_coalesce_impl
(tsdn=tsdn@entry=0x22513e089090, arena=0x22513e200980,
r_extent_hooks=0x8215e0578, rtree_ctx=rtree_ctx@entry=0x22513e0890c0,
extents=extents@entry=0x22513e2058d8,
extent=0x22513e30eb80, coalesced=0x0, growing_retained=<optimized out>,
inactive_only=<optimized out>) at jemalloc_extent.c:1620
#1 0x0000000826fbc9e8 in extent_try_coalesce (tsdn=0x22513e089090,
arena=0x22513e200980, r_extent_hooks=0x8215e0578,
rtree_ctx=0x22513e0890c0, extents=0x22513e2058d8, extent=0x22513e30eb80,
coalesced=0x0, growing_retained=<optimized out>)
at jemalloc_extent.c:1678
#2 extent_record (tsdn=tsdn@entry=0x22513e089090,
arena=arena@entry=0x22513e200980,
r_extent_hooks=r_extent_hooks@entry=0x8215e0578,
extents=extents@entry=0x22513e2058d8, extent=0x22513e30eb80,
growing_retained=<optimized out>) at jemalloc_extent.c:1717
#3 0x0000000826fbd855 in extent_grow_retained (tsdn=0x22513e089090,
arena=0x22513e200980, r_extent_hooks=0x8215e0578,
size=<optimized out>, pad=4096, alignment=<optimized out>, slab=<optimized
out>, szind=<optimized out>, zero=<optimized out>,
commit=<optimized out>) at jemalloc_extent.c:1383
#4 extent_alloc_retained (tsdn=0x22513e089090, arena=0x22513e200980,
r_extent_hooks=0x8215e0578, size=262144, pad=4096,
alignment=<optimized out>, slab=<optimized out>, commit=<optimized out>,
new_addr=<optimized out>, szind=<optimized out>,
zero=<optimized out>) at jemalloc_extent.c:1480
#5 __je_extent_alloc_wrapper (tsdn=0x22513e089090,
arena=arena@entry=0x22513e200980,
r_extent_hooks=r_extent_hooks@entry=0x8215e0578,
new_addr=new_addr@entry=0x0, size=size@entry=262144, pad=pad@entry=4096,
alignment=64, slab=<optimized out>, szind=52, zero=0x8215e05cf,
commit=0x8215e0577) at jemalloc_extent.c:1539
#6 0x0000000826f9a866 in __je_arena_extent_alloc_large
(tsdn=0xc4ceb9fe1a85ec53, tsdn@entry=0x22513e089090,
arena=arena@entry=0x22513e200980, usize=262144, alignment=<optimized out>,
zero=zero@entry=0x8215e05cf) at jemalloc_arena.c:448
#7 0x0000000826fc2545 in __je_large_palloc (tsdn=0x22513e089090,
arena=<optimized out>, usize=<optimized out>,
alignment=alignment@entry=64, zero=<optimized out>) at jemalloc_large.c:47
#8 0x0000000826fc23a2 in __je_large_malloc (tsdn=0xc4ceb9fe1a85ec53,
arena=0xff51afd7ed558ccd, usize=1937131034, zero=false)
at jemalloc_large.c:17
#9 0x0000000826f9c405 in __je_arena_malloc_hard (tsdn=0xc4ceb9fe1a85ec53,
tsdn@entry=0x22513e089090, arena=0xff51afd7ed558ccd,
arena@entry=0x0, size=<optimized out>, ind=2181051958, zero=false) at
jemalloc_arena.c:1528
#10 0x0000000826f8f6e5 in arena_malloc (tsdn=0x22513e089090, arena=0x0,
ind=2181051958, zero=false, tcache=0x22513e089280,
slow_path=false, size=<optimized out>) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:176
#11 iallocztm (tsdn=0x22513e089090, ind=2181051958, zero=false,
tcache=0x22513e089280, is_internal=false, arena=0x0,
slow_path=false, size=<optimized out>) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h:53
#12 imalloc_no_sample (tsd=0x22513e089090, usize=262144, ind=2181051958,
sopts=<optimized out>, dopts=<optimized out>,
size=<optimized out>) at jemalloc_jemalloc.c:1953
#13 imalloc_body (tsd=0x22513e089090, sopts=<optimized out>, dopts=<optimized
out>) at jemalloc_jemalloc.c:2153
#14 imalloc (sopts=<optimized out>, dopts=<optimized out>) at
jemalloc_jemalloc.c:2262
#15 __je_malloc_default (size=<optimized out>) at jemalloc_jemalloc.c:2293
#16 0x000000000097d1e3 in ?? ()
#17 0x0000000000984d5b in palloc ()
#18 0x000000000094926f in ?? ()
#19 0x0000000000949d3e in RelationCacheInitializePhase3 ()
#20 0x0000000000965ac1 in InitPostgres ()
#21 0x000000000077c20e in ?? ()
#22 0x000000000077bee7 in StartAutoVacWorker ()
#23 0x000000000078bc31 in ?? ()
#24 0x0000000822bc34a0 in handle_signal (actp=actp@entry=0x8215e1190,
sig=sig@entry=30, info=info@entry=0x8215e1580,
ucp=ucp@entry=0x8215e1210) at /usr/src/lib/libthr/thread/thr_sig.c:299
#25 0x0000000822bc2a6b in thr_sighandler (sig=30, info=0x8215e1580,
_ucp=0x8215e1210) at /usr/src/lib/libthr/thread/thr_sig.c:242
#26 <signal handler called>
#27 _select () at _select.S:4
#28 0x0000000822bc5824 in __thr_select (numfds=9, readfds=0x8215e16d0,
writefds=0x0, exceptfds=0x0, timeout=0x8215e17d0)
at /usr/src/lib/libthr/thread/thr_syscalls.c:492
#29 0x000000000078d6bb in ?? ()
#30 0x000000000078af14 in PostmasterMain ()
#31 0x00000000006e64b1 in main ()
Just after this, the application process lost its database connection ("server
closed the connection unexpectedly").
This is another backtrace in an autovacuum worker process on machine 1, this
time with postgresql14-server-14.21:
Program terminated with signal SIGBUS, Bus error.
#0 0x000000082a8b5c04 in _swrite (fp=fp@entry=0x82a984120,
buf=buf@entry=0x6e65206665642070 <error: Cannot access memory at address
0x6e65206665642070>, n=n@entry=134947567)
at /usr/src/lib/libc/stdio/stdio.c:116
#1 0x000000082a8adbfe in __sflush (fp=fp@entry=0x82a984120) at
/usr/src/lib/libc/stdio/fflush.c:125
#2 0x000000082a8b133e in _fwalk (function=0x82a8adba0 <__sflush>) at
/usr/src/lib/libc/stdio/fwalk.c:62
#3 0x000000082a8fe47a in exit (status=0) at /usr/src/lib/libc/stdlib/exit.c:94
#4 0x00000000007f454a in proc_exit ()
#5 0x000000000077dd3f in ?? ()
#6 0x000000000077d997 in StartAutoVacWorker ()
#7 0x000000000078d6e1 in ?? ()
#8 0x00000008223f74a0 in handle_signal (actp=actp@entry=0x8212108d0,
sig=sig@entry=30, info=info@entry=0x821210cc0,
ucp=ucp@entry=0x821210950) at /usr/src/lib/libthr/thread/thr_sig.c:299
#9 0x00000008223f6a6b in thr_sighandler (sig=30, info=0x821210cc0,
_ucp=0x821210950) at /usr/src/lib/libthr/thread/thr_sig.c:242
#10 <signal handler called>
#11 _select () at _select.S:4
#12 0x00000008223f9824 in __thr_select (numfds=9, readfds=0x821210e10,
writefds=0x0, exceptfds=0x0, timeout=0x821210f10)
at /usr/src/lib/libthr/thread/thr_syscalls.c:492
#13 0x000000000078f16b in ?? ()
#14 0x000000000078c9c4 in PostmasterMain ()
#15 0x00000000006e7f51 in main ()
As before, just after this, the application process lost its database
connection ("server closed the connection unexpectedly").
This is another backtrace, this time in the application's postgres process on
machine 2 with postgresql14-server-14.20_1:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000000082b9f4a93 in extent_try_coalesce_impl
(tsdn=tsdn@entry=0x184fa2a89090, arena=0x184fa2c00980,
r_extent_hooks=0x821619bf8, rtree_ctx=rtree_ctx@entry=0x184fa2a890c0,
extents=extents@entry=0x184fa2c058d8, extent=0x184fa2d10200, coalesced=0x0,
growing_retained=<optimized out>, inactive_only=<optimized out>) at
jemalloc_extent.c:1620
#1 0x000000082b9f19e8 in extent_try_coalesce (tsdn=0x184fa2a89090,
arena=0x184fa2c00980, r_extent_hooks=0x821619bf8, rtree_ctx=0x184fa2a890c0,
extents=0x184fa2c058d8, extent=0x184fa2d10200, coalesced=0x0,
growing_retained=<optimized out>) at jemalloc_extent.c:1678
#2 extent_record (tsdn=tsdn@entry=0x184fa2a89090,
arena=arena@entry=0x184fa2c00980,
r_extent_hooks=r_extent_hooks@entry=0x821619bf8,
extents=extents@entry=0x184fa2c058d8, extent=0x184fa2d10200,
growing_retained=<optimized out>) at jemalloc_extent.c:1717
#3 0x000000082b9f2855 in extent_grow_retained (tsdn=0x184fa2a89090,
arena=0x184fa2c00980, r_extent_hooks=0x821619bf8, size=<optimized out>,
pad=0x1000, alignment=<optimized out>, slab=<optimized out>, szind=<optimized
out>, zero=<optimized out>, commit=<optimized out>) at jemalloc_extent.c:1383
#4 extent_alloc_retained (tsdn=0x184fa2a89090, arena=0x184fa2c00980,
r_extent_hooks=0x821619bf8, size=0x200000, pad=0x1000, alignment=<optimized
out>, slab=<optimized out>, commit=<optimized out>, new_addr=<optimized out>,
szind=<optimized out>, zero=<optimized out>) at jemalloc_extent.c:1480
#5 __je_extent_alloc_wrapper (tsdn=0x184fa2a89090,
arena=arena@entry=0x184fa2c00980,
r_extent_hooks=r_extent_hooks@entry=0x821619bf8, new_addr=new_addr@entry=0x0,
size=size@entry=0x200000, pad=pad@entry=0x1000, alignment=0x40, slab=<optimized
out>, szind=0x40, zero=0x821619c4f, commit=0x821619bf7) at
jemalloc_extent.c:1539
#6 0x000000082b9cf866 in __je_arena_extent_alloc_large
(tsdn=0xc4ceb9fe1a85ec53, tsdn@entry=0x184fa2a89090,
arena=arena@entry=0x184fa2c00980, usize=0x200000, alignment=<optimized out>,
zero=zero@entry=0x821619c4f) at jemalloc_arena.c:448
#7 0x000000082b9f7545 in __je_large_palloc (tsdn=0x184fa2a89090,
arena=<optimized out>, usize=<optimized out>, alignment=alignment@entry=0x40,
zero=<optimized out>) at jemalloc_large.c:47
#8 0x000000082b9f73a2 in __je_large_malloc (tsdn=0xc4ceb9fe1a85ec53,
arena=0xff51afd7ed558ccd, usize=0xdd9d807a, zero=0x0) at jemalloc_large.c:17
#9 0x000000082b9d1405 in __je_arena_malloc_hard (tsdn=0xc4ceb9fe1a85ec53,
tsdn@entry=0x184fa2a89090, arena=0xff51afd7ed558ccd, arena@entry=0x0,
size=<optimized out>, ind=0x1df040b8, zero=0x0) at jemalloc_arena.c:1528
#10 0x000000082b9c46e5 in arena_malloc (tsdn=0x184fa2a89090, arena=0x0,
ind=0x1df040b8, zero=0x0, tcache=0x184fa2a89280, slow_path=0x0, size=<optimized
out>) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:176
#11 iallocztm (tsdn=0x184fa2a89090, ind=0x1df040b8, zero=0x0,
tcache=0x184fa2a89280, is_internal=0x0, arena=0x0, slow_path=0x0,
size=<optimized out>) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h:53
#12 imalloc_no_sample (tsd=0x184fa2a89090, usize=0x200000, ind=0x1df040b8,
sopts=<optimized out>, dopts=<optimized out>, size=<optimized out>) at
jemalloc_jemalloc.c:1953
#13 imalloc_body (tsd=0x184fa2a89090, sopts=<optimized out>, dopts=<optimized
out>) at jemalloc_jemalloc.c:2153
#14 imalloc (sopts=<optimized out>, dopts=<optimized out>) at
jemalloc_jemalloc.c:2262
#15 __je_malloc_default (size=<optimized out>) at jemalloc_jemalloc.c:2293
#16 0x000000000097d1e3 in ?? ()
#17 0x0000000000984e1b in palloc0 ()
#18 0x00000000004ec0f0 in heap_form_minimal_tuple ()
#19 0x000000000098cc3e in ?? ()
#20 0x000000000098fc4a in tuplesort_puttupleslot ()
#21 0x00000000006c2b45 in ?? ()
#22 0x00000000006b851e in ?? ()
#23 0x00000000006b7d10 in ?? ()
#24 0x000000000069216b in standard_ExecutorRun ()
#25 0x000000000081e203 in ?? ()
#26 0x000000000081de25 in PortalRun ()
#27 0x000000000081cfd9 in ?? ()
#28 0x000000000081aa98 in PostgresMain ()
#29 0x000000000078e392 in ?? ()
#30 0x000000000078dbdc in ?? ()
#31 0x000000000078af14 in PostmasterMain ()
#32 0x00000000006e64b1 in main ()
--
You are receiving this mail because:
You are the assignee for the bug.