I noticed that HEAD crashes at startup with assertions disabled and
WAL_DEBUG turned on:

#2  0x00000000007af987 in ExceptionalCondition (
    conditionName=conditionName@entry=0x974448 "!(CritSectionCount == 0 || 
(CurrentMemoryContext) == ErrorContext || (MyAuxProcType == 
CheckpointerProcess))", 
    errorType=errorType@entry=0x7e9bec "FailedAssertion", 
    fileName=fileName@entry=0x974150 
"/pgsql/source/minmax/src/backend/utils/mmgr/mcxt.c", 
    lineNumber=lineNumber@entry=670) at 
/pgsql/source/minmax/src/backend/utils/error/assert.c:54
#3  0x00000000007d2080 in palloc (size=1024) at 
/pgsql/source/minmax/src/backend/utils/mmgr/mcxt.c:670
#4  0x00000000005f3abe in initStringInfo (str=str@entry=0x7fff11f68a80)
    at /pgsql/source/minmax/src/backend/lib/stringinfo.c:50
#5  0x00000000004f42ca in XLogInsert (rmid=48 '0', rmid@entry=0 '\000', 
info=<optimized out>, 
    info@entry=0 '\000', rdata=rdata@entry=0x7fff11f68d30)
    at /pgsql/source/minmax/src/backend/access/transam/xlog.c:1262
#6  0x00000000004f4f17 in CreateCheckPoint (flags=flags@entry=6)
    at /pgsql/source/minmax/src/backend/access/transam/xlog.c:8197
#7  0x00000000004f8079 in StartupXLOG () at 
/pgsql/source/minmax/src/backend/access/transam/xlog.c:7097


I'm using an interim fix by excepting the startup process (see attached
patch), like the current code does for checkpointer, but I guess a more
robust solution should be sought.

I find it strange that nobody has seen this before.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index e83e76d..bf3c540 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -68,7 +68,7 @@ static void MemoryContextStatsInternal(MemoryContext context, int level);
  */
 #define AssertNotInCriticalSection(context) \
 	Assert(CritSectionCount == 0 || (context) == ErrorContext || \
-		   AmCheckpointerProcess())
+		   AmCheckpointerProcess() || AmStartupProcess())
 
 /*****************************************************************************
  *	  EXPORTED ROUTINES														 *
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to