4

I'm debugging a code in VS that I wrote in C. For some reason, at some point it jumps to an assembly window with the following line:

  int        3

And a pop up message box appears with the following message:

  User Breakpoint Called From Code At  0X7c90120120e

I looked at the stack, and the command that caused that was MALLOC !

In output window:

Heap missing last entry in committed range near 22549c0

The weird thing is, when I press OK at the message then F5 to continue debugging it continues and everything works 100%. But when I try to execute the code I get a message that my project encountered some problem.

I tried cleaning my project, rebuilding, removing all breakpoints .. nothing worked.

SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105
Howaida Khoureieh
  • 519
  • 2
  • 11
  • 24

2 Answers2

4

First of all thank you all for commenting/ answering.

I solved the problem. I found out that I was trying to Free the same memory TWICE.

The reason that I didn't notice it before is that the "Free" (delete function) wasn't in the same function nor the same file as where the debugger stopped/ the breakpoint occured(on malloc).

So if anyone is having the same problem, just make sure you are not Free-ing the same memory more than once.

Howaida Khoureieh
  • 519
  • 2
  • 11
  • 24
2

Possible duplicate of this stack overflow thread.And here's an explanation of this problem in this link.Hope that helps you out.

Community
  • 1
  • 1
Santhosh Pai
  • 2,535
  • 8
  • 28
  • 49
  • The first link seems to be to this discussion. Did you mean something else? – doctorlove Aug 21 '13 at 15:36
  • @SanthoshPai about the first link, I saw it and read the answer and it didnt help me, I also checked in google but didnt find anything that could help, every question was about Free/assert not malloc, which is the wierd, because malloc only allocates memory and returns a pointer, there is no way that I accesed an invalid address. About the SECOND link, thank you, I will check if it helps me. – Howaida Khoureieh Aug 21 '13 at 15:44
  • 1
    Refer this link too http://us.generation-nt.com/answer/user-breakpoint-called-help-7403942.html – Santhosh Pai Aug 21 '13 at 15:51