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 1qVFOo-00GkO2-Mq for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Aug 2023 18:01: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 1qVFNn-009qkK-BC for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Aug 2023 18:00:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVFNn-009qkC-23 for pgsql-bugs@lists.postgresql.org; Sun, 13 Aug 2023 18:00:07 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qVFNl-002B4U-0h for pgsql-bugs@lists.postgresql.org; Sun, 13 Aug 2023 18:00:06 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fe655796faso5691975e87.2 for ; Sun, 13 Aug 2023 11:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691949603; x=1692554403; 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=ftu2n7LYsLG6CeZhpMYnQQFWzUrtuaTI4H2RWpauQ8Y=; b=ISGk8OkKKqzEkupfT+pzFgKKYcsoGrCXE7WNQtzvXli2PEaBCsrP73dq2JiEwLmU7B ZTDoGKPxIWFLejxe6grBTkyiqteT5hUQBx9KhNMMIASlsoa3KJeAVWxGet6bAyqjYQ82 zPIroHRBmlf71YL7tzvhgaHhlB6sRtUE3NSZhvRPBp/tcmB2CaOGvhbEJF7Gb3lylC0M Xdcvw8iUQieF4OjWncMHLAycT5sn/HixNZzRhe16ipxkWsyj37Q+Fu/WuvZfWJfqSoLe tLyHwFphUq2LuGwXQo9P18Gqh+zUA4RaLxzICyxxzo2afovH/CW6xOkhRJcysRaySufq uY/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691949603; x=1692554403; 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=ftu2n7LYsLG6CeZhpMYnQQFWzUrtuaTI4H2RWpauQ8Y=; b=OijdYggdJ/QtVmy1GqdnwqeXkIxlRQmKg7qDJiFTlAa3e+tjLp49aFhJYXCvl5MUl2 pmsIlLh4F7L0XqUar4/Mzjjujo7TPDO83iFaGoOeGa2V9S7O2yChaYjrc0iYqV5OjsWH vHH7WGQ6EbbUmq4lVFG89zo10uFlPA7g4yCMD6pTFywQCSimSx0P2NrXQX1f6mst6GeB hmDpB1civK6pZBK7Ne0Tftg5u1k7f5iKPtC3BzPWtQbX1/owKT2kLqv4humw6256+foi guwX7yp2eNCNnaE52GtyEbQXIT95j0J93JejF/vq/3aiWfV7eawGFHznkYRPovDO344N +Ihw== X-Gm-Message-State: AOJu0YyIhe2/aUJ7GXc8+sgFsOLXrALCA3I2rzNkY87l421QXCKH+Jjt i1bdnxI0YycCzrgP0lhulGWNPvPTINU= X-Google-Smtp-Source: AGHT+IE4at1m0Bsd+ixfRs/VcjLscH7pqe8wyy8Vlgj92rWzwLfJcCx8ycZRid48s2Uvv5QD6IFjKA== X-Received: by 2002:a05:6512:2213:b0:4f9:5a61:194f with SMTP id h19-20020a056512221300b004f95a61194fmr6430924lfu.11.1691949603023; Sun, 13 Aug 2023 11:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.23.36]) by smtp.gmail.com with ESMTPSA id c26-20020a19761a000000b004fe3512e26dsm1610559lff.291.2023.08.13.11.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Aug 2023 11:00:02 -0700 (PDT) Message-ID: <09fec706-0691-a131-5c6c-3e64ecc134fc@gmail.com> Date: Sun, 13 Aug 2023 21:00:01 +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 #17950: Incorrect memory access in gtsvector_picksplit() Content-Language: en-US To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <17950-6c80a8d2b94ec695@postgresql.org> <665394.1691937343@sss.pgh.pa.us> From: Alexander Lakhin In-Reply-To: <665394.1691937343@sss.pgh.pa.us> 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 Tom, 13.08.2023 17:35, Tom Lane wrote: > Alexander Lakhin writes: >> I can also propose a regression test addition that demonstrates the valgrind >> complaint and also the output of gtsvectorout() for the case ISALLTRUE and >> the opposite. > OK, but ... > >> This addition increases the duration of `make check -C contrib/pageinspect` >> under valgrind by 7-8 seconds for me: > [ ie, more than triple its previous runtime ] Yes, unfortunately. > ... that seems completely unacceptable cost-wise. I'd be inclined > to commit the fix without a supporting test case, instead of that. I've tried to make that addition as valuable as possible in the context of this issue, but as it is too expensive (to be honest, I was bolstered by the gin test duration (~10 secs too)), then let's leave it aside. > Given that the misapplication of GETSIGN is causing an incorrect > pointer to be passed to sizebitvec(), how come the error is not > leading to outright wrong answers? I guess because it's in > picksplit, the worst outcome normally is a poor choice of split, > so maybe exhibiting wrong behavior in a detectable way is hard. (In fact, I stopped my previous research when I had come to the conclusion that generating data pattern needed to demonstrate wrong answers or at least an inefficient split require many more data rows than we can afford in a regression test.) >> In absence of any objections or other propositions, I'm inclined to register >> this bugfix on the commitfest. > Please do that in any case, so we don't forget about it. Thank you! Done: https://commitfest.postgresql.org/44/4498/ Best regards, Alexander