In this thread we share stories of some of the worst hotfixes we've seen and/or applied.
In a game I had to present I was experiencing an extremely obscure bug where after some time pointers would randomly point to garbage values, crashing the game. I had an hour to get it working before the presentation.
I spent 45 minutes trying to reproduce it with no success. It happened at seemingly random times, but for some reason it was always the same two pointers that were modified.
Seeing as I was running out of time, I ended up inserting checks which would replace the garbage value (when it occurred) with the correct value again - the correct value I knew because I saw it in the debugger and it seemed to remain consistent.
if(game->settings_doc != 0x63e1b0)
game->settings_doc = 0x63e1b0; /* from debugger */
After the presentation I sat down with valgrind and found the problem. A buffer overrun was writing into memory it wasn't supposed to.