Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

What is the Best Bug-as-a-Feature?

Posted by Cliff on Fri Mar 30, 2007 12:53 PM
from the unexpected-benefits dept.
Bat Country wonders: "The workflow system, at the department I develop for, was hand-coded by my predecessor in a rather short amount of time, resulting in somewhat unreadable code with a number of interesting 'features.' When I took over maintenance of the code base, I started patching bugs and cleaning up the code in preparation for a new set of features. After I was done, I got a pile of complaints about features that had disappeared, which turned out to be caused by the bugs in the code. So, that leads me to ask: what is your favorite bug that you either can't live without or makes your life easier?"
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • The best (Score:5, Funny)

    by Anonymous Coward on Friday March 30 2007, @12:54PM (#18546189)
    Windows Genuine Advantage
    • Re:The best (Score:5, Funny)

      by TerranFury (726743) on Friday March 30 2007, @01:03PM (#18546349)

      >Windows Genuine Advantage

      No, that's a feature that acts like a bug. ;-)

    • Perl versus Python (Score:5, Interesting)

      by goombah99 (560566) on Friday March 30 2007, @01:06PM (#18546427)
      Perl is perhaps one large bug that works so well that it's a great feature. For example in perl when you compare two things you get an answer that is stable no matter what the items are. In python you can't and even when you can the answer is not stable. The order of a sorted list can depend on it's orginal ordering! You cant compare floats to Complex numbers but you can compare strings to complex numbers. Sets are grouped by equality not identity so 4.0 and 4 are the same thing for a set. Which one stays and which one get added to the set depends on the ordering of the lists that were put in the set.
      it's nuts. And the origin of the nutty ness is an obsessive desire not to have default behaviours. Whereas perl is all default behaviours. In the end perl does what you really meant, and python does what you told it.

      in case you think I'm python bashing google what python evangelist david mertz says about python warts.

      • by badfish99 (826052) on Friday March 30 2007, @01:16PM (#18546613)
        As a mathematician, I'm always surprised by people who think that 4 and 4.0 should not be equal.
        • by zappepcs (820751) on Friday March 30 2007, @01:21PM (#18546729) Journal

          As a mathematician, I'm always surprised by people who think that 4 and 4.0 should not be equal.
          Well, one is just a number, the other is the SP version identifier that tells you when its safe to upgrade to a new version of windows.
        • by rootofevil (188401) on Friday March 30 2007, @01:22PM (#18546733) Homepage Journal
          As a programmer, I'm always surprised by mathematicians who think that 4 and 4.0 should be equal.
          • by IMarvinTPA (104941) <IMarvinTPA.bigfoot@com> on Friday March 30 2007, @01:33PM (#18546921) Homepage Journal
            As a programmer, I'm amused by both.
            4 and 4.0 are equal by value but not in precision. 4 has one significant digit, while 4.0 has two. This is important because multiplying it by 1200 (which has two significant digits), yields two scientifically different answers. 4*1200 yields 5000 (5 x 10^3) while 4.0*1200 yields 4800 (4.8 x 10^3).

            So, in the end, it depends, just like everything else.

            IMarv
            • by zippthorne (748122) on Friday March 30 2007, @01:56PM (#18547315) Journal
              As an engineer, I'm also amused.

              4.0 is definitely a 2 sig dig number, but 4 could be 1 sig dig or it could be "exact." You wouldn't say the 2 in 2*pi*r is only one significant digit, would you? Of course not, it would render any precision in pi or r meaningless.

              Also, 1200 could have 2, 4, or be exact depending on the context. It's best to always use a notation that includes the fraction mark for non-exact quantities.
              • by xero314 (722674) on Friday March 30 2007, @02:14PM (#18547631)

                4*1200 yields 5000

                If that isn't a bug, I don't know what is.
                That is because the IEEE standards for floating point values is the biggest and most prolific bug in software today.
          • by heretic108 (454817) on Friday March 30 2007, @01:52PM (#18547255)

            should 4.0+0.0j and 4.0 be equal? Python does not think so. should 4L and 4.0 be equal? python does not always think so


            WTF?!? Which particular python version are you talking about?
            Python2.4 and later:

            >>> x0 = int(4)
            >>> x1 = long(4)
            >>> x2 = float(4)
            >>> x3 = complex(4, 0)
            >>> x0 == x1 and x0 == x2 and x0 == x3 and x1 == x2 and x1 == x3 and x2 == x3
            True
            >>>

            Or, are you talking about inequalities (<, <=, > >=) which are required for list sorting?
            In this case, it's not a python issue but a mathematical issue. You shouldn't be trying to use inequality operators on complex numers. Inequalities with scalars such as floats, ints, longs etc are a mapping (S1,S2)=>(Bool), where S1 and S2 each can be one of float, long, int, bool, string, but such mapping is not defined if S1 and/or S2 is the field 'complex'.

            Your question is interesting though - a matter of whether a sort of a list of containing complex numbers should work if all the complex numbers have a zero imaginary part. I wouldn't think so. But if you're desperate, you could try something like:

            x0 = int(4)
            x1 = long(4)
            x2 = float(4)
            x3 = complex(4, 0)
            list1 = [x0, x1, x2, x3]
            list2 = [x3, x1, x2, x0]
            def compare(x, y):
                          if isinstance(x, complex) and x.imag == 0:
                                  x = x.real
                          if isinstance(y, complex) and y.imag == 0:
                                  y = y.real
                          return cmp(x, y)
            list1.sort(compare)
            list2.sort(compare)

            As for the 'problem' of list sort results depending on order of the original list, this only happens where there is computational equality between members of the original list, so what's the problem really?
  • 404 (Score:5, Funny)

    by Jordan Catalano (915885) on Friday March 30 2007, @12:55PM (#18546193) Homepage
    My favorite:

    "404 File Not Found
    The requested URL (askslashdot/07/03/30/0116246.shtml) was not found."


    That little error saved me from having to read a bunch of replies.
    • Re:404 (Score:5, Funny)

      by Anonymous Coward on Friday March 30 2007, @01:10PM (#18546493)
      From DOS:

      Keyboard not found.
      Press to continue.
  • it pops up all sorts of porn pages I never even asked for!
  • Windows? (Score:5, Funny)

    by cmeans (81143) <`moc.raftni' `ta' `snaemc'> on Friday March 30 2007, @12:57PM (#18546223) Homepage Journal
    Microsoft keeps trying to clean up their code, and as a result, sometimes, features that SPAMmers etc. are relying on stop working.

  • rm (Score:5, Funny)

    by KillerCow (213458) on Friday March 30 2007, @12:57PM (#18546227)
    rm * .old
      • Re:rm (Score:5, Informative)

        by LihTox (754597) on Friday March 30 2007, @02:21PM (#18547741)
        One way to lessen the chance of mistakes when using "rm" is to always use "ls" in place of "rm" first, then when the list of files looks right, replace the "ls" with "rm".
        I have a script "lrm" which does this: ls the files, ask for confirmation, and then delete (if confirmed).
  • by Anonymous Coward on Friday March 30 2007, @12:58PM (#18546251)
    Great game! Here. [download.com]

    The guy who wrote the Windows version actually allows you to turn it on! Overpay the money lender and your money grows at 10% a month! The bug was in the original Apple 2 version and then subsequent ports, like the one to Palm, removed it.

      • by Zenaku (821866) on Friday March 30 2007, @01:39PM (#18547017)
        In the olden days (DOS) version of X-Com: UFO Defense, a save game consisted of a whole bunch of individual files in a directory tree. After some tinkering around, I realized that one particular file stored nothing except a list of what equipment you had "on order" and after how much more game time it was going to arrive.

        By ordering a bunch of equipment and saving your game just before it was due to arrive (call that save game A) then saving again immediately after it arrives (call that save game B), and then copying this file from save game A to save game B, you could get whatever equipment you had ordered to arrive again. And again, and again. And you could turn around and sell all the extra stuff for cash.

        Lather, Rinse, Repeat. I used to start off a game by repeating this trick until I had maxed out my cash. I found the corresponding file that allowed you to improve your tech without actually performing the research, but that was less of an advantage, since the game used your tech-level to decide how difficult the scenarios it gave you should be.
  • buffer overflow (Score:5, Insightful)

    by virtualXTC (609488) on Friday March 30 2007, @12:58PM (#18546261) Homepage
    buffer overflows are great - they allow you to get root on all sorts of devices that some bastard tried to lock you out of.
  • Easy! (Score:5, Funny)

    by carn1fex (613593) on Friday March 30 2007, @12:59PM (#18546289)
    They screwed up alot of our web-based financial software. If i set the number of items purchased to zero, the whole thing reboots and i get to go home for th
  • by ZiZ (564727) on Friday March 30 2007, @01:00PM (#18546297) Homepage

    Error

    Nothing for you to see here. Please move along.

    Nothing beats a good dose of pot-kettle interaction.

  • by Kufat (563166) <fanbeatsmanNO@SPAMgmail.com> on Friday March 30 2007, @01:00PM (#18546299)
    The famous undocmented 320x240 VGA video mode, pre-VESA, and other tweaked VGA modes.

    I've heard the 6502 (or, more specifically, RP2A03) had some useful undocumented opcodes. I think they weren't intentional, so they might count.

    On the software side...how about exploitable buffer overflows on the Xbox and PSP to enable execution of arbitrary code?
    • by greed (112493) on Friday March 30 2007, @01:36PM (#18546973)

      The Rockwell 6502 was a hard-wired processor; there was no "illegal instruction" check. So, any bit-patter you loaded as an instruction would try to do something. Sometimes, because of the internal open-collector busses, you'd get neat "something OR something" that wouldn't normally happen.

      Here's the I'm Feeling Lucky hit on it: 6502 Opcodes [s-direktnet.de].

      Thing is, the results might vary from implementation to implementation. So they might not work usefully on the 6510, which was otherwise a 6502 with an I/O register at $0000-$0001.

  • by jimicus (737525) on Friday March 30 2007, @01:02PM (#18546339) Homepage
    Not a software bug but a design flaw in a car I used to own.

    The Vauxhall Astra Mk.2 (Opel Kadett E) had a design flaw in the steering column. Specifically, the steering column was rather weaker than the steering lock.

    The upshot of it was when some little scrote decided to try and steal my car (this was way before cars were fitted with immobilisers), when he tried to break the steering lock the steering column snapped and the steering wheel came straight off in his hand.
  • Linux (Score:5, Funny)

    by stratjakt (596332) on Friday March 30 2007, @01:03PM (#18546351) Journal
    It was supposed to be a unix clone, but actually came out useful in the end.
  • by Behrooz (302401) on Friday March 30 2007, @01:03PM (#18546357)
    "Subscribe to view" webpages that are still visible to users browsing as GoogleBot.
     
      User agent switcher extension [chrispederick.com] + Browse pretending to be GoogleBot = Annoying "register/pay to see me!" pages go away. I have no idea how many sites it works on now, but I think it still gets into a lot of archived newspaper articles and suchlike.

    • Personally I use the modify headers extension to do the same thing. But I have "I am not a Googlebot/2.1", rather then the full Googlebot string. But I sometimes come across pages that say something along the lines of "You appear to be pretending to be a major search engine when you are not", for those pages I change the header to "I DIDN'T CLAIM TO BE A MAJOR FUCKING SEARCH ENGINE".

      Of course, both are examples of why you shouldn't use "User-Agent" to try and detect what browser or bot is using your webpage. The first allows "illegitimate" users access, and the second blocks legitimate users.

      In fact, you shouldn't trust headers for anything unless you have a secure session. To control access to your webpage to robots, use ROBOTS.TXT or a meta tag, and to control access to other users, password protect. But the trouble is that sites are trying to eat their cake (be crawled and indexed) and have it too (control access to ordinary users).
  • by Manatra (948767) on Friday March 30 2007, @01:04PM (#18546385)
    For me, the physics bug that enabled "skiing" in Starsiege: Tribes was the best bug as a feature. It's a bug that became a key defining point of the series.

    A description of skiing is here [wikipedia.org].
  • by EWIPlayer (881908) on Friday March 30 2007, @01:06PM (#18546413)
    Sendmail
  • by Headcase88 (828620) on Friday March 30 2007, @01:07PM (#18546437) Journal
    This barely qualifies as bug, more on an inconsistency, but...

    In Firefox, when you make a new bookmark, you need to give it a name. FF grays-out the OK button until you do. This implies that bookmarks weren't meant to be nameless. Here's the "bug": if you go to rename the bookmark, you can make it blank and the OK button remains active.

    So what good is a nameless bookmark? I place all of my frequently-visited bookmarks on the menu bar, to the right of the menus (it's normally wasted space). I have over 25 bookmarks marks there, and if they had names (even one-letter names), they wouldn't fit by a long-shot. The favicons are all I need, so this ability is pretty helpful, and isn't likely to be fixed.
  • Second Life camera (Score:5, Informative)

    by LinuxHam (52232) on Friday March 30 2007, @01:07PM (#18546449) Homepage Journal
    In Second Life, if you zoom your camera up to a wall, you will normally just zoom in to see closer detail of the wall. But once up against the wall, swing the camera around to the side, and you can "back your way in" through the wall. Release and click again, and the camera is now "mounted" inside the house. Its so much fun to watch people inside their homes, especially when your avatar is prevented from entering the property. Some even pay for a little orb that still tells them that no one is detected within 30m. Its fun because the clicks still work, too, like right clicking on someone and IM'ing them.. to tell them that you liked their last outfit more than this one, or the couch looked better in the other corner.. really freaks them out. That is definitely a "bug" (or feature) I couldn't live without... not in SL at least.
  • by Ancient_Hacker (751168) on Friday March 30 2007, @01:09PM (#18546491)
    There were two oversights in the older VW's electrical system:

    (1) You needed the key to close the sunroof.

    (2) But.. a sneak path in the headlight wiring meant you could instead just turn on the headlights and pull on the high-beam flasher (on the turn-signal lever). Enough electricity would flow backwards through the sneak path to operate the sunroof motor. ... ooops, that's more hardware than software. sorry.
  • by mmell (832646) <mike@the-mells.com> on Friday March 30 2007, @01:11PM (#18546509) Homepage
    More than once, I've rescued SUN servers where somebody hosed up PAM (or even /etc/passwd /etc/shadow) by breaking in this way.

    A related "bug" is the ability to boot Linux "fail safe" with the notation 'initrd=/bin/sh' on the boot line. As MVS would say, "Thou art God!"

  • by foxtrot (14140) on Friday March 30 2007, @01:12PM (#18546539)
    From the Blue Sky Rangers website [intellivisionlives.com]:

    FUN FACT: While testing the game, Bill came across a bug: every now and then, the game would, seemingly at random, hyperspace you. He and his boss, Mike Minkoff, went over the code with a fine-tooth comb before realizing what the problem was: the Intellivision hand controllers encode button presses in such a way that an action (side) key pressed at the same time as particular directions on the disc will be interpreted instead as a numeric key being pressed. There was no software way around this; shooting while moving would occasionally be interpreted as pressing 9 -- the hyperspace button.

    After several days of puzzling over a solution, the bug was ultimately "fixed" by including the following note in the instruction manual:

    "Every once in a while, your space hunter will move near a 'black hole,' and the computer will automatically put him into HYPERSPACE. This will cost you the same number of points as if you had pressed the HYPERSPACE key yourself. On the other hand, it will save your hunter."

    This led to an axiom frequently heard around Mattel: If you document it, it's not a bug -- it's a feature. Anytime a game in development crashed -- no matter how badly or bizarrely -- witnesses would invariably turn to the frustrated programmer, shrug, and calmly say "document it."


    -JDF
  • by pak9rabid (1011935) on Friday March 30 2007, @01:13PM (#18546547)
    I'd have to go with strafe jumping in Quake2. What better way to get the 100 health pack in q2dm1 w/out having to sacrifice precious life w/a rocket jump. w00t!
  • I dunno (Score:5, Interesting)

    by Chris Burke (6130) on Friday March 30 2007, @01:13PM (#18546549) Homepage
    In high school I wrote a program for a physics project that showed electromagnetic wave propagation and interference. Nothing that special, the end result was basically a pretty screensaver with some relevence to physics. In light of that, one of the features I added was a pull-down menu for selecting what color you wanted to use. This was back in the VGA days with a 256 color pallette and manually poking the VGA frame buffer. Due to an off-by-one error in calculating the bounding box of the pull down menu, it was possible to select an invalid index for the color, so instead of selecting a row of the pallette with my nice color gradients set up, it was one of basically random colors. The result was really trippy, so when I discovered the bug, I decided to leave it in. At the open house where my program was running through a projector some bystander discovered the bug and thought it was indeed cool and trippy.

    That's about it. Most of my bugs just break shit. :)
    • Re:I dunno (Score:5, Interesting)

      by DedWisdom (1081989) on Friday March 30 2007, @01:48PM (#18547199)
      I had a similar experience when I was younger. I was learning C++ graphics programing on windows (95), and I was trying to simply make a static screen that showed a monochrome random gradient. Well I had some bug in my algorithm, and the screen went crazy, showing this massive arch with these beautiful repeating patterns within the arc, but random static outside of the arc. Okay, weird, changed some +s and some -s, and got it working, fine.

      Years later I started learning about chaos theory and fractals, and something in my head clicked. I instantly had a vivid memory of that bugged screen and realized that it was a fractal. I had accidentally created a rather complex fractal. Blew my mind clean up.
  • by mattgreen (701203) on Friday March 30 2007, @01:17PM (#18546645)
    I used to play too much Starsiege: Tribes about five or six years ago. It is a multiplayer first person shooter with enormous maps. When it first came out, everyone walked around, or hitched a ride on a vehicle. The game was fun, but it was a bit slow for my tastes (I grew up on NetQuake). Somebody discovered a physics bug that allowed players to move very fast over terrain by rapidly tapping the jump button as players slid down a hill. This process was scripted, and the overall dynamics of the game (terrible pun) changed dramatically. The game went from being fairly slow to being one of the most intense games I've ever played. Different hills would give different amounts of speed, and the process of 'skiing' itself required that you constantly look for ways to maintain your speed while fighting off other players.

    When the developers saw the potential it gave the game, they left it in. They realized how it made the game unique and exciting, and this bug became the standard feature that sets Tribes far apart from almost all FPS games out there, even to this day. This bug resulted in probably the closest simulation to virtual athleticism that I have ever seen, which was responsible for the fanatical, but small fanbase the Tribes series had.
  • by adavies42 (746183) on Friday March 30 2007, @01:24PM (#18546771)
    A couple of friends of mine in high school CS wrote a Tetris clone for class, but they had a bug where occasionally, blocks would spontaneously appear or disappear. They couldn't figure out how to fix it, so they claimed (in the docs, not to the teacher) that they had AI adjusting the difficulty to match the players' skills.
  • Date library (Score:5, Interesting)

    by isj (453011) on Friday March 30 2007, @01:25PM (#18546785) Homepage
    Not me, but one of my colleagues took over maintenance of a system which included a date library. The dates and times were treated as floating-point, leading to much conversion and adjustinging. Eg. 12:30 was 12.30, so when adding 40 minutes getting 12.70, and then adjusting that to 13.10, No input validation was done. My colleague tried cleaning that up, but then got complaints from the users. They had discovered the "features" and were now using eg:
        January -6th
    meaning december 24th the previous year.

    My colleague had to remove the input validation again and keep the features.
  • by mccalli (323026) on Friday March 30 2007, @01:41PM (#18547053) Homepage
    This was a fun one. I had one of the first MINI Coopers, and ordered it with the CD player ('Wave' option? Seem to remember that name). I forget exactly when I took possession of the car, but I think it was around September or October. Something like that.

    Anyway, at roughly 2:00am every morning the car alarm would go off, much to the 'delight' of myself, my neighbours and everyone in the vicinity. I'd go out, stop the alarm and then try to sleep. After which it would go off again, every hour or so.As if we weren't losing enough sleep with our then new-born daughter.

    The cause was eventually traced, and it's one of the more obscure bugs I've ever come across. Turns out that the car had a low-power rather than completely off mode, and the CD player retained a tiny amount of power going through it. When it was cold, say at 2:00am on an autumn morning for example, the CD player would detect that condensation was forming and would wake up the car's electrics to create some warmth to clear the condensation. This is deliberate, and quite clever I think.

    However, the problem came in that it did this too often and started causing a big drop in battery reserves. The security system interpreted this as an attempt to start the car by hotwiring it, and so the alarm would be set off. I'd come out to switch it off, then go back to bed on the cold autumn night at which point condensation would form again, the CD player would switch itself on again, the security system would sound the alarm again and a bleary-eyed version of me would stagger out to turn the alarm off again. At which point condensation would start to form again and...

    Bah.

    Cheers,
    Ian
  • by sconeu (64226) on Friday March 30 2007, @01:42PM (#18547063) Homepage Journal
    I'd argue that C++ Template Metaprogramming as a fully Turing-complete functional programming language was probably an unintended result of the definition of templates.
  • by Col. Klink (retired) (11632) on Friday March 30 2007, @01:53PM (#18547275)
    My college dorm elevator had bug/feature. If you briefly pulled and then reset the "emergency stop" button as the elevator was stopping at a floor it would skip that floor. I lived on the third floor and we routinely skipped folks on the second floor waiting for the elevator. This was a great time saving feature (except, of course, when the fourth floor residents would skip the third floor).

    The only misfeature of this bug was that the bell would briefly ring alerting those waiting that they had been skipped. One time, some second floor residents heard us skip their floor and we heard them running down after us. We skipped the lobby and went back to the fourth floor. We could have kept it going all night if they tried chasing us, but they didn't. Anyone too lazy to walk to the lobby from the second floor sure isn't going to race up to the fourth floor.

    Eventually, they upgraded the elevator and we had to stop for the second floor whenever they wanted.
    • by smallfries (601545) on Friday March 30 2007, @01:04PM (#18546379) Homepage
      That probably isn't a bug. Most file-systems don't lock files that you are executing, so they can be overwritten whilst mapped into memory. This can abused in lots of amusing ways.
    • by badfish99 (826052) on Friday March 30 2007, @01:36PM (#18546967)
      I think you're describing the Unix feature that you can replace an executable file while it is in use; the program that is using it will continue to see the deleted version of the file, and new programs will see the new version.

      That's not a bug, it's a feature. It's the reason why you don't have to reboot Unix machines after a software update, as you do for Windows.