Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehnGE-0000pW-1H for pgsql-committers@arkaria.postgresql.org; Sat, 03 Feb 2018 02:08:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehnGC-0005cj-HZ for pgsql-committers@arkaria.postgresql.org; Sat, 03 Feb 2018 02:08:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ehnGC-0005cZ-Ci for pgsql-committers@lists.postgresql.org; Sat, 03 Feb 2018 02:08:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehnG7-0001kj-Hu for pgsql-committers@postgresql.org; Sat, 03 Feb 2018 02:08:53 +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 w1328nxi009325; Fri, 2 Feb 2018 21:08:49 -0500 From: Tom Lane To: Thomas Munro cc: pgsql-committers Subject: Re: pgsql: Fix another instance of unsafe coding for shm_toc_lookup failure In-reply-to: References: Comments: In-reply-to Thomas Munro message dated "Sat, 03 Feb 2018 14:59:30 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9323.1517623729.1@sss.pgh.pa.us> Date: Fri, 02 Feb 2018 21:08:49 -0500 Message-ID: <9324.1517623729@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > On Sat, Feb 3, 2018 at 12:32 PM, Tom Lane wrote: >> Fix another instance of unsafe coding for shm_toc_lookup failure. > my mistake was actually to put noError = true there when noError = > false was called for. Ah. > However, it's not surprising that you drew the > opposite conclusion (ie that it might in fact not be in the TOC), > since the shm space is really only necessary for EXPLAIN ANALYZE. > Perhaps I should make it skip setting up this shm stuff if > !node->ss.ps.instrument, just like the equivalent Sort node code. I > will look into that on Monday. OK. Please send in a patch to either do that or switch this call to use noError = false. Or possibly both: shouldn't there be some other signal path that tells the worker whether instrumentation is needed? I'll leave it alone pending your investigation. regards, tom lane