Jump to content


visual studio 2008 debugger problem


  • You cannot reply to this topic
6 replies to this topic

#1 v71

    Valued Member

  • Members
  • PipPipPip
  • 289 posts

Posted 29 October 2008 - 12:13 AM

Hi, i have a strange problem visual studio 2008 , doesn't detect memory leaks, even if i cause them on purpouse, am i missing something ?
I am not using managed extensions.
Thanks

#2 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 911 posts

Posted 29 October 2008 - 03:10 PM

You need to enable it using _CrtSetDbgFlag and _CRTDBG_LEAK_CHECK_DF.
"Stupid bug! You go squish now!!" - Homer Simpson

#3 v71

    Valued Member

  • Members
  • PipPipPip
  • 289 posts

Posted 29 October 2008 - 09:52 PM

Done, but still no report, the DEBUG option is set .
tried also to do write instructions into the program to set it manually
but still no report
i don't know if my ( big ) app is leaking or not
why Ms messes things up every time ?

#4 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 911 posts

Posted 30 October 2008 - 02:47 PM

v71 said:

Done, but still no report, the DEBUG option is set .
tried also to do write instructions into the program to set it manually
but still no report
i don't know if my ( big ) app is leaking or not
It only works with the _DEBUG macro, but that might be what you meant. If nothing is dumped to the Debug Output Window, then there are either no memory leaks, or something else is wrong.

v71 said:

why Ms messes things up every time ?
The thousands upon thoundsands of other people using msvc are not having any problems, just you :)
"Stupid bug! You go squish now!!" - Homer Simpson

#5 v71

    Valued Member

  • Members
  • PipPipPip
  • 289 posts

Posted 30 October 2008 - 05:13 PM

Kenneth Gorking said:

It only works with the _DEBUG macro, but that might be what you meant. If nothing is dumped to the Debug Output Window, then there are either no memory leaks, or something else is wrong.


The thousands upon thoundsands of other people using msvc are not having any problems, just you :)

I have created a situation where a memory leak should be reported, and visual studio didn't , obviously there is something wrong, and i would like to have an advice from more of this billions of people , not just 2 , even msdn forumers are avoid the questions

#6 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 911 posts

Posted 30 October 2008 - 08:13 PM

I just tried a small example, and it seems that you also need the _CRTDBG_ALLOC_MEM_DF flag. The following code:

int main(int argc, char* argv[])

{

	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

	int *i = (int*)malloc(128);

	return 0;

}

dumps the following:

Quote

Detected memory leaks!
Dumping objects ->
{102} normal block at 0x00857220, 128 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.

"Stupid bug! You go squish now!!" - Homer Simpson

#7 v71

    Valued Member

  • Members
  • PipPipPip
  • 289 posts

Posted 31 October 2008 - 11:51 AM

Tried that too, visual studio is not reporting memory leaks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users