BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints

From: "Stephen Clouse" <stephenc(at)theiqgroup(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints
Date: 2005-03-01 02:04:30
Message-ID: 20050301020430.BD03DF0D1D@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1512
Logged by: Stephen Clouse
Email address: stephenc(at)theiqgroup(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2005-03-01 03:00:52 Re: BUG #1512: Assertion failure (lock.c:1537) with SELECT FOR UPDATE and savepoints
Previous Message Tom Lane 2005-02-28 22:13:05 Re: problem creating rtree index on timestamptz