Elektrine lite

← Feed

@simontatham@hachyderm.io

2026-10-28 09:57 UTC

I had a really good afternoon at work yesterday. I had a long pair-debugging session with a junior colleague, helping to track down a crash in something they were in the middle of writing. We started from the visible crash and backtracked to find the root cause, investigating everything along the way that looked odd. We were expecting one bug, but ended up finding two. The load instruction that first put a bogus value into a register was loading from a totally wrong address, *and* there was some weird data at that address that shouldn't have been there, and those two wrong things had independent causes. Neither bug by itself would have caused the crash: it needed both. If we'd found only one of them – for example by jumping to a conclusion, speculatively fixing something, and observing that the crash had gone away – then we'd have thought the whole problem was fixed, and been wrong. But by going through methodically to the point where the first weird thing happened, we were able to find both bugs. We fixed one on the spot, and ended the session knowing what to do about the other. My colleague had asked for help with the aim of learning debugging skills (both low-level and general) as well as getting the bug fixed. I don't always have success when I do this on real-world problems, because if the problem turns out to be too hard, I can't solve it _and_ explain what I'm doing at the same time. Here, it was just about right: challenging, but not too much so. I learned things too. We had to use LLDB rather than GDB, and I'm not nearly as familiar with LLDB, and now I'm more so. (It has a proper hex-dump command!) So it was a useful learning experience on both sides, as well as a successful bug-fixing exercise. They apologised afterwards for taking up my whole afternoon, but I think it was time well spent. And to put the icing on the cake, nobody at any point suggested throwing an LLM at anything. The only thing that bothers me about it is that this kind of experience is now rare enough in my life that I feel moved to toot about it when it happens!

Replies (0)

No replies.