Follow

are we sharing debugging war stories?
one time I was debugging why a c++ source file wasn't being rebuilt when its corresponding header changed.
turns out the makefile generator had a bug where it would skip the first during dependency gen if the file had a unicode BOM

basically every c++ build system that does depedency generation had this bug. it's such a simple pattern to read a line, check if it starts with '#', and skip otherwise. breaks down with a BOM (which is invisible on most text editors, mind)

another time I was debugging some javascript code that was injected into an html renderer. code crashed on a simple debug statement. problem was the javascript was concatenated with minified jquery, and the jquery source had a comment at the end with no newline

so concatenating the jquery file with the source file meant the first line of the file also became a comment.
that first line was the one-line declaration for the debugging function

lots of "first line of the file was ignored because reasons" issues

@SuricrasiaOnline@cybre.space i had this one matlab exercise that had wrong output and I couldn't figure out the cause

asked my prof and he couldn't spot the problem either

i rewrote it from the ground up, doing basically the same thing, and worked

never figured what was wrong

@not_on_pizza if it's on line 2 then it's fine, since a newline will follow the byte order mark

Sign in to participate in the conversation
Cybrespace

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!