Newbie
Newbie

Reputation: 1613

How to find the real problem line in my code with Application Verifier?

I am now trying to use this Application Verifier debugging tool, but i am stuck, first of all: it breaks the program at a line that is simple variable set line (s = 1; for example)

Secondly, now when i run this program under debugger, my program seems to have changed its behaviour: i am drawing image, and now one of the colors has changed o_O, all those parts of the image that i dont draw on, has changed the color to #CDCDCD when it should be #000000, and i already set the default color to zero, still it becomes to #CDCDCD.

How do i make any sense to this?

Here is the output AV gave me:

VERIFIER STOP 00000002: pid 0x8C0: Access violation exception. 

    14873000 : Invalid address causing the exception
    004E422C : Code address executing the invalid access
    0012EB08 : Exception record
    0012EB24 : Context record

AVRF: Noncontinuable verifier stop 00000002 encountered. Terminating process ... 
The program '[2240] test.exe: Native' has exited with code -1073741823 (0xc0000001).

Upvotes: 1

Views: 1505

Answers (2)

henry
henry

Reputation: 13

Typically when breakpoints are hit like this (via AV or an unhandled exception, etc.) inside a debugger, there is a green arrow pointing to a line of code. That arrow is pointing to the next statement to execute when the thread returns from the current function. Perhaps this green arrow is pointing to the line where you wrote "s = 1", but really the offending code is the line above it. Now I can't see your code so I can't exactly know for sure and I don't have enough rep to post a comment - but this is something that is easy to check the next time the breakpoint is hit.

Upvotes: 1

MSalters
MSalters

Reputation: 179981

I am willing to bet that s is NOT a "simple" variable. I'm much more likely to believe it's something like this:

class Foo;
    int s;
    void Bar() {
        s = 1;
    }
};

Sure, it looks like a simple s=1 statement, but in reality it is a this->s=1 statement. And if this is an invalid pointer, this->s isn't a proper variable either.

Upvotes: 0

Related Questions