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 1jLF5y-0005rs-UX for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2020 23:54:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jLF5x-0000pz-99 for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2020 23:54:29 +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 1jLF5w-0000pr-Us for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2020 23:54:29 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jLF5t-0003Jt-Ca for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2020 23:54:28 +0000 Received: by mail-qv1-xf30.google.com with SMTP id g4so6667492qvo.12 for ; Sun, 05 Apr 2020 16:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=5rAe43kY+tB3GCJ09OdM00iW0S9jlUkyI1SBTGEs4oU=; b=A8h5w23CBjnMf6zvBwrcG5PSqECD6gML2Y83JZ2Ps+GpcbVFDff7RdZo40779HUMyT Bcww9tTmQO6psy3MGUKRj4054v1c7w0r/aGSYtCCoeb/JQMpoctAdrIZGM/RmqRomQNM +QeTMU6gxBBOg6vnvt0Vu30jNRaBGsZ+w6NTtUQGVJy7aAWT606vf8MSHTDTncM/JRMs I3xA6bnXmWQaMgSFrDOBh17uKek5mLovI+lz52xje1stU2ENst/O77UlFmjRvkKRWypR lpR7WNyo3s0UKNLQ/9CzU/XY4UJG/lSt1sg4GpBvFu4d+oMZtroldeeWmEEKz++W1NJq +t3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=5rAe43kY+tB3GCJ09OdM00iW0S9jlUkyI1SBTGEs4oU=; b=DQDixu9lQP64aoUyS96vgEzHawkBgmKvdNy7CNMWlagpS7FBTiOdTqXlYCSSbGkKGF wd3XzPPaMl92p2dvNFvRamMI8W3dmtD/ltKb1hwWagcbHSQlnKgjgteiQPWgO/0Qf4he QdQt1+0nAeetONifWgcMG3TUYwHGBDyl8bVSh0NuDtfWj1QGaeOEXmMcCJF4c3UlUzMj VqDG9LyjXu26xSm2Hj7jHakDkKBNxbnLdYOguMx+OBsy27UX6lmxpwBNitLCHKoC5aL8 Q5wixS/GUtnNJtptHyKfoPgt/XtJBNM2Q7BzPiCFwJcsToF91nuVGo23zTV3tsnDXkaU st3w== X-Gm-Message-State: AGi0PuZYtSMxLzHezxbFir5Bgdog7Frkcb7BbjiaPAFupQFbWfGvzZkE usSHbdl9Z41K+4b2WDkHWqECbA== X-Google-Smtp-Source: APiQypLB6nFePnBzRrYmj4UotEGl2KerB6gyruJcIJD5hA3EfS0jWGegS96yTxPAx3jVonrdiLtl/Q== X-Received: by 2002:a05:6214:924:: with SMTP id dk4mr18341470qvb.140.1586130863344; Sun, 05 Apr 2020 16:54:23 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id o6sm84868qki.94.2020.04.05.16.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 16:54:22 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id AD25E300A03; Sun, 5 Apr 2020 19:54:19 -0400 (-04) Date: Sun, 5 Apr 2020 19:54:19 -0400 From: Alvaro Herrera To: Tom Lane Cc: Andres Freund , pgsql-hackers@lists.postgresql.org, Robert Haas Subject: Re: CLOBBER_CACHE_ALWAYS regression instability Message-ID: <20200405235419.GA24134@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2887.1586116355@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2020-Apr-05, Tom Lane wrote: > What I wish we had was alloca(), so you don't need a FUNC_MAX_ARGS-sized > array to parse a two-argument function call. Too bad C99 didn't add > that. (But some sniffing around suggests that an awful lot of systems > have it anyway ... even MSVC. Hmmm.) Isn't it the case that you can create an inner block with a constant whose size is determined by a containing block's variable? I mean as in the attached, which refuses to compile because of our -Werror=vla -- but if I remove it, it compiles fine and works in my system. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --VS++wcV0S1rZb1Fb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="not-alloca.patch" diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 9c3b6ad916..415ea17c68 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -103,7 +103,6 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, Node *first_arg = NULL; int nargs; int nargsplusdefs; - Oid actual_arg_types[FUNC_MAX_ARGS]; Oid *declared_arg_types; List *argnames; List *argdefaults; @@ -115,6 +114,9 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, char aggkind = 0; ParseCallbackState pcbstate; + { + Oid actual_arg_types[list_length(fargs)]; + /* * If there's an aggregate filter, transform it using transformWhereClause */ @@ -888,6 +890,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, /* if it returns a set, remember it for error checks at higher levels */ if (retset) pstate->p_last_srf = retval; + } return retval; } --VS++wcV0S1rZb1Fb--