TestConfiguration returns int, not bool. This mistake is relatively

harmless on signed-char machines but would lead to core dump in the
deadlock detection code if char is unsigned.  Amazingly, this bug has
been here since 7.1 and yet wasn't reported till now.  Thanks to Robert
Bruccoleri for providing the opportunity to track it down.
REL7_2_STABLE
Tom Lane 23 years ago
parent 40faf433b0
commit 28afe6f8ef
  1. 6
      src/backend/storage/lmgr/deadlock.c

@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/deadlock.c,v 1.8 2001/10/28 06:25:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/deadlock.c,v 1.8.2.1 2003/03/31 20:33:09 tgl Exp $
* *
* Interface: * Interface:
* *
@ -47,7 +47,7 @@ typedef struct
static bool DeadLockCheckRecurse(PROC *proc); static bool DeadLockCheckRecurse(PROC *proc);
static bool TestConfiguration(PROC *startProc); static int TestConfiguration(PROC *startProc);
static bool FindLockCycle(PROC *checkProc, static bool FindLockCycle(PROC *checkProc,
EDGE *softEdges, int *nSoftEdges); EDGE *softEdges, int *nSoftEdges);
static bool FindLockCycleRecurse(PROC *checkProc, static bool FindLockCycleRecurse(PROC *checkProc,
@ -299,7 +299,7 @@ DeadLockCheckRecurse(PROC *proc)
* number of soft edges. * number of soft edges.
*-------------------- *--------------------
*/ */
static bool static int
TestConfiguration(PROC *startProc) TestConfiguration(PROC *startProc)
{ {
int softFound = 0; int softFound = 0;

Loading…
Cancel
Save