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.