void main crashes...

X

Xavi Vera

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
 
J

Jason Dorie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top