Menu

Application Verifier break message

Probing null address.

Probable cause

This stop is generated if Application Verifier detects an IsBadXXXPtr call with a NULL address.

Information displayed by Application Verifier

Parameter1 - Not used

Parameter2 - Not used

Parameter3 - Not used

Parameter4 - Not used

Description - Probing null address

Additional information

Verifier stop code 0606.

To debug this stop look at the current stack trace (kb) and try to determine why the caller of the IsBadXXXPtr function ended up with the NULL address. This is typically the sign of someone not checking the return value of one of the memory allocation functions. For example the code below is incorrect:

int main (void)

{

����������� PVOID p;

p = malloc (1024);

Use (p);

return 0;

}

void Use (PVOID p)

{
if (IsBadReadPtr (p)) {

����������������������� return;

}

//

// p is safe to be used here.

//

}

This code should be re-written as this:

int main (void)

{

����������� PVOID p;

p = malloc (1024);

if (NULL == p)) {

����������������������� return -1;

}

Use (p);

return 0;

}

void Use (PVOID p)

{

//

// p is safe to be used here.

/

}

MSDN library lists a few reasons why applications should not use the IsBadXXXPtr APIs:

  • In a preemptive multitasking environment, it is possible for some other thread to change the process's access to the memory being tested.

  • Dereferencing potentially invalid pointers can disable stack expansion in there threads. A thread exhausting its stack, when stack expansion has been disabled, results in the immediate termination of the parent process, with no pop-up error window or diagnostic information.

  • Threads in a process are expected to cooperate in such a way that one will not free memory that the other needs. Use of this function does not negate the need to do this. If this is not done, the application may fail in an unpredictable manner.

Because of all these reasons, it is recommended to never use these APIs.