Live data from Hacker News

Ask HN: What is the funniest bug you encountered?

news.ycombinator.com

11–20 of 66 posts

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

#11
I had this bug that can reproduce only on a specific hp notebook, after running certain stress test for days.

The issue (a crash) was in a device driver we were developing, but the root cause was because 1 single bit in the host memory was flipped randomly.

My coworker joked that this bug was due to strong sunspot activities during those days (We indeed saw news about strong sunspot activities at the time.), so that strong universal radiation altered the data on the memory. I guess that batch of memory the notebook used had some issues.

My background is purely software, I always thought that computer hardware is rigid and trustworthy. But I learnt from this bug that it's not always the case.

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

#12
An embedded system written in C++ had a Singleton. The Singleton pattern means that you have one instance, which has to live somewhere. This implementation had the instance as a static variable in the getInstance() method, e.g.:

  Foo* getInstance()
  {
    static Foo;
    return foo;
  }
This is perfectly valid.

Unfortunately, getInstance() was implemented in Foo.h, not in Foo.cpp. But in C++, functions in header files are inline by default. This means that every caller of Foo::getInstance() wound up with their own "static Foo" in their own inlined Foo::getInstance(), which meant that each caller got a different instance of the Singleton.

Most interesting bug I've seen in ten years.

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

#13
post #9

Not really a bug, but.. An early release of our product (not to be named), contained a database that contained a perl script that was written out to a web server. The person who took over maintaining this script looked at the original author's code and put a comment line in containing the descriptive phrase "Chicken Goat Fuck Logic" (aka "CGF Logic"). We accidentally forgot to remove that comment before producing the…

why not named?

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

#15

Tester worked a later shift (noon to 8pm) and was running scenarios. Got a really odd error that made contracted pricing incorrect. Developer came in the next morning and ran the scenario just fine. Tester repeated the scenario at 6:30PM and got the same error. Both thought the other was nuts and this went on for a week. Found out it was an interaction issue when using the time (UDT) to get the current market date. L…

I also found a test breaking on Mondays. Never on any other day. It tested a sum for the current week but made the mistake of creating models for "yesterday" which is on another week if it's the first day of the week (depending on location, Monday in Europe, Sunday in the USA).

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

#17
One I wrote myself. Frustrated with some bizarre bug that I struggled to reproduce, I added two popups, to two separate conditionals that should have been exclusive (either one or the other executes, but never both). The first one said "What", and the second one "the fuck". I eventually managed to get both to show up, correctly forming the expletive, but it wasn't enough to help me solve the bug. There were more bugs though, had to get the ticket list down, so I dropped it and went after some lower-hanging fruit.

A week later, our dev team gets sent a chain email with two screenshots, and a brief comment from the lead saying "This should never happen." In the first screenshot, was my "What" popup. I didn't need to see the second one.

Turns out, when I moved on to other tickets, I completely forgot I had left that code just lying there, instead of discarding it, and had even pushed it with nary a thought. Nobody else on the dev team had seen either popup. No one in QA saw them either. And so, it made it all the way to production, where one of our users (mercifully, an in-house one), promptly caught it.

The dept head thought I was committing sabotage, given the very specific set of actions one had to take to see the effect, but thankfully everyone knew that it was too stupid to do something like that via commit into repo! At the least, my frustration at the bug proved justified.

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

#19
As an undergrad doing an internship helping some PhD students write a complex MATLAB simulation. Part of the simulation needed to be done in a loop and, naturally, I used "i" as the index variable. I spent several days debugging why the expected output result was not correct.

Turns out there were some calculations using complex numbers (e.g. `x = 2 + 3*i`) and MATLAB decided that I obviously wanted to redefine the imaginary number constant in the loop. It was not very funny at the time.

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

#20
For some reason, in some astrodynamics calculations, I multiplied by r^2 rather than dividing, and since r was on the order of 10^8, the answer was off by 32 orders of magnitude.

(Yes, I now know about changing the units so that the numbers aren't so big; this was before I understood all that.)

Post reply on HN