Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1oxm-00FAYG-DC for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Apr 2024 15:00:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s1oxj-006khD-TK for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Apr 2024 15:00:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1oxj-006kh5-LE for pgsql-bugs@lists.postgresql.org; Tue, 30 Apr 2024 15:00:08 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s1oxf-000rYn-Ic for pgsql-bugs@lists.postgresql.org; Tue, 30 Apr 2024 15:00:07 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-51bae805c56so6745815e87.0 for ; Tue, 30 Apr 2024 08:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714489202; x=1715094002; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bUgxMuQEvO1Q3NCe65VxriiWxVhzKsLIbwnctQWuS18=; b=XnEQ84QNXGbv1dA8zToV4Nh0OatsDIIXNAxInR50hsiHlIB1YkGAEGKREWbVAz4Mp7 j0hZEwnHkFn/l+fvr7NFwFZs64C+PPJcfpM22DFovxlV7ltExyoj3cJwsbo4XPUNFNWo SBF55Tl5RvLhP50cYr5Mx7pSFtpAQbOMt7OVetKs2CofH6hXWq/3lL3yduo/JANK/xI9 7V71D8W34QNzxGF8KWwOfmU1P5Kf2FfMETz4c/jubc06l1OHPieDGfcs11jTbpvBi3j4 3y5T/xByhyO6KItv3ldao4if0ThZyKSsEA/qALXsBmnAvxcVSFunpGLFmMgx+yv9+meI A9kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714489202; x=1715094002; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bUgxMuQEvO1Q3NCe65VxriiWxVhzKsLIbwnctQWuS18=; b=RBRSwlHD7Smse4dKYEgJU3viAbQZ7bJG8+O/KX3Kx0tx42tNETJFd2w4jHvl0GkIks BpR7dOUYQqNVtYtmRFyA5JGzVbw5Eva8nDrM1CHgT4HW3hHs/sy+sfm4gUvpcJFCqi+d aKDZPUdzwsM2uXiOde3CSJiStFKsg4TUKmPGPXNB7PVK+g3Prq7Sute0G9j9ZDJRecID 54cOa6HyI9AKSQVj06nEZ/cUE0zUfbpkWY7boKmp3j+/7p2lQuhREtMcGIRd61nO1xMR Buk8qmv6AX5X4zBQJjdxOnjUPdcOT6u0chhxY4lAuKR9YjWDxAJ0uYNXVfeJ3sj3qIAQ uTqw== X-Forwarded-Encrypted: i=1; AJvYcCUJJxuSl1BONWupAT75cY9Gxs/gIXNCuE8LaLfsUzOzRFzeg05rESJSAl+NPptfz3RX/wDeqD5Rnh0kZriqX3J0Of2xBxphJR0qw6l2fBBC X-Gm-Message-State: AOJu0YyG/MkFx/Df07nzIZgjViKDWFIHNd5t40UPrG5wQ5pYrBTkUb0g 5BCekGBb6NTLPe3oPbRNLPTmLnOD/Sgx/FdBF9WvkP2vW8nk2VRd X-Google-Smtp-Source: AGHT+IH3n9+h0BdhtSq8kMuSPBM0CtCWwMlABZiaFtMJemc2cjIAKfP8uXouZkJZWr7hje9ARcvtlA== X-Received: by 2002:ac2:42ca:0:b0:51c:79e1:a92f with SMTP id n10-20020ac242ca000000b0051c79e1a92fmr8771150lfl.63.1714489201946; Tue, 30 Apr 2024 08:00:01 -0700 (PDT) Received: from [1.0.0.7] ([178.155.23.194]) by smtp.gmail.com with ESMTPSA id t26-20020ac24c1a000000b0051979e3a586sm4415109lfq.266.2024.04.30.08.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Apr 2024 08:00:01 -0700 (PDT) Message-ID: <5664e428-4473-d51f-363d-c143c39d57e3@gmail.com> Date: Tue, 30 Apr 2024 18:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17855: Uninitialised memory used when the name type value processed in binary mode of Memoize Content-Language: en-US To: David Rowley , Tom Lane Cc: Robert Haas , pgsql-bugs@lists.postgresql.org References: <17855-5f523e0f9769a566@postgresql.org> <3943232.1714060238@sss.pgh.pa.us> <1228403.1714400922@sss.pgh.pa.us> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello David, 30.04.2024 03:48, David Rowley wrote: > On Tue, 30 Apr 2024 at 02:28, Tom Lane wrote: >> One bit of research that needs to be done is whether btree will >> truncate an "include"'d column of type name. I think it will not, >> because that behavior is driven by the opclass and there isn't one >> for an included column, but it wouldn't hurt to check. If so, >> just restricting these setup loops to consider only indnkeyatts >> columns should fix this. > I did that research in the form of setting a breakpoint in > index_deform_tuple() and verified the tup->t_info & 0xFFF grows by > 64-bytes for each extra name column I INCLUDE. Also verified those > extra bytes are all zero'd Yes, I saw the same with pageinspect. I could not find cases (I've tested also ranges and arrays based on the name type) where the v4 behaves incorrectly, so I think it solves the problem. As a side note, perhaps this addition: +#include "catalog/pg_opfamily_d.h" is not needed for the current implementation. Thank you for the fix! Best regards, Alexander