Re: [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Ankit Kumar Pandey <itsankitkp(at)gmail(dot)com>
Cc: pghackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements
Date: 2023-04-12 11:48:08
Message-ID: CAApHDvqcJvaJWjzvwDOUM7QFrdejguqmg2Owe1OBVfevibmE6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 12 Apr 2023 at 03:49, Ankit Kumar Pandey <itsankitkp(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-04-12 12:19:51 Re: Non-superuser subscription owners
Previous Message Richard Guo 2023-04-12 11:35:53 Wrong results from Parallel Hash Full Join