Re: Integer undeflow in fprintf in dsa.c
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Ильясов Ян <ianilyasov@outlook.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-02-20T12:22:48Z
Lists: pgsql-hackers
On Tue, Feb 20, 2024 at 5:30 PM Daniel Gustafsson <daniel@yesql.se> wrote: > The message "at least 0 contiguous pages free" reads a bit nonsensical though, > wouldn't it be preferrable to check for i being zero and print a custom message > for that case? Something like the below untested sketch? > > + if (i == 0) > + fprintf(stderr, > + " segment bin %zu (no contiguous free pages):\n", i); > + else > + fprintf(stderr, > + " segment bin %zu (at least %d contiguous pages free):\n", > + i, 1 << (i - 1)); That does seem reasonable. However, this is just debugging code, so it also probably isn't necessary to sweat anything too much. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Fix integer underflow in shared memory debugging
- d5c3d6ca0152 13.15 landed
- a30a305584b8 16.3 landed
- 6fd144e3a966 17.0 landed
- 55ea12a28277 15.7 landed
- 24dc4afebd5a 12.19 landed
- 217928ddb45a 14.12 landed
-
Introduce dynamic shared memory areas.
- 13df76a537cc 10.0 cited