DEV Community

loading...

Discussion on: What's the longest you've ever spent debugging a single bug?

Collapse
pinotattari profile image
Riccardo Bernardini

A couple of days; an issue with pointers in a C program.

It began as usual: the program dies with a segmentation fault, open it with the debugger to check where the fault happened and... the stack is a nonsensical mess. Ouch. This is not a good sign, stinks of dangling pointers or similar.

In cases like this the actual error can be anywhere and it could be necessary a veeery long time to find the actual bug. It turned out that there was a problem not with just a pointer, but with a pointer to pointer to pointer to ... deep three or four levels.

I am soooo happy that I now code in Ada and not in C anymore.