Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YccdO-0001N8-FS for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2015 16:33:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YccdN-0007C9-Of for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2015 16:33:53 +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 1YccdM-0007C2-Qj for pgsql-bugs@postgresql.org; Mon, 30 Mar 2015 16:33:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YccdJ-0008ES-Gp for pgsql-bugs@postgresql.org; Mon, 30 Mar 2015 16:33:51 +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 t2UGXlFA017495; Mon, 30 Mar 2015 12:33:47 -0400 From: Tom Lane To: root@simply.name cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12918: Segfault in BackendIdGetTransactionIds In-reply-to: <20150330162247.2492.923@wrigleys.postgresql.org> References: <20150330162247.2492.923@wrigleys.postgresql.org> Comments: In-reply-to root@simply.name message dated "Mon, 30 Mar 2015 16:22:47 -0000" Date: Mon, 30 Mar 2015 12:33:47 -0400 Message-ID: <17494.1427733227@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 root@simply.name writes: > 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= optimized out>, 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 Hmm ... looks to me like BackendIdGetTransactionIds is simply busted. It supposes that there are no inactive entries in the sinval array within the range 0 .. lastBackend. But there can be, in which case dereferencing stateP->proc crashes. The reason it's hard to reproduce is the relatively narrow window between where pgstat_read_current_status saw the backend as active and where we're inspecting its sinval entry. 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