Re: [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Ankit Kumar Pandey <itsankitkp@gmail.com>
Cc: pghackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-04-12T11:48:08Z
Lists: pgsql-hackers
On Wed, 12 Apr 2023 at 03:49, Ankit Kumar Pandey <itsankitkp@gmail.com> wrote: > Also, comments on BogusFree mentions `As a possible > aid in debugging, we report the header word along with the pointer > address`. How can we interpret useful debugging information from this? > > `pfree called with invalid pointer 0x7ff1706d0030 (header > 0x4fc8000100000000)` elog(ERROR)s are not meant to happen. ISTM, what's there is about the best that can be done with our current infrastructure. If that occurs on some machine that we can't get access to debug on, then having the header bits might be useful, at least, certainly much more useful than just not having them at all. If you can think of something more useful to put in the elog, then we could consider changing it to improve it. Just in case you suggest it, I don't believe it's wise to try and split it out into the components of MemoryChunk's hdrmask. MemoryContexts aren't forced into using that. They're only forced into using the 3 least significant bits for the MemoryContextMethodID. David
Commits
-
intarray: Prevent out-of-bound memory reads with gist__int_ops
- ab40b0395a75 11.21 landed
- 6ecc1c02ade5 12.16 landed
- ae9aac64a38f 13.12 landed
- 019a40d61959 14.9 landed
- 4be308edee44 15.4 landed
- c00fbe89dc51 16.0 landed