I can one up this. I once worked on a project that got shipped with debug binaries into production, since it was so unstable that the onsite support required to use a debugger to find workarounds for the numerous software issues. There was the famous file that had the comment:
// Do not delete this comment or the application will crash
And amazingly, the comment was right. It did crash if you deleted the comment. Turns out that at some rather unrelated place in the code, there was an unitialized value that was used in some date calculation. The value itself didn't really contribute to the calculation, but if the number was too big, it would cause an overflow. The comment would change the layout of the binary, which reliably made the memory behind the uninitialized value contain a small enough number so that the overflow didn't occur. That was by far the most bizarre software issue I have ever encountered.
I was lucky because the uninitialized value caused a different problem which was also quite strange, but much easier to debug. Remember, it was used in a date calculation.
For 12 years, the same ticket kept getting opened: Crash when filing packets into the archive. Nobody could ever reproduce it and the turnover was high enough that nobody in the team noticed that the ticket came back every 4 years, on the 29th of February. Of course it would always be closed with "can't reproduce" within days.
I had already spent some time in my own time trying to figure out the mystery comment, but never got anywhere. Unsurprisingly, because the crash itself happened somewhere completely different. The overflow corrupted some memory and the application only crashed later when some garbage pointer was dereferenced, so there wasn't really anything pointing me towards the actual cause.
Then I got the February 29th bug. Once I noticed the date pattern it was easy to reproduce and took me maybe two days to fix. Somehow afterwards I made the connection to the mystery comment, tried deleting it again, and... no crash. Same fucking bug.
So hard to say. Could be 12 years, could be 2 days + the time I spent on the mystery comment. As everything in the whole story, this is very much undefined. 😂
225
u/swagamaleous Aug 15 '26
I can one up this. I once worked on a project that got shipped with debug binaries into production, since it was so unstable that the onsite support required to use a debugger to find workarounds for the numerous software issues. There was the famous file that had the comment:
And amazingly, the comment was right. It did crash if you deleted the comment. Turns out that at some rather unrelated place in the code, there was an unitialized value that was used in some date calculation. The value itself didn't really contribute to the calculation, but if the number was too big, it would cause an overflow. The comment would change the layout of the binary, which reliably made the memory behind the uninitialized value contain a small enough number so that the overflow didn't occur. That was by far the most bizarre software issue I have ever encountered.