Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZEM8e-0004lQ-Sh for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Jul 2015 18:38:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZEM8d-000071-Ub for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Jul 2015 18:38:07 +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) (envelope-from ) id 1ZEM8c-00006i-Ax for pgsql-bugs@postgresql.org; Sun, 12 Jul 2015 18:38:06 +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.84) (envelope-from ) id 1ZEM8U-00046z-5L for pgsql-bugs@postgresql.org; Sun, 12 Jul 2015 18:38:05 +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 t6CIbsXb013183; Sun, 12 Jul 2015 14:37:54 -0400 From: Tom Lane To: Michael Bommarito cc: Michael Paquier , PostgreSQL mailing lists Subject: Re: BUG #13490: Segmentation fault on pg_stat_activity In-reply-to: References: <20150707165212.1188.60819@wrigleys.postgresql.org> <14297.1436652379@sss.pgh.pa.us> Comments: In-reply-to Michael Bommarito message dated "Sun, 12 Jul 2015 14:09:09 -0400" Date: Sun, 12 Jul 2015 14:37:54 -0400 Message-ID: <13182.1436726274@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Michael Bommarito writes: > Here's the session with debug_query_string: > (gdb) printf "%s\n", debug_query_string > SELECT application_name AS source, client_addr AS ip, COUNT(*) AS > total_connections FROM pg_stat_activity WHERE pid <> pg_backend_pid() GROUP > BY application_name, ip ORDER BY COUNT(*) DESC, application_name ASC, > client_addr ASC Thanks. This still doesn't match the stack trace: in particular, this stack frame #3 0x00007fd0d478152c in expression_tree_mutator (node=0x7fd0d5d9e908, mutator=0x7fd0d481c390 , context=0x7fff52170620) at /tmp/buildd/postgresql-9.5-9.5~alpha1/build/../src/backend/nodes/nodeFuncs.c:2769 indicates that we found a PlaceHolderInfo node in the expression tree that pullup_replace_vars() was applied to, but so far as I can see no such node should exist in the query tree generated by this query. The most likely theory seems to be that something clobbered the query tree while it was sitting in the plancache, causing this recursive function to follow a bogus pointer. But that doesn't leave us with a lot to go on. What can you tell us about the environment this is happening in? How is the client-side code executing the failing queries? (We know it's using extended query protocol, but is it preparing a statement and then executing it repeatedly, or just using a one-shot unnamed prepared statement?) What nondefault settings are in use on the server side? Do you have any extensions loaded, such as pg_stat_statements or auto_explain? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs