Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was the most stupid bug you could not find for a long time? [closed]

I was working on a project that missbehaved, for some reasons no exception was thrown even when it should have. Deep down I have found this kind of error handling:

try {
    m.invoke(parentObject, paramObj);
} catch (IllegalArgumentException e) {
    new CaseLibException(e);
} catch (IllegalAccessException e) {
    new CaseLibException(e);
} catch (InvocationTargetException e) {
    new CaseLibException(e);
}

My brain recognized that several exceptions were wrapped into another one, so that's not so bad. But I had to stumble over this code at least 3 times to see what's missing...

What is your most stupid bug you could not find?

like image 455
martinus Avatar asked Dec 21 '08 22:12

martinus


People also ask

What is debugging and example?

Debugging, in computer programming and engineering, is a multistep process that involves identifying a problem, isolating the source of the problem, and then either correcting the problem or determining a way to work around it. The final step of debugging is to test the correction or workaround and make sure it works.


2 Answers

I fixed a bug once where the application crashed every day at 6:12pm.

Turned out that someone had stored the number of seconds since the start of the day in a 16bit int.

like image 78
Fortyrunner Avatar answered Nov 10 '22 06:11

Fortyrunner


In C/C++ (which I learned recently)

if (x = 0) {
...
}
like image 34
Ed S. Avatar answered Nov 10 '22 06:11

Ed S.