3 ms·
Do other people who have been doing this for a while feel like those bugs end up as a blur? As new programmers we all went through hard to debug timing/memory
by YZF 13y ago
Do other people who have been doing this for a while feel like those bugs end up as a blur? As new programmers we all went through hard to debug timing/memory corruption/threading issues but I like to think I've learned enough to avoid those classes of issues...
War story #1:
I designed and programmed a board based on a TI fixed point DSP (5x series). Problem is the software ran for a very short while and then the board would crash. I went through everything I could think of, the software, verifying the reset sequence, memory accesses. Everything looked good. Called TI support. Couldn't figure it out. After I think two weeks of checking everything it turned out that one of the ground pins that was supposed to be connected (it was in my schematic) was left unconnected by the PCB designer. When we brought out the PCB design we saw the via to the ground plane but a tiny little segment between the pad and the via (under the chip) was left unconnected. If you don't hook up all the Vcc and Gnd pins you get undefined behaviour...
War story #2: Odd intermittent very rare behaviour in an application we worked on. Turned out we were using some implementation of shared pointers that used interlocked increment for incrementing the count but didn't use interlocked decrement for decrementing. So very rarely two threads on two cores would hit that and someone would end up with an invalid pointer. That one also took a long time with trying to get some semi-reproducible behaviour to even know where to start looking.
EDIT: One thing I've learnt over the years is that bugs that look impossible to figure out will eventually. The magic time period is around two weeks for those rare super hard bugs. This is from having no clue of what's going on, intermittent weird failures that look impossible to figure out, all you have to do is "do the time" and you can figure those out. I've seen people simply give up and live with things not working and believe that those issues are "unsolvable"...
- aidenn0 13y agoWorst bug I saw took nearly a year with some really smart people working on it. It reproduced only after about 6 machine years (had ~100 test machines, and one of them would randomly crash every 3 weeks).
- anabis 13y agoYeah, reproducability would determine how long it will take to zoom in, but being rare should also reduce the severity.