Groups | Blog | Home
all groups > dotnet faqs > january 2004 >

dotnet faqs : void main crashes...


Jason Dorie
1/22/2004 6:31:34 PM

The "Block type is valid" assertion is from the debug memory manager. It's
basically telling you that some internal checks on the memory block prefix
(the stuff the memory manager keeps track of for each memory block) is
invalid. The most likely cause of this is writing outside the bounds of an
array, through either a negative index, or index beyond the allocated size.

Check your global objects (you must have some, otherwise this error would be
next to impossible to cause) and see if any are allocating space and then
writing to it.

Jason Dorie



[quoted text, click to view]

Xavi Vera
1/22/2004 8:11:10 PM
Hi there!
I have a Win32 Console project within Visual Studio .NET.
This consists of different files. Everything compiles and links fine.
The problem arises when I run the program without doing anything (even
though I build the whole solution):

int main (int argc, char **argv)
{
return 0;
}

If I run it under debug mode (is also crashes with the release version), it
crashes with the following error:

Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

Does anybody know what's wrong? If I remove all files from the project and
recompile, then it runs properly. Is it a bug in the linker?

All help is appreciated.

Cheers,

/Xavi

AddThis Social Bookmark Button