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 1l1bqe-0003Q2-RV for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jan 2021 21:14:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1bq8-0007oG-9O for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jan 2021 21:13:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1bq8-0007o5-20 for pgsql-hackers@lists.postgresql.org; Mon, 18 Jan 2021 21:13:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1bq6-0002lM-1O for pgsql-hackers@postgresql.org; Mon, 18 Jan 2021 21:13:31 +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 10ILDS3k412419; Mon, 18 Jan 2021 16:13:28 -0500 From: Tom Lane To: Zhihong Yu cc: David Geier , PostgreSQL-development Subject: Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault In-reply-to: References: <0253344d-9bdd-11c4-7f0d-d88c02cd7991@swarm64.com> <347100.1610995608@sss.pgh.pa.us> <389041.1611000954@sss.pgh.pa.us> Comments: In-reply-to Zhihong Yu message dated "Mon, 18 Jan 2021 13:09:20 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <412417.1611004408.1@sss.pgh.pa.us> Date: Mon, 18 Jan 2021 16:13:28 -0500 Message-ID: <412418.1611004408@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Zhihong Yu writes: > I was thinking that, if sstate->ss_currentRelation is null for the other > cases, that would be a bug. > An assertion can be added for the cases ending with T_TidScanState. Maybe, but there are surely a lot of other places that would crash in such a case --- places far more often traversed than search_plan_tree. I do not see any value in complicating search_plan_tree for that. regards, tom lane