Search code examples
visual-studio-2013breakpoints

Visual studio 2013 triggering break point


I am using Visual studio 2013 always encountered a break point when compiling my code in debug mode. Before this post I gone through this and this.

I went through [DEBUG-> Windows-> Breakpoints] there is no break point available to delete any.

Below screenshot for how my exe triggering breakpoint at time of compilation. Yes, my project contains numerous libraries and this break point triggering only to library files. Could anyone help me to fix it, i googled a lot but can't?

enter image description here

Here is my Call stack copy:

    ntdll.dll!770cfe2c()    Unknown
        [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 
        [External Code] 

DemoProj.exe!CryptoPP::MessageQueue::TransferTo2(CryptoPP::BufferedTransformation & target, unsigned __int64 & transferBytes, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & channel, bool blocking) Line 27  C++
DemoProj.exe!CryptoPP::BufferedTransformation::Get(unsigned char * outString, unsigned int getMax) Line 420 C++

When i debugging my code getting a error i.g "UMEngx86.dll'. Cannot find or open the PDB file."

'DemoProj.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'DemoProj.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sysfer.dll'. Cannot find or open the PDB file.
'DemoProj.exe' (Win32): Loaded 'C:\ProgramData\Symantec\Symantec Endpoint Protection\12.1.4112.4156.105\Data\Definitions\BASHDefs\20160125.011\UMEngx86.dll'. Cannot find or open the PDB file.
'DemoProj.exe' (Win32): Loaded 'C:\~…\release\log4cplus.dll'. Module was built without symbols.

I also read this document about this issue. Still need help from export.


Solution

  • Finally, i able to solve my won problem.

    1. What was the problem?

    A: It was a heap memory corruption, so Heap manager thrown a exception by triggering a automatic break point.

    1. Where you did mistake?

    Ans: I am explaining my mistake with simple example;

    #include "stdafx.h"
    #include <iostream>
    using namespace std;
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        char *buffer = "Simple Heap Error Demo"; 
        int len = strlen(buffer); 
        char *plaintext = new char[len];  //Here i mistaken
    
        /*It should be char *plaintext = new char[len + 1]; because i need one more memory cell for NULL character, that i forgotten and later i am trying to delete [] palintext. */
    
        memcpy(plaintext, buffer, len);
    
        plaintext[len] = '\0';
    
        cout << "\nplaintext: " << plaintext;
    
        if (plaintext != NULL);
        delete[] plaintext;     //Exception thrown here 
    
        system("pause");
        //cout << "\nplaintext: " << plaintext;
        return 0;
    }
    
    1. How you solved your problem?

    Ans: First i neatly debug my project using WinDbg found where exactly heap corruption exception happening. Then i wrote a simple separate program related to same scenario and able to fix my problem.

    A special thanks to Steve who helped me to resolve my issue.