Error in backend/storage/lmgr/proc.c: ProcSleep()

From: Tomasz Zielonka <tomek(at)mult(dot)i(dot)pl>
To: PostgreSQL bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Error in backend/storage/lmgr/proc.c: ProcSleep()
Date: 2001-09-03 04:55:57
Message-ID: 20010903065557.A6474@mult.i.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi!

Platform: PostgreSQL 7.1.3, Linux 2.4.8, egcs 2.91.66

PostgreSQL forgets to release lock until shutdown in this scenario:

CREATE TABLE dummy (X integer);

session1 session2
------------------------------------------------------------
BEGIN; |
|BEGIN;
SELECT * FROM dummy; |
|SELECT * FROM dummy;
LOCK TABLE dummy; |
|LOCK TABLE dummy;
deadlock....
\q \q

Deadlock is OK here, but I can't access dummy table until I restart postmaster

Everything's fine, when I comment out * marked lines in
backend/storage/lmgr/proc.c:

if (myHeldLocks != 0)
{
int aheadRequests = 0;

proc = (PROC *) MAKE_PTR(waitQueue->links.next);
for (i = 0; i < waitQueue->size; i++)
{
/* Must he wait for me? */
if (lockctl->conflictTab[proc->waitLockMode] & myHeldLocks)
{
/* Must I wait for him ? */
* if (lockctl->conflictTab[lockmode] & proc->heldLocks)
* {
* /* Yes, can report deadlock failure immediately */
* MyProc->errType = STATUS_ERROR;
* return STATUS_ERROR;
* }

Then the standard deadlock detection procedure is used.

greetings,
tom

--
.signature: Too many levels of symbolic links

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John Summerfield 2001-09-03 09:26:24 Building documentation in PostgreSQL 7.2devel
Previous Message John Summerfield 2001-09-03 01:39:13 Problem building JDBC in PostgreSQL 7.2devel