How to stop "Break called from code".

Started by
33 comments, last by MichaelT 19 years, 8 months ago
Apparently somewhere a break is being called in my code. I have no clue when or where it is set but it's there everytime I run. The funny thing is that it doesn't stop on a code line, it stops on some assembly line. I'm not even sure if it's invoked by me since my only code that called for a break is commented out. Does anyone know how to find such a line? I'm using VC++ 6.0. Thanks. ~Wave
Advertisement
Yes, use debugger and walk the stack, duh...
I tried that AP, and ended up at a line in the code that really didn't help much. The problem is that breaks called from code from a line such as: _crtsetbreakalloc(321); don't really tell you exactly where the break is coming from since they are set at run time.

~Wave
_crtsetbreakalloc(321);
is that line is in your code?
And I apologize for being tasty
Quote:Original post by Wavewash
I tried that AP, and ended up at a line in the code that really didn't help much. The problem is that breaks called from code from a line such as: _crtsetbreakalloc(321); don't really tell you exactly where the break is coming from since they are set at run time.

~Wave


The stack didn't lead up to a line of your own code? Is it happening at start-up/close or something? And when you say break, do you mean an actual breakpoint?

Matt Hughson
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
I meant to say that it's breaking in a system dll. NTDLL seems to be the culprit. I have no idea why it is doing that though. At this site they mention how to handle system dll breakpoint issues. I don't understand it or if it applies to my problem.

Quote:Original post by Anonymous Poster
And I apologize for being tasty


It's cool, I'm just happy to get a reply.

~Wave
Quote:Original post by matthughson

The stack didn't lead up to a line of your own code? Is it happening at start-up/close or something? And when you say break, do you mean an actual breakpoint?

Matt Hughson


If I move back up the stack far enough it comes to my code where I deleted an array. The breakpoint called from code acts just as a regular breakpoint would but since it is called from code no stop sign is there. It just stops on whatever line. If I keep running through it by pressing f5 I get no issues and it completes executing with no issues.

~Wave
I got a similar error just last night, in my case it was simply because I released memory that contained data that was overflowing the memory. Then the _crt.. functions crashed when checking for memoryleaks (kind of funny since that is what they are for, MS bug perhaps?) In any case, I allocated correct amount of memory for the data (I just happened to *know* which one, in your case it might be more difficult) and the problem went away. I don't know if this is of any help for you though.

No no no no! :)
Thanks MichealT, this is my first time encountering this sort of thing. I'm looking through my code, I think it's probably something the compiler is getting picky about. Thanks for the tip though.

~Wave

This topic is closed to new replies.

Advertisement