Live data from Hacker News

Ask HN: What is the funniest bug you encountered?

news.ycombinator.com

61–66 of 66 posts

Re: Ask HN: What is the funniest bug you encountered?

#62
In a chemical simulation with OpenGL animation of molecules crashing into each other we used the wrong sign for the vectors after colliding. Instead moving in the opposite direction the molecules started to glue to each other. They kept moving around in ever growing chunks with wild psychedelic shapes.

We kept this bug as an easter egg.

Re: Ask HN: What is the funniest bug you encountered?

#64
post #7

"ERROR: Task completed successfully"

This is actually really common. I can't remember if it's Linux or Windows specific, but it is almost always caused by code like this:

    result = some_system_call(argv);
    if (result == ERROR) {
        do_something_else();
        error_message = get_text_for_last_error();
        display("ERROR: " + error_message);
    }
What happens is that the call to `do_something_else()` calls another system call, which completes successfully. Unfortunately, system calls just return a success or failure code, and store the actual detailed error number in a shared global variable. So, when the handler code goes to retrieve the text message describing the error, it ends up looking up the code for the status of the second system call. But when that returned it saved the code for 'Task completed successfully' over the first error code the developer actually wanted...

I think it's probably Windows, maybe the `perror()` call, that does this?

Re: Ask HN: What is the funniest bug you encountered?

#65

Did not happen to me, but it's really baffling! https://www.ibiblio.org/harris/500milemail.html

I know Trey Harris. I remember when he first posted about this. I was the Sr. Internet Mail Administrator for AOL at the time, and I just about passed out from laughing so hard.

Re: Ask HN: What is the funniest bug you encountered?

#66

Wrote a rate limiter in C. It broke when time got adjusted due to day light savings . Didn't take into account negative time delta. It was an ahuh moment when I realized the next day

Relevant XKCD: https://xkcd.com/1883/ And yes, I do hate working with timezones - and so does everyone else I guess, Outlook still fails to correctly send appointment invites across timezones when DST is involved.

UTC FTW!
Post reply on HN