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.
It's his son who saw it. So we removed it before the client (or anyone, it was in production) feedback to us.
Bullet dodged !
http://advancedsearch2.virginmedia.com/main?FailedURI=bugzil...
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.
The errors on all the sites were reporting a broken sql query - something like "select * from qccounts...". I guess the way ASP worked meant that the code was stored in a common location in memory for all the sites.
I like to imagine some cosmic event millions of years ago flipped that bit...
Oh, wait, those were regexes.
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 "gold" CD.
A couple of weeks later, a very large national youth organization (also not to be named) contacted us, saying they would be unable to use our software, because their CyberNanny software had detected swear words in the output.
Arguably, if this hadn't happened, we would have become Amazon before Amazon became Amazon. Ooops!
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.
Now, if your function is sufficiently complicated, the compiler may choose to not inline it anyway (with the definition of "sufficient" being compiler-dependent).
It could be considered a compiler bug that a function with a static variable in the body could be inlined. As you say, that changes the behavior of the function. Or perhaps it could be considered a specification error - I don't know if the standard prohibits inlining in this circumstance, but perhaps it should.
Making the singletons in shared objects, each one gets it's own. Adding a destroyInstance method.
It can be done, but if anybody ever calls destroyInstance in production code, well, I question their approach...
6mths after it was in production I got an email saying "The system won't work and it keeps calling me Dave!, I'm not called Dave, my name is Chris!".
Lesson learnt right there, never put funny error messages in with the intention of replacing them later and never swear in error messages.
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?
INBF "do the opposite." Markets don't work that way.
Then the young grasshoppers learn about checkpointing and using our dev ops systems to make sure the environment is up to spec, but I feel this has to happen at least once to each Deep Learning researcher
Lesson: if anything goes wrong at night but not during the morning, look at all the date code.
At the appointed time the cleaner came by, unplugged his machine from the power socket and plugged in the vacuum cleaner to clean the room, and when done, plugged the machine back in.
This next bug (in the same game) we purposefully left in and it became an easter egg. A big part of the game was being able to customize your store with different retail stands and tables to put your merchandise on. If you edited your store layout while customers were in the store, you could trap them. The path finding code we wrote for the customers required a valid point of entry and a valid point of exit to the store. As soon as you trapped the customer, the lack of valid path to an exit had an unusual effect on the character animation. The character movement and animation speed would increase up to 2x, which made the customer look like it was freaking out. It also negatively effected the customer "happiness" state. A store's reputation score was based on the average customer happiness level over a particular time period. A trapped customer could absolutely destroy that score. I've seen it drop from 2000+ to 0 in seconds. As with the other bug, we never did figure out why this was happening.
2nd tl;dr If sex/gender is an Enum you should have at least 4 values unspecified, female, male, other.
A few years ago I was working on a front end that talked to different scheduling software systems. Our front end had a much more nuanced way of representing sex/gender while the system that talked to scheduling systems had an older enum
Bad_Gender { female = 0, male = 1, }
A bug was introduced such that no gender was set. However the field not being set meant that it's value was 0. This led to all appointments being booked as women. Even a prostate exam. Needless to say we fixed the bug quickly.
Worked fine in the office. Every time we went up on the mountain to test, the video didn't work. Go back to the hotel it worked fine.
Whole project was going to fail because of this. Finally it worked once on the mountain, so we proved the system could work.
Finally I found the bug. When setting the video orientation, I was passing in device orientation instead of UI orientation. In my office, I always have my iPad on a stand, so device orientation matched ui orientation and everything worked fine.
When I was on the mountain, I held the iPad flat so I could shield it from the sun with my body, then I'd lift it up when the athlete was about to start. The video would fail to record if device orientation was 'down' since that isn't a valid orientation to rotate video.
I only ended up finding it because I ended up leaving my iPad stand at home one day.
When in Danger
Or in Doubt
Run in Circles
Scream and Shout!
Apple eventually admitted that A/UX didn't support those giant monitors. I installed Mac OS and it ran fine.
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.
Back in my ISP days, we sold IPTV packages, which we in turn received from the IPTV company via satellite. And because of this elaborate distribution method we would get THE BEST outage/disruption notices.
For example;
"Urdu News will be unavailable from approximately 1AM GMT to 8PM, due to HIGH ENERGY SOLAR ACTIVITY."
How much better is that than telling your customers "Your news is unavailable because Barry doesn't understand BGP"?!
https://i.imgur.com/JtbCGkB.png
(Disclaimer this doesn't happen, like ever)
Spiders.
Customer put one of our server in a shack outside the main building. Spiders and other bugs got in the server causing the hardware to fail. We never never thought of testing our against an arachnid infestation.
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.
Only “funny” because it's a phenomenally expensive product with on paper substantial QA/QC, and yet somehow it got into release with an install script that was guaranteed to fail.
We kept this bug as an easter egg.
(Yes, I now know about changing the units so that the numbers aren't so big; this was before I understood all that.)