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 1pUwlT-0001P0-7q for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Feb 2023 21:35:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pUwlS-0003Df-0s for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Feb 2023 21:35:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUwlR-0003DL-Nd for pgsql-hackers@lists.postgresql.org; Wed, 22 Feb 2023 21:35:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUwlP-0007e1-Hx for pgsql-hackers@postgresql.org; Wed, 22 Feb 2023 21:35:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 31MLYiZT295607; Wed, 22 Feb 2023 16:34:44 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org, Nikita Glukhov , Andrew Dunstan , David Rowley Subject: Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size In-reply-to: <1014296.1655422634@sss.pgh.pa.us> References: <20220616233130.rparivafipt6doj3@alap3.anarazel.de> <1014296.1655422634@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 16 Jun 2022 19:37:14 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <295548.1677101633.0@sss.pgh.pa.us> Date: Wed, 22 Feb 2023 16:34:44 -0500 Message-ID: <295606.1677101684@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <295548.1677101633.1@sss.pgh.pa.us> I wrote: > Andres Freund writes: >> Maybe it's worth sticking a StaticAssert() for the struct size >> somewhere. > Indeed. I thought we had one already. >> I'm a bit wary about that being too noisy, there are some machines with >> odd alignment requirements. Perhaps worth restricting the assertion to >> x86-64 + armv8 or such? > I'd put it in first and only reconsider if it shows unfixable problems. Now that we've got the sizeof(ExprEvalStep) under control, shouldn't we do the attached? regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="check-sizeof-ExprEvalStep.patch"; charset="us-ascii" Content-ID: <295548.1677101633.2@sss.pgh.pa.us> Content-Description: check-sizeof-ExprEvalStep.patch diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h index 86e1ac1e65..06c3adc0a1 100644 --- a/src/include/executor/execExpr.h +++ b/src/include/executor/execExpr.h @@ -669,6 +669,10 @@ typedef struct ExprEvalStep } d; } ExprEvalStep; +/* Enforce the size rule given in the comment above */ +StaticAssertDecl(sizeof(ExprEvalStep) <= 64, + "size of ExprEvalStep exceeds 64 bytes"); + /* Non-inline data for container operations */ typedef struct SubscriptingRefState ------- =_aaaaaaaaaa0--