I have a simple for for loop that initializes a char array and never stops. Here is a small sample program that simulated the problem. #include <stdio.h> int main(int argc, char *argv[]){ int i=0; char name_array[7][100]; for (i=0; i <= 7; i++) { printf("Loop i: %d\n", i); name_array[i][0] = '\0'; } return 1; } Here are my compile options g++ -o testloop testloop.cpp Example of the output Loop i: 1 Loop i: 2 Loop i: 3 Loop i: 4 Loop i: 5 Loop i: 6 Loop i: 7 Loop i: 1 Loop i: 2 Loop i: 3 Loop i: 4 Loop i: 5 Loop i: 6 Loop i: 7 Loop i: 1 Loop i: 2 Loop i: 3 Loop i: 4 Loop i: 5 Loop i: 6
Note you are going over name_array's bounds so you are invoking undefined behavior. 7 <= 7. arrays go from 0 to last-1 in C or (0, last-1] in math notation for C arrays.
Was code given to me by Contract programmer. Released person simple mistake after reviewing.
*** Bug 31288 has been marked as a duplicate of this bug. ***