From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vladimir Borodin <root@simply.name>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12918: Segfault in BackendIdGetTransactionIds
Date: Mon, 30 Mar 2015 13:00:01 -0400
Message-ID: <27537.1427734801@sss.pgh.pa.us> (raw)
In-Reply-To: <F209A528-1F4C-4E69-97A5-4E987248AA29@simply.name>
References: <20150330162247.2492.923@wrigleys.postgresql.org>
<17494.1427733227@sss.pgh.pa.us>
<F209A528-1F4C-4E69-97A5-4E987248AA29@simply.name>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Vladimir Borodin <root@simply.name> writes:
> I’ve also tried to revert dd1a3bcc where this function appeared but couldn’t do it :( If you would be able to make a build without this commit (if it is easier than fix it in right way), I could install it on several production hosts to test it.
Try this.
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-bugsAttachments:BackendIdGetTransactionIds-crash.patch (text/x-diff, 1.2K) downloaddiff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.cindex 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);
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: tgl@sss.pgh.pa.us, root@simply.name
Subject: Re: BUG #12918: Segfault in BackendIdGetTransactionIds
In-Reply-To: <27537.1427734801@sss.pgh.pa.us>
References: <20150330162247.2492.923@wrigleys.postgresql.org> <17494.1427733227@sss.pgh.pa.us> <F209A528-1F4C-4E69-97A5-4E987248AA29@simply.name> <27537.1427734801@sss.pgh.pa.us>
* 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