1111 * Portions Copyright (c) 1994, Regents of the University of California
1212 *
1313 * IDENTIFICATION
14- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.34 2000/12/01 18:14:29 tgl Exp $
14+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.35 2000/12/05 23:40:36 tgl Exp $
1515 *
1616 * NOTE:
1717 *This is a new (Feb. 05, 1999) implementation of the allocation set
@@ -719,7 +719,7 @@ AllocSetFree(MemoryContext context, void *pointer)
719719/* Test for someone scribbling on unused space in chunk */
720720if (chunk -> requested_size < chunk -> size )
721721if (((char * )pointer )[chunk -> requested_size ]!= 0x7E )
722- elog (ERROR ,"AllocSetFree: detected write past chunk end in %s %p" ,
722+ elog (NOTICE ,"AllocSetFree: detected write past chunk end in %s %p" ,
723723set -> header .name ,chunk );
724724#endif
725725
@@ -793,7 +793,7 @@ AllocSetRealloc(MemoryContext context, void *pointer, Size size)
793793/* Test for someone scribbling on unused space in chunk */
794794if (chunk -> requested_size < oldsize )
795795if (((char * )pointer )[chunk -> requested_size ]!= 0x7E )
796- elog (ERROR ,"AllocSetRealloc: detected write past chunk end in %s %p" ,
796+ elog (NOTICE ,"AllocSetRealloc: detected write past chunk end in %s %p" ,
797797set -> header .name ,chunk );
798798#endif
799799
@@ -923,6 +923,10 @@ AllocSetStats(MemoryContext context)
923923/*
924924 * AllocSetCheck
925925 *Walk through chunks and check consistency of memory.
926+ *
927+ * NOTE: report errors as NOTICE, *not* ERROR or FATAL. Otherwise you'll
928+ * find yourself in an infinite loop when trouble occurs, because this
929+ * routine will be entered again when elog cleanup tries to release memory!
926930 */
927931static void
928932AllocSetCheck (MemoryContext context )
@@ -966,16 +970,16 @@ AllocSetCheck(MemoryContext context)
966970 * Check chunk size
967971 */
968972if (dsize > chsize )
969- elog (ERROR ,"AllocSetCheck(): %s: req size > alloc size for chunk %p in block %p" ,
973+ elog (NOTICE ,"AllocSetCheck(): %s: req size > alloc size for chunk %p in block %p" ,
970974name ,chunk ,block );
971975if (chsize < (1 <<ALLOC_MINBITS ))
972- elog (ERROR ,"AllocSetCheck(): %s: bad size %lu for chunk %p in block %p" ,
976+ elog (NOTICE ,"AllocSetCheck(): %s: bad size %lu for chunk %p in block %p" ,
973977name , (unsigned long )chsize ,chunk ,block );
974978
975979/* single-chunk block? */
976980if (chsize > ALLOC_CHUNK_LIMIT &&
977981chsize + ALLOC_CHUNKHDRSZ != blk_used )
978- elog (ERROR ,"AllocSetCheck(): %s: bad single-chunk %p in block %p" ,
982+ elog (NOTICE ,"AllocSetCheck(): %s: bad single-chunk %p in block %p" ,
979983name ,chunk ,block );
980984
981985/*
@@ -984,14 +988,14 @@ AllocSetCheck(MemoryContext context)
984988 * can't check as easily...)
985989 */
986990if (dsize > 0 && chunk -> aset != (void * )set )
987- elog (ERROR ,"AllocSetCheck(): %s: bogus aset link in block %p, chunk %p" ,
991+ elog (NOTICE ,"AllocSetCheck(): %s: bogus aset link in block %p, chunk %p" ,
988992name ,block ,chunk );
989993
990994/*
991995 * Check for overwrite of "unallocated" space in chunk
992996 */
993997if (dsize > 0 && dsize < chsize && * chdata_end != 0x7E )
994- elog (ERROR ,"AllocSetCheck(): %s: detected write past chunk end in block %p, chunk %p" ,
998+ elog (NOTICE ,"AllocSetCheck(): %s: detected write past chunk end in block %p, chunk %p" ,
995999name ,block ,chunk );
9961000
9971001blk_data += chsize ;
@@ -1001,7 +1005,7 @@ AllocSetCheck(MemoryContext context)
10011005}
10021006
10031007if ((blk_data + (nchunks * ALLOC_CHUNKHDRSZ ))!= blk_used )
1004- elog (ERROR ,"AllocSetCheck(): %s: found inconsistent memory block %p" ,
1008+ elog (NOTICE ,"AllocSetCheck(): %s: found inconsistent memory block %p" ,
10051009name ,block );
10061010}
10071011}