This is likely a stack overrun. You can not put data structures this size on the stack.

If you need arrays of this size, you must allocate them from the heap, using malloc(). As a rule of thumb, when your fingers and toes won't suffice anymore to count your local variables, you need malloc().