Discussion:
[hlcoders] Z_CheckHeap
Mark Gornall
2005-04-02 11:04:03 UTC
Permalink
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hi,
I'm seeing this error occasionaly on Windows dedicated servers for IOS
(Half-Life 1). It happens only once every few days or constant use. Doesn't
happen on Linux.

L 03/29/2005 - 06:24:18: FATAL ERROR (shutting down): Z_CheckHeap: block
size does not touch the next block

Anyone know how to fix, track, diagnose, what it means etc?
Thanks,
Mark (r2).
www.iososccer.com
--
tei
2005-04-02 22:40:06 UTC
Permalink
Post by Mark Gornall
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hi,
I'm seeing this error occasionaly on Windows dedicated servers for IOS
(Half-Life 1). It happens only once every few days or constant use. Doesn't
happen on Linux.
L 03/29/2005 - 06:24:18: FATAL ERROR (shutting down): Z_CheckHeap: block
size does not touch the next block
Error on the legacy code from Q1. Memory management.
Quake avoid multiple malloc calls, but do a few mallocs, then use custom
functions to manage this memory. ( Yes, malloc its slower that this system )

/*
========================
Z_CheckHeap
========================
*/
void Z_CheckHeap (void)
{
memblock_t *block;

for (block = mainzone->blocklist.next ; ; block = block->next)
{
if (block->next == &mainzone->blocklist)
break; // all blocks have been hit
if ( (byte *)block + block->size != (byte *)block->next)
Sys_Error ("Z_CheckHeap: block size does not touch the next block\n");
if ( block->next->prev != block)
Sys_Error ("Z_CheckHeap: next block doesn't have proper back link\n");
if (!block->tag && !block->next->tag)
Sys_Error ("Z_CheckHeap: two consecutive free blocks\n");
}
}
Post by Mark Gornall
Anyone know how to fix, track, diagnose, what it means etc?
No idea.

- check all hl commands related (z, malloc, heap, etc..), maybe hl1
already include debug dommands for the heap
- check all flush related commands ( to unload resources before to load
maps)
- check for corrupted maps/models/etc.. (you can run a md5 or binary
diff, or something similar). a corrupted file can query for M bytes but
need N bytes, or problems like that... most resource loaders (textures,
models, etc..) are simple minded.
- check initilization commands related to memory ( -minheap, -heapsize
or something similar), maybe you can query more ram or less, to force
rare error to become ultrarare.
- analize your memory for errors ( with mem86 or other memory analysys
tools), maybe you have damaged chips

My favorite blame its corrupted models, because hee!!.. You can always
blame artist and export plugin coders and have lots of fun. ( but maybe
its other problem :I )
Post by Mark Gornall
Thanks,
Mark (r2).
www.iososccer.com
--
good luck!

Loading...