]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix integer underflow in shared memory debugging
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 29 Feb 2024 11:19:52 +0000 (12:19 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 29 Feb 2024 11:19:52 +0000 (12:19 +0100)
commitd5c3d6ca0152b8ea4870effcd49521e4f767ccac
treeaddda6cb62fa7393d176b1fb23663538b8db1883
parent43cca9de9a0adf3fb47aaa6310cc0022a78eee8a
Fix integer underflow in shared memory debugging

dsa_dump would print a large negative number instead of zero for
segment bin 0.  Fix by explicitly checking for underflow and add
special case for bin 0. Backpatch to all supported versions.

Author: Ian Ilyasov <ianilyasov@outlook.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://postgr.es/m/GV1P251MB1004E0D09D117D3CECF9256ECD502@GV1P251MB1004.EURP251.PROD.OUTLOOK.COM
Backpatch-through: v12
src/backend/utils/mmgr/dsa.c