Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0D89DB5DBC7 for ; Mon, 26 Sep 2011 07:12:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 60353-05 for ; Mon, 26 Sep 2011 10:12:45 +0000 (UTC) X-Greylist: delayed 00:05:49.815531 by SQLgrey-1.8.0-rc2 Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11]) by mail.postgresql.org (Postfix) with ESMTP id F3A7AB5DBBD for ; Mon, 26 Sep 2011 07:12:44 -0300 (ADT) Received: by mail.netbsd.org (Postfix, from userid 1270) id 4D3BC14A143; Mon, 26 Sep 2011 10:06:53 +0000 (UTC) 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) In-Reply-To: Your message of "Sun, 25 Sep 2011 16:00:09 -0400" <5291.1316980809@sss.pgh.pa.us> References: <5291.1316980809@sss.pgh.pa.us> X-Mailer: Cue version 0.8 (100217-1432/takashi) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-20110926184647-0908101" Message-Id: <20110926100653.4D3BC14A143@mail.netbsd.org> Date: Mon, 26 Sep 2011 10:06:53 +0000 (UTC) From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/175 X-Sequence-Number: 31192 --Boundary-20110926184647-0908101 Content-Type: Text/Plain; charset=us-ascii 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 --Boundary-20110926184647-0908101 Content-Type: Text/Plain; charset=us-ascii Content-Disposition: attachment; filename="pg.c" #include #include #include #include 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); } --Boundary-20110926184647-0908101--