this post was submitted on 02 Jan 2026
85 points (98.9% liked)
Programming
24348 readers
329 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I joined a team and was assigned a bug that had been bugging them for two years. Randomly files they saved would be corrupted.
Eventually isolated it to the third party library they used to serialize the data. For some reason this library corrupted file names that were an odd length. So "cat" would get corrupted while "cats" would save and load just fine. It was a black box library we didn't control so was told to just program a workaround to check filename length and append a character if it was odd and move on.
I still want to know what that library was doing.
Haunting
Notepad on windows, I think around the XP and earlier versions, had a similar bug. If you typed
this app can breakand saved it, the file would be corrupted. Something to do with the number and placement of characters.ASCII was interpreted as UTF because the function that checked whether the given text was Unicode checked the difference between bytes at even and odd positions. Many of the common phrases used to trigger this were in the 4-3-3-5 format (by letters), e.g., Bush hid the facts However, there was never any reason that this format of character placement was necessary for the bug (though even length was necessary)
Hmm yeah that's really weird... I can't think of a purpose for a check like that, plus even it was a valid reason throw an exception or return a result indicating failure, don't just corrupt the file