I am writing a complicated program with a server and multiple clients. The server crashes on a line that looks like this:
printf("Done parsing input\n");
The call stack shows the error in _flsbuf where in assembly I found the ecx register to be NULL so I can see why it would crash, but how on earth did this happen, it seems to be a simple printf statement.
Another interesting thing about this, is that the clients communicate with the server and send data that needs to be parsed. This is in an infinite loop, and it goes through successfully 20-30 times before it crashes.