Debugging: Indispensable rules for finding even the most elusive problems (2004)
41–50 of 238 posts
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#42I have found that 90% of network problems, are bad cables.
That's not an exaggeration. Most IT folks I know, throw out ethernet cables immediately. They don't bother testing them. They just toss 'em in the trash, and break a new one out of the package.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#43Step 10, add the bug as a test to the CI to prevent regressions? Make sure the CI fails before the fix and works after the fix.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#44For #4 (divide and conquer), I've found `git bisect` helps a lot. If you have a known good commit and one of dozens or hundreds of commits after that is bad, this can help you identify the bad commit / code in a few steps. Here's a walk through on using it: https://nickjanetakis.com/blog/using-git-bisect-to-help-find... I jumped into a pretty big unknown code base in a live consulting call and we found the problem pr…
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#4510) Enable frame pointers [1].
[1] The return of the frame pointers:
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#46Wheeler gets close to it by suggesting to locate which side of the bug you're on, but often I find myself doing this recursively until I locate it.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#47Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#48Really, that's important. You need to think clearly, deadlines and angry customers are a distraction. That's also when having a good manager who can trust you is important, his job is to shield you from all that so that you can devote all of your attention to solving the problem.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#49Step 10, add the bug as a test to the CI to prevent regressions? Make sure the CI fails before the fix and works after the fix.
I don't think this is always worth it. Some tests can be time consuming or complex to write, have to be maintained, and we accept that a test suite won't be testing all edge cases anyway. A bug that made it to production can mean that particular bug might happen again, but it could be a silly mistake and no more likely to happen again than 100s of other potential silly mistakes. It depends, and writing tests isn't fr…
Writing tests isn't free, I agree, but in this case a good chunk of the cost of writing them will have already been paid in a way.
Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)
#50Some additional rules: - "It is your own fault". Always suspect your code changes before anything else. It can be a compiler bug or even a hardware error, but those are very rare. - "When you find a bug, go back hunt down its family and friends". Think where else the same kind of thing could have happened, and check those. - "Optimize for the user first, the maintenance programmer second, and last if at all for the c…