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 1kVhrU-0001X5-Pp for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2020 21:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kVhrT-0001eD-N1 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2020 21:11:03 +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 1kVhrT-0001XJ-G2 for pgsql-hackers@lists.postgresql.org; Thu, 22 Oct 2020 21:11:03 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kVhrO-0006gV-Mt for pgsql-hackers@postgresql.org; Thu, 22 Oct 2020 21:11:02 +0000 Received: by mail-pl1-x62d.google.com with SMTP id v22so1620867ply.12 for ; Thu, 22 Oct 2020 14:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/c3HWkDt1A85tigr3rsyxCX94NMoyEzAJ9ZE93/Z6zA=; b=ifFNacxtI6CqGEV1t08mh+2tVKgSdSmDCVF5Gxw2V6AP++QYZM5OJAUPtTTqd11sXW vf+sN3kf/btVef1DSIhen/P88SCBpOFevNZnVkqw3TX8zHBZ34XVWQ98wx30/OLWUa8i cIqmbsryUzyodeSMv7oMe7f6nxN+pStrk2PzugnzUkh44ntZfBoo/6Ke4HFei4xIaMCP g3jhjFZ7TNhym37vZkFb42VXeci1kFJv4VyF8/U95XYcjzu/80bQ+Yo2jcN8RuSaQUU3 d1ys126mgW+vV+4UMVlSuKfEKLvz7rgth9+oYxwf+vt26oMOoE8oQsvBQSSCOzKiE3/J HJaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/c3HWkDt1A85tigr3rsyxCX94NMoyEzAJ9ZE93/Z6zA=; b=VYKIU3aD1llh3HR1JQctWptjfvmItO5VOv+6quXppWrO9YfArVHtRH5qfQVRbXU7n8 Znv4/4eQgMrMtgYSIsrSVE+1RxNJsO9LLfviPIjNUivC5Cq3+uruhvVZ/LAwo8AfwW9k JTNI/jKvyDRdqd1+zN7LY1UfBwSDqgzkAf1M5iSl1tCoxhCAJVZnfxnPx4IuPBj5dPCv YoXeucZ8vMnfeQ0xTEsTPo+6JFayjkAHDHmwelz/DT8Qp9HXE3zijUD9mmbzIbaN9uvT xoEofxddn4+TQCAZOcnZbaEo01NbPGuRQ+n1OdaSUHl/95H9wBY4UPifTITzKWZryapc lMPg== X-Gm-Message-State: AOAM530DsgTbGsAOHzjzMroPrlxMaIXhkGY/nyxCtTb+jFFXMeoEYo8o b9Pg6+4jk5FnhSZTYFsnd2jT+39+E06oJEVp3E9dTQC2igtJ69lVFaPZZmvFU3Q968PrNFgKRKw 28QNPp/2dowpblj7MVWW+97KrjYeeMVcJ/UTY0FSWNKVlHURh0e64aJU+SDS7pwjW+P3v67TL8Y zT7hEIy8NxIhINaXOD8297UHK3iB8COqP7OYry X-Google-Smtp-Source: ABdhPJyxlzi4P48UWvj7CxQX3j3HsRMT9IYAvlx2kz+8BWFSnMdWaGYjeMovgYpT8Bika7eFqmKJpQ== X-Received: by 2002:a17:902:6b08:b029:d6:1f21:801e with SMTP id o8-20020a1709026b08b02900d61f21801emr633745plk.21.1603401057468; Thu, 22 Oct 2020 14:10:57 -0700 (PDT) Received: from [192.168.0.29] (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id d9sm2913050pjx.47.2020.10.22.14.10.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2020 14:10:56 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: new heapcheck contrib module From: Mark Dilger In-Reply-To: <43209.1603400779@sss.pgh.pa.us> Date: Thu, 22 Oct 2020 14:10:55 -0700 Cc: Robert Haas , Peter Geoghegan , "Andrey M. Borodin" , Stephen Frost , Michael Paquier , Amul Sul , Dilip Kumar , Andres Freund , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: References: <12ED3DA8-25F0-4B68-937D-D907CFBF08E7@enterprisedb.com> <20200420194210.sevnpi4lyghoanxi@alap3.anarazel.de> <23E60C3C-C20A-4508-84AC-E0CEA59E784A@enterprisedb.com> <5F743835-3399-419C-8324-2D424237E999@enterprisedb.com> <885D2EC9-7D06-4903-A17D-72C184A1E1C5@enterprisedb.com> <5CC85F28-F210-47AC-8DA8-EC4E82AF3FD5@enterprisedb.com> <0C0349EB-DD85-4DA8-82C7-DF70AB714592@enterprisedb.com> <9DF93B83-FE46-4EC4-A99D-77A60729FD2D@enterprisedb.com> <50F6468F-5A5E-412A-86EC-DF24B549D733@enterprisedb.com> <7D603B53-8078-4AF0-851B-803FF4416501@enterprisedb.com> <98265AA9-7BDC-4708-9348-CC1B173BBE1D@enterprisedb.com> <209783.1603313248@sss.pgh.pa.us> <77A60E99-6054-40FD-A5D6-769C287D4A0F@enterprisedb.com> <721BFA83-EA6F-463D-A9DF-CE78A318B73A@enterprisedb.com> <2A7DA1A8-C4AA-43DF-A985-3CA52F4DC775@enterprisedb.com> <43209.1603400779@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3608.120.23.2.1) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Oct 22, 2020, at 2:06 PM, Tom Lane wrote: >=20 > I wrote: >> Mark Dilger writes: >>> It is seeking to position 32 and writing '\x77\x77\x77\x77'. x86_64 = is >>> little-endian, and ppc32 and sparc64 are both big-endian, right? >=20 >> They are, but that should not meaningfully affect the results of >> that corruption step. You zapped only one line pointer not >> several, but it would look the same regardless of endiannness. >=20 > Oh, wait a second. ItemIdData has the flag bits in the middle: >=20 > typedef struct ItemIdData > { > unsigned lp_off:15, /* offset to tuple (from start of = page) */ > lp_flags:2, /* state of line pointer, see below = */ > lp_len:15; /* byte length of tuple */ > } ItemIdData; >=20 > meaning that for that particular bit pattern, one endianness > is going to see the flags as 01 (LP_NORMAL) and the other as 10 > (LP_REDIRECT). The offset/len are corrupt either way, but > I'd certainly expect that amcheck would produce different > complaints about those two cases. So it's unsurprising if > this test case's output is endian-dependent. Yeah, I'm already looking at that. The logic in verify_heapam skips = over line pointers that are unused or dead, and the test is reporting = zero corruption (and complaining about that), so it's probably not going = to help to overwrite all the line pointers with this particular bit = pattern any more than to just overwrite the first one, as it would just = skip them all. I think the test should overwrite the line pointers with a variety of = different bit patterns, or one calculated to work on all platforms. = I'll have to write that up. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company