Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
Bug Programming Software IT

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

Posted by Cliff
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?"
This discussion has been archived. No new comments can be posted.

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

Comments Filter:
  • by smallfries (601545) on Friday March 30, 2007 @02: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.
  • Second Life camera (Score:5, Informative)

    by LinuxHam (52232) on Friday March 30, 2007 @02: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.
  • mertz (Score:2, Informative)

    by goombah99 (560566) on Friday March 30, 2007 @02:24PM (#18546763)
    mertz article []
  • by IMarvinTPA (104941) <IMarvinTPA.IMarvinTPA@com> on Friday March 30, 2007 @02: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.

  • by badfish99 (826052) on Friday March 30, 2007 @02: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.
  • by greed (112493) on Friday March 30, 2007 @02: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 [].

    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 casualsax3 (875131) on Friday March 30, 2007 @02:47PM (#18547159)
    Combine this with Favicon Picker 2 - a plugin that lets you set your own favicons for the bookmarks and you can have a pretty toolbar: 176

  • by Anonymous Coward on Friday March 30, 2007 @02:51PM (#18547241)
    as a non-mathematician, I'm surprised that a mathematician would think that 4 and 4.0 are equal. 4 is a member of the set of integers. 4.0 is a member of the set of real numbers.
  • by heretic108 (454817) on Friday March 30, 2007 @02: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

    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)

    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?
  • by teh_chrizzle (963897) <<gro.notibboh> <ta> <9-llik>> on Friday March 30, 2007 @02:57PM (#18547331) Homepage

    i'll be there still are. i wanted to play around for old time's sake a couple of years ago (popping the heads off some spoonbots) and a few people dropped into my server.

    renwerx [], the guys who made the renegades mod, is making it's own game [] called ascension. it's going to be free to the community and since it was made by the renegades, i figure they will be true to the original spirit of gameplay.

  • by mccalli (323026) on Friday March 30, 2007 @03:06PM (#18547519) Homepage
    The Mini Cooper dates from about 1968,
    It does, but the MINI Cooper dates from about 2002 I think. I also owned original Minis and I'm quite careful in the distinction between them - note the capitlisation. As for the condensation on them - yep, and particularly the distributor. I used to use the washing-up glove trick - cut the tips off the fingers, thread the HT leads through and then wrap the distributor in the rest of the glove. Helped a lot, though it wasn't perfect.

  • Re:GPOW (Score:3, Informative)

    by Binestar (28861) on Friday March 30, 2007 @03:12PM (#18547599) Homepage
    Godly Plate of the Whale certainly existed in the game. Single player you would find it all the time, you would find it extremely RARELY, but all you needed was -1-, and you're set.

    I personally found a Staff of the Apocolypse with 3 charges. Once you have that, you can dupe it up and pretty much just clear every level by casting 3 times, then portaling and repairing it.

    Once people got item editors which allowed you to change the amount of charges to 99, it was even more useful.
  • by Anonymous Coward on Friday March 30, 2007 @03:12PM (#18547611)
    Hmm, Java seems to think int(4 * 1200) and double(4.0 * 1200) and double(4 * 1200) are all 4800. Now if you do 4 * 1.2 and round to the nearest integer, then multiply by 10^3, I could see getting 5000, but that is what you wanted, not what the language is forcing on you. Nor does scientific notation force you maintain 1 significant digit.
  • Re:rm (Score:5, Informative)

    by LihTox (754597) on Friday March 30, 2007 @03: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).
  • That's init=/bin/sh, and it's hardly a bug - you're just changing the kernel configuration to skip all that silly authentication stuff. Someone who has access to the bootloader (you do set a bootloader password, right?) probably has enough access to override whatever security - short of disk encryption - you might have by force if necessary.
  • Re:QW strafejumping (Score:3, Informative)

    by shoolz (752000) on Friday March 30, 2007 @03:30PM (#18547881) Homepage
    Yes! The strafe jumping bug/feature was so cherished by the Quake 3 community that when iD patched Quake 3 to fix it, the community went ape-shit forcing iD to patch the game again to reintroduce the bug!

    This is the only related link [] that I could find.
  • by Anonymous Coward on Friday March 30, 2007 @03:34PM (#18547937)
    Try the smart bookmarks bar []. Does it without the renaming
  • Re:rm (Score:2, Informative)

    by pr0fess (778841) on Friday March 30, 2007 @03:51PM (#18548153) Homepage
    alias rm to rm -i, it asks for confirmation.
  • by twistedsymphony (956982) on Friday March 30, 2007 @03:51PM (#18548161) Homepage
    Heh, thank you. As an engineer I was also going to make this point, I'm glad I'm not the only one who realizes that the number of 0s after a decimal carries with it some hefty implications in the manufacturing and engineering realm. Working for a bearing manufacturer I can tell you that the difference between a part with a diameter of 4.00cm and a part with a diameter of 4.00000cm is a few hundred dollars.
  • Re:rm (Score:5, Informative)

    by hal-j (8004) on Friday March 30, 2007 @03:52PM (#18548185) Homepage
    ug. You should always make a file named "-i" in important directories to prevent this. That way when you do something dumb, like "rm * .old" the "-i" gets seen as a command line switch to "rm" and you get asked for confirmation.
  • by pipatron (966506) <> on Friday March 30, 2007 @04:03PM (#18548331) Homepage

    Speaking of hyperjumps and documented bugs, in Frontier - Elite 2 (and possibly the original Elite as well) you could jump to solar systems with your warp drive, and you could normally jump between 5 to 10 light years at a time. If you scrolled away so the distance passed 655.35 light years, the limit comparison wrapped around and you could jump 655.36 + 5 to 10 light years. If you knew your maths, you could do some simple trigonometric calculations to jump anywhere you liked in a 1310 light year radii with only two short jumps.

    I don't have the manual right here, but I strongly recall that this was described vaguely in the manual.

  • by Red Flayer (890720) on Friday March 30, 2007 @04:04PM (#18548359) Journal

    Dude, that's just wrong and it has nothing to do with precision at all.
    No. It's not wrong:
    4 * 1200 = 4800 +/- 600, since 4 could represent 3.500000000000001 or 4.4999999999999.

    For that matter, 1200 could represent 1249.9999 or 1150, so
    4 * 1200 = 4800 +/- 625.

    We just don't know how accurate the initial measurement was, so it is completely inaccurate to say that 4 * 1200 is equal to exactly 4800.
  • Re:rm (Score:5, Informative)

    by LihTox (754597) on Friday March 30, 2007 @04:09PM (#18548439)
    alias rm to rm -i, it asks for confirmation.

    I do that as well, but there is a danger if you start working in someone else's account, where rm is not aliased as expected. It may be better to alias del='rm -i' (for example) and train yourself to type del.

    Also, "rm -i" is a pain when you're deleting a large number of files at once.
  • by Anonymous Coward on Friday March 30, 2007 @04:11PM (#18548485)
    The bug in the 80286 that made it _not_ wrap around addresses at 1MB in real mode enabled all kinds of hacks that allowed 8088 code to access over 1MB in real mode.
  • Automotive Bug (Score:5, Informative)

    by wramsdel (463149) on Friday March 30, 2007 @04:14PM (#18548529)
    I always enjoyed cars with "child-safe rear windows" which don't roll all the way down. In many cases, this is because the rear wheel well cuts into the door, reducing the space available for the window.
  • Re:rm (Score:5, Informative)

    by cloudmaster (10662) on Friday March 30, 2007 @04:42PM (#18548935) Homepage Journal
    I'm partial to ls -- "$@" && rm -i -- "$@"

    In any event, you should be using "$@" (with the double-quotes)instead of $*, so you can properly preserve arguments with spaces. If you try to remove a file with a space in it with your script, it will not work as expected.

    I'd also suggest adding a typeset -l yesno before the read, so you force the input string to lowercase before comparing it. Heck, let's see if it starts with a y, too. That way, y, yes, YES, and even YePaRoonIe will work...

    I like ls -dF, so it doesn't show the contents of directories (-F appends a slash to the end of the filename, though, so you could add a "grep '/'" and fail if directories are present - hint: put the ls -1dF output in a variable using var=$(ls -1dF "$@"), test $?, then test inside the if block to see if the variable contains any lines that end with a slash).

    Finally, you could use the ls command as your conditional statement instead of having to run ls twice.

    if ls -d -- "$@"
      typeset -l yesno
      read yesno discard
      [[ -z "${yesno##y*}" ]] && /bin/rm -fr -- "$@"
    PS - the two hyphens protect you from arguments which start with a hyphen...

    Email with questions - I don't check replies on the dot very often. :)
  • by networkBoy (774728) on Friday March 30, 2007 @04:48PM (#18549011) Homepage Journal
    I liked the old ultima 6 bug of loading your companions.
    If you told them to pick up something heavy then they would say "too heavy"
    If you had something ungodly heavy you could pick it up and move it to them, no problem.
    I always had a skiff at my disposal because of that bug.
  • Re:rm (Score:4, Informative)

    by jimicus (737525) on Friday March 30, 2007 @05:13PM (#18549313)
    That's because rm doesn't get passed a *, it gets passed a list of filenames which has been expanded from the * by the shell.

    Convention states that the way a program knows that no further arguments should be interpreted as command switches is by means of the -- switch. If no -- has been found, then anything which looks like a switch is generally interpreted as one.

    The alternative would be to look to see if there is a -i file and if there is assume that you meant "delete file called -i" rather than "delete interactively", which runs completely contrary to another common Unix convention - specifically, that the program shouldn't try to second-guess the user.
  • by raddan (519638) on Friday March 30, 2007 @05:25PM (#18549481)

    #include "stdio.h"

    int main () {
    char str = '4';
    printf ("%i\n", (int) str);
    return 0;

    '4' is obviously 52. No problems comparing it to (int) 4.0 here!

    [ed: stupid /. -- can't put in angle brackets!]
  • by greed (112493) on Friday March 30, 2007 @05:40PM (#18549699)

    That's just Sun being late to the party. Everyone else had that bug in the "r" commands back in the early 90s; 'rlogin -l -froot hostname' was great when you got spam from an unpatched server. (Which was rare enough to be entertaining.)

    I think it was the Linux port of the "r" commands that had someone say, "Hey, these things have been broken _forever_!"

  • Re: init=/bin/sh (Score:3, Informative)

    by BKX (5066) on Friday March 30, 2007 @05:49PM (#18549799) Journal
    Put your BIOS into USB legacy mode first. Then it'll work.
  • Re:404 (Score:1, Informative)

    by Anonymous Coward on Friday March 30, 2007 @05:55PM (#18549899)
    This depends on the motherboard, and possibly other things. We had a line of computers from Dell (via CDW) that froze if you plugged in a PS/2 keyboard while on.
  • Re:aMSN (Score:3, Informative)

    by hritcu (871613) on Friday March 30, 2007 @05:59PM (#18549937) Homepage
    It is called "Psychic Mode" [] and it does not seem to be documented. Anyway, it comes with the default distribution of Gaim, you just need to turn it on.
  • by goombah99 (560566) on Friday March 30, 2007 @06:13PM (#18550095)
    another example:

    create identical sets in different orders.

    x = set((1,2,4.0+0.0j, 4))
    y = set(( 1,3,4, 4.0+0.0j))

    a = y | x
    b = x | y
    a == b
    # result is TRUE

    yx = list(a)
    xy = list(b)

    xy == yx
    # result is TRUE

    sorted(xy) # not an error
    sorted(yx) # is an error

    The funny thing is that you are not even guarnteed which of those will work and which will be an error. This is because the storage order of the set is not stable so it can change the order of the underlying lists.

    oddly enough for some reason the lists come out of the set the same order they went in. This is appropos the topic of this discussion of a non-guarentteed feature that I am relying on.
  • by dan828 (753380) on Friday March 30, 2007 @07:16PM (#18550795)
    Standard practice for truck drivers. Banging through 9 or 10 gears and having to double clutch when shifting is hard on the left knee after a while, so drivers just shift without the clutch by syncing the RPMs up manually, allowing the transmission to slide in and out of gear with just fingertip pressure. Anybody that doesn't/can't do this is pretty much considered a n00b.
  • by Bat Country (829565) on Friday March 30, 2007 @08:16PM (#18551401) Homepage
    In this particular case, the previous programmer was entirely new to web programming. I've been patching severe security holes in the website since about a month after I started (the period it took me to figure out how the code worked.)

    A lot of what I was doing was requested by the management to stop people from taking advantage of poor deadline calculations and to break certain workarounds discovered by the employees.

    In the process of locking up some of these holes, there were some actual unintended behaviors (per the original documentation, they were prohibited) which became a vital part of the work flow process.

    Although I'll cop to breaking a few things in the interest of cleaning them up, then immediately having to revert my changes, a lot of these bugs-as-features were in fact bugs which later became vital to the process.
  • by Anonymous Coward on Friday March 30, 2007 @09:26PM (#18551951)
    The Z80 had a plethora of undocumented opcodes many of which were actually useful (and sometimes used). DD and FD prefixes could be used to mess with the index registers in a bunch of different ways (preceding the LD H,A instruction with a DD prefix, for example, would give LD IXl,A - load A into the lower 8 bits of the index register IX) - completely undocumented, but very logical if you studied the instruction set organisation. Actually, having written a Z80 emulator I will state that the painful opcodes weren't these undocumented but logically consistent ones, but the documented exceptions to the otherwise simple rules of index register substitution. Then there were the DDCBddxx opcodes which while not all that useful were, if not useful then definitely, ummm, "interesting". And a major pita to emulate.

    The z80 even had undocumented hardware features that got used in some computers. For example, the contents of the A register would appear on the upper 8 bits of the address bus for some port operations, which were occasionally used to do weird and wonderful "magic". For example, on a microbee 256 the clock rate of the CRTC could be changed using the following code:

    LD A,1 - load the A register with 1
    IN A,(9) - load the A register from port 9

    which makes absolutely no sense until you realise that LD A,1 actually sets bit 8 of the address bus during the the IN instruction, and putting 9 on the lower 8 bits would cause bit 8 to be latched.
  • Re:rm (Score:3, Informative)

    by pr0fess (778841) on Friday March 30, 2007 @09:38PM (#18552039) Homepage
    Indeed, but if we are working someone else's account, we should think twice before deleting files ;)

    The -f argument overrides -i at least in the Solaris and Ubuntu boxes I frequent, so not so much of a pain.

    A personal preference in the end.

  • Re:aMSN (Score:2, Informative)

    by scapor (855510) on Saturday March 31, 2007 @05:24AM (#18554159)
    As an aMSN developper I can say this ain't a bug but sure is a feature. It gave us some headaches as since MSN Messenger 7.0, the official client also opens a SwitchBoard session to you if you come online to request your avatar picture if it's not updated on their side. As before, this was our sign a user started a conversation, we had a lot of windows popping up from 7.0 users. This is fixed now though. Now we open the chatwindow when the "user is typing ..." notification comes :).

Committees have become so important nowadays that subcommittees have to be appointed to do the work.