BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints - Mailing list pgsql-bugs

From Stephen Clouse
Subject BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints
Date
Msg-id 20050301020430.BD03DF0D1D@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints  (Michael Fuhr <mike@fuhr.org>)
Re: BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1512
Logged by:          Stephen Clouse
Email address:      stephenc@theiqgroup.com
PostgreSQL version: 8.0.1
Operating system:   Fedora Core 3
Description:        Assertion failure (lock.c:1537) with SELECT FOR UPDATE
and savepoints
Details:

You need two psql sessions going to reproduce this.  Start with this very
simple schema:

CREATE TABLE foo (bar NUMERIC);
INSERT INTO foo VALUES (1);

Now, start session 1:

> BEGIN;
> SELECT * FROM foo WHERE bar = 1 FOR UPDATE;

 bar
-----
   1
(1 row)

Switch to session 2:

> BEGIN;
> SAVEPOINT foo;
> SELECT * FROM foo WHERE bar = 1 FOR UPDATE;
(Abort this with Ctrl-C)
Cancel request sent
ERROR:  canceling query due to user request
> ROLLBACK TO SAVEPOINT foo;

Back to session 1:

> ROLLBACK;
Session 1's backend will now die horribly and trigger a server reset.

Log shows the following as the cause of the server abort:

TRAP: FailedAssertion("!(SHMQueueEmpty(&(lock->procLocks)))", File:
"lock.c", Line: 1537)


I have not achieved guru status with the PostgreSQL code yet, otherwise I'd
send a patch along with this.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: problem creating rtree index on timestamptz
Next
From: Michael Fuhr
Date:
Subject: Re: BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints