Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmYxf-00063w-EJ for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2023 11:48:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmYxe-0005VC-2t for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2023 11:48:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmYxd-0005V3-O5 for pgsql-hackers@lists.postgresql.org; Wed, 12 Apr 2023 11:48:25 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pmYxb-0008HZ-MD for pgsql-hackers@lists.postgresql.org; Wed, 12 Apr 2023 11:48:24 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-54c061acbc9so353519277b3.11 for ; Wed, 12 Apr 2023 04:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681300103; x=1683892103; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m0Y6GPO+ccHkXUEQbFbnRg+ryTR9nLrZ0H2ZD+9pCVk=; b=YtFynmjQ00cWKoR0OYU70whoBJwGxx7sjryBF165AO2ZJQc3Eg0NC3LbuvydBt/j4p 4b+Xxwnhy0hE7nZHrUXtRSitfkMWR+TWrHOCDVW2qvbEfPU8q6vFsBYMZsR9cLcsBbVH fRfHzcyAr5AGGDbNPws8DOfu9dWTsjI/WpthAO0OzQx3GmkYgJotXe+LEEgcziGZmj3u oEjPCTYm2AwfdCaeZL/ymVpQ6n/sb+dFHr+A/VdiRFHzBOBSOBL0EDwYSzO6OkxjqZY+ Y9ocx5hMPdWxL2eLTidXzFcsIUNra/yMUWVd4SRlsSGRONJmvYDLZwqJdpEIHkaOzgHE C4RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681300103; x=1683892103; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m0Y6GPO+ccHkXUEQbFbnRg+ryTR9nLrZ0H2ZD+9pCVk=; b=JFDH7lFNQIfCp5/SSvuYyz+dIwk5P4mAM+3gQY8i+4qg4WZ9rIECcM3nuWJacQTyfS G83gvpn4gN2sEfvfNGD+ITUmy+tnkkifaiCy1cBlOzK6km/TyVsw/ov+fpo8+nJp/Brq f9zwJmueCih3tii3kisK15UfSMW77RO3VaaVgF5gTyPAeX6Vc6inoQqgUy3nf3Q3PcJs AyjuqmjZjwyP1t5hVJKBIpv6AmwXRLqWBptQBRljt12qFq85fAHbJ7O/q0jJ4Li5LhW+ 1064Q8tqwqzNaY7e0DWgJEvnnvGVe0wIlHYjhbHdp0F794tjpa/LmVj2Xi+oogMLnRQx UGmQ== X-Gm-Message-State: AAQBX9cyv2PRkrvNgnokEIkQ6g4XKBzujMQV9lUGdXMIl73DTs/NSn3G v72PEHBIu4TjWwI1dvPplDhVvqyj6jS5STRnX6V/z5zu9W0= X-Google-Smtp-Source: AKy350Y5VThcM+mlw8bIzLfDq2eOYlQNxBMuX/tok76JI4ZEV9UlaW+M9aVHRIyTNvWNxgl+E8t81mXpuzogi/pu5YA= X-Received: by 2002:a81:9f01:0:b0:541:85d2:af21 with SMTP id s1-20020a819f01000000b0054185d2af21mr3851666ywn.5.1681300102778; Wed, 12 Apr 2023 04:48:22 -0700 (PDT) MIME-Version: 1.0 References: <796b65c3-57b7-bddf-b0d5-a8afafb8b627@gmail.com> In-Reply-To: <796b65c3-57b7-bddf-b0d5-a8afafb8b627@gmail.com> From: David Rowley Date: Wed, 12 Apr 2023 23:48:08 +1200 Message-ID: Subject: Re: [BUG #17888] Incorrect memory access in gist__int_ops for an input array with many elements To: Ankit Kumar Pandey Cc: pghackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 12 Apr 2023 at 03:49, Ankit Kumar Pandey 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