Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jGV4k-0007Zj-1C for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2020 21:57:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGV4i-0007ol-6L for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2020 21:57:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jGV4h-0007oe-Q6 for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2020 21:57:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGV4f-0005Ft-Cr for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2020 21:57:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02NLvS4O003782; Mon, 23 Mar 2020 17:57:28 -0400 From: Tom Lane To: Andres Freund cc: Amit Kapila , Michael Paquier , Julien Rouhaud , Masahiko Sawada , PostgreSQL Hackers Subject: Re: Missing errcode() in ereport In-reply-to: <20200323214446.omszgudfu3etpieu@alap3.anarazel.de> References: <32174.1584454158@sss.pgh.pa.us> <20200319175902.vjib2tslosw65iyr@alap3.anarazel.de> <5063.1584641224@sss.pgh.pa.us> <20200319230446.lxjybufdcgwaqkhj@alap3.anarazel.de> <5995.1584660775@sss.pgh.pa.us> <20200320015908.ajxneh4jx6avqegv@alap3.anarazel.de> <9966.1584671550@sss.pgh.pa.us> <20200320045637.n3xo6gcmbqcg42tq@alap3.anarazel.de> <15922.1584715221@sss.pgh.pa.us> <31649.1584998689@sss.pgh.pa.us> <20200323214446.omszgudfu3etpieu@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 23 Mar 2020 14:44:46 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3779.1585000648.1@sss.pgh.pa.us> Date: Mon, 23 Mar 2020 17:57:28 -0400 Message-ID: <3780.1585000648@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > I wondered before whether there's a way we could move the elevel check > in errstart to the macro. For it to be a win we'd presumably have to > have a "synthesized" log_level variable, basically > min(log_min_messages, client_min_messages, ERROR). > Probably not worth it. Yeah, I don't really agree with that idea. The whole business of which elevels will trigger output is fundamentally policy, not mechanism, and you do not want policy decisions embedded into ABI so that there are hundreds of copies of them. It's a loss for code size and a worse loss if you ever want to change the behavior. > On 2020-03-23 17:24:49 -0400, Tom Lane wrote: >> One thing I'm not totally sure about is whether we can rely on >> this change: >> >> -extern void errfinish(int dummy,...); >> +extern void errfinish(void); >> >> being fully ABI-transparent. One would think that as long as errfinish >> doesn't inspect its argument(s) it doesn't matter whether any are passed, >> but maybe somewhere there's an architecture where the possible presence >> of varargs arguments makes for a significant difference in the calling >> convention? We could leave that change out of the v12 patch if we're >> worried about it. > I would vote for leaving that out of the v12 patch. I'm less worried > about odd architectures, and more about sanitizers and/or compilers > emitting "security enhanced" code checking signatures match etc > ("control flow integrity"). Yeah, good point. Let's skinny the v12 patch down to just macro and docs changes, then, not touching elog.c at all. I made a commitfest entry for this just to see what the cfbot thinks of it, but if there are not objections we should go ahead and push in a day or so, IMO. regards, tom lane BTW, the CF app is showing me as the first author, even though I definitely put you in first. Guess it doesn't care about author ordering ... is that a bug to be fixed?