none
Application has encountered a user-defined Breakpoint

    Question

  • I build my application in release mode but it hangs some times with the error message: Application has encountered a user-defined Breakpoint. How can this happen when it is compiled in release mode?

     

     

     

    Wednesday, September 12, 2007 9:15 AM

Answers

  • It could go haywire and land on an Int 3 instruction.  Not good news, very hard to debug.
    Wednesday, September 12, 2007 6:39 PM

All replies

  •  

    Hi

     

    do you have any dependent assenbly?

     

    what about the dependent assemblies... r they also in realease mode or what ?

     

    just have a look

    Wednesday, September 12, 2007 2:39 PM
  • It could go haywire and land on an Int 3 instruction.  Not good news, very hard to debug.
    Wednesday, September 12, 2007 6:39 PM
  • Yes, I have tripple checked all my assemblies and they are in release mode.

     

    Thursday, September 13, 2007 7:12 AM
  • Is there no way to remove the int 3 instruction?

     

    Thursday, September 13, 2007 7:17 AM
  • Hello,

    The instruction "int3" is not in your code, most likely. Thus, there are no way to remove that. First, you must find module which generated this type of exception, but, it's impossible without debugging.

     

    Thursday, September 13, 2007 11:20 AM
  • I've had the same issue recently in a project built with VS2008. I was lucky to have the issue on my dev pc, so I was able to do some debugging. However when I was debugging application from VS, the problem did not show up neither in DEBUG nor in RELEASE builds. However it happened 100% when I ran application in command line (RELEASE build).

    For some reason (possibly because I have both VS2008 and 2010 on my pc) I was not able to debug it with Debug button on the error dialog box.

    Using extra logging I was able to locate and then address the problem which does not look an issue per se.

    What was "wrong" is that I had an exception in a constructor that was handled. It was my "lazy" code that I re-worked to get rid of exception and the problem has gone.

    This is the original code:

    try
    {
      BatchId = (int)batch.BatchId;
    }
    catch (Exception)
    {
      BatchId = -1;
    }

    And this is the new code:

    BatchId = -1;
    if (batch != null)
    {
      BatchId = (int)batch.BatchId;
    }

    This does not sound like the root cause of the issue, however it changed occurence from 100% to 0%. It may be related to the int 3 issue mentioned above or I may have faulty environment on my pc.

    Thursday, September 27, 2012 11:37 PM
  • In a release build you should not have int 3 in code, so if you get this error, most likely you are executing data as a result of buffer overrun, or less likely, some other program tries to break into your process. Usually when the crash happens long after  the damage is done, the earlier you can get your process to crash on such error the better


    Visual C++ MVP

    Friday, September 28, 2012 12:46 AM