Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YccSy-0000vF-G9 for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2015 16:23:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YccSx-0006H1-Vd for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2015 16:23:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YccSx-0006Gv-Af for pgsql-bugs@postgresql.org; Mon, 30 Mar 2015 16:23:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YccSs-00083O-VC for pgsql-bugs@postgresql.org; Mon, 30 Mar 2015 16:23:06 +0000 MIME-Version: 1.0 Subject: BUG #12918: Segfault in BackendIdGetTransactionIds To: pgsql-bugs@postgresql.org From: root@simply.name Date: Mon, 30 Mar 2015 16:22:47 +0000 Message-ID: <20150330162247.2492.923@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 12918 Logged by: Vladimir Email address: root@simply.name PostgreSQL version: 9.4.1 Operating system: RHEL 6.6 Description: Hello. After upgrading from 9.3.6 to 9.4.1 (both installed from packages on yum.postgresql.org) we have started getting segfaults of different backends. Backtraces of all coredumps look similar: (gdb) bt #0 0x000000000066bf9b in BackendIdGetTransactionIds (backendID=, xid=0x7f2a1b714798, xmin=0x7f2a1b71479c) at sinvaladt.c:426 #1 0x00000000006287f4 in pgstat_read_current_status () at pgstat.c:2871 #2 0x0000000000628879 in pgstat_fetch_stat_numbackends () at pgstat.c:2342 #3 0x00000000006f9d5a in pg_stat_get_db_numbackends (fcinfo=) at pgstatfuncs.c:1080 #4 0x000000000059c345 in ExecMakeFunctionResultNoSets (fcache=0x1f4c270, econtext=0x1f4bbe0, isNull=0x1f5e588 "", isDone=) at execQual.c:2023 #5 0x00000000005981a3 in ExecTargetList (projInfo=, isDone=0x0) at execQual.c:5304 #6 ExecProject (projInfo=, isDone=0x0) at execQual.c:5519 #7 0x00000000005a458d in advance_aggregates (aggstate=0x1f4bdc0, pergroup=0x1f5e380) at nodeAgg.c:556 #8 0x00000000005a4da5 in agg_retrieve_direct (node=) at nodeAgg.c:1223 #9 ExecAgg (node=) at nodeAgg.c:1115 #10 0x0000000000597638 in ExecProcNode (node=0x1f4bdc0) at execProcnode.c:476 #11 0x0000000000596252 in ExecutePlan (queryDesc=0x1eae6d0, direction=, count=0) at execMain.c:1486 #12 standard_ExecutorRun (queryDesc=0x1eae6d0, direction=, count=0) at execMain.c:319 #13 0x0000000000686797 in PortalRunSelect (portal=0x1ea5660, forward=, count=0, dest=) at pquery.c:946 #14 0x00000000006879c1 in PortalRun (portal=0x1ea5660, count=9223372036854775807, isTopLevel=1 '\001', dest=0x1f5a528, altdest=0x1f5a528, completionTag=0x7fff277b3b80 "") at pquery.c:790 #15 0x000000000068404e in exec_simple_query (query_string=0x1e989d0 "SELECT sum(numbackends) FROM pg_stat_database;") at postgres.c:1072 #16 0x00000000006856c8 in PostgresMain (argc=, argv=, dbname=0x1e7f398 "postgres", username=) at postgres.c:4074 #17 0x0000000000632d7d in BackendRun (argc=, argv=) at postmaster.c:4155 #18 BackendStartup (argc=, argv=) at postmaster.c:3829 #19 ServerLoop (argc=, argv=) at postmaster.c:1597 #20 PostmasterMain (argc=, argv=) at postmaster.c:1244 #21 0x00000000005cadb8 in main (argc=3, argv=0x1e7e5e0) at main.c:228 (gdb) Unfortunatelly, I can't give a clear sequence of steps to reproduce the problem, segfaults are happening in quiet random time and under random workloads :( So I'm trying to reproduce it on testing stand where PostgreSQL is built with --enable-debug flag to give you more information (but still no luck for last two weeks). The common conditions are: 1. it happens only on master hosts (never on any of the streaming replicas), 2. it happens on simple queries to pg_catalog or system views as shown in the backtrace above, 3. it happens only with direct connecting to PostgreSQL (production-queries go through pgbouncer and no coredumps contain production queries). And till now it happened only with python-psycopg2 (we have tried versions 2.5.3-1.rhel6 with postgresql93-libs, 2.5.4-1.rhel6 and 2.6-1.rhel6 with postgresql94-libs). I've asked about it on psycopg-list [0] but it doesn't seem to be the client problem. [0] http://www.postgresql.org/message-id/flat/CA+mi_8a246TK6YBLzf_7c5sc+XuiMaGafG0mhrFbp6Nq+SQt3w@mail.gmail.com#CA+mi_8a246TK6YBLzf_7c5sc+XuiMaGafG0mhrFbp6Nq+SQt3w@mail.gmail.com -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs