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 1efYTw-00026k-Cz for pgsql-bugs@arkaria.postgresql.org; Sat, 27 Jan 2018 21:57:52 +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 1efYTv-0006CZ-HA for pgsql-bugs@arkaria.postgresql.org; Sat, 27 Jan 2018 21:57:51 +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 1efYTv-0006CQ-Bk for pgsql-bugs@lists.postgresql.org; Sat, 27 Jan 2018 21:57:51 +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 1efYTs-0005ha-D6 for pgsql-bugs@lists.postgresql.org; Sat, 27 Jan 2018 21:57:50 +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 w0RLvk9P020360; Sat, 27 Jan 2018 16:57:46 -0500 From: Tom Lane To: Andrew Grossman cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15033: Segmentation fault running a query In-reply-to: References: <20180127050845.28812.58244@wrigleys.postgresql.org> <17399.1517083207@sss.pgh.pa.us> Comments: In-reply-to Andrew Grossman message dated "Sat, 27 Jan 2018 20:06:48 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20358.1517090266.1@sss.pgh.pa.us> Date: Sat, 27 Jan 2018 16:57:46 -0500 Message-ID: <20359.1517090266@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Grossman writes: > I will follow-up with a stack trace. In the meantime, a more accessible > version of the reproduction script has been placed at the following address: > https://fleetinventory.com/media/static/pg10crash.sql Thanks. I pulled that down, and while it didn't reproduce for me immediately, some fooling with the postmaster's "ulimit -s" setting eventually produced a crash in the recursion in create_plan_recurse(), which indeed lacks a check_stack_depth call and should have one. But I wonder whether that's the identical crash site you're seeing. This query is going to result in deep recursion in quite a few places, and there might be other ones that need protection. The amount of stack consumed per recursion level could vary across machines, so that the deepest stack growth might not be at the same place for everybody. (I'm actually rather surprised to see create_plan_recurse be the weakest link --- I'd have figured that earlier planner phases would consume more stack per setop.) regards, tom lane