I remember testing a geographical data normalizer written in Java that had concurrency problems. So, when you tried to normalize a city (say "Rome") and another guy did that too (say "New york"), you would get the other guy's data normalized ("NEW YORK") instead of your query.
What's the bug that mostly made you smile in your career?
The best bug report I ever got was for the Sims 2. The bug report was, "Ugly naked guy appears."
The bug turned out to be that the NPC in question had clothing from an expansion pack, and the expansion pack wasn't available so he would turn up to your house naked.
At Microsoft, there's a hardware test lab that's responsible for testing the zillions of webcams out there against each new build of Windows to make sure it doesn't break anything. One of the webcams was rolling when the 2001 Seattle earthquake hit [1].
After that earthquake, every bug database in the entire company had a few bugs entered of the form "when I click on the Update button, the entire lab starts shaking", or "when I deleted the file, things started falling off the shelves".
Most of the bugs of that form were closed "not repro".
[1] http://www.youtube.com/watch?v=q7boO%5FwTzS4I wrote an OnChange or OnKeyUp, etc. on a TextBox once. Whenever I typed in it, I would get really erratic behavior. I spent hours trying to debug it before I realized it was the batteries in my wireless keyboard going out.
While editing Rise of the Triad [1] I forgot to place the stopper code that should prevent a moving wall from 'walking off the map' and all of a sudden, this drawing popped-up:
Clbuttic [1]
Let's also remember its counterpart, Consbreastution [2]
[1] http://www.google.com/search?hl=en&q=clbuttic&btnG=SearchWhile learning a new computer system, I wrote a program to play blackjack. One of the people using it discovered that he could enter a -negative- value for the bet and then deliberately lose the hand. When this happened, the program obediently subtracted the negative value from the player's money total, thus giving him more money every time that he lost.
Since that day, I have been a lot better at checking user-entered input values.
We got a couple crazy bug reports from Sega testing of our baseball game.
We had a scoreboard that animated when certain things happened. One showed the batter holding a bat which then burned up like a match when the player struck out:
"Scoreboard animation shows player holding bat that turns into giant flaccid penis. Scoreboard animations must not contain any form of penis."
Or, for the baseball challenged:
"Often, when playing the fielding team against an AI batter, the batter will take or swing at the first pitch, take or swing at the 2nd pitch, then swing at the 3rd pitch, either hitting the ball or striking out."
Ya... um, that's called Baseball.
I got one
if (accountExpired)
{
// do something
}
{
// do something else
}
remember to read between the line lol.
else
keyword, like the rarely used then
, is optional! - slebetman
Testing iPhone accelerometer code in the simulator, and wondering why I'm not getting any data.
A long time ago, I knew a guy that had to create a left to right scrolling banner with Javascript for a website.
When he was done, it turned out that if you made the window smaller than the width of the site, the whole site would scroll right to left, while the banner held still.
<marquee />
? - Tim N
I was writing some stock code to recursively delete all the files/directories after a process had been completed. Easy stuff.
I ran the program and imagine my surprise as all my source code files suddenly disappeared.
The working directory in question was a subdir of the bin directory, which was in turn a sub dir of the source code. No problem right? Except my base case test to halt the recursion had an error which caused it to perform 2 more iterations than necessary.
Due to the secure delete utility we were using, I lost about a week's worth of code.
I like to think that my software humbly committed suicide in protest against its massively incompetent creator.
I was recently debugging some code on a coworker's machine and noticed subtle typos peppered throughout his code. Every lowercase letter l
had been replaced by an almost-identical number 1
. I was about to point this out, amazed that the code even compiled, but stopped myself when I realized the problem.
Many moons ago, when we were first learning linux, I figured I'd help him hone his troubleshooting skills by creating an alias in his .bashrc startup file. (Right about now, the corner of your mouth is curling up in a smirk, isn't it?)
Right: I aliased the cat
command to make that replacement each time he typed a file.
And in all these years, he'd never noticed anything wrong, and he never found my joke!
It's still there ... waiting.
Early in my career, I was doing some UI work and couldn't figure out why nothing was appearing in the cells of a tabular view. After the better part of two days, the answer presented itself.
Apparently having the foreground and background color the same makes the text hard to read 8-)
Taught me a valuable lesson though, never overlook the obvious.
When I first started learning AJAX I implemented a webpage that checked if a photographer was busy on a certain date or not.
I used a tutorial to start with, and replaced what I needed to get it to work.
Unfortunately, I forgot to change the error message, so if you entered a date in the past it said:
"Merry Christmas!"
The tutorial checked if it was christmas or not you see. Didn't notice until the client informed me of strange behaviour...
I have a habit of hitting ';' at the end of my lines when programming in c++.
for (i=0; i<end; ++i);
{
//code
}
I did that in a programming competition. We lost.
(It's a good idea to turn on compiler warnings)
code
in the increment of the for loop, and there's no more problem! - Mechanical snail
Finding this bit of code after another developer threw his hands up in frustration:
for ( int i=0;i < numrecords; i++ )
{
// a dozen lines of database code that used i
i=0;
}
Just ran into this one myself (it is Tuesday): OpenOffice doesn't print on Tuesdays [1]. (To Brother printers anyway). I can confirm the fix works.
[1] https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161/comments/28file
utility already. I'd think a serious tool like cups would not need to primarily rely on such a general-purpose, best effort classifier... - sehe
Setting constants in 'C' and putting zero on the front of each of them so that they lined up neatly.
Worked fine when there were only 7 of them but it took several versions of the program to work out why the tenth and eleventh message =0010 and =0011 weren't getting there.
By chance codes 8 and 9 weren't used.
Programming a boss monster for a platforming shooter. The boss had a very simple behavior pattern: if at long range, throw a grenade. Otherwise, occasionally fire bursts from a machine gun. In any case, close to within a certain distance from the player. Simple, right? I went with a simple signum function to determine which direction to move. (If it matters, positive x is to the right.)
x+= 3 * sign(x - Player.x);
See the problem?
Consider Player.x = 200, Boss.x = 400. sign(400-200) = +200, and the boss moves RIGHT.
Enemies were also coded to die immediately if they left the play area.
Battle starts, boss walks backwards off the screen, dies horribly, battle ends.
I wouldn't say smile but the silliest bug I had was comparing a variable to the letter 'O' thinking it was a zero...
It was pretty frustrating
At university we had to implement a calculation algorithm using Fortran 77. Having never used it before it took a while to implement it and get it running, but to my disappointment the calculation result wasn't correct. I spent a hours time checking every line of code, especially the part that did the distribution of the data to the calculation nodes, and the aggregation of the result, and everything looked right. I carefully checked every part of the long equation that gave the final answer, and it was exactly as in the problem description.
It wasn't until I turned the syntax highlighting on I noticed that the last term in the equation ( / Z
), was dark blue...
If you ever have to touch Fortran 77, use syntax highlighting and make sure not to write code beyond column 72 [1]. Beyond that, everything is automatically considered a comment by the compiler.
[1] http://www.iopb.res.in/grad-course/fortran/node2.htmlthe first time i ever learned about C, i tried homework #1
#include <stdio.h>;
int main() {
printf("hello world");
return 0;
}
and for an hour the program will not compile... and then later on, i found that "in C, every statement should end with a semicolon" doesn't apply to a preprocessor line...
A customer called up and said every time he drank coffee, our daily synchronization program would hang the computer.
Obviously the guy took his coffee-break whilst synchronization ran because it was processor, and time-intensive. Turned out he was using a proper desktop system with a horizontal( instead of a tower ) cabinet. The cabinet had sustained some damage, and placing a full coffee mug on top of the cabinet would kill the processor-fan, and Voila!
Drove us crazy figuring out what was going wrong, and we only got it by accident (Luckily!)
One of my favourite bugettes was a list of customer data that seemed to very occasionally sort incorrectly so sometimes Mr Downing would appear above Mr Downinger and sometimes the other way round.
Eventually this problem was traced back to a historic developer trying to "ensure" that all the names were unique by appending a guid to the name, they didn't realise that the sort was also applied to that cell meaning that v.occasionally Mr Downing would get a guid appended that made alphabetically AFTER Mr Downinger.
An employee added some grid adorner code to the OOFILE report-writer engine, to draw borders around tables. It crashed the Mac every time he printed.
After an unknown time it was turned over to me to debug, being responsible for most of the report writer code - I was expected to have some magic insight.
It was only through very slow sing-stepping that I noticed that at one point he redrew a line on top of itself, rather than having more complex conditional logic deciding when to draw a line or not. On nothing more than instinct, I took that code out and it fixed the crash.
I came to the conclusion that the Laserwriter printer driver, which was converting Macintosh PICT drawing commands to a Postscript program, was unable to handle identical line segments drawn on top of each other.
Thats my funniest bug I can remember, in over 25 years. I can't remember what time in the morning I finally found the bug but I'm pretty sure my ecstatic yell set off a few car alarms in the adjacent park.
I am not a resident of Scunthorpe [1], thankfully.
[1] http://en.wikipedia.org/wiki/Scunthorpe_ProblemThe old printer on fire bug happened to me at Uni. Scared me to death.
http://marc.info/?l=linux-kernel&m=102893054014512&w=2 [1]
Suffice to say the printer was not actually on fire.
But the message was scary enough.
Not really a bug, exactly. But, on one of my first paid gigs I was working with an ISAM database library that prefixed all of its error-reporting functions, constants, and other related stuff with "wtf_". Being young and rather naive, I didn't understand the significance of the prefix until the first time it actually reported an error, and I uttered the three magic words.
Not my bug, but I worked in QA on the first Rock Band game. One day I was poking around in the bug database and found that someone had submitted one alleging that the "Don't Fear the Reaper" track--you guessed it--needed more cowbell. I kept an eye on it; when we got the next release, it was marked for regression with the dev comment "Increased the volume of background instrumental." Apparently the tester found this satisfactory and marked it as a fix.
My favorite bug of my own was when I was working on an IRC bot which would, among other things, choose between two options when prompted. Just to be silly, I added to its list of hardcoded responses that when it was asked "Apples or oranges?" it should say "Bananas!" Well, I screwed up the edit--overloaded a variable, if memory serves--and managed to create the situation where any time anyone said ANYTHING in a channel with the bot (addressed to it or not), the bot would reply, "Bananas!" Luckily I was running it in a test channel, not the 300+ user channel it now lives in! (It still cracked up the channel admin enough that he made it an easter egg in his own bot.)
Coding some assembler on an old Amiga A1200 (15-17 years ago) I was trying to blit an image onto the framebuffer in my program. Didn't work, but it still ran through the loop without hitch.
I shifted between the asm and the program a few times, then I decided to give up for the day
Now, the Amiga had fast preemptive multitasking (for its time) due to the lack of inter-process memory protection (i.e. no MMU/TLB).
So, when I closed the assembler and saw the desktop, in the background was my picture!!
(I had copied the image alrigth, to the wrong place, which was on top of the desktop background picture, managing to not overwrite any critical code or data. It was there until the next reboot. 8-D)
It was when the Renault Laguna III was about to be released. The test vehicle had a right-hand side steering wheel and when I opened the driver's door, the display showed that I had opened the left door :)
Anyway, I started the engine and ran the diagnostic tool. It showed that the injection is not OK and the car couldn't drive at more than 10 km/h. Also at stopped position the tool displayed that I was driving at -1 km/h :)
Finally, the fuel tank was almost empty and there was a big attraction to the public driving the non-released Laguna III at 10 km/h to the nearest gas station :)
When trying to test some ORM I created a quantum test. It was thus because the action of confirming if the test had succeeded (by using the session to query for the existence of the object) actually forced the session to persist the object and for the test to succeed.
Without the code that tested the success the entity was not persisted. :O
In C/C++:
#define true false // happy debugging losers
Usually, my bugs doesn't make me laugh at all!
When I first started programming I tried to a make a simple calculator program in QBASIC. If I remember correctly it looked something like this:
INPUT "Enter the first number:"; num1$
INPUT "Enter the second number:"; num2$
PRINT num1$
PRINT "+"
PRINT num2$
PRINT "="
PRINT num1$ + num2$
I couldn't figure out why it was saying 1 + 1 = 11 and 1 + 2 = 12. :P
(In QBASIC, variables that end in $ are strings, and + is the concatenation operator...)
when in junior high, a bunch of us were learning to program in BASIC.
and we typed in a program
for i = 1 to 1O
print i
next i
and it couldn't run... so the few of us including a more senior guy was going over it about twenty times. and we thought, maybe the computer got crazy... and one of the smart guys said, maybe the motherboard was too hot... and then after half an hour, we found that the 0 was typed by one of the genius as a capital o
.
Many moons ago the company I worked for changed the location where images for our web app were located. It took some time for this change to percolate thru the source tree, so for a few builds we had red X's on many of our web pages (buttons, logos, etc) as paths were adjusted. This was obviously frustrating to a lot of us...
After the dust settled several weeks later the red X's appeared again! The paths were right, the code looked good. What was wrong?
Some prankster (ahem) had checked-in an IMAGE of a red-X on top of most of the 'real' images - buttons, logos, etc. So on subsequent builds we DEPLOYED a bunch of red-X images!
TG for rollback.
Brilliant!
As a practical joke on a fellow designer, I added some Javascript to a website project we were working on to make the browser slowly and randomly wiggle around the screen when users named "Michael" signed in on Fridays.
A laugh was had by all, the product shipped, and I'm sure you can guess what strange bug started occuring in the wild.
Some rollbacks had occured and the removal of my easter egg was undone. To add insult to injury, it was rolled back with and forgotten about by yours truly.
Not a "bug" per se, but what took me quite a while to figure out was when I was mocking up an EBCDIC to ASCII converter in VBScript and Norton AV (or some other AV software, I forget now) apparently kept thinking the keycode mapping code was something malicious and kept quarantining my source code.
In the college days, we were supposed to choose a classic concurrent problem and deliver a resolution on C. A friend was working on The Sleeping Barber [1] problem and asked me why his code was not working. When he ran the program to show me what was happening, the following appeared on the screen:
I'm gonna release
I'm gonna release
Sit on the Barber!
I'm gonna release, in portuguese, is an obscure sexual pun...
The error was unrelated to the output, but the unexpected and hilarious image of customer asserting his homosexuality and sitting on the barber is something always remembered when there is a reunion of our old college gang.
As a teaching assistant in college I had a student come to me with a listing. "I don't understand why this doesn't work," he said. "It's too SHORT to have any bugs in it!"
When I was first working with ML for class, I wrote a quicksort method that just would not terminate, ever! I would enter my call to test quicksort in the interpreter, press enter, and then wait and wait and wait until I got fed up and killed it. Eventually, I stepped through my program by hand, step-by-step, through all the recursions, and proved to myself that it MUST be terminating. It was only then, after nearly an hour of debugging, that I realized the interpreter was simply waiting for me to enter a semi-colon to tell it I was finished with my input and to interpret my command. The quicksort method worked perfectly.
Another fun one I do ALL the time:
for (int i = 0; i < height; ++i)
{
for (int j = 0; j < width; ++i)
{
}
}
Many years ago I worked on flight simulators for BAe. My team had to commission a small rig at another BAe site and were very confident that the rig had been extensively tested (with the exception of some touchscreen calibration software that I'd write when on site).
I wrote the missing code which ran perfectly on a Sun workstation, we burned new PROMs and installed them in the rig. A few seconds after power-up the entire rig crashed and rebooted, this happened repeatedly and I was catching huge amounts of abuse. Three hours of debug / abuse later, still no answer and now 1 oclock in the morning one of the team went for a breather. He came back grinning and said he'd cracked the problem.
He'd spotted the sites air traffic control radar and noted how it turned full circle in exactly the same interval that the rig took to boot and crash. We shoved the rig to the side of the portakabin shielded by a row of filing cabinets from the radar's sweep and from the first power-up the rig was cured.
I once misspelled the name of a constructor in C++:
class TotalBBBetaTeams {
public void TotalBBetaTeams() {
// code would never get called.
}
};
Now, of course I got the compile error that I was missing a return type first, so the "void" there was added to fix that error, instead of fixing the spelling. Constructors don't (can't) have return types.
I've been doing some game (MUD) development. While programming containers, I added the command put
, so can put
an object into a container. Turns out, I'd forgotten to add a check that the object you were placing in the container wasn't the container itself.
This ended with me putting a handful of daggers into a rucksack... and then folding the rucksack up inside itself, thus disappearing.
A friend in college asked me why his code wasn't compiling. I was reading over it and found he had a variable named IndexOfSmallest, but at one point he had misspelled it as IndexOfSmellest. Now that's what I call a code smell!
I added some test code that called our unexpected exception handler with the text "this is not an error", and put it in the File->Exit code to make it easier to test. I'm more of a "red X" guy, so I kinda sorta forgot about it... until a customer reminded me.
When using TOAD for Oracle, I would get the error message "Error: No Error". Makes you scratch your head now and then and say "what!?"
This is not a strict developer bug but anyways...
When building an electronic device for our company everything worked out very well. The PCB-layout turned out to work and every card we got manufactured worked.
We built a complete system and in our test bench everything worked out nice.
But when it was time to take the system live the communication between the "master" device and a computer would not work, we got strange messages and so on ... After a while we stumbled upon the solution, pick a 1 ohm resistor and put it in series with the power supply, everything worked! At present we do not really know why this solved our problem, some kind of low pass filter ... but hey ... it compiles, ship it.
One of our programs had placeholder error messages during development, they were supposed to be replaced by localized messages before the release of the program. However, at least one of them wasn't. One day our support desk got a call from a scared customer who didn't dare to touch the computer after "TERRIBLE ERROR!" popped up on the screen...
Worked only while debugging
if (log.isDebugEnabled()) {
// some debug stuff
log.debug(...);
doSomethingVeryImportant(); <----------------
log.debug(...);
}
In our application the user make a upload of an image:
It was cropped.
Then when he saved the image:
My co-workers say it's not a bug, it's a feature. The Obi-Wan sword makes
Ssszzhh!
[1].
While debugging i found something like this:
if(dataRow.isBirthDateNull)
{
//some error handling code here...
errorMessage = "..." + dataRow.BirthDate.toShortDateString();
}
First i thought was... omg this guy fails at fail!
One of the very first programs I wrote was a small BASIC program that generated 7 random numbers for the Lotto. I won $7 the first week. The following week I ran the program again and was baffled by the output being something like 2,4,7,7,10,26,26. That was very hard problem for me at age 11. That ugly old ABC80 [1] sure taught me a thing or two.
[1] http://en.wikipedia.org/wiki/ABC%5F80An IT administrator was testing to make sure the folder on the web site that he was working with was correctly pointed at by the web server. To check, he created a simple HTML file with the only HTML <h1>Poop!</h1>
in it.
The administrator was not aware that in IIS, there is a 'default document' priority order, and if you create a new file called "index.htm" the site will show that as the main home page instead of the correct "default.aspx" page.
Customers visiting the high-end spa web site were very confused that instead of seeing soothing images of massages, flowing water, and pink flowers, they were being commanded to defecate.
The lesson IT learned that day: Always use non-offensive test data and messages, just in case.
Trying to execute a 'dump' program but constantly misspelling it as 'dumb'.
When I had just met my future wife I was walking around twitterpated for a while.
After replacing a critical financial report formula with the following bug
SET A = A
my employees rebelled and forbid me to code for the next two weeks.
A configuration file setting in a 3D simulation I wrote accidentally scaled everything by multiplying by zero. The result was that nothing appeared in the world. Several days of adding sanity checks finally found the culprit.
It's funny now, but not at the time. It taught me the value of adding asserts.
My funniest bug was when I was just entering college. In high school, we were using Pascal, while the college class I took was using C++. Naturally, I was still using Pascal conventions.
While writing one application for the C++ class, I forgot about the C convention of () after a function name and was still working as I would a Pascal programmer. Instead of getting back something logical like "functions must be terminated" or something similar, the compiler was telling me that it was an invalid variable cast. Took me about an hour of searching for help on the problem to fix it, but I got MS to create a bug report and got my program finished. Never forgot the differences between conventions again.
Ok, I just got a compiler message that seems like too funny of a bug and makes my previous answer look pathetic.
In Delphi 5 (maybe in others too), set a breakpoint on a begin statement, let the code run to the breakpoint, then do an evaluate/modify on the begin. The error message is "Expression too complicated".
I worked intensely as sole dev on a team to create a data entry internet app for a small clinic. We finish, ship, and after initial flurry of support tickets, there is a long period of silence, and then this:
When I press BACKSPACE I end up on the previous page, Client Listing.
IS VERY ANNOYING ! PLS FIX !! !!!
Facepalm. = /
In a web app I was working on we ran into a problem where pasting data sometimes failed. After some examination it seemed you could paste forward ( to the right and below ) on the page but not behind. We found the culprit:
source, target = Pasteable.find(source_id, target_id)
The paste able objects happened to be in id order on the page. ActiveRecord returned objects in id order, not the order passed in.
A fail attempt at an HLSL shader:
warning X4547: debug info exceeds maximum comment size; no debug info emitted
Compiled shader code uses too many instruction slots (25848). Max. allowed by the target (ps_3_0) is 512.
Lesson learned: don't unroll ridiculously large loops.