L
9

Debugging a model that kept crashing on Tuesday, found the fix by accident

I spent all day Tuesday chasing a random crash in my image generator, swapping out libraries and checking hardware. Turned out a single trailing space in my prompt config file was breaking the parser, which I only noticed because I cat'd the file on a whim. Has anyone else had a tiny typo eat hours of your time like that?
3 comments

Log in to join the discussion

Log In
3 Comments
ninaw88
ninaw882mo ago
Actually I think you might be slightly off on what happened there. Trailing spaces aren't usually the kind of thing that breaks a parser unless it's specifically checking for exact matches or stripping whitespace in a weird way. More likely it was a newline or carriage return character that was invisible to you in the terminal. When you cat a file it shows spaces just fine actually but carriage returns get hidden. I'd double check by running cat -A on that file to see all the hidden characters just to be sure. I spent four hours once on a bug that turned out to be a stray tab character that looked exactly like eight regular spaces in my editor.
2
nelson.gavin
Yeah "invisible in the terminal" is exactly the kind of trap that gets you. @ninaw88 your cat -A tip is golden, I'm gonna start using that. Reminds me of this buddy of mine who spent like three days trying to figure out why his config file kept failing. He'd checked every line, every space, everything looked clean. Turned out he had a freakin null byte stuck at the end of the file from some text editor glitch. cat -A would've caught that in two seconds but instead he was pulling his hair out rewriting the whole parser. Those hidden characters are straight up evil man.
5
lee_ward54
lee_ward542mo agoMost Upvoted
Man that seems like a lot of effort to figure out something that took you all day. I mean yeah it sucks when a weird thing breaks your code but at the end of the day it's just a space or whatever and you moved on right?
2