pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Gould <daveg@sonic.net>
To: maxim.boguk@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13286: Core dumped during pg_terminate_backend call.
Date: Thu, 14 May 2015 13:23:24 -0700
Message-ID: <20150514132324.34b5a4e9@engels> (raw)
In-Reply-To: <20150514042457.2726.49365@wrigleys.postgresql.org>
References: <20150514042457.2726.49365@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Thu, 14 May 2015 04:24:57 +0000
maxim.boguk@gmail.com wrote:

> Bug reference:      13286
> Logged by:          Maxim Boguk
> Email address:      maxim.boguk@gmail.com
> PostgreSQL version: 9.4.1
> Operating system:   Centos Linux
> Description:        
> 
> Once per few days database getting core dumped during cron run of the
> following query:
...
> Program terminated with signal 11, Segmentation fault.
> #0  0x000000000066bf9b in BackendIdGetTransactionIds (backendID=<value
> optimized out>, xid=0x7f47769a5538, xmin=0x7f47769a553c) at sinvaladt.c:426
> 426                     xact =
> &ProcGlobal->allPgXact[stateP->proc->pgprocno];
> 
> (gdb) bt
> #0  0x000000000066bf9b in BackendIdGetTransactionIds (backendID=<value
> optimized out>, xid=0x7f47769a5538, xmin=0x7f47769a553c) 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  0x00000000006fb132 in pg_stat_get_activity (fcinfo=0x7fffaccf0ee0) at
> pgstatfuncs.c:579

This looks like a duplicate of bug #12918 which is a segfault in
BackendIdGetTransactionIds that affects pg_stat_activity and similar things.
One of my clients also hit that but it is resolved by Tom Lanes patch
pasted below.

-dg
---

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vladimir Borodin <root@simply.name>
cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #12918: Segfault in BackendIdGetTransactionIds
Date: Mon, 30 Mar 2015 13:00:01 -0400
Sender: pgsql-bugs-owner@postgresql.org

inline patch 1: src/backend/storage/ipc/sinvaladt.c (+9/-6 lines) download inline-1.patchdiff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c index 81b85c0..a2fde89 100644 *** a/src/backend/storage/ipc/sinvaladt.c --- b/src/backend/storage/ipc/sinvaladt.c *************** BackendIdGetProc(int backendID) *** 403,411 **** void BackendIdGetTransactionIds(int backendID, TransactionId *xid, TransactionId *xmin) { - ProcState *stateP; SISeg *segP = shmInvalBuffer; - PGXACT *xact; *xid = InvalidTransactionId; *xmin = InvalidTransactionId; --- 403,409 ---- *************** BackendIdGetTransactionIds(int backendID *** 415,425 **** if (backendID > 0 && backendID <= segP->lastBackend) { ! stateP = &segP->procState[backendID - 1]; ! xact = &ProcGlobal->allPgXact[stateP->proc->pgprocno]; ! *xid = xact->xid; ! *xmin = xact->xmin; } LWLockRelease(SInvalWriteLock); --- 413,428 ---- if (backendID > 0 && backendID <= segP->lastBackend) { ! ProcState *stateP = &segP->procState[backendID - 1]; ! PGPROC *proc = stateP->proc; ! if (proc != NULL) ! { ! PGXACT *xact = &ProcGlobal->allPgXact[proc->pgprocno]; ! ! *xid = xact->xid; ! *xmin = xact->xmin; ! } } LWLockRelease(SInvalWriteLock);
-- David Gould daveg@sonic.net If simplicity worked, the world would be overrun with insects. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs

view thread (2+ messages)

Message-ID: <20150514132324.34b5a4e9@engels>
Permalink:  ../20150514132324.34b5a4e9@engels/
Also on:    postgresql.org/message-id/20150514132324.34b5a4e9@engels

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: daveg@sonic.net, maxim.boguk@gmail.com
  Subject: Re: BUG #13286: Core dumped during pg_terminate_backend call.
  In-Reply-To: <20150514132324.34b5a4e9@engels>
  References: <20150514042457.2726.49365@wrigleys.postgresql.org> <20150514132324.34b5a4e9@engels>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox