16

Sometimes when I quit my application (SaviHOST running a DLL that I'm making) I show this screen:

enter image description here

Unfortunately I don't know where the error happens, because it just load that screen, not the line where the exception is made.

How can I fix this? What wntdll.pdb have to do with this? Thanks

markzzz
  • 47,390
  • 120
  • 299
  • 507
  • 3
    Symbols are either corrupted or not able downloaded. First, go to Options ->Debugging -> General: select Load dll exports (Native only). Or download the all pdb from Microsoft Symbol Severs manually, Options -> Debugging -> Symbols -> symbol file location: select Microsoft Symbol Severs and specify the path. And another potential workaround is to change the C++ project settings in Debugging / Debugger Type from "Auto" to "Managed Only" reference: https://stackoverflow.com/questions/40489106/myapp-exe-has-triggered-a-breakpoint-while-debugging-afterwards-slow-symbol – Jack Zhai Jan 12 '18 at 05:14
  • Do you get any latest information in your side? – Jack Zhai Jan 24 '18 at 02:02
  • After I update today I started to get exactly the same problem with wntdll.pdb when I try to load symbols for ntdll.dll – Pavel P Dec 12 '18 at 04:10

5 Answers5

5

To see what line in your code caused it click continue and then a pop up pops, click retry.

Example: enter image description here

TheLogicGuy
  • 682
  • 8
  • 19
  • After "Continue", nothing happens :( I'm with Visual Studio 2017 – markzzz Jan 15 '18 at 14:04
  • 1
    @markzzz, Like this feedback:https://developercommunity.visualstudio.com/content/problem/152734/missing-wntdllpbd.html, do you have symbol loaded for ntdll in your side? Please enable the Microsoft symbols server, debug it again. In addition, whether it is related to your system version, 32 bit or 64 bit? If you have different Environment, please also debug it. – Jack Zhai Jan 16 '18 at 08:43
  • Same: after Continue, nothing happens. – Doug Null Aug 03 '18 at 13:29
  • @JackZhai-MSFT after I updated win10 today now all my debugging is completely brokne, as ntdll.pdb is now missing (it requests wntdll.pdb and ms symbol server doesn't serve it). – Pavel P Dec 13 '18 at 01:59
5
  1. Connect to Internet.
  2. Enable Microsoft Symbol Servers in Symbol path settings.

enter image description here

enter image description here

  1. Close VS (I used VS 2015)
  2. Restart and Debug With Native. All symbols will be loaded from MS Servers.

enter image description here

Daniel Cheung
  • 4,779
  • 1
  • 30
  • 63
0

I had this same error, and it turned out to be me trying to delete a pointer that was not initialized with new operator in a class destructor.

example:

class smu
{
public:
    smu();
    ~smu()
    {
         delete voff
    }
private:
    char* voff;
};
Daniel
  • 1
0

Set the application to use Microsoft's symbols. rebuild and start application, it SHOULD load all symbols for you, and it might take a while depending on your internet screen, I myself am loading all the symbols now... boy it takes time!

enter image description here

UnkownReality
  • 130
  • 13
0

I was having the same problem with a non web-based application. Pulling my hair out, but it turned out to be a small logical and syntax error in the destructor of one of my classes. Here's the code as was:

// Constructor //
StatusTrigger_Manager::StatusTrigger_Manager( bool isCreator,unsigned short desiredMemberCount )
{
    maxMembers = desiredMemberCount;
    memberHoldersRequired = ( maxMembers / 32 ) + 1;
    memberHolders = new unsigned int[ memberHoldersRequired ];
    for ( unsigned short index = 0; index < memberHoldersRequired; index++ )
    {
        memberHolders[ index ] = 0;
    }
    //
    if ( isCreator )
    {
        stringList = new STRINGLIST_STATUSTRIGGERS[ maxMembers ];
        // Initialize 'stringList' members to default names
        unsigned char memberName_ValueOffset = 7;
        for ( unsigned int index = 0; index < maxMembers; index++ )
        {
            // Set current member name to default
            stringList[ index ].memberName = new char[ 14 ] { "Member_00000\0" };
            unsigned short individualVal =     0;
            unsigned short    valDivider = 10000;
            unsigned int tempIndex = index;
            for( unsigned char i = 0; i < 5; i++ )                  {
                individualVal = ( index / valDivider ) + 48;
                stringList[ index ].memberName[ i + memberName_ValueOffset ] = individualVal;
                tempIndex -= ( individualVal - 48 ) * valDivider;
                valDivider /= 10;                                   }
            tempIndex = 0;
        }
    }
    else
        stringList = nullptr;
}

// Destructor //
StatusTrigger_Manager::~StatusTrigger_Manager()
{
    if ( stringList != nullptr )
    {
        delete[] &stringList[ 0 ].memberName;
        stringList[ 0 ].memberName = nullptr;
    }
    if ( memberHoldersRequired == 1 )
        delete memberHolders;
    else if ( memberHolders != 0 )
        delete[] memberHolders;
}

And here's the destructor after making the ammendments which fixed both the dll problem and memory leak issues. Small change - but hair is now growing back.

// Destructor //
StatusTrigger_Manager::~StatusTrigger_Manager()
{
    if ( stringList != nullptr )
    {
        for ( unsigned int index = 0; index < maxMembers; index++ )
        {
            delete[] stringList[ index ].memberName;
            stringList[ index ].memberName = nullptr;
        }
    }
    if ( memberHoldersRequired == 1 )
        delete memberHolders;
    else if ( memberHolders != 0 )
        delete[] memberHolders;
}

I got clued off when the same problem wasn't occurring in debug mode - commonly caused by leaving variables unitialized which are set to defaults in debug mode only, or failure to delete an array correctly in my experience. Hope it helps. Good luck.