I observed a strange behaviour from gdb. Please assist me to identify this.
Below is affected snippet.
Note: Below for loop should not execute more than two times as max value of totNumEntries is 2.
Code:
totNumEntries = callLegPtr->activeSpContextPtr->directMediaPtr->numEntries;
for (index = 0; index < totNumEntries; index++)
{
.......
}
Printing values via gdb.
Code:
(gdb) p index
$79 = 35933
(gdb) p totNumEntries
$80 = 65535
(gdb) p callLegPtr->activeSpContextPtr->directMediaPtr->numEntries
Cannot access memory at address 0x53369955
As per gdb print, 0x53369955 is out of bond and cannot be accessible but still i can see "totNumEntries" having value 65535 because of that reason above for loop went into to many iterations (35933) and our process declared time out.
Type of totNumEntries is unsigned short (Max value is 65535).
My concern is what exactly the meaning of "Cannot access memory at address 0x53369955". When 0x53369955 is not accessible how come "totNumEntries" taking large value which maximum range for unsigned int type. It is very important for me to understand, please let me know if you need any further information.
Regards,
Shahid Hussain