DEV Community

loading...

Discussion on: What was the weirdest bug you ever encountered?

Collapse
gsto profile image
Glenn Stovall

I used to work on an application that colleges used to process certain types of applications. College could create their own forms. When the user was done, it would compile the answers into a PDF and mailed out to relevant people.

For one client, the PDF would come in empty, but only 10-20% of the time. We couldn't figure out why.

I spent three days tracking down a bug in legacy code that ended up being a bug in PHP itself. . Our system did a lot of parsing of the data to move in between different formats. When you did a Regex find/replace, the method should return the updated string. If there were no matches, it should have returned the original string.

BUT

If you passed in a string over a certain length, and there were no matches, it would return null instead. This one client ask a lot of essay questions. The script would only fail for the most verbose students.

We couldn't patch PHP, so we wrote some checks to strip useless markup and keep strings under the limit.

Collapse
sergix profile image
Peyton McGinnis

Good gracious. I've had to deal with similar bugs in APIs that have string limits as well, always very annoying to deal with. But never anything that strange.