markzzz
markzzz

Reputation: 47945

wntdll.pdb not loaded - Can't see the exception

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

Upvotes: 16

Views: 52673

Answers (5)

Jonathan Deans
Jonathan Deans

Reputation: 1

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.

Upvotes: 0

UnkownReality
UnkownReality

Reputation: 137

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

Upvotes: 0

Daniel
Daniel

Reputation: 1

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;
};

Upvotes: 0

sajal Shrivastava
sajal Shrivastava

Reputation: 51

  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

Upvotes: 5

TheLogicGuy
TheLogicGuy

Reputation: 691

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

Example: enter image description here

Upvotes: 5

Related Questions