From: yamt@mwd.biglobe.ne.jp
To: tgl@sss.pgh.pa.us
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6218: TRAP: FailedAssertion( "!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365)
Date: Mon, 26 Sep 2011 10:06:53 +0000 (UTC)
Message-ID: <20110926100653.4D3BC14A143@mail.netbsd.org> (raw)
In-Reply-To: <5291.1316980809@sss.pgh.pa.us>
References: <5291.1316980809@sss.pgh.pa.us>
hi,
> yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) writes:
>>> There isn't terribly much we can do with this report unless you can
>>> provide a complete test case to reproduce it.
>
>> after some investigation, i think it is triggered by protocol-level prepare
>> of ROLLBACK in an aborted transaction. does the following patch make sense?
>
> Maybe, but I'd still like to see a test case, because I can't reproduce
> any such problem by preparing ROLLBACK in an aborted transaction.
reading GetTransactionSnapshot, it seems that the problem happens
only with IsolationUsesXactSnapshot() true.
the attached program triggers the assertion failure reliably for me.
YAMAMOTO Takashi
>
> regards, tom lane
Attachments:pg.c (text/plain, 892B) download
#include <assert.h>
#include <stdlib.h>
#include <libpq-fe.h>
#include <unistd.h>
int
main()
{
PGconn *conn;
PGresult *res;
conn = PQconnectdb("");
assert(PQstatus(conn) == CONNECTION_OK);
res = PQexec(conn, "SET SESSION CHARACTERISTICS AS "
"TRANSACTION ISOLATION LEVEL REPEATABLE READ");
assert(PQresultStatus(res) == PGRES_COMMAND_OK);
PQclear(res);
res = PQexec(conn, "BEGIN");
assert(PQresultStatus(res) == PGRES_COMMAND_OK);
PQclear(res);
res = PQexec(conn, "hoge"); /* intentional syntax error */
assert(PQresultStatus(res) != PGRES_COMMAND_OK);
PQclear(res);
assert(PQtransactionStatus(conn) == PQTRANS_INERROR);
res = PQprepare(conn, "r", "ROLLBACK", 0, NULL);
assert(PQresultStatus(res) == PGRES_COMMAND_OK);
PQclear(res);
res = PQexecPrepared(conn, "r", 0, NULL, NULL, NULL, 0);
assert(PQresultStatus(res) == PGRES_COMMAND_OK);
PQclear(res);
exit(0);
}
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: yamt@mwd.biglobe.ne.jp, tgl@sss.pgh.pa.us
Subject: Re: BUG #6218: TRAP: FailedAssertion( "!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365)
In-Reply-To: <20110926100653.4D3BC14A143@mail.netbsd.org>
References: <5291.1316980809@sss.pgh.pa.us> <20110926100653.4D3BC14A143@mail.netbsd.org>
* 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