Re: [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements - Mailing list pgsql-hackers

From David Rowley
Subject Re: [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements
Date
Msg-id CAApHDvqcJvaJWjzvwDOUM7QFrdejguqmg2Owe1OBVfevibmE6w@mail.gmail.com
Whole thread Raw
In response to [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements  (Ankit Kumar Pandey <itsankitkp@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Wrong results from Parallel Hash Full Join
Next
From: Robert Haas
Date:
Subject: Re: Non-superuser subscription owners