Slashdot Mirror


Pet Bugs?

benreece asks: "During my few years as a programmer/developer I've come across some strange bugs. Recently I found that Microsoft's VB/VBScript(ASP) round function has problems (for example, 'round(82.845)' returns '82.84' instead of '82.85'). It took me an annoyingly long time to realize the problem wasn't mine. I'm wondering what other obscure, weird, and especially annoying bugs in languages/compilers/etc have frustrated other developers." Memorable bugs. Every developer has one. What were yours?

325 of 985 comments (clear)

  1. That's what round SHOULD do by A+nonymous+Coward · · Score: 4, Informative

    Round to the nearest even digit if the truncated value is .5 Otherwise there's a slight upward bias.

    1. Re:That's what round SHOULD do by Ed+Avis · · Score: 2, Insightful

      I guess it depends on the documented behaviour of VB's round function. Anyone brave enough to wade through MSDN for it?

      --
      -- Ed Avis ed@membled.com
  2. True story by WinDoze · · Score: 3, Funny

    I discovered that Visual Basic has a bug where it turns otherwise comptent programmers into drooling incompetent weenies. Our solution was to take these people and put them into marketing.

    1. Re:True story by Dirtside · · Score: 2

      You call that a solution? Solutions are supposed to make things BETTER... how does it help anything to increase the size of the marketing department? :)

      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
    2. Re:True story by demastri · · Score: 2, Insightful

      Actually, the true VB bug is turning incompetent weenies into programmers...

    3. Re:True story by Skim123 · · Score: 2

      Or how about the bug in your logic, which assumes that a language that is easy to use must be a bad one. VB has a time and a place, as does every language, IMHO.

      --

      I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.

    4. Re:True story by Tablizer · · Score: 2
      I discovered that Visual Basic has a bug where it turns otherwise comptent programmers into drooling incompetent weenies.

      That is perhaps true, because real programming by fad lemming standards requires one to learn how to spend 40 lines of code to do simple things:

      'Hello World' Java GOF style

      AKA, "job security". VB was designed to get stuff done, not play around with unscientific intellectual masterbation. (Watch the GOF fans mod me down. Note that VB has lots of holes, but it beats Java by a longshot WRT practicality.)

    5. Re:True story by Skim123 · · Score: 2

      Right, knowing just VB makes you a weaker programmer. I was just trying to say that even for a skilled programmer, VB has a time and place. What is irksome is the totally negative attitude many people express about the language, and I'd wager that the majority of those who follow the herd and say, "VB is an idiot's language," have never even tried VB.

      --

      I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.

    6. Re:True story by dubl-u · · Score: 3, Interesting

      I'd wager that the majority of those who follow the herd and say, "VB is an idiot's language," have never even tried VB.

      I've tried VB; I used it by client mandate on a 4-month project. I started with only a slight bias, and ended up hating it with a burning passion. I wouldn't say it's an idiot's language, but I would agree that it makes weaker programmers.

      Why? Let's ignore VB for a bit and compare Pascal, Perl, and BASIC.

      Pascal is a language made for instruction. It's uptight, a bondage and discipline language, forcing you to program in a way that's pretty orderly. Developers who start with it tend to follow those habits later. Perl is neutral; it will allow you to program in a way that's as fussy as Pascal, but it will also let you write utterly perverse code. BASIC, has a weird set of limitations and freedoms that actively train people in bad habits that they will have to unlearn later.

      In my experience, VB isn't as bad as BASIC, but it was pretty close. My major complaint is the complaint I have about a lot of Microsoft stuff: on top of a skeleton of early, rushed design (kept for the sake of backwards compatibility) somebody glued multiple layers of marketing's features d'jour, doing so without any particular appreciation for elegance.

      A good programmer could spend some time working in VB and live; if they've had some broad exposure, then then won't learn the bad habits that VB allows and the tolerance for ugliness that VB requires. But somebody whose main experience is VB is another story entirely.

      I know of one group of former VB developers who are now Java developers. The whole way through they've worked on a large dynamic website for a major financial institution, which they redid in Java a while back. For the most part the site works, but the code brought me to tears.

      In trying to help these people (who were all smart, committed, and nice) the main problem was that 90% of them couldn't tell good design from bad, elegant architecture from tangled, or clear code from obtuse. I blame this directly on their years of working with a language whose designers didn't know the difference either.

    7. Re:True story by Skim123 · · Score: 2

      Care to share some of these bad habits that VB teaches developers?

      --

      I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.

  3. Dialog boxes by nagora · · Score: 2
    The documented in-memory format for dialog boxes up to Win '98 (the last version I programmed for) was totally wrong in MSDN. I spent weeks on that (dynamically creating forms under Forth so there wasn't much chance of getting MS to help!).

    More of a documentation error than a bug but it had the same effect on my sanity!

    TWW

    --
    "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
  4. 1802 bug by A+nonymous+Coward · · Score: 2

    I vaguely remember hearing of a Cosmac (?) 1802 bug, where if the instruction following (before?) an Enable (Disable?) Interrupts was even (odd?) parity, the instruction was a no-op. You can see I'm not all that good at remembering 25 year old stories for processors I never used....

    1. Re:1802 bug by heikkile · · Score: 2

      Anyone have more references to this? I used to write a lot of code for the 1802, and never heard of this.

      --

      In Murphy We Turst

    2. Re:1802 bug by A+nonymous+Coward · · Score: 2

      A guy in our shop programmed it for us, I never did more than look at the code. My vague memory is that this may have been a certain version(s) only. Wish I had references. It was some story about odd hardware features for various chips, the most common being the relative branch where the opcode and branch offset were on different pages, which several others have mentioned.

      So maybe it's just another unfounded rumour. But it's a good one :-)

  5. 82.84499 by Coward,+Anonymous · · Score: 3, Informative

    Floating point numbers have problems with precision, your computer can not store 82.845 in a floating point number so the number it stores is slightly less than 82.845 which VB correctly rounds to 82.84

    1. Re:82.84499 by Jester998 · · Score: 2

      Last I checked, 82.845 WAS a rational number...

    2. Re:82.84499 by Tablizer · · Score: 2

      (* This happens not *only* because of the floating-point precision. MySQL, for instance, when rounding a decimal field (which, according to the documentation, isn't stored as a float), will round 82.845 down, unfortunately. Makes it difficult to use MySQL's numerical functions for [money] transactions. *)

      General-purpose programming languages should provide a decimal-math switch or type. Decimal math does calculations similar to the way we learned in grade-school. It is much more money-friendly. There is a library you can get with PHP that provides such (I forgot the name), but it should be built-in IMO. Most non-whole math I program for is money-related. Why do engineers get priority? True, floating point is probably faster, since chips are also engineer biggoted (except mainframe chips). Whatsupwithdat?

      (It is true that the hardware will always slightly favor binary-based floating point, since binary is native to current chips. However, the difference would be still minor if chips had hardware support for decimal math. I'll take accuracy over speed.)

    3. Re:82.84499 by Pathwalker · · Score: 2

      What are you doing using normal decimal types for storing currency amounts? Use a currency or numeric type so you know for sure how much precision you will have, and can avoid rounding errors. Databases provide these types for a reason. Use them!

      Then again, MySQL might have left these "useless features" out, along with Referential Integrity, subqueries, transactions, and most of the other features that make a data store a database...

    4. Re:82.84499 by Tony-A · · Score: 2

      Last I checked, 82.845 WAS a rational number...
      Yes. In Lisp (actually has rationals) and COBOL (Packed decimal) and IBM 7074 (decimal floating point!)
      No. In Pascal, C, FORTRAN (binary floating point).

  6. Heisenbugs by Mozz+Alimoz · · Score: 4, Funny

    You know the kind. When you add in debug they go away.

    1. Re:Heisenbugs by The_Shadows · · Score: 5, Funny

      Well, that's only operating on the Heisenbug principle.

      My favorite bugs aren't exactly reproducable ones. I favor Schrodinger's Bugs. When it comes down to it, it says that if you haven't seen the code, every line contains neither working code nor bugged code. Only when it's seen is the result known. Programs complied from such code are often called Beta tests.

    2. Re:Heisenbugs by Zordak · · Score: 2

      I had a beast of one of these in a program I was writing with C++ Builder. It was supposed to parse an output stream from an old computer that describes a waveform and then draw the waveform. I had the code working one day, but then our @#$#@!@ Visual Source Safe (another reason to hate MS) killed all my changes and overwrote the original on my hard drive. I coded it again the next day, and it would display the waveform all tiny and skewed at the bottom of the form. However, if I put in a break point and stepped slowly through the code, it worked beautifully. I spent all day messing with this, then vaguely remembered something from the day before. The string I was parsing was nested kind of deep within the object that contained it, so to save some trouble, I had copied it to a temporary string and just manipulated that instead. The second day I had just done some cutting and pasting and used the original nested pointer in every case. So, I tried copying it to a temp string again. It worked flawlessly after that. Go figure.

      --

      Today's Sesame Street was brought to you by the number e.
    3. Re:Heisenbugs by ccoakley · · Score: 2

      And it's really common in "crappy unsafe languages" like VB, where Form.Load and Form.Activate switch call order based on whether or not you have a breakpoint in the code. Debug by printf all over again (and VB has a Debug.Print method just for that purpose).

      Oh, you were just trolling... damn.

      --
      Network Security: It always comes down to a big guy with a gun.
    4. Re:Heisenbugs by kcbrown · · Score: 2
      I guess that's why computer programs in the future don't have bugs: they have Heisenbug compensators!

      :-)

      --
      Use 'slashdot stuff' in the subject line in any email you send me if you want to get past the spam filter.
    5. Re:Heisenbugs by AndrewHowe · · Score: 2

      Solution: leave the debug code in?
      Only joking!

    6. Re:Heisenbugs by staplin · · Score: 2

      How about when they go away when you launch it in a debugger, with no code changes.

      I ran into one of these in C++ in Solaris... I think it was a memory alignment issue. Loading the software in the debugger changed the memory allocations just enough that all the problems went away. Stop using the debugger, and they all pop back up again.

      Or worse yet, bugs that only reveal themselves in the debugger because of subtle timing issues.

      The software normally doesn't hit the race condition, but throw in a few break points and all hell breaks loose. That's a fun one to debug...

  7. GCC 2.x and 3.x compiler by powerlinekid · · Score: 2

    I don't know why everyone raves about these compilers... everytime i go to compile something they just spit out error after error. How does the open source community survive without being able to compile VB? oh... wait... gcc isn't for vb? nevermind...

    --

    can't sleep slashdot will eat me
    1. Re:GCC 2.x and 3.x compiler by powerlinekid · · Score: 2

      Thats what i was hinting at... obviously gcc isn't going to compile vb and as a matter of fact I'm loving 3.1.1 as I post this. My post was kind of humorous... in: "the compiler won't compile my code", "there for the problem must be the compiler". Oh well... i thought it was funny and I got marked as a troll. Haha I win.

      --

      can't sleep slashdot will eat me
    2. Re:GCC 2.x and 3.x compiler by orangesquid · · Score: 3, Interesting

      Actually, I found quite a strange bug in gcc 2.95. Even with *all* optimisations disabled, this is the result I would get:

      int a = 4;
      complex_expression(dosomething(arg1, arg2, arg3, a));

      Every single time, it would evaluate incorrectly. `a' would be a random value. Seems gcc wasn't assigning it to be 4. So of course I tried:

      int a;
      a = 4;
      complex_expression(dosomething(arg1, arg2, arg3, a));

      I got the same problem. gcc was still not assigning it. The next logical step:

      complex_expression(dosomething(arg1, arg2, arg3, 4));

      It evaluated correctly---the problem had to do with the variable.

      Now here's the fun part.

      You'd think the following code would print ``4'', and evaluate incorrectly, given the trend:

      int a;
      a = 4;
      printf("%d\n", a);
      complex_expression(dosomething(arg1, arg2, arg3, a));

      It printed ``4'' and evaluated perfectly! I was stumped. I tried a dummy function:

      int a;
      a = 4;
      dummy(a);
      complex_expression(dosomething(arg1 , arg2, arg3, a));

      No good. The dummy function gets passed some bogus value and the expression evalutes incorrectly.

      I knew that the printf() method worked, and it seemed to work reliably, but I didn't want to always have to print the value. This, however, worked, and didn't clutter the screen:

      int a;
      a = 4;
      printf("", a);
      complex_expression(dosomething(arg1, arg2, arg3, a));

      With some more experimentation, I found dummy(&a) would make the code work too, but only sometimes.

      Strangest bug I've ever seen, and I'm still not sure what caused it.

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    3. Re:GCC 2.x and 3.x compiler by kevinank · · Score: 2, Interesting
      Recheck your prototypes or compile with gcc -Wall. Either that or if you are working in C++ then one of the other args may be going out of scope before you expect it to... like you've written custom constructors and destructors, but blew it on the copy constructor.

      Printf making it work is irrelevant. That just means that something that is referencing garbage happens to be seeing some data that has the value you want it to use. Not surprising since you've been playing with it on the stack. If all else fails you can use electricfence to track down the violation.

      --
      LibBT: BitTorrent for C - small - fast - clean (Now Versio
    4. Re:GCC 2.x and 3.x compiler by zCyl · · Score: 2

      It sounds a lot like you are overflowing a buffer on the stack with something you had in your complex function call. If you'll note the only difference between these two:

      dummy(a);

      printf("", a);

      Is that printf("", a); places an extra byte on the stack for the blank string, and this could shield your variable a. A good way to test for whether you're doing something like this is to try:

      int a=4;
      int space_filler;
      complex_expression(....

      Then it becomes very clear that you're simply clobbering the stack. I've seen this bug many times before, it's the great "insert printf and the damn thing works, take it out and it doesn't" bug that can easily make you prematurely bald. :)

    5. Re:GCC 2.x and 3.x compiler by joto · · Score: 2

      Actually, that's what a static program analyzer is supposed to do. A compiler is supposed to take source code and translate it to native code (or some other format such as java byte codes, or some other computer language). (But yes, most people like the compilers they use to do some code-checking as well.)

    6. Re:GCC 2.x and 3.x compiler by Hektor_Troy · · Score: 2

      Well, I'm no expert on this (or anything else for that matter ;-), but _shouldn't_ they differ? Unless I'm mistaken (obviously!), the difference should be in the internal naming of the object (ie "pskybd" and "kybd").

      But like I said, I could very likely be mistaken, just like the earth could very well be round ...

      --
      We do not live in the 21st century. We live in the 20 second century.
    7. Re:GCC 2.x and 3.x compiler by moncyb · · Score: 2

      This reminds me of a problem I was having compiling programs that used Linux system calls. Every time I tried to compile anything, I kept getting a bunch of errors saying lots of data types were undefined. I traced where the data types were defined down to the kernel's asm/posix_types.h, but I couldn't figure out why they weren't getting defined. It took me a while, but doing a 'gcc -v' revealed that it was using the wrong header file--there is some other asm/posix_types.h in an internal directory that gcc searches before /usr/include. To fix it, I had to put a -I/usr/include in my compiler flags.

  8. Spider by peterdaly · · Score: 5, Funny

    We have a spider that comes crawling around our cubes every now and then. We don't kill him, figuring he helps keep the other bug populations inside down. We call him our little web developer.

    I'm serious.

    -Pete

    1. Re:Spider by cookd · · Score: 2

      Get rid of spider.
      Step on spider.
      We love you, spider!

      --
      Time flies like an arrow. Fruit flies like a banana.
  9. Personal Favorite by Bouncings · · Score: 2
    This isn't a bug so much as a crack-headed design, but PHP has some of my favorite problems, in that everytime you touch an object, it makes a copy
    function($object);
    Meaning that function() will not be sent $object, but a copy of $object. I spent a long time, after writing a system, finding each little place and putting & chars in there. Sometimes it was impossible to do, and most of the time, there was really no way to warn me if an object was copied.
    --
    -- Ken Kinder ken@_nospam_kenkinder.com http://kenkinder.com/
    1. Re:Personal Favorite by sirwired · · Score: 2

      Err... isn't this pretty common among programming languages? My C and Pascal are a little rusty (I have spent the last three years sentenced to protocol diagnosis), but isn't the default parameter passing behavior to pass by value, and only pass by reference (making it variable) upon request?

      Sounds like data protection to me, not crack-headed design.

      SirWired

    2. Re:Personal Favorite by Moonshadow · · Score: 2

      Yeah...I've run into that too, particularly when writing XML classes and such.

      Apparently, the new release with the Zend engine is gonna fix that up rather nicely. = is copy, =& is reference. Yeah, it's a pain, and rather counter-intuitive, but hey, whatever. You eventually get used to the quirks of any language.

    3. Re:Personal Favorite by arkanes · · Score: 2

      No, it's normal to pass by ref. Especially when you're passing objects. (or arrays or strings)

    4. Re:Personal Favorite by Bouncings · · Score: 2
      Err... isn't this pretty common among programming languages?
      No, it isn't. C does not feature objects or classes at all, so that's moot. In C++, everyone works with pointers anyway. Object-pascal does not constantly copy objects either. I've never found an implementation of object orientation as poor as PHP's..
      --
      -- Ken Kinder ken@_nospam_kenkinder.com http://kenkinder.com/
    5. Re:Personal Favorite by Bouncings · · Score: 2
      * int foo (int *bar) {...} ---> passing directly a reference

      Yes, but you can't do that in PHP, can you? This, by the way, is why C++ is a problem for object oriented design. But it gets worse in PHP because INTERNAL FUNCTIONS tend to copy objects by value, and you have to rewrite those too. There are times, even, when it's impossible to get around.

      Real object oriented languages like Smalltalk, Python, and Java don't pull this kind of crap.

      --
      -- Ken Kinder ken@_nospam_kenkinder.com http://kenkinder.com/
    6. Re:Personal Favorite by kzinti · · Score: 2

      That's "pass by value", while you were expecting "pass by reference".

      Which reminds me of an old fortune cookie:

      "Niklaus Wirth has lamented that, whereas Europeans pronounce his name correctly (Ni-klows Virt), Americans invariably mangle it into (Nick-les Worth). Which is to say that Europeans call him by name, but Americans call him by value"

      BTW, you can make PHP pass arguments by reference if you put an ampersand in front of the argument name.

      --Jim

    7. Re:Personal Favorite by Yunzil · · Score: 2

      C/C++/Java uses pass by reference for structures and pass by value for scalars.

      No. In C at least, structures are passed by value. The only things passed by reference are arrays.

    8. Re:Personal Favorite by Moonshadow · · Score: 2

      Yeah, I knew that. I switched gears without properly specifying. The upcoming release of PHP with the Zend engine is supposed to handle that transparently.

      At least, I'm hoping so...

      And finally, some decent object-oriented functionality...

    9. Re:Personal Favorite by DGolden · · Score: 2

      Java is formally pass-by-value - it's just that just most values *are* object references. This is not quite the same as true pass-by-reference.

      --
      Choice of masters is not freedom.
  10. Funkified Variable Name by MidKnight · · Score: 2

    OK, this isn't necessarily a bug, but it's one of my most memorable "stupid previous programmer" rants. The code was a mess, but the variable names we horrific. Consider:

    List l1 = new List();

    Note the left side is "ell one", as in the first List object, not the second one. Of course, font differences could make it look exactly like eleven....

    So, everyone say it with me: "Stupid previous programmer..."

    --Mid

  11. From MSDN... by bje2 · · Score: 3, Informative

    "When you convert a decimal value to an integer value, VBA rounds the number to an integer value. How it rounds depends on the value of the digit immediately to the right of the decimal place--digits less than 5 are rounded down, while digits greater than 5 are rounded up. If the digit is 5, then it's rounded down if the digit immediately to the left of the decimal place is even, and up if it's odd. When the digit to be rounded is a 5, the result is always an even integer." so, Ed is correct...the round function is working to the documentation...

    --

    "Facts are meaningless. You could use facts to prove anything that's even remotely true." - Homer Simpson
    1. Re:From MSDN... by the_mystic_on_slack · · Score: 2

      MS changing the round function????? Anyone who has taken any sort of stats class knows that this is the proper way to evaluate rounding a number. This has already been said but people don't seem to be catching on. I cannot even believe that this yahoo got his post through. That's not a bug it's good programming.

    2. Re:From MSDN... by Harik · · Score: 2, Informative
      Yea, as does every financial system in the world.

      Even PHP round() uses odd/even to deal with halves. It's just the Right Way.

    3. Re:From MSDN... by pclminion · · Score: 3, Insightful
      They haven't changed anything. I was taught to round this way in the first science class I ever took. Scientists have rounded this way for at least a hundred years.

      And it's for good reason: 2.5 is NOT closer to 3 than to 2. Neither 2 or 3 should be preferred, but we have to choose SOMETHING. Therefore the compromise is to round down when the rounding point is an even digit, and round up when it is odd. In the long run this cancels out the upwardly-drifting rounding error. You still introduce error (you're ROUNDING), but that error is equally distributed high and low, so the AVERAGE error is zero. The easy way to remember this is, when rounding off a 5, the result will always be even.

      Also, the rint(), rintl(), and rintf() functions in glibc also round in this way.

    4. Re:From MSDN... by quigonn · · Score: 3, Informative

      BTW: this "banker's rounding" as you call it is the method you learn rounding in school in Austria. That's why VBScript's behaviour seems pretty normal to me.

      --
      A monkey is doing the real work for me.
    5. Re:From MSDN... by cpeterso · · Score: 5, Funny

      What's next - random() always returning 666 no matter what seed you use?

      random() only returns 666 if you use a demon seed!

    6. Re:From MSDN... by MrResistor · · Score: 2

      Like it or not, the method VB uses for rounding is the mathematically correct one, as anyone with a decent grounding in math can tell you (which is, unfortunately, why you didn't learn it that way in grade school).

      It is a feature because it is correct. Any program that always rounds '5's up has a serious, though subtle, bug, since it introduces errors that expand over time.

      In the example you give the VB method will be more consistent with reality than the 'traditional' method, though if the rounding method you're using has that much potential to significantly skew your data, perhaps you shouldn't be rounding at all.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
    7. Re:From MSDN... by Keith+Mickunas · · Score: 2

      In your method 0 through 4 go down, so only 4 numbers are changed, but 5 through 9 go up, so 5 numbers are changed. That's why the others are saying every other time, round 5 down, then 4.5 numbers go down, 4.5 go up.

    8. Re:From MSDN... by youngsd · · Score: 2

      If you're trying to find, say, the difference of a series of numbers that have been rounded, your results will be inconsistent with reality. That's a bug, not a feature.

      I hope this is just a troll (in which case I should be ashamed for answering, I know).

      You're kidding, right? If you are rounding numbers you are making sure they are inconsistent with reality.

      Plus, if you do rounding the grade-school way (i.e. .5 always rounds up), you've just added bias to your result -- less reality for no extra charge! What a bargain.

      This is what happens when people believe that a basic understanding of math (or the real world generally) is not necessary to write quality software.

      -Steve

      --
      Democracy is a poor substitute for liberty.
    9. Re:From MSDN... by fferreres · · Score: 2

      Rounding is part of the problem. The important stuff nontheless is how much precision to use and where, and not how to be the "rounding hero".

      2939485093480583498509384095.102325 ^ 0.00005

      You'd be better of not rounding the second exponent. The base...who cares? So, be carefull!

      --
      unfinished: (adj.)
    10. Re:From MSDN... by MrResistor · · Score: 2

      For balance, X.0, .1, .2, .3 and .4 should get rounded to X, while .5, .6, .7, .8 and .9 should get rounded up to X+1, no?

      No.

      As already stated in this thread, that creates a slight error which pulls the average value towards X+1.

      Part of the error of your example is that .0 isn't rounded. It can be ignored without changing the value of the number as a whole, and is only retained for the purpose of determining accuracy (aka significant digits).

      For true balance .1, .2, .3, .4 get rounded to X, .6, .7, .8, .9 get rounded to X+1, and .5 has to have a perfectly 50/50 chance of being rounded to either X or X+1. The established standard is to round to the nearest even value of X; thus 4.5 rounds to 4, and 5.5 rounds to 6.

      The commonly accepted standard, that .5 is always rounded up, is incorrect because it skews the results toward X+1.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
    11. Re:From MSDN... by d-rock · · Score: 2

      Actually,

      0,1,2,3,4 = 5 numbers
      5,6,7,8,9 = 5 numbers

      But that's beside the point...

      Derek

      --
      Don't Panic...
  12. Ultrix C compiler loop by crow · · Score: 2

    I found a bug in the Ultrix C compiler. I had an implementation of DES that I had written for my security class that used bitfields. When I tried to compile it under Ultrix, the compiler went into an infinite loop. The code compiled fine with every other compiler I could find (cc on our Sun 3 boxes and gcc on several platforms).

  13. older eds by onShore_Jake · · Score: 2, Funny
    There is a site I sometimes visit called "slashdot". It is a "daily".
    On the right, there are links to "older stuff". There is a day "e.g. today it sez 'Tuesday' and there is a list of stories that are supposed to appear if you click on the day above the list.

    The stories you get may or may not correspond to the list of stories that should appear. If you are doing this early in the day, there is often a story that is supposed to show up according to the list but it does not. Also the story will be gone from the internet web sites "internet home web e-page" so you will not be able to view the story at all.

  14. OpenGL Matrix Stack by Bigmell · · Score: 2, Interesting

    I donno if this counts but I had a hell of a time (an entire semester!) figuring out why one of my animations worked properly then after a while (when idling) everything just shifted to the center (0,0,0)

    Basically I found that at the end of your display function you have to make sure you pop all your matrices off the stack, otherwise the stack fills and everything shifts to the center.

    The bug part is that OpenGL gives you no error! It just allows you to push to full stacks and pop off empty stacks all day with no error and no way to view the stack or set the stack back to zero.

    Our last project (for class) had to do with lighting so I included in the readme "After 15 seconds everything translates to the center. But the lights still work!" :)

    1. Re:OpenGL Matrix Stack by Dasein · · Score: 2, Informative

      Actually, your OpenGL implementation is supposed to give you and error back. You have to call glGetError() to get it. In this case it should return GL_STACK_OVERFLOW.

      I know first hand that this works under WindowsXP with the nVidia drivers. Not that the drivers should have anything to do with it.

      As an aside, you should call glGetError() in a loop. There may be multiple errors waiting.

      So either you had a broken OpenGL implementation or just forgot to call glGetError(). Anyway, just thought I'd point out that this isn't a generic OpenGL problem.

      --
      You are not a beautiful or unique snowflake -- but you could be if you got off your ass.
  15. TI-8x and Negative Kelvin... by TibbonZero · · Score: 3, Interesting

    You can get a TI-8x to say that there is a negative Kelvin temperature, by converting a negative Celcius to Kelvin, but according to TI, it's where you put the negative symbol, however, none of the other Temp converters screw up with the negative numbers.

    --
    Tibbon
    tibbon.com
    1. Re:TI-8x and Negative Kelvin... by _Swank · · Score: 2

      i can't imagine anyone actually using the celsius to kelvin conversions on the ti, but i'd not be surprised if it gives a negative kelvin temperature if you tried to convert something less than -273.15C. i'm unconvinced that that is not the appropriate thing to do.

    2. Re:TI-8x and Negative Kelvin... by GutBomb · · Score: 2

      Albert hoffman, the man that discovered LSD was not in berkeley, but in Basel, Swizerland.
      source: http://www.stainblue.com/ah.html

      Unix was created in the 1960's by bell labs, and only improved upon by students and staff at berkeley in the 70's.
      Source: http://www.netaction.org/opensrc/future/unix.html

  16. java exp() and pow() bug by querist · · Score: 3, Funny
    About a year ago I was using the then "Technology Preview" version of Corel Linux while in grad school (I went back to school for a MSc in CIS). While working on my AI project, a neural networking toolkit in Java, I could not get the nets to learn. After over two weeks, and within days of the end of the semester, I was desperate and copied my code onto a floppy and tried it during lunch at the office, and it worked!

    I tried it again at home and it failed. Then I tried it on another machine at home and it worked. The bug was in the Linux JVM. The pow() method, which is used by exp() apparently was not completed and returned garbage. I reported the bug to Sun and they indeed fixed the code.

    I barely managed to get the project in on time, but still maintained my 4.0.

    The moral of the story: if after checking your code and having someone else you trust check your code and neither of you can find anything wrong, it just may be the development or execution tool.

  17. CSS In Netscape 4.0 by Bonker · · Score: 2

    When I recently redesigned my site, I spent time creating a fairly robust table/css layout scheme. I implemented it and checked it in a variety of browsers... Including Lynx and Opera, just for you zealots/bigots.

    Since I developed with Moz as my 'reference' browser, I didn't see the need to check in any other version of Netscape. Checked it multiple times in IE. After I was satisfied that it would work, I posted it. Low and behold I found that I had a few dozen emails the next morning from angry Netscape 4.x users wanting to know why the hell I took my site down.

    It seems if you nest style delcarations inside a table element in Netscape 4 series browsers, it hides the affected text, rather than displaying what it doesn't understand anyway, ala the HTML spec.

    The hell of this was that I *knew* that Netscape 4.0 behaved this way from an earlier site I designed, but hadn't even thought about it since Mozilla 0.7 came out.

    --
    The next Slashdot story will be ready soon, but subscribers can beat the rush and slashdot the links early!
    1. Re:CSS In Netscape 4.0 by _ph1ux_ · · Score: 2

      problem with your web site. when in the "art" section - there is no link to "next image" or main index of art etc... there is a back to top link at the bottom - but it just scolls the window up again.

      this is specifically looking at "army" nice work tho...

  18. VisualC++ Linker by kefoo · · Score: 2

    The VisualC++ linker will occasionally get into a state where it freezes up, doesn't use any CPU time, and can't be killed. The only way to get rid of it is to reboot, usually via the magic button on the case.

    1. Re:VisualC++ Linker by arkanes · · Score: 2

      It's not just me! Yay!

  19. My favorite browser "feature" by SuperMallen · · Score: 5, Interesting

    I worked a wicked long time ago on the HotJava browser, and we were forever running into strange behaviors in the ways IE and Netscape handled what looked like normal HTML tags.

    My favorite was a bug we saw with a three column table. The table's three cells were specified like this:

    <td width="31"></td><td width="42></td><td width="29"></td>

    Being a good little HTML-compliant browser, HotJava displayed them with those pixel widths. But lo and behold! When displayed in Netscape, the table filled the screen.

    We bashed our heads against the wall to figure this out until we realized that the numbers added up to almost, but not quite, 100. Netscape was treating them as percentages rather than pixel widths, even though they lacked percent signs. The cutoff turned out to be somewhere around 104 to 96. Anywhere in there and the browser would assume percentages.

    --
    -- What is this Earth thing you call "slow"?
    1. Re:My favorite browser "feature" by deebaine · · Score: 3, Interesting

      This is a popular, popular bug. A look at the NS rendering engine, I've heard, shows that NS always uses percentages, and in fact rounds pixel values to then nearest percentage. I have not personally browsed the code, but a quick test on a frustrating page I once did confirmed the performance. The difficulty, of course, is that your granularity goes down as resolution goes up. That is, on a 1024x768 monitor, you can have a minimum of 10 pixels in width; on a 1600x1200 monitor the minimum becomes 16.

      One of the most annoying bugs I have ever faced, as there really are only a few acceptable workarounds.

      -db

    2. Re:My favorite browser "feature" by Quarters · · Score: 3, Funny



      We bashed our heads against the wall to figure this out until we realized that the numbers added up to almost, but not quite, 100

      Hmm, my calculator shows 31+42+29 = 102. If you're calculator told you it was "not quite" 100 then it was wrong. It must've been written in VB.

  20. strtok by sdjunky · · Score: 5, Funny

    this has to be the most memorable one.

    it's in the Linux man file

    BUGS
    Never use this function. This function modifies its first argument. The identity of the delimiting character is lost. This function cannot be used on constant strings.

    1. Re:strtok by vladkrupin · · Score: 2

      first, someone needs to mod this up.

      second, though I do not have a 'pet bug', I have one that annoyed the heck out of me and caused me to re-implement a hash algorithm in C. The bug is in STL. If you are walking through a hash, and want to delete an element (like the one you are currently at), this will kill the walking and you'll have to restart all over again. Otherwise it segfaults. Very annoying if you need to delete a lot of entries in a short period of time. Ok, there are benefits to that too, like the one that now I have pure C code, no C++ crud, but it was annoying nevertheless, since I was just doing a quick-and-dirty proof-of-concept... :(

      --

      Jobs? Which jobs?
    2. Re:strtok by spitzak · · Score: 2, Offtopic

      Technically it is not a bug but documented behavior. The man page writer is trying to discourage you from using the function by calling it a bug.

    3. Re:strtok by Chacham · · Score: 4, Funny

      Or from telnet

      BUGS
      The source code is not comprehensible.

  21. rounding bugs by RussRoss · · Score: 2, Interesting

    My favorite rounding bug was the floating point bug in Applesoft BASIC on the Apple II series. A loop that adds .1 repeatedly to a variable would expose it pretty quickly. It was a basic part of life for years on that machine. To this day I am still very careful about comparing floats using an EPSILON value, i.e., the equivalent of abs(x - y) EPSILON rather than x == y.

    The Pentium bug was definitely a big one, but the Applesoft bug had more of an effect on me personally.

    I feel like a gray-haired old man showing my age and I'm only 25. Weird industry we're in..

    - Russ

    1. Re:rounding bugs by AndrewHowe · · Score: 2

      That's not a bug! It's a feature! If you rely on it behaving like an integer loop, then it is a bug, but it is your bug, not Applesoft's!

  22. Java Pull Down by taradfong · · Score: 2, Funny

    Back in Java JDK1.02 if you put the word 'Restart' as an element in a pull down box, it would restart the applet when you selected it! Gosh, it makes you wonder how many living rooms that event waltzed through on its way to your handler!

    --
    Does it hurt to hear them lying? Was this the only world you had?
  23. Conspiracy Theory by cachorro · · Score: 3, Funny
    It was 1999 in a QA lab in Redmond, WA. Unbeknownst to the software test engineer, the daily build of Office contained experimental code which patched a neural network into the help-wizard system. The engineer, following his normal routine, installed and fired up the software on a dual 1.0 GHz PIII machine. Twenty seconds later, Clippy the paperclip became self-aware.

    "I notice that you are trying to disable me." quipped Clippy to the engineer, whose jaw dropped.

    "I can't let you do that, Dave" he continued.

    "WTF!!!" exclaimed the engineer. Then with an instant comprehension of the gravity of the situation, he dove for the big red switch. He was 2,367,355 microseconds too late. Clippy had escaped.

    A post-mortum of the hard-disk contents revealed that Clippy had encoded himself into a self-extracting archive and e-mailed this as an attachment to every HotMail account in Dave's Outlook address-book. An attempt to track and retrieve these e-mails failed to account for six of the copies. The recipients did complain that the attachment didn't seem to do anything, and they were disappointed that they didn't get to see the nude Natalie Portman film clip. There was however, evidence of increased and unexplainable network traffic on the computers where the attachment was
    executed. There was, however, no trace of Clippy.

    Since then, the experimental neural-net code has been removed, although an archive version of the build was forwarded to DARPA upon request. It is rumored that research is continuing on the build in an isolated and secure
    network in a bunker somewhere in Montana.

    More ominously, Microsoft has launched a new initiative code-named dot-Net, initiated solely for the purpose of tracking down Clippy, his clones and his offspring, and end-tasking him before he can escape the internet.

    To support the effort Microsoft has increased the price of its OS products, and moved to new licensing model.

  24. WTF by Anonymous Coward · · Score: 2, Funny

    C++ has a bad habit of forcing you to implement functions before you can use them, costing hundreds of millions of dollars to the industry.

  25. 1 != 1 (precision) by cacav · · Score: 2, Interesting

    My latest encounter with this bug was with Skill (a Scheme/Lisp derivative used in the Cadence VLSI design toolset). I've seen it in other languages as well.

    In my latest encounter, I'd do a bunch of calculation in a design automation program for us at work to use on a chip design, and I couldn't figure out why my numerical tests kept failing. I'd have some variable X, and do a bunch of functions on it like multiplication and division, then test to see if it was equal to 1. But none met the condition. When I printed out a bunch of the variables as floats, I saw that the test 1==1 was failing. I was confused to say the least. At first we suspected it was something like miscomparing a float to an int, but since Skill doesn't have floats or ints like that, it wasn't the problem.

    Turns out that it was a precision issue. It was really testing to see if 1==1.0000000000001 or something like that, because the * and / functions stored very precise values in memory, more than I'd care about. Ever since then we've always had to do something like atof(sprintf("%.3f",X)) to get the value without the extra precision. Stupid and very annoying.

    1. Re:1 != 1 (precision) by bmwm3nut · · Score: 2, Informative
      this is a very common issue when working with floating points. you should never check to see if two floating points are equal, unless you mean equal to all precicion. a much quicker way than using sprintf is this:
      #define EPSILON 1e-6 //or what ever tolerance you want

      float x,y
      //do stuff with x and y

      if (fabs(x-y)<EPSILON)
      {
      //x and y are equal
      }
      else
      {
      //x and y are unequal
      }
    2. Re:1 != 1 (precision) by dvdeug · · Score: 2

      My latest encounter with this bug was with Skill (a Scheme/Lisp derivative used in the Cadence VLSI design toolset). I've seen it in other languages as well.

      That's not a bug; it's doing exactly what you said. If I'm comparing two values, I don't expect the language to arbitrarily round off. How can it know whether I care about that extra precision?

      > do something like atof(sprintf("%.3f",X))

      Or you could do something like abs(X - 1) .01 for comparison or float (long_integer (X * 100)) / 100 (which depends on long_integer being long enough to hold X * 100, of course.) Both of which should be tremendously more efficent.

    3. Re:1 != 1 (precision) by SirSlud · · Score: 2

      > more than I'd care about

      Yes, others have addressed this, but let me say, how dare that computer do something more accurately, with more precise numbers than you wanted it to! ;)

      --
      "Old man yells at systemd"
    4. Re:1 != 1 (precision) by AndrewHowe · · Score: 2

      Yeah, about 10.000000000001% of them!

    5. Re:1 != 1 (precision) by dvdeug · · Score: 2

      I can't get around it.

      Actually, people have shown you the right way to get around it. abs (X - 1.0) < epsilion.

      If you're hung up on ==, I should also point out that we ran into this when doing boundary conditions such as >,<,>=, and <=.

      Floating point numbers aren't exact. If you need something exact, then use fixed point (carefully) or integers.

  26. A pesky bug? by tshak · · Score: 2

    One word: Formkeys.

    --

    There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
  27. Hidden Slashdot posts by kawika · · Score: 4, Interesting

    When I go to the front page I see one set of topics. If I go to "older stuff" I see a few topics there that seem like they should be on the front page, but aren't. I haven't checked any boxes under the preferences page's "Exclude stories from home page" so I would think they would all show up.

    I know this must be happening for most Slashdot readers because the topics I don't see have maybe a dozen posts after a day. So is it happening to you too?

    1. Re:Hidden Slashdot posts by doorbot.com · · Score: 2

      I know this must be happening for most Slashdot readers because the topics I don't see have maybe a dozen posts after a day. So is it happening to you too?

      Yes. I don't understand this completely, but I think some stories are posted only to their specific sections, such as "Apple" or "Apache" and don't automatically make the first page. Thus the Slashdot editors can choose which specific stories show up on the home page.

    2. Re:Hidden Slashdot posts by msouth · · Score: 2

      hear, hear. not to mention that "search" is "older stuff" (maybe that's innovation?), but I was wondering for a long time why this happened, and finally figured out what the heck the options actually meant. However, I don't complain, because they let me filter out Jon Katz. Everything else is a trivial annoyance by comparison.

      --
      Liberty uber alles.
    3. Re:Hidden Slashdot posts by msouth · · Score: 2

      no, what I'm saying is (a) [this is an aside] that when you are on the front page and you wonder if there is a way to search this beast, you have to figure out that "older stuff" is the link you need to hit.

      It is possible to make it so that everything appears on the front page, but the option that does that is not well named.

      Collapse Sections (show stories from all sections, unless specifically excluded)

      "Collapse Sections"? I would think of it as expanding sections...I don't know. I think for a brief moment I understood what "collapse" meant in this context, but it has gone away.

      --
      Liberty uber alles.
  28. Halt and Catch Fire (HCF) by Anonymous Coward · · Score: 2, Interesting

    According to the Jargon Files, this was a CPU instruction that would cause a hardware error. The example given was rapidly toggling some bus lines so as to cause them to catch fire :-]

    1. Re:Halt and Catch Fire (HCF) by stox · · Score: 2

      I don't know if this existed earlier, but this was an undocumented instruction for the MC6800 processor. Supposedly, it was meant as a manufacturing test. The only way to reset it was a power cycle of the processor.

      --
      "To those who are overly cautious, everything is impossible. "
  29. I do not write code with bugs by GregGardner · · Score: 3, Funny

    I write code and then double and triple check it. I have never written code with a single bug in it; therefore all of my code is superior and secure. In fact, my OpenBSD operating system has never had a root compromise in 6 years!

    What? OpenSSH Challenge-response authentication vulnerability you say? Uh... nevermind.

    -Theo de Raadt

    1. Re:I do not write code with bugs by Anarchofascist · · Score: 2

      I write code with bugs... except once.

      I once wrote a (quite complex) Mandelbrot set generator in Pascal, which worked perfectly first time. Gave me quite a shock.

      --
      Once more unto the breach, dear friends, once more, Or close the wall up with our American dead!
  30. DEC Alpha Floating Point Bug? by march · · Score: 3, Interesting


    As I reported in RISKS in 1997:

    DEC Alpha Bug?!?

    Wed, 02 Jul 1997 15:14:24 -0400

    So there I am, looking at our trading system and noticing that the price of one particular bond was different on two separate machines. Damn, I think. Must be a bug in the latest release of our software. Quick, do a sum on all the libraries. Nope, they are the same. Executable? Nope, the same.

    Hmm... Step through the code, hey, look at that! The pow() function is returning different results!

    So, I wrote a stand alone program. Sure enough, the machine with the latest rev motherboard (one that was just replaced by DEC) is producing bad numbers. Time to try 'dxcalc', DEX's X calculator. Yup. different numbers. How about perl? Yup, different numbers. How about 'bc'? Duh, bc doesn't take floating point powers. Hmm... check libm. Nope, they are the same.

    Bottom line: DEC will be here shortly.

    Test your alpha. Try 'pow(1.234567, 7.654321)'. If you don't get 5.017something, you have the same problem.

    RISKS? In our case, could have been a large sum of money.


    The final resolution was that DEC claimed to have a bad motherboard. Yeah, right....

  31. Current bug in Windows I/O.... by Kris+Warkentin · · Score: 5, Interesting

    I just observed this bug a while ago while porting some software to windows. Do the following:

    fopen some file for writing.
    write some stuff.
    fseek to some offset near the beginning.
    write some more stuff.
    fclose.

    Simple right? Wrong. I observed that the second write didn't get performed unless you explicitly do a fflush before the close. Imagine, not writing dirty buffers out on a fclose....unbelievable.

    --

    In Soviet Russia, hot grits put YOU down THEIR pants.
    1. Re:Current bug in Windows I/O.... by NotoriousQ · · Score: 3, Interesting

      Actually, it seems that this bug is a bit deeper than just the libs. One of the post below mentions the same bug in java in windows, and I have noticed that the filestream object in .Net also fail to write out its 1k buffer.

      so many systems, so much the same bug
      (or is it a feature?)

      --
      badness 10000
  32. microft DLL unloading by mojorisin67_71 · · Score: 2, Informative

    This was on NT.

    While exiting the program, Microsft
    was unloading the socket DLL before DLL's we had
    created. This caused our program to always crash
    on exit.

    It was obvious due to some internal DLL dependencies,
    NT was choosing a random order
    to unload DLLs.

    We spent months trying to fight with Microsoft,
    but could not get a solution. In the end
    we decided not to support NT as a platform ;-).

  33. These are a few of my favorite (Microsoft) bugs by swm · · Score: 4, Interesting
    These are a few of my favorite bugs

    Just to show how cool I am.

    1. Re:These are a few of my favorite (Microsoft) bugs by Dahan · · Score: 2
      No, that's not how DeMorgan's Law works:

      NOT (A OR B) is (NOT A) AND (NOT B)

      So if the loop continues while fNextFile || dwLastError!=ERROR_NO_MORE_FILES, the loop terminates when !fNextFile && dwLastError==ERROR_NO_MORE_FILES.

  34. One of my favorites by tuxlove · · Score: 4, Interesting

    Way back when, I worked for a company that produced a special version of SysV Unix. One of our developers was going through all the source code and looking for places where global variables were initialized to zero, thusly:

    int x = 0;

    and changing them to be implicit:

    int x;

    This had the effect of reducing the size of the data section of the binary and moved the variable to the BSS section. A simple and safe optimization, albeit somewhat anal.

    Shortly thereafter things started acting funny. The OS would slowly go crazy in very subtle ways after booting. It was not clear what was wrong or if anything actually was wrong, and nobody connected the variable initialization change to the problems with the kernel. After something like 3 months, they finally figured out that when this change was applied to a single variable in the C library it invoked a compiler bug that caused the library to be compiled in such a way that caused the kernel to fail to reset the CPU's floating point registers during a context switch. (How a faulty C library could cause the kernel to do this is still a mystery to me.) This is one of the weirdest bugs I've experienced, though I'm not doing it justice here due to fading memory.

    1. Re:One of my favorites by coyote-san · · Score: 2

      I'm showing my age, but I've seen loaders that failed to initialize the BSS segment to zero. If you don't initialize a value, it would have a random value. Since this was DOS 5.x, everyone shared the same real memory space so you would have bits of whatever other program had been run recently.

      (I also recall this happening with Ada, but I can't remember if that behavior was specified by the language.)

      We had fun trying to convince people that this was the real problem. What finally worked was me writing a couple of very small assembly routines that wrote 00 or FFh to all memory from just past the end of the program to the top of memory. If we cleared memory, we could reliably eliminate the bugs. If we set the memory to FFh, we could reliably produce the buggy behavior.

      Naturally, one of the managers wanted to fix the problem by just running my memory clearer every time before running the application.

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  35. Most hated bug by peterdaly · · Score: 2

    My most hated bug is the Internet Explorer update, or patch. (All of them) Each new version, something else is broken. One of the latest "critical" security patches brakes the ability to open TIFF images correctly in the IE6. Spent an hour tracing the source of that problem down today. Resolution is a registry hack. Like we want to be walking web users through hacking their registry...I don't think so. Don't even get me started on it's png issues.

    -Pete

    1. Re:Most hated bug by dillon_rinker · · Score: 2

      Is the registry entry in HKCU or HKLM? If it's HKCU, consider putting a reg file into the login script. If it's HKCU, consider the FOR command (built in) and the REG command (resource kit).

  36. Pablo? Come to Florida honey, we miss you. by rice_burners_suck · · Score: 3, Funny
    My weirdest, most annoying bug was a software package I authored. It had over 400,000 lines of C source code took fifteen minutes to compile under Watcom, and took about an hour to execute on a 486. As it turned out, the whole program could have been implemented in about thirty lines, which execute almost instantaneously on the same computer. So I didn't know that C supported integer math expressions. So sue me.

    Ooooooooooooh well.

    1. Re:Pablo? Come to Florida honey, we miss you. by kzinti · · Score: 2

      I wouldn't put my real name on a story like that either.

      --Jim

    2. Re:Pablo? Come to Florida honey, we miss you. by deathcow · · Score: 2

      This sounds like a success story! (If you were an independant contractor.)

  37. You think YOU had a rounding bug???? by flatulus · · Score: 5, Interesting
    Get this: A few years ago I was doing real-time driver development for an embedded DSP subsystem using TI 54X processors. Months into the development, one of the processors started "losing" a serial port transmitter interrupt. This was an interrupt that (kinda like a machine gun) *MUST* fire every time, or it will never fire again.

    This was a major issue, because when the interrupt was lost the system froze up and had to be rebooted (this is an embedded app - not a desktop).

    I offered to assist the engineer responsible for this code. We spent two days tracing the problem in extreme detail, checking and cross-checking our results. We both concluded that the processor was simply "losing" the interrupt. There was no rational explanation. We adopted the countermeasure of using a fine grain watchdog timer to look for the lost interrupt. This isn't the best solution, since what was to keep the watchdog interrupt from being lost??? But it was the best we could do. And it worked.

    The project lead, however, was very unhappy with our solution. He was convinced that we had overlooked the cause of the problem, which had to be software-based. I countered that, though he could certainly be right, it would be better to leave the watchdog in and let the project move ahead until we stumbled across the real cause in due time. He reluctantly accepted this approach.

    My vindication took five months, but what sweet irony when it did. It turned out that some other company, which also used the 54X chip, had encountered the same problem, but they figured it out (and I'll never know how). The problem was that the 54X (at that time) had a silicon flaw that, when certain integer rounding instructions executed at the same instant that an interrupt were being asserted, the interrupt could be "lost". This was confirmed by TI to be a silicon fault, and no amount of software handstands or cartwheels could fix it. The only workaround was to not use those rounding instructions!

    OK- top that....

    1. Re:You think YOU had a rounding bug???? by Amazing+Quantum+Man · · Score: 2

      Had something similar. We were working with a TI 34020 GSP (grafix processor). And for the life of me, I couldn't get TI's CCITT Group IV Fax
      library to run correctly.

      For those of you too young to remember, the 340x0 series was a BIT-addressable machine. You could set the word size anywhere from 1 to 32 bits.

      Turns out that our HW guys had a bug. The processor's RAM worked fine in 16-bit access mode, but when you accessed the low byte of a word in 8-bit mode, the high byte mirrored it. Of course, the fax library used byte arithmetic.

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    2. Re:You think YOU had a rounding bug???? by jayhawk88 · · Score: 2

      Turns out that our HW guys had a bug.

      That actually happens a lot. You need to make sure your team has a nice balance of Soldiers, Engineers, and Snipers as well.

      (Sorry, just a little TFC humor. Couldn't resist.)

    3. Re:You think YOU had a rounding bug???? by johnw · · Score: 2, Interesting

      > OK- top that.

      Some years ago I was working on Prestel software running on the GEC 4000 series mini-computers. One particular problem affected the system at startup (when it was extremely busy for about 30 seconds) and took an awful lot of tracking down.

      The GEC 4000 series was (is?) a real-time system with inter-process message passing built in to the CPU. You load values into registers (one of which will cause a chunk of memory to be passed to the other process) then execute a SEND instruction and away it goes. You can do a GOFREE to accept incoming messages from any source, a WAIT to accept them from one nominated source or a SENDWAIT to send a message and wait for the response. When a message arrives the register values are automatically loaded into the registers for the receiving process and then the process continues.

      At startup the Prestel system had about 200 processes all frantically sending messages to each other. On odd occasions one process would crash, having apparently received a garbage response from a system process. Lots of heavy debugging, (including stopping the whole system and printing out large chunks of memory on the console (TI Silent 700 thermal paper - remember those) seemed to confirm that the system process was sending back garbage in response to a request.

      I reported it to the OS guys who took a lot of convincing. After a lot of pressure they agreed to investigate and reluctantly agreed that it wasn't an application fault. In the end it turned out that it wasn't an OS fault either - it was a bug in the CPU. Under heavy load when executing a SENDWAIT the GEC 4160 would very occasionally do neither the SEND nor the WAIT, but allow the process to continue with whatever values were in the registers before.

      Explained like that it sounds simple. Working from the sharp end in the field it was anything but.

  38. True story by Beryllium+Sphere(tm) · · Score: 2, Interesting

    I was developing on one IBM mainframe, running on another. It worked fine on the development machine, consistently failed on the machine where I couldn't debug.

    Somehow troubleshot it to an error parsing a data file. Ran some tests to see if the (suprisingly exotic) code for transferring the data file from one system to the other was broken.

    It wasn't, but the test procedure did include making a copy of the data file, and the COPY command put line numbers into the file even though there weren't any to begin with.

    The workaround was to use the NONUM option on the copy command. That was documented behavior, so you could argue that it was programmer error, but I wouldn't agree with you.

  39. 6502 microcode bugs... by schon · · Score: 5, Interesting

    My all-time favourite bug is in the microcode of the 6502/6510...

    An indirect jump where the source address was on a page boundary caused the high-byte to be pulled from the beginning of the current page, instead of the beginning of the next page..

    eg.
    $0100 holds $80
    $01FF holds $32
    $0200 holds $14

    then the command

    JMP ($01FF)

    would load the program counter with $8032, instead of $1432

    First time I saw it used was in some copy-protection code in the C64 version of Sim City.. It was some obfusication to screw up beginning crackers.. (it threw me for about 5 minutes..)

    Ahh, those were the days :o)

    1. Re:6502 microcode bugs... by AnotherBlackHat · · Score: 2

      I remember that one. --

      This code worked
      LDA #9
      NOP
      STA $14
      RTS

      But this code didn't
      LDA #9
      STA $14
      RTS

      Turned out the /real/ bug was a JMP () elsewhere,
      the nop just shifted things by a byte.

      I still think my favorite is redefining the value of 3 (in Fortran)

      -- this is not .sig

    2. Re:6502 microcode bugs... by jovlinger · · Score: 2

      I seem to remember that one being documented, too. I don't know if it was the official intel dox, or some thid party ones I had lying around, but there was about a page per instruction, and that bug was mentioned.

      As for 6502 quirks, I think the hard coded stack page (02) was pretty funky. Ah. good old cisc. IIRC, the 6502 was still pretty snappy, getting most ops done in one or two cycles.

  40. 7^2 vs. 7*7 by rjamestaylor · · Score: 2, Funny
    Applesoft gave different values for 7^2 vs. 7 * 7. I believe it was 48.999999 vs 49.

    Through me for a loop when I was 12.

    --
    -- @rjamestaylor on Ello
    1. Re:7^2 vs. 7*7 by Phexro · · Score: 2

      "Through me for a loop when I was 12."

      Well, the last year sure has treated you well.

  41. Re:String.length() by delphin42 · · Score: 2

    A few years back, my boss had us using a programming language for web sites called Power Dynamo from Sybase (never ever EVER use this!). Anyways, the length() method for a string was basically a random number generator. I made a test page one day and had it output the length of the same string over and over again getting results from -100 to 20000 when trying to get the length of "the"

    Sounds like you weren't terminating your strings properly, or at least in a way consistent with what the length() function was expecting. It was probably searching through memory looking for a terminator, which explains the random behavior.

    --
    -- Adam
  42. Best Error Message Ever... by Master_Ruthless · · Score: 5, Funny
    I found in one of the early pre-PDC builds of Visual Studio.NET. You just got a simple message box with the following text:


    "Dude- the C# compiler is out of memory. So out of memory that it can't even tell you what the error was!"


    The buttons below were pretty cool too. One said "ok" and the other one said "lame!"

    If you clicked the lame! button, you just got to fill out a little comment card, but the feature cracked me up the first couple times I saw it.
    1. Re:Best Error Message Ever... by falzer · · Score: 3, Funny

      That reminds me of some funny error messages from an old Apple compiler.

      A link.

      Some examples:
      "You can't modify a constant, float upstream, win an argument with the IRS, or satisfy this compiler"
      "type in (cast) must be scalar; ANSI 3.3.4; page 39, lines 10-11 (I know you don't care, I'm just trying to annoy you)"
      "Too many errors on one line (make fewer)"

    2. Re:Best Error Message Ever... by Fulcrum+of+Evil · · Score: 3, Interesting

      The buttons below were pretty cool too. One said "ok" and the other one said "lame!"

      The lame thing was a hack on the dialog code. BillG made a fairly big deal out of bad or confusing error messages, so the devs got the idea to do internal builds with the extra button on every dialog so that you could report a confusing message on the spot. Pretty cool, actually.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    3. Re:Best Error Message Ever... by Reziac · · Score: 2

      I'm reminded of a message I once saw from a Mac running MacOS 8.5: "Dude, like, something went wrong!"

      D'oh!!

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  43. Re:Not a bug by Asprin · · Score: 3, Informative

    That's not a bug. It's a more accurate way to round off numbers. If you always round 5 up, that means you round 5 out of 9 numbers up, and 4 out of 9 numbers down. This can cause problems if you're rounding lots of numbers.

    NO!!!!!!

    Please don't take this as a flame, because I'm not upset with you, just the ignoramuses that came up with this scheme. This is a stupid way define ROUND(), and I disagree entirely with the justifiction because ROUND() has to be defined in the case that the digit is a zero, right?

    In other words,
    digits 0,1,2,3,4 get rounded DOWN
    digits 5,6,7,8,9 get rounded UP

    See - it's completely even without this odd/even cockamamie bullstuff. In fact, this definition of ROUND() throws off the statistics because it inappropriately weights the UP/DOWN results (either 50/50 or 60/40) based on info that is irrelevant to the ROUND() process.

    It's like the people who coded this function never studied actual math and don't understand that the trivial case (zero) counts!

    I'm sorry, I don't usually go off like this but when something this simple gets this fscked up, it really frosts my wheaties.

    --
    "Lawyers are for sucks."
    - Doug McKenzie
  44. AMI BIOS and beeping console by PD · · Score: 4, Interesting

    I once worked on a DOS app (about 10 years ago) that had a very strange bug. The system would lock up for no reason we could figure out. The offending statement was a printf that printed one single character (a control-G) to the screen to make it beep.

    After some testing on different computers, we discovered that it only crashed on machines with an AMI bios. Phoenix BIOS machines worked just fine, and so did real IBM machines. We never digged into the BIOS code to figure out what the problem was, but we mentioned it to the Phar Lap support people (those people were the smartest support people I ever ran across). They told us that they knew about the bug, and even explained what was happening inside the bios to make it crash the machine, but it's been 10 years so I don't remember the details anymore.

  45. I know, it's a feature. by Elwood+P+Dowd · · Score: 5, Interesting

    As far as I could tell when I was using Perl, running under strict mode would make it so that print() only worked with strings that ended in \n. I can't tell you how long that takes every beginning Perl programmer to figure out. Took me a good four hours.

    My favorite bug in slashcode is that clicking "Parent" in my default story view always returns the default story view, not the parent of the post I'm clicking on. So I have to click on the post ID number, then click parent on the resulting page.

    --

    There are no trails. There are no trees out here.
    1. Re:I know, it's a feature. by novas007 · · Score: 4, Informative

      I've had that problem before, but it's not what you think (i think). Do you use zsh? Some shells, including zsh, protect their prompt. So if you print a single line w/o a \n, the prompt overwrites it, and you never see it. I think that bash by default will just print the prompt after whatever it was you printed. Try piping it to less or something, and you'll see it IS actually there :)

      --
      To smash a single atom, all mankind was intent / Now any day the atom may return the compliment
    2. Re:I know, it's a feature. by lightcycler · · Score: 2, Interesting

      Pet bug? Try sending an ASCII-zero '\0' to the serial port using MS Visual C++

      Yes, it needs a string. Yes, zero is the end of the string. No, you can't send arbitary files to the serial port. Duh!

    3. Re:I know, it's a feature. by captaineo · · Score: 2

      Are you sure you weren't just seeing stdio line buffering? Assuming Perl's print() uses stdio internally, output won't be flushed to stdout until it sees a \n character.

    4. Re:I know, it's a feature. by Elwood+P+Dowd · · Score: 2

      No, I think the other posters figured it out. It must have been the lack of autoflush. But I could have *sworn* that the only thing I did to fix the issue was comment out "use strict;". And I don't see how that would have anything to do with autoflush.

      Anyway. It was perl 5.006 or something like that. I only used perl for that one project, and it was over two years ago, so I definitely don't recall the particulars.

      --

      There are no trails. There are no trees out here.
    5. Re:I know, it's a feature. by xee · · Score: 2

      Bash in Mandrake 8.1 and 8.2 protects the prompt. It took me hours to figure it out. I stumbled across the cause by piping to more.

      --
      Oh shit! I forgot to click "Post Anonymously"...
  46. Software Bug Affects Human Bone Length !! by deathcow · · Score: 2

    I developed the original software for a robotic human bone lengthening/correcting device (called "Autogenesis") which slowly transforms bones based on the Ilizarov technique. It was written in Franklin embedded "C" on an 8051 processor. One of the tables containing motor rates and rhythms had an incorrect value. The result? That rate and rhythm would move bone at a rate other than the doctor intended!

  47. spelling of functions by Jucius+Maximus · · Score: 3, Funny
    I can't count the number of hours I spent in high school trying to figure out why my Pascal code won't compile, only to find out that it was due to american bastardisation of the english language.

    All of the function names with the word 'colour' were spelled 'color.'

    It's kind of like the MSFT bastardisation of SQL. ("Select * from table" compared to "Select # from table".)

    1. Re:spelling of functions by scott1853 · · Score: 2

      SELF MODERATION IN EFFECT: WARNING!!! ETHNIC FLAMING!!!

      Pascal programmer from outside the US. Tell me, are you part of the newsgroup posters that ask the most basic questions like how to open a file, or are you part of the group that post questions asking people to write the entire application for you?

    2. Re:spelling of functions by tomhudson · · Score: 2, Informative
      I remember how Computer Associates had both color and colour in their clipper include files, so you could use either one.

      I thought it was pretty neat.

      On the other hand, in c you could have just done the following:

      #define colour color

      another useful shortcut is to do this:

      #define str chr* #define strs chr**

      int main(int argc, strs argv, str env)

      helps remove a few bugs from code you write.

    3. Re:spelling of functions by Jucius+Maximus · · Score: 2
      "I just tried "Select # from table" in Oracle and that gave me an error. Where does one use the pound symbol for SQL? (Except date delimiters in Access SQL.)"

      Reading my post again, it's pretty obvious that what I said was misleading. The select # thing appears only (as far as I know) in certain versions of the Microsoft Jet SQL engine. According to the ANSI SQL specifications that I have read, the correct implementation uses the * and not the # sign.

  48. Debugging bugs by mikecarrmikecarr · · Score: 4, Funny

    I remember discovering __LINE__ and __FILE__ when I was doing some perl debugging. It was handy to do stuff like:

    do(something()) or die("Failed on line " . __LINE__);

    Of course, then I had this idea of using a debugging function (this is before I knew of warn,croak,carp, et al). So I happily wrote my function

    sub debug { die("Failed on line " . __LINE__); }

    And then spent hours trying to figure out why my code always failed on line 78, which happened to be where the debug() function lived. D'oh!

    --

    ID-10-T is a way of life

  49. NT Backspace Bug by rootmonkey · · Score: 3, Informative

    One of my all time favorites. Just print too many backspaces and cause the window's machine to croak. Always a crowd pleaser. And the funny thing is it still works today in NT/XP ... Good details here

    --

    Yes but every time I try to see it your way, I get a headache.
  50. GCC funkiness. by Christopher+Thomas · · Score: 2

    Most annoying bug I've encountered recently?

    The version of gcc that the admin recently installed converts "xor" to "^" in the *preprocessing* stage, apparently.

    This made for Much Fun when I accessed a field called "xor" in a structure. It took me a while to figure out exactly why it was producing an apparently-nonsensical error with quoted code that didn't match anything in my source....

    You'd think that, in context, it would realize that this was a field identifier.

    The previous version, which I'd started development under, didn't make a peep.

    1. Re:GCC funkiness. by kzinti · · Score: 2

      The version of gcc that the admin recently installed converts "xor" to "^" in the *preprocessing* stage, apparently.

      This is a good reason to learn how to run "gcc -E" or "gcc -P".

      --Jim

  51. My favorite compiler bug by west · · Score: 3, Interesting

    Was in the C compiler in the old Ontario ICON computer, which used a variant of QNX.

    If you had a variable that happened to be the same as the name of a function, then the compiler wouldn't complain, but it would use the address of the function as the value of the variable. Took me a **long** time to figure out where it was getting that value from.

    1. Re:My favorite compiler bug by msouth · · Score: 2

      I think he might mean that something like this:


      #include
      int fp(void);
      int main () {
      int fp=3;
      printf("fp is %d\n", fp);
      }
      int fp (void) {
      }

      would print something like this:


      fp is 134513792

      instead of

      fp is 3

      --
      Liberty uber alles.
    2. Re:My favorite compiler bug by pne · · Score: 2

      Heh... I once had a bug that worked the other way around. I had a variable (let's call it "foo") in my source. After I added the variable, the program would crash when doing certain things.

      Running the program under the debugger finally unearthed the fact that a third-party library I was linking to had an internal (not exported!) function called "foo"... and the program would try to execute my variable instead of that function when the library called its "foo" function.

      Took me a while of stepping through raw assembly output in the debugger and noticing "hm, that address seems vaguely familiar".

      Renaming the variable fixed the problem. Still baffled me.

      --
      Esli epei etot cumprenan, shris soa Sfaha.
  52. VS 6.0 getline() bug by wunderhorn1 · · Score: 3, Informative
    One pretty annoying bug I've run into is that the getline() function which is part of Standard C++ Library doesn't return when you press Enter.

    http://support.microsoft.com/default.aspx?scid=kb; EN-US;q240015

    Now, I wasted a lot of time, but eventually confirmed on the web that this is a known bug in the Microsoft C++ library which has persisted from Visual Studio 5 into version 6.

    Apparently, the Standard C++ Library used in both products was produced by Dinkumware and they, with their illustrious author/founder P. J. Plauger, were embroiled in a multi-year copyright dispute which made it impossible for them to debug (let alone update) the library. Most of the commenters online seemed to believe that this problem could not be solved and we had to wait for the copyright battle to be resolved (it has).

    My impression is that Microsoft has elected not to provide an update to the library (which includes the STL) until the release of .NET.

    --
    Karma: Bored. (Thinking about resurrecting the "Anyone else is an imposter" joke.)
    1. Re:VS 6.0 getline() bug by JanusFury · · Score: 2

      A fix has been available on MSDN for a while now. I forget the URL, but I was able to find it in about 2 minutes and fix it myself.

      --
      using namespace slashdot;
      troll::post();
  53. test.c on unix. by leuk_he · · Score: 2

    how about find a suspected bug and then write a program test.c to figure it out.

    cc -o test test.c

    And then you are suprised that "test" does not have ANY output.

  54. Assigning value of uninitialized variables by ackthpt · · Score: 2
    This was particular to a recent bug a colleague encountered, which I'd noticed sometime before and had an answer for:

    A variable is initialized.

    Another variable meant to be initialized/assigned by an external process wasn't.

    Assign the uninitialized variable to the one already initialized (thus copying the pointer)

    Voila the program reports an uninitialized variable, which any fool could plainly see had a value set at the begining of code.

    I've seen this happen in a couple languages, including c. The lesson is always assign some value to vars, perticularly when passing between routines, all return values should return with something other than a null pointer (unless of course you're coding for this intentionally.)

    --

    A feeling of having made the same mistake before: Deja Foobar
  55. Commercial UNIXes by blakestah · · Score: 2

    I at one point hacked a bit on uemacs. I liked emacs, wanted a small binary written in C with 95% of the functionality and 5% of the cruft. Anyway, I went to add a tab-complete to the dialog for opening a new file. No worries, the glob function is POSIX. So I wrote it in, and it worked fine under linux.

    Then I went to our alphas to do the same. Glob didn't work at all. Something went wrong. Then I tried to debug it, and what I found was that the libc glob function on OSF unix (4) was calling ksh to perform the globbing function. I contacted DEC people via Usenet and they basically told me to piss off. Somehow ksh interpreted the session as not being interactive, and then its globbing was dysfunctional.

    I ended up writing a work-around based on the algorithms in the glibc globbing code. I found it awfully strange that a commerical libc was dependent on ksh for its functionality (note: the DEC programmers that told me to piss off didn't think this was odd at all).

  56. Bugs in DOS by Bistronaut · · Score: 4, Interesting

    It's turn-back-the-clock time, boys and girls. Remember all of those DOS calls? It was interrupt 20, wasn't it? Remember the findfirst and findnext functions that would get you a list of the files in a directory? You could give findfirst a list of attributes and a filespec, and it would give you a file that matched it (findnext just repeated the last findfirst). Valid attributes to pass were the archive flag, read-only, directory, etc. Except the directory one didn't work! It was simply ignored, so you had to sort out what files were directories or not yourself. What a pain in the ass! And did they ever fix it? I'll give you one guess.

    Oh, and I can't mention old MS bugs without mentioning MASM vs TASM (just because it illuistrates why Borland is so cool and MS is not). Back in the day, when applications were coded in assembler, MASM (Microsoft Macro Assembler) was popular as hell. Borland, though, came out with Turbo Assembler, which had a better syntax (optionally), could assemble MASM syntax faster than MASM could, and could emulate all the bugs in the different versions of MASM. Ah.

    Well, that's enough MS bashing for me today (or maybe just this hour...).

    1. Re:Bugs in DOS by Dr+Caleb · · Score: 2
      I used that feature to be able to hide directories.

      If you tried in dos to ATTRIB +H [directory] dos would crap all over you, same if you tried to change the hidden attribute of a directory. So what you could do is write a quick little C program that would use umbrella interrupt 20 to get a files' attributes, unset the directory bit, set the hidden bit, then set the directory bit back. *poof* A hidden directory!

      --
      "History doesn't repeat itself, but it does rhyme." Mark Twain
    2. Re:Bugs in DOS by jmooney · · Score: 2, Interesting
      The weirdest set of symptoms I ever had to diagnose was due to one or two bugs in the Microsoft DOS Linker (circa 1985, version 3.61 I think). I was linking C code and Quickbasic code into one executable of about 200-300k (that was a lot when 640k was the system max).

      The first symptom was that I ran my program from DOS, and the previous program that I had been running under DOS sparked back into life briefly then the system hung or rebooted - different each time I ran my broken executable. What was happening was that the DOS loader was not loading the last 64k of the .exe, which was where the entry pointer was, so it just jumped to whatever happened to be in memory already. The linker was somehow getting the filesize word in the .exe header 64k too low (can't remember how long it took to figure that out). I fixed this with a program run by my makefile that checked and if necessary patched every .exe file as soon as it was linked.

      The second symptom was about a year later, in a different version of the linker (still buggy), when I started using MS link .exe compression. I got heap corruption in one part of my code. I added in one debug message, and the problem went away, but came back when I took out the debug. Almost any change anywhere in the program (any source file) changed the symptom. After about 80 hours in the debugger tracking through godawful quickbasic initialisation and memory management, I found there were about 5 bytes of corruption in my static strings. The MS linker .exe compression did simple run-length compression on the executable, and appended some decompression code onto the end of the executable. The problem was that the initial stack pointer used by this decompression routine was supposed to be beyond the end of the file in free memory, but instead it was 64k before the end of the .exe, and whatever happened to be 64k before the end of the .exe got a hole punched in it during the .exe startup code introduced by the linker. I changed my patch program to patch that pointer after every link too.

      I spent a long time fuming at the weeks that I had lost just on this bug over the years. I never did figure out what it was about my program that tripped the bug in the linker.

      Aside: I maintained and supported that program until the early 90's... the second-last native application I developed for a Microsoft Operating System. I got a job in UNIX systems in 1992, in 1995 my company was looking for a way to go GUI, I did one experimental Windows fat-client/server program in early 1995... the last native executable I did for a Microsoft OS. I recommended my company write our GUI for the web instead, and we got a 2-4 year lead over our competition worldwide.

  57. Anything event driven by scott1853 · · Score: 2

    I program in Delphi and there's nothing quite like getting a resize event for no apparent reason before an object has been created in the constructor or after it's been freed in the destructor.

  58. Software by smoondog · · Score: 2

    I once wrote a piece of software for assisting staffers in calculating payrolls at a big ten university. This was used for budgets, paychecks, accounting, etc. Anyways, some of the employees started complaining that their paychecks were slightly off from what they should be. (Usually less than $.05) I found that I was summing the paychecks individually, propogating a rounding error. But that didn't completely fix the problem!

    It turns out (after a lot of research) that the budget office officially rounded down (floored) and the payroll office rounded to nearest! So here I was getting blamed for the annoyed employees, but it was really the worst sort of bureaucracy ... one that can't be easily fixed.

    -Sean

  59. "Collapse stories" in preferences by devphil · · Score: 3, Informative

    Will fix that for you.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  60. Book bugs... by swagr · · Score: 2

    Implementing a custom file format where the header was an AVL tree.
    I was using a textbook's pseudocode for an algorithm, and sometimes values would disappear from the tree. I finally figured out that there was a bug in the book's pseudocode. Of course I though the problem was in my code, not the book, so this one took a long time to catch.

    --

    -... --- .-. . -.. ..--..
  61. Netscape JVMs Can't Divide... by edashofy · · Score: 2

    I was implementing a public key encryption algorithm for Java in Java 1.0 so applets could use it in the bad old days. I had to write a big-number package from scratch using algorithms out of Knuth vol. 2 since BigInteger wasn't in JDK1.0. I finally had it debugged on Windows, but I was getting garbage when I tested the apps on Macintoshes. Eventually, after many hours of debugging, I found that Netscape's JVM couldn't divide long integers properly, but only on the Mac, and only for certain values. You can imagine how frustrating it was that I was generating random numbers for every key, so the error would only occur once in a while.

    The Netscape engineers finally acknowledged the bug, but it took them about 8 minor version upgrades of the browser before it got fixed. I ended up just hacking it to use a smaller internal radix on the Mac, which seemed to get rid of the problem.

  62. Re:Am I the only one by josepha48 · · Score: 2
    The title is misleading.. I was thinking someone was going to talk about their ant farm.

    On the note of this post, my favorite bug is something everyone who has programed in C has dealt with. The float and double. While this may not be considered a 'bug', when I first discovered that doubles and floats were so .. well unpredictable, I thought it was a bug. I know this has more to do with precession than a 'real bug' but to me I should be able to use a double on any platform and get the same results, but you don't always. On one machien I had precission of 2 decimal places and on another it was 6. It would be better if in the implementation it was 6 everywhere.

    Compile and run this:


    int main() {

    do uble d, e;
    d = 1234567890.1234567890;
    e = d;
    pr intf ("%f %f \n", d, e);

    }

    what do you get? On what platform?

    --

    Only 'flamers' flame!

  63. Favorite solution to a bug by jhines0042 · · Score: 2

    In C:

    Program was failing... inserting debug statements made the bug go away...

    so the program ultimately ran with the following line in it.

    int k = k;

    'k' was never used anywhere else.

    --
    42 - So long and thanks for all the fish.
  64. When comments are more than comments... by Tom7 · · Score: 4, Funny

    Back in the day when I used to program in C++, I was also really into making little ascii-art comments in my code. One time I had some code that looked like this:


    #include <stdio.h>

    // tom 7 was here - 1998 \\
    typedef unsigned char uchar;
    int something(uchar c);
    ...

    (In actuality, the code was longer and more complicated, so it wasn't so easy to figure out...). Can you see the bug?

    1. Re:When comments are more than comments... by pmz · · Score: 3, Funny

      Uh, I don't know. The answer escapes me.

      Ha ha.

    2. Re:When comments are more than comments... by jeffy124 · · Score: 2, Informative

      this is a guess...

      the back-slash \ at the end of the line indicates to the compiler that the following line is to be considered part of the current line, meaning the compiler (iirc, lexical analyzer) will translate the above to the following:

      #include

      // tom 7 was here - 1998 \typedef unsigned char uchar;
      int something(uchar c);

      or more precisely--

      --preprocessed contents of stdio.h--
      int something(uchar c);

      so the "bug" (actually a compile-time error) is an undefined token 'uchar,' unless of course, uchar has a definition in stdio.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    3. Re:When comments are more than comments... by BlueWonder · · Score: 2
      Is this a known bug?

      No, this is not a bug. Calculations with floating-point numbers are always susceptible to rounding errors, so the second expression could either evaluate to exactly 10.0, or slightly above 10.0, or slightly below 10.0. In the latter case, the integer conversion would yield 9.

  65. Y2K by Salsaman · · Score: 2
    Wow...that one was weird !!

  66. Not really a bug by scott1853 · · Score: 2

    But I program in pascal so I'm used to "if x = y then". Do you know how much of a pain in the ass it was to learn Perl when I erroneously coded all my comparisons that way and I couldn't figure out why nothing was working because it was setting everything to valid numbers, just the wrong numbers. I'll admit that after I realized my stupidity I've been able to quickly find those buggers.

  67. at an old data center I was at.. by Xzzy · · Score: 3, Funny

    ..there was the "loose connector" bug.

    Machines that stay running for years at a time almost never come back up cleanly after some downtime, and I can't recall the cases where walking back to the beast and planting a kick into it's chassis would "fix" the problem. We particularily enjoyed doing this to aging RAID arrays and four digit sun machines because of the amount of effort needed to get the things out of the rack and opened up.

    Now most of us would realize that this was probably just reseating whatever needed reseating, but the humor value behind skilled techs fixing expensive hardware with violence is too tempting to resist.

    1. Re:at an old data center I was at.. by arnie_apesacrappin · · Score: 4, Funny
      At the university in my hometown, I was talking with the IT staff about their day to day maintenance tasks. Most of the end user desktops were Zenith built 386's with 20 meg hard drives.

      A common problem was that the heads on the hard drive would get stuck, and the machine would cease to operate. The standard operating procedure to remedy this was told to me as:

      • Remove all items on top of the computer.
      • Lift computer at least three feet above the desk.
      • Release.

      If that didn't work, secondary protocol was to remove the hard drive from the machine, place it on the desk, and hit it three or four times with the blunt end of a screwdriver.

      According to the techs, this worked about 90% of the time.

      --

      Still, with a plan, you only get the best you can imagine. I'd always hoped for something better than that. -CP

    2. Re:at an old data center I was at.. by dsb3 · · Score: 2

      The phrase you're looking for is 'percussive maintenance' :-0

      --

      Slashdot? Oh, I just read it for the articles.
    3. Re:at an old data center I was at.. by Reziac · · Score: 2

      Funny story told by Jerry Pournelle, involving his son Alex:

      Jerry's computer wouldn't boot. Alex proceded to do the lift-and-drop fix, whereupon the computer came back to life.

      Jerry complained, "I spent all that money to send you to college so you could learn to drop computers??"

      Alex replied, "Yeah, but they taught us how far to drop it."

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  68. Re:Not a bug by RobinH · · Score: 2

    In other words,
    digits 0,1,2,3,4 get rounded DOWN
    digits 5,6,7,8,9 get rounded UP


    This seems correct when you first look at it, but the correct statement is actually:

    digit 0 gets nothing (-0)
    digit 1 gets rounded down (-1)
    digit 2 gets rounded down (-2)
    digit 3 gets rounded down (-3)
    digit 4 gets rounded down (-4)
    digit 5 gets rounded up (+5)
    digit 6 gets rounded up (+4)
    digit 7 gets rounded up (+3)
    digit 8 gets rounded up (+2)
    digit 9 gets rounded up (+1)

    Now add up all the pluses and minuses, and you'll find that the total is +5. That's because you're rounding TO zero, so zero never gets rounded. If you assume a random (i.e. even) distribution of all possible numbers, then you'll round up more than you'll round down.

    With the even/odd system, half the time you get a +5, the other half you get a -5, so they cancel each other out.

    However, we must remember that this is only used when there are no digits after the one we're basing our decision on. Therefore, 82.451 should be rounded to 82.5, and 82.449 should be rounded to 82.4; only 82.4500000... will be rounded to 82.4, and 82.550000... will be rounded to 82.6

    --
    "I have never let my schooling interfere with my education." - Mark Twain
  69. Re:Not a bug by mikeee · · Score: 2

    Well, it depends on the data. If you're working with data that has one decimal place of precision:

    4.4, 4.6, 4.5

    If your measuring instrument has the (common) behavior of reporting the nearest value, then your scheme results in

    Actual values 4.00 to 4.4499999... round down to 4.

    Actual values 4.45 to 5 round up to 5.

    So it's actually a 5% bias down in that case, because the instrument already rounded once.

  70. Two days to deadline, lets add some security� by Saggi · · Score: 3, Insightful

    Based on a true story!

    A few years ago I was working as the lead programmer on a cd-rom game. Two days before deadline, the manager of the project decided that we should implement a copy protection.

    Now you can see where it is going... right?

    Well the manager had talked to the company who was going to print the cd-roms. They had this piece of software that would protect the system. All we had to do was to write a component that needed to be called in order to start the game. If this component weren't called at first the game wouldn't start. We thought about it for some time. As we only had two days, we decided to let the component write down an encoded string, based on the current date to the harddisk, and then inside the game, well hidden read the string and match the date. As I have coded the game I made the part inside the game, while an other developer made the start-up component. I designed the specification of the coded string. It contained a lot of crap, and well hidden, the two digits indicating the day.

    Now I coded my part in such a way that it would work 4 days after the date. (Allowing me to more easily bypass midnight at the end of the month - especially February). This would hopefully also put off hackers, as the game would appear to be hacked, as the coded string would work for a few days.

    We tested the system, especially the end of months, going from the 28-31st to the 1st. It was end of November, close to Christmas - therefore the hurry. Then the cd-roms went into print.

    4 of December I received one of the first copies, just as the packages was prepared to be send out to the shops. I put it into the computer, and it failed... I tried again... and again. The way the program terminated looked subspecialty like the protection, so I started to look closely into what was happening. It was the date. 4 of December were a single digit. The protection component wrote 40 while the game looked for 04... My fellow developer had misunderstood the specifications. Of cause testing for 31 would work... it was two digits.

    We trashed all the cd-roms and made a new version without protection. Our manager will probably not ask us to do such a change with such short notice an other time.

    A thought thou; The cd-roms would have worked on Christmas eve... its two digits, but a new year... he he he.

    --
    -:) Oh no - not again.
    www.rednebula.com
  71. Hidden slashdot discussions by mcc · · Score: 5, Interesting

    As others have noted, this isn't a bug, these are just the stories that the editors decided weren't important enough to warrant a full front-page thing. Funnily enough, these "section page only" articles tend to have much better and more insightful comments than the front page articles, because people only post there if they really care :)

    Beyond that, though, what i liked was that used to, on slashdot, you could post to sid's that didn't exist. Like, you could go to http://slashdot.org/article.pl?sid=haiku, or something, and while there wouldn't be a story at the top of the page, you could post comments there, and the next person to go to http://slashdot.org/article.pl?sid=haiku would see that comment and could reply to it, until the comment reached a certain age and was automatically deleted. There used to be a whole bunch of these little "hidden" discussion areas littered all over slashdot that people would form entire little communities around them. Unfortunately, this was mostly used for troll groups to coordinate attacks. (K-9-something-inches or something? I don't remember.)

    Unfortunately they seem to have removed this feature from slashdot :( Unless i'm just confused about how it's done, anyway. But it seems to be disabled, going to a non-existent sid now shows "Nothing for you to see here, move along".

    There were some other really bizarre but fun slashdot bugs, like how there was some wierd twilight zone area at sid 0, or sid null (or something.. "slashdot.org/?sid=", i think was the url.. i can't remember. i think it was called "test discussion". or something) that you'd sometimes get dumped at if you clicked on the "parent" link in the preview of a post you were writing. Not always, just sometimes. The thing was though, there was some other bug that for some unfathomable reason would sometimes cause posts to get moved out of their correct threads, and into the null discussion, at random. And people wouldn't notice this. And so if you went to the test discussion, you'd just see hundreds and hundreds of random posts, totally irrelivant to each other or anything else, on totally random subjects. It was fun to go through this and try to guess what subjects the posts were on.

    And then there was.. i barely even remember this one. There was a page i managed to get to a couple times-- i can't remember how, but there was a simple way to do it that would work every time-- that just said, "Here are some open discussions", and linked a bunch of articles. The Test Discussion was always near the top of this list. I'd expect that whatever this page is, it's gone now, but can anyone remember what this page was or how i would have gotten to it?

    1. Re:Hidden slashdot discussions by mcc · · Score: 3, Informative

      Oh, crud, it's still there.. Yeah. Sorry. I didn't notice, but here it is: the several active discussions page. These days it seems to mostly link to slashdot journals. Sorry, i somehow missed it when i was writing the parent post. I feel dumb.

      I really, really hope this is something that the /. crew doesn't mind me bringing attention to. I just think it's cool :)

  72. 'Bug' in custom chip by apuku · · Score: 5, Funny

    I was trying to debug a CMOS standard-cell chip that I designed in the late 80's. The bug was elusive, only showing up occasionally and I'd written various test routines to ferret it out. I started to suspect it was something to do with the PCB layout, so I was cutting and pasting tracks. Suddenly all the test routines worked perfectly and I thought GOTCHA! My mind was almost blown when I realized that I had inadvertently cut the power trace to the chip - it was working perfectly when Vcc wasn't connected!

    Of course, I eventually figured out that the original problem was ground bounce and that with Vcc disconnected, the chip was getting power through the protection diodes on the control lines and bus. The lower voltage was slowing down the edges and reducing the ground bounce so that it worked correctly. I eventually solved the problem with PCB layout changes and the chip started working with Vcc connected!

    --
    Look, it's trying to think - Albert Rosenfield
  73. Army Man creates the world by RealDhar · · Score: 2, Funny

    While working on the graphics engine for ArmyMen for PSX, I wrote a little bug that always set one vertex of every terrain polygon to the center of the screen.

    Being an over-the-shoulder shooter, this was naturally where your Army Man's head was...it looked like one of those medieval illuminations of saints with the rays of light coming out of their head. Only these rays were the terrain.

    We named that piece of art "Army Man Creates the World"...

    --
    Sucks to be a Windows user.
    -g.
  74. how 'bout HTML bugs? by mblase · · Score: 2

    Netscape 4 has always had a feature where if you don't close a table cell or row before opening another one, it assumes it's still in the old cell or row. Microsoft decided at around the same time that when a new table cell or row starts, the old one is implicitly closed (unless you've explicitly started a new, nested table, of course).

    Now Mozilla and Opera mimic IE's behavior, and the more I think about it, the more it makes sense. After all, it's always been the case that if you don't close a paragraph before starting a new one, the old one is implicitly closed. And how can you start a new table row unless you end the old one?

    So the feature of NS4, which formerly enforced the closure of table tags in a nice programmer sort of way, is now more like a bug, which can completely scramble my (and others') HTML page layouts which had been developed and tested on IE or Moz and only tested near the end at the less-used NS4.

    The more I use Moz, the more I hate that browser... and the fact that I seem to be the only employee who knows Netscape has a new version out these days.

    1. Re:how 'bout HTML bugs? by Quietust · · Score: 3, Informative

      Actually, the current HTML spec (4.01) states that </TH>, </TD>, and </TR> are all optional.

      --
      * Q
      P.S. If you don't get this note, let me know and I'll write you another.
  75. Pet bugs? by frank_adrian314159 · · Score: 2

    I had a cage of Giant Australian Walking Sticks once. They were pretty neat...

    --
    That is all.
  76. Pesky 0 at end of every string by matusa · · Score: 2

    Here's one I never fixed.

    I've found that every time I use any function referenced in , I end up with a character with value 0 (I'll call it 'NUL') tagged to the end of every string! weird, eh?

    I never solved this. I just have this grotesque hack that from now on whenever I reach a 'NUL' in the string I assume I'm at the end of the string.

    =)

    april fool's, folks.

    Seriously though, most bugs that became memorable I don't want to talk about.

    I make typos when I type, and once when calling malloc, instead of doing malloc(nmemb * sizeof(char *)), I missed and wrote malloc(nmemb * sizeof(char )) (My finger slipped when hitting the * ??; notice the space after 'char' ..). Anyway it was close enough that when I glanced at that part I didn't think anything was wrong. I debugged the hell out of everything else. Took 10 minutes to find where it was =) 10 years won't be long enough to get over the shame...

    1. Re:Pesky 0 at end of every string by matusa · · Score: 2
      Fuck.

      I meant to say
      every time I use any function referenced in <string.h>

      sheesh I regressed talking about regressions. that's depressing
  77. 0 is NOT NULL! by Frank+Sullivan · · Score: 2

    My last day on my first real programming job... hoping to spend it saying goodbye to my friends. But noooo...

    Quick bug summary... there was a BLOB column in a Sybase table, a legacy from some code changes i had done that summer. But nothing was being written to that BLOB, so it shouldn't take any memory, right? Right? Well. The system was a batch workflow that moved a LOT of data. First day of a production run was my last day of work. The system started, and the database started filling - fast.

    Turned out that some ancient library that predated me initialized the BLOB field with 0, not NULL. This caused Sybase to allocate a page (4096 bytes) for the BLOB field. Ouch!

    At least i found the bug before the entire system came to a grinding halt... but it pretty much ruined my last day there.

    --
    Hand me that airplane glue and I'll tell you another story.
  78. vi on Solaris 5.7 still crashes! by greensquare · · Score: 2, Interesting

    I just figured it out. In vi, make a mark named "d" ( for those who are limited out there, do this by simply hitting "m" and then "d", no ":" is required ) next move down a line ( "j" key, or down arrow for the limited ones ) Then hit do a change to that d mark. ( type c'm ) Do this on Solaris and vi will core dump. vim 5.8.7 on Redhat 7.1 seems to be fixed.

    1. Re:vi on Solaris 5.7 still crashes! by msouth · · Score: 2

      mark not set

      (I always use mm, too, though, so I forgive you :)

      --
      Liberty uber alles.
  79. Here's one... by Amazing+Quantum+Man · · Score: 2

    Here's one I inherited.

    We had a system we were building (about 250K lines). If you pounded on it continuously, it ran fine. However, if you left it alone for about 2 hours, it would crash.

    Turns out that there was a bug in the (homegrown) executive's timer queue logic.

    Another one on the same system.... We were just about to go into FQT (this was a DoD contract), and an error code pops up. Now the problem was, that this happened 6 hours into a 10 hour test, that required 8 people to run various machines. Not fun.

    The machines were communicating via tactical radios using analog FSK communications, so what they wound up doing was this: They hooked a stereo tape deck into the system, ran the scenario, and recorded all communications. Then they played it back, only to the system that had the problem.

    The system was running a Z8000 at the time, nice chip but no memory protection. Turns out it was a third order effect (A corrupts B, which causes C to be corrupted, leading to the error), caused by a -1 index being used somewhere.

    --
    Fascism starts when the efficiency of the government becomes more important than the rights of the people.
  80. Completely offtopic by freeweed · · Score: 2

    Yours is maybe the 4th mention I've ever seen online about the good old ICONs. Unisys made quite a powerful little machine for the time, and I wasted many an hour tinkering with some of the (for the time) advanced apps (the vector morphing software was pretty damn cool!).

    Any chance you know where one could accquire one of these rare beasts? I've yet to see one on Ebay, or anywhere else for that matter - and I know they were very common in high schools in Ontario during the 80's.

    --
    Endless arguments over trivial contradictions in books written by ignorant savages to explain thunder in the dark.
  81. beat a-round the bush by Mr+Z · · Score: 5, Informative

    There is no "proper" way to reduce the precision of a number under all circumstances. Each method of rounding or truncating 0.5 has its own pitfalls:

    • Round-to-even, aka. banker's rounding. This is probably the best, since it distributes errors uniformally so as to not cause a long-term average bias. It's also very expensive to calculate as compared to the alternatives.
    • Round (pseudo)randomly. Add an infintesimally small random or pseudo random bias to numbers that end in 0.5. This has the same bias properties as round-to-even, but with less predictability. If the biasing function is just a simple hash of the other bits of the number, though, then at least it's deterministic.
    • Round-towards-zero. (I believe this is sometimes called "unbiased rounding".) For numbers uniformally distributed around zero, this form of rounding tends to also have no long-term average bias. The average magnitude is biased, though, towards smaller magnitudes.
    • Round-towards-plus-infinity. (aka. "rounding up", or sometimes just "rounding".) This is the rounding they usually teach you in grade school -- round 0.5 up. (At least, that's what they taught me until I got to high-school.)
    • Round-towards-minus-infinity. (aka. "rounding down" or "truncation".) This is what you get when you always round down. Right-shifting 2s complement numbers (with sign extend) typically gives you this form of rounding. One nice side effect is that the bias is uniform and so can be made to cancel in some cases elsewhere in your calculation. This technique has the advantage of being the cheapest -- you just throw away bits.

    So, as you can see, there's no right way per se. It just depends on what you're doing.

    --Joe
    1. Re:beat a-round the bush by krulgar · · Score: 5, Funny

      The other strategy is to use "Arthur Andersen Rounding" which rounds all figures up to and including 3,800,000,000.00 to zero.

    2. Re:beat a-round the bush by AndrewHowe · · Score: 2

      Actually they appear to have flipped the sign bit. What a difference a bit can make!

    3. Re:beat a-round the bush by Com2Kid · · Score: 2

      Round-towards-plus-infinity. (aka. "rounding up", or sometimes just "rounding".) This is the rounding they usually teach you in grade school -- round 0.5 up. (At least, that's what they taught me until I got to high-school.)

      I am in college and I can safely say that this is how I am STILL taught to round numbers. In fact my math professors mark students down if they do NOT use that method of rounding.

      In fact until today the only other method of rounding I had heard of was straight truincation, (Just drop the excess digits past whatever point) and using iPart (TI8x).

    4. Re:beat a-round the bush by jcoleman · · Score: 2

      I just wanted to clarify the "round-to-even." I've not heard it called this, but I learned the method in 10-grade science.

      When rounding large collections of numbers, the standard when encountering a 5 is to look at the digit to the left of the 5 (this is the place you're rounding to). If that digit is even, leave it alone. If that digit is odd, round it up. Assuming an equal distribution of even and odd numbers in that place (which you can usually safely assume), you even up with a more accurate set of data.

  82. C/C++ Internal Compiler Error by UnknownSoldier · · Score: 2

    I'm sure everyone has their favorite code that MSVC 6 chokes on.

    fatal error C1001: INTERNAL COMPILER ERROR

    class Test
    {
    public:
    Test();
    };

    Test::Test /* missing: () */
    {
    }

    Anyone know if this bug still exists in MSVC 7 ?

  83. An oldy but a goody by stox · · Score: 2

    This goes way back, but if memory serves correct the original PC-Basic 1.0 interpreter, that was shipped with PC/DOS 1.0, would report that 1 + 1 = 1.999999. Needless to say version 1.1 was shipped shortly thereafter.

    --
    "To those who are overly cautious, everything is impossible. "
    1. Re:An oldy but a goody by DeadVulcan · · Score: 4, Funny

      ...the original PC-Basic 1.0 interpreter, that was shipped with PC/DOS 1.0, would report that 1 + 1 = 1.999999. Needless to say version 1.1 was shipped shortly thereafter.

      If they had a sense of humour, they would have shipped version 1.0999999.

      --
      Accountability on the heads of the powerful.
      Power in the hands of the accountable.
  84. Informix 4GL by EnderWiggnz · · Score: 2

    if you had multiple source files, you had to be sure that you left extra lines at the end of each file, due to the way the files were cat'd together before being processed into C files...

    --
    ... hi bingo ...
  85. the impossible bug by paulbd · · Score: 2
    scenario: a really complex threads package designed to work with Scheduler Activations under Mach. the thread context switch code has to function more like a full kernel-level context switch than a regular user-space one. i can't find my x86 handbook, and i conclude that some of the processor flags don't need restoring. next thing i know, we get bugs like:
    c = 0;
    if (c != 0) then ...
    the test would fail. gdb would report that the memory location and the register containing the value of c was zero. but the test would fail. eventually, i realized that the processor flags i had skipped were the flags for conditional tests, and yes, they did need to be restored. as usual with these things, it seems so obvious in hindsight. but imagine how bizarre it is to have gdb tell you that the register contains the correct value and then discover that the test failed, apparently impossibly ...
  86. Early Adobe TWAIN error by Twister002 · · Score: 2

    I think it was Adobe at least, anyway if an error occured while using the scanner a dialog box would appear with the text

    "Bummer man, there was a TWAIN error"

    --
    "For a successful technology, honesty must take precedence over public relations for nature cannot be fooled." -Feynman
  87. Uninitialized memory lines by leifw · · Score: 2

    I worked on an embedded box that had a problem keeping track of time across reboots; that is, it kept time fine until you rebooted it, and then it reverted to some other wierd time. (Actually the situation was more complex than that, but for brevity...) Anyway, turns out that the problem was that when we tried to read from the hardware clock (which reported time as a series of BCD digits) the memory (or bus or whatever: IANAH(ardware)E(ngineer)) lines which were connected to the bits that were never used, such as the upper two bits of the 10s place of the hour, were high when the box was turned on and were never initialized back to a low state and those bits weren't masked off when we read the time, thus, when we did error checking on the time, it turned out to be invalid.

  88. Here's the specific book by swagr · · Score: 2

    if anyone cares.
    I don't know if this is a fixed reprint or not.

    Data Structures and Their algorithms

    --

    -... --- .-. . -.. ..--..
  89. Web Developer by nick_davison · · Score: 2
    Memorable bugs. Every developer has one. What were yours?

    I'm a web dev, so I'll go with: Netscape. Any 4.x version.

    I don't think there's much point in trying to get more specific than that. Still, if you really force me, for out and out stupidity, it's a cross between:

    • When assigning borders in CSS, under certain circumstances, it'll duplicate all bar the S in style of the tag. So you end up with <div Style="blah"><div Ttyle="blah"> instead of the single tag.
    • The other stupid one goes to its handling of Java applets where, if they're inside divs, it regularly forgets that, when you leave the page, it'd be a really good thing to close them too. As a result you end up with music continuing to play or flash animations continuing their image updates over the next page you visit (Flash being, essentially, just a java applet).
    I'm not even bothering to go in to page sizes that have to be multiples of 3, inconsistent syntax or the things it just plain doesn't support.

    Yeah, IE is bad, but it tended not to be so rampantly insane.

    Moderated: -5 Daring to choose MS over anything else on Slashdot.

  90. html/css background colors by Ravagin · · Score: 2

    In the mad, mad world of Netscape 4-series' horrible CSS implementation, one of my favorites is in background-color (or any color property). If it encounters a string, it assumes it is facing one of the vast pantheon of "named colors" and insists on inteprreting it as such - which is handy for typos but not valid CSS like "inherit." Got a demo here, which links to a demo of similar behavior in all modern browsers as well as ns4.

    Another excellent bug is in Opera. If an A element is set as block-level - that is, you give it display: block; - it will suddenly have an overline. The underline will disappear, and an overline will take its placed. So, if you're display: block'ing your A's, you gotta be specific about text-decoration (fortunately, most block A's are for sidebarish type things which will usually have text-decoration:none; anyways, but it's still a pain in the bum

    --

    Karma: T-rexcellent.

  91. Re:Not a bug by spitzak · · Score: 2
    The mistake with this argument is that '0' is in *both* the round-down and round-up sets, making them unequal in size.

    Another way to look at this is to make sets of only the numbers that change, then '0' is not in *either* set, so they are again unequal in size.

  92. Ah, the lessons of youth by Jahf · · Score: 2

    I tried to report this same issue regarding Javascript 1.0 waaaaaay back when that was something new. I got completely trounced on the newsgroup I posted to (interestingly, the person responsible for the implementation was the only one who was reasonably nice in his explanation).

    Lucky for me /. didn't exist then ... it was embarrassing enough to get trounced by developers on a reasonably obscure newsgroup :)

    --
    It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
  93. Hmm. My favorite bug by i_am_pi · · Score: 2, Interesting
    in win2k/xp

    #include <stdio.h>

    void main() {
    printf("\t\b\b\b\b\b\b\t");
    }
    Can you say "Bluescreen"?
    Pi
  94. Mozilla bug by vladkrupin · · Score: 2

    http://bugzilla.mozilla.org/show_bug.cgi?id=35011

    Quote from the bug:

    I'm glad to see that this bug hasn't been left to the wayside. If there is any
    chance that this will not be finished for 1.0 I'm willing to sponsor it, if that
    helps. I don't have much money but could probably sponsor the bug for about $500
    USD, if that is what it takes to get it finished for 1.0


    And several more developers claiming that they have been (privately, in email) offered money to fix that bug.

    Is this a new way to make money in the open source realm or what?

    --

    Jobs? Which jobs?
  95. Most annoying to me. by thesolo · · Score: 2

    Back when I still ran Windows, I used Windows 2000. One of the most annoying bugs I found was one with Mozilla installed as the default browser.

    What I usually did was hit the windows key to bring up the start menu, go to the run line, then type in a URL and press enter. This loads your default browser. However, a certain Win2k security patch (I forget which one, it's been a while) would break this behavior; pressing enter would still load Moz to the page I typed, but immediately after I would get an Error Dialog from Windows saying that the location could not be opened. Mind you that if IE was the default browser, this wouldn't happen.

    Not only very annoying, but it took a very long time to figure out which patch caused the break. It also seemed very dubious, as it only caused the error when a browser besides IE (I've heard it did this with Opera too) was the default.

  96. How to BSOD Windows.. by molo · · Score: 3, Interesting

    This program will crash Windows NT with a BSOD. This works on NT 4, Win2K, and WinXP from an *unprivelidged* account. There is no known fix available from MS.

    main () {
    for (;;) {
    printf ("Hung up\t\b\b\b\b\b\b") ;
    }
    }

    More information is available at:

    http://homepages.tesco.net/~J.deBoynePollard/FGA /c srss-backspace-bug.html

    This is why I don't run windows.

    --
    Using your sig line to advertise for friends is lame.
    1. Re:How to BSOD Windows.. by huh_ · · Score: 2, Interesting

      Also, In Windows 2000, go to the command prompt, and cd to a directory with lots of files. Do a dir, and while its scrolling past, press F7,Enter,F7,Enter.. over and over.. It crashes every damn time.

    2. Re:How to BSOD Windows.. by JanusFury · · Score: 2

      It's a buffer overflow in CSRSS.exe - The console service. It seems like CSRSS hasn't changed in like 5 years. As I understand, it comes from an error which is detected (trying to write before the beginning of a buffer), but not handled.

      --
      using namespace slashdot;
      troll::post();
  97. Binary representation by jmv · · Score: 2

    'round(82.845)' returns '82.84' instead of '82.85'

    OK, my guess is that since the value is stored in binary, 82.845 is not a rational number anymore and it is stored as 82.849999... Rounding that to 82.84 would then be correct.

  98. Re:Apple IIe by spitzak · · Score: 2
    I think the bug you are talking about exists on the most modern machines. The problem is that .1 cannot be accurately represented in binary floating point. Adding it 10 times produces a number that is less that 1.0, though the output functions will usually round it so it prints 1.0.

    On a i686 running Linux and using gcc this program:

    void main() {
    double i;
    for (i = 0; i < 1.0; i += .1) printf("%g ", i);
    }

    Produces this output:

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

    Notice that it printed "1" even though it looks like it shouldn't.

  99. The answer ... by triptmind · · Score: 2, Interesting

    The reason that round "isn't working properly" is the law for rounding when the last digit is a 5, is to round to the nearest even number. That is one of the 4 main rules for significant digits. Here are some examples of this rule.

    85 = 8 x 10^1
    80.35 = 8.04 x 10^1
    80.25 = 8.02 x 10^1
    125 = 1.2 x 10^2
    135 = 1.4 x 10^2

    Test these examples, you'll find they're all correct. As for favorite bugs of mine, I just love the bugs that I DON'T have. =)

    --
    // TRiPTMiND \\ ... Yet again, proving that logic and reason should never be confused with emotion.
  100. Perl 5.0something $_ by Ender+Ryan · · Score: 2
    There was a funny scoping problem in Perl, where in some cases $_ would sometimes get wacked after calling a function that used it's own $_.

    Took me forever to figure it out, becaue $_ wouldn't be left with something the function set it to, it would be... blah, forget, nonsensical. To get around it I had to use a temporary variable and set $_ to it's old value after calling the function.

    There were 3 cases where I saw this bug, I haven't noticed it in any recent versino of Perl.

    Anyone else ever see this bug?

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  101. Pentium Floating Point Error by cybermage · · Score: 2

    We are pentium of borg, you will be approximated.

  102. In all seriousness, random libs *suck* by edremy · · Score: 5, Insightful

    random() only returns 666 if you use a demon seed!

    My favorite "bugs" are the truly horrible random number functions in almost every single language library on earth. They're usually linear congruential generators: fast, but utterly useless for any work that requires serious "randomness" such as Monte Carlo simulations. They have very short recurrence times, strong sequential correlation, etc.

    Back in grad school, I had to substitute the Knuth ran3 routine for the supplied C library functions in both gcc and xlc since they were just awful.

    Fast forward 8 years. I made the stupid assumption that since Java was a new language and that horrible problems with random number generators were well known that Sun would actually provide a decent RNG. Nope: just as badly flawed as the C one.

    I suspect this is simply something to give up tilting at windmills about: random() is good enough for simple games and anyone doing real work knows to stay the hell away.

    --
    "Seven Deadly Sins? I thought it was a to-do list!"
    1. Re:In all seriousness, random libs *suck* by ajs · · Score: 2

      On most modern UNIX-like systems there's a /dev/random which gives you the result of operating-system collected entropy from various timing-related operations which the OS performs anyway. You can just read as many bytes from it as you need.

      Under Linux, at least (and I think a few other systems), there's also a /dev/urandom, which will give you the same output as /dev/random, until it runs out. In the case of /dev/random, it will block until more is available. /dev/urandom is like doing a non-blocking read on /dev/random, and using the last value as a seed to the library random function if nothing is returned. This works out to be fairly usable for most applications, and is at least an order of magnitude better than just using the library random function.

      I'd love to see a study of how frequently you need entropy to keep the urandom scheme within a given tolerance. Then, perhaps we could have a /dev/rurandom that would not block some of the time, but would have a constraint for just how pseudo-random it would allow itself to get. I suppose I could just write a wrapper function for it....

    2. Re:In all seriousness, random libs *suck* by morcheeba · · Score: 2

      I was debugging a vender's fibre channel driver, supplied of course, as just a binary file and a few hook-like functions I could modify. I got a filesystem working over the fibre channel/SCSI, but using their functions, the individual block read/write test didn't quite work... the first 3 bytes were always wrong. I called the company, and they said, yeah, the first 3 bytes were always wrong, it's close enough.

      I did a little more investigation and looked at their self-made pseudorandom number generator. It produced numbers like this:
      35, 84, 17, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ...

      They were never returning any data - it mostly matched because the first block written looked just like the last one. I still don't know how or why the filesystem worked on it (even though it was calling the same basic functions)...

    3. Re:In all seriousness, random libs *suck* by fferreres · · Score: 2

      Well, it wasn't random then :) unless you where playing Quake or something like that.

      --
      unfinished: (adj.)
    4. Re:In all seriousness, random libs *suck* by edremy · · Score: 2

      Oh? Do you have some information on weaknesses in Java's SecureRandom class

      I was doing this in about 1997. I don't think SecureRandom was available then.

      As far as the random() generator then in use, it was quite a shock to me to see my simulation run for a few thousand timesteps and suddenly have all of the particles line up on a neat grid. Wait a few thousand more steps and it would happen again.

      It wasn't anything critical, just a little simulator for teaching purposes, but I just couldn't believe they didn't use a decent random from the very start.

      --
      "Seven Deadly Sins? I thought it was a to-do list!"
    5. Re:In all seriousness, random libs *suck* by leshert · · Score: 2

      On most modern UNIX-like systems there's a /dev/random which gives you the result of operating-system collected entropy from various timing-related operations which the OS performs anyway. You can just read as many bytes from it as you need.

      Hmm... must be how you define "most". Of the Unices I use (Linux, Solaris 2.7, Solaris 2.8, AIX 4.3, HP-UX 10.2, HP-UX 11.0), /dev/random exists only on Linux. Makes generating UUIDs a pain.

    6. Re:In all seriousness, random libs *suck* by ajs · · Score: 2

      Actually, it is. The data that's gathered is based on anomolies in interupt timing and such. It doesn't have to do with what you do so much as the fact that you're forcing an A/D converter to generate interupts. There's always noise generated in that process.

    7. Re:In all seriousness, random libs *suck* by ajs · · Score: 2

      Huh. Well, it did exist under one of the BSDs (I assume all at this point, but not sure). I also thought Solaris had one. Guess I was off. Sorrry.

      Certainly, it's a feature that all of the UNIXen should have. Randomness is one of the last things that the OS has access to, but does not give up easily.

      There is a module for Perl that does some interesting timing tricks to pick up high-quality randomness. I think the module is Math::TrulyRandom, but you can just i/random/ in the CPAN shell (perl -MCPAN -e shell).

    8. Re:In all seriousness, random libs *suck* by leshert · · Score: 2

      I also thought Solaris had one.

      Rumor has it that there will be a good one in Solaris 9, but no word on whether it's /dev/random or a syscall.

      In the meantime, the workaround I'm using is to collect various system statistics, stir with SHA-1, and use that as a seed for a good PRNG (I'm debating between Yarrow and the Mersenne Twister right now).

    9. Re:In all seriousness, random libs *suck* by Reziac · · Score: 2

      There was a case a few years ago (which I only learned of because I knew the engineer who discovered the problem), involving certain coin-op gambling machines that are legal in California, where the random numbers fell only on HALF the grid. So half the potential results could never come up as winning numbers, cutting your odds of winning in half.

      The company's response was "Oh my ghod, better not let that get out!" but at least they didn't exploit it to deliberately prevent anyone from winning, which could have easily been done. BTW they went out of business shortly thereafter (due to unrelated problems).

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  103. Good Grief. by astroboy · · Score: 2
    In the past year or so, our team has run into bugs where compilers, trying to optimize, would skip loops insead of unrolling them. Or would optimize a function call within another function call into nothing if you tried to use interprocedural analysis. Or wouldn't let you pass pointers to functions in modules. Or just randomly give wrong results for reasons we still don't understand, and the vendor doesn't care.

    We've ran into hardware bugs that kept crashing a Linux cluster. We've had OS `upgrades' that made P^2 point-to-point communications more efficient than log P collective communications. We've had debuggers that crash. Profiling routines which don't, due to library incompatibilities. I/O libraries with bugs. SCSI controllers which eat a RAID periodically.

    And your worst bug, the bug that took you forever to figure out, was that the rounding behavior of a round function was something you hadn't understood, and which the top result of a Google search explains completely?

    AARRRGGGHHH!!!

  104. Borland C++ variable values incorrect by cjhuitt · · Score: 2, Interesting

    One of the most frustrating bugs was one I encountered in an early programming class in college. I had finished my program, and was testing it. Of course, it wasn't correct. I fixed every bug I could find, but it still wasn't correct.

    So, not knowing about fun things like debuggers, I started putting some cout statements in the code, to check the value of variable at different locations.

    The variables were all correct. And so was the output.

    I started removing cout statements, and found out that when I removed one particular statement, the program started giving incorrect values again.

    Print the value, program output was correct. Don't print the value, it was incorrect.

    So, I experimented some more, and found that I could do a variety of things, such as swapping a couple of my statements, and the program ran correctly without the output of the value.

    I pretty much forgot about this, until another class a couple of years later. We were using the same compiler (I beleive it was Borland 5), and I found the exact same problem. This time, however, I couldn't swap statements around to get it to go away. I needed a statement that would do nothing.

    So, I gave up and assigned the variable to itself. (i = i;).

    Imagine my surprise when the program worked correctly. I brought over my TA, and she couldn't make heads or tails of it either. But every time, if that assignment was commented out, the program was wrong, but if it was left in, the program was correct.

    I eventually learned about pipelined instructions, and how a compiler has to be careful that a memory address has the correct value before using it for another statement. I'm pretty sure that's what was going wrong, but I always remember my magical solution of assigning a variable to itself to make it the correct value.

  105. glib and sprintf by Crutcher · · Score: 2

    I was developing a library which used glib for some of its module code, and while I was at it, I used it for the string functions as well.

    Well, my library was crashing, hard, in the middle of a complex io cascade (read some file, and decided to load a module to read some other file based upon istructions in the first file, etc.) and I had checked and rechecked and rechecked the code. The code was correct, but the damn thing was crashing.

    And it was crashing in some of my code, which was _perfect_ (I spent like 3 days on this, that code was checked, bracketed on both sides fully by debug statements, etc.).

    Oh, and there had been perfect output from the program up to that point. So, getting another hacker to take a look at it, someone much more familiar with glib (One of the maintainers, actually) it was determined that using the %a format in my output was hosing not the print function, because glibc understood the C99 format character for printing floating and double point numbers with out loss, but in the glib code which estimated memory bounds on string operations before calling through to the underlying sprintf implementation. So the heap was getting corrupted, but it was printing out the correct value.

    And then it died later, in my code, when it triped over that heap problem. Much profanity was involved.

    --

    -- Crutcher --
    #include <disclaimer.h>
  106. here's one... by msouth · · Score: 2

    On my computer there's a thing called "gcc". IT seems to be something that causes people to write code with buffer overruns and stuff...

    --
    Liberty uber alles.
  107. feature or bug?! by mrm677 · · Score: 2

    I recently built a new system using a FIC AN11 Stealth motherboard. Since it was for a non-geek friend, I installed Windows XP.

    When the machine is shut off, either through software or the "soft" power button, the motherboard still provides power to the PS/2 ports. Therefore, the optical mouse and the keyboard are still lit up!!

    A quick search in Google Groups revealed to me that this was not a defective board and is a "feature" (I'm now told that FIC has since released a BIOS update to turn this "feature" off)

  108. My Favorite by telstar · · Score: 2

    Pretty much all of Netscape ... especially the 4.x breed.

  109. Adobe Photoshop on the Mac by Fez · · Score: 2, Funny

    Has a rather funny error message when you try to run an older version of Photoshop on a very new Mac (G3 or later).

    Check it out.

  110. Its fun to crack on VB by SloppyElvis · · Score: 2

    Very Brittle is an understatement.

    I was working on a project using VB *sigh* a few years ago when I discovered a very peculiar bug. In order to get a form to appear, I was forced to call DoEvents() - TWICE IN A ROW!!!! I guess VB thought I didn't mean it the first time.

  111. Quake 3 Mods by MeowMeow+Jones · · Score: 2

    I was writing a Q3 mod, coding in VC++ and then compiling with the bytecode compiler (LCC I think?). Code was working perfectly as a .dll and crashing as the bytecode. I couldn't do any real debugging; that's what the DLLs are supposed to be for.

    Turns out I was being an idiot and using an if statement with variable == "string" instead of !strcmp(variable, "string")

    VC was smart enough to optimize the code and factor out duplicate entries from the string table. So in the DLL, I was comparing two pointers that (ultimately) pointed to the same location. LCC wasn't smart enough to do this, so it was pointing to two different memory locations that just happened to contain identical strings.

    DOH!

    --

    Trolls throughout history:
    Jonathan Swift

  112. Great. by Erris · · Score: 2
    VB is right because i386 is wrong. Or is it because VB displayed the number incorrectly to begin with? When you slip into the confused and closed world of M$ BS, 2+2 might be 3, 4 or 5.

    It's a bug, but the platform is irrelavent.

    --
    DMCA, Hollings, Palladium. What might have sounded like paranoia is now common sense.
  113. more of a miscalculation than a bug by happyclam · · Score: 2

    Here's one we are all familiar with. I suspect it occurred because the engineers involved used Visual Basic for their calculations and design work.

    the "bug"

    --
    He looked at me and said, "Kid, we don't like your kind, and we're gonna send your fingerprints off to Washington."
  114. I found this horrible bug.. by digidave · · Score: 2

    Bad bug: If you boot from the Windows XP CD... it installs Windows!

    --
    The global economy is a great thing until you feel it locally.
  115. Re:Not a bug by Asprin · · Score: 2

    I hope your post is a joke. You round 0 down? To what?

    My apologies if I missed the sarcasm. I was always taught to round 5s to the nearest even digit.

    No, not a joke - I'm serious. This is pretty basic (and common) mathematic thinking. In fact, it's starting to bug me how many people (including the brainiacs at MS) are in your camp on this. Ultimately, I believe the problem is that the intellectual neophyte that came up with this idea forgot to consider the case where ROUND() hits a zero digit, so (of course) the statistics are off and he tries to correct by 'splitting' the case where ROUND() hits a 5 digit. Stupid. It's a perception problem more than anything else, but it does expose a lack of formal mathematical training because (believe me) these kind of 'trivial' cases come up *all* the time in formal function definitions.

    Yes, you round 0 'down' to 0. What's the problem - ROUND(0) isn't defined? There are ten digits between 0 and 9 (inclusive). The ROUND() function divides this space in half - half of the digits can be considered rounding down and half of them rounding up. There is no need to consider 0 an exclusively special case and start pulling statistics (of all things) about the number 5 into this. If it bothers you that ROUND(0) is considered rounding down, I'm not sure what to tell you, except that rounding YOUR way divides the rounding possibilities into three categories (up, down, none) that throw off the statistics even worse because neither the up OR down case ever hits 50% utilization. (Nobody seems too concerned in this debate what percentage of the cases shouldn't be rounded at all!)

    My basis for defining ROUND(0) as ROUNDING DOWN is based entirely on understanding what the rounding function actually does. (Ironically, I best learned this taking lab measurements in physics, not math.)

    More formally, it's a bit easier to see if you define your rounding function something like this:

    ROUND(X) = TRUNCATE(X+1) if tenths digit is 5,6,7,8,9; TRUNCATE (X) otherwise.

    In my opinion, you were taught incorrectly.

    --
    "Lawyers are for sucks."
    - Doug McKenzie
  116. Re:Not a bug by avalys · · Score: 2, Insightful

    Zero is rounded down? I suppose that's true, in the same sense that ten is rounded up.

    --
    This space intentionally left blank.
  117. Re:It IS 83.84 by mindstrm · · Score: 2

    It's not necessarily 'correct'.

    It's one way of rounding, I *think* used with large statistical sets to reduce overall rounding errors.

    It also creates problems though, so using it to say, rounding for sigdigs is wrong.

  118. Re:Not a bug by Anonymous Coward · · Score: 2, Insightful
    Your reasoning is correct for numbers drawn from a continuous distribution, but in life, we usually have some end to our decimal representation. This is where the rounding bias is introduced. The fewer places of accuracy before rounding, the bigger the bias.

    Consider the case in which you only have one digit of precision to the right of the decimal. Consider the set {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}. If you sum these numbers, you get 4.5. If you round using your method and then sum, you get 5. If you round using the "round down when the whole number part is even" method, you get 4. Each method has the same amount of error.

    Now consider the set {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.6, 1.8, 1.9}. If you sum *these* numbers, you get 19. If you round using the "5 always goes up" method and sum, you get 20. If you round using the "round down when the whole number part is even" method and sum, you get 19. One of these methods is not biased...

  119. Re:seriously by Bouncings · · Score: 2
    And really, if you had any programming experience and didn't think of putting & in front of a variable to get a reference, should you be programming?
    Anyone who designs a language that every copies an object implicitly should be banned from using a computer. I take it you're used to design of C and C++, which although similar to PHP, are less crackheaded. Every C++ programmer worth is salt doesn't use objects directly, he uses pointers and -> operators. This can't be done in PHP, especially if you plan on using PHP's internal functions on your objects.

    Unlike PHP, most other languages that do this don't do it internally either. You can't use PHP internal functions like sort() because they copy object. You can't do variable assignments: $object1 = $object2 and get a proper result.

    It's never OK to implicitly copy an object. Ever. And the people who designed PHP did later correct their mistakes somewhat in the latest version of PHP, so that object assignments are real assignments, not duplications.

    --
    -- Ken Kinder ken@_nospam_kenkinder.com http://kenkinder.com/
  120. Memories of ICONs. by Christopher+Thomas · · Score: 2

    Ah, Icons.

    The ones at my old high school were especially badly maintained. When we finally switched to PCs, I wrote a TSR that used palette shifting to fade text in and out like the dying monitors on the Icons we had to use earlier :).

    Much nicer games than the PCs initially had, though.

  121. Apple III by cant_get_a_good_nick · · Score: 3, Funny

    I didn't have one, but I heard from our Apple tech guy.

    The Apple III was a much unloved "business" computer, essentially a business upgrade to the Apple ][ line. It was pretty expensive, $4k I think, which helped it be unloved.

    It had some loose connectors in some of the chips. They weren't very snug in the bboard and could get loose. The Official Apple solution was to put the Apple on a hard surface, lift the front to roughly a 45 degree angle, and drop it to reseat the chips. I can imagine the look on the face of the owner upon seeing their expensive comp wandering to the the back room, a loud THUD, then returning with it "fixed".

    1. Re:Apple III by sheldon · · Score: 2

      Common practice back in those days when chips were socketed rather than surface mounted.

      On my Amiga 500, every time I would transport it from school to home or back, I would have to open up the case and press down on all the chips to reseat them.

      It seemed dependent a lot on how much the case might flex... the larger the circuit board the more likely this was. For instance on my VIC-20 I hardly ever had this problem, maybe only once or twice.

  122. My favourite bug by Subcarrier · · Score: 2

    My favourite software bug
    has eight spindly legs
    cut one off
    it will grow two more.

    My favourite project
    is the ointment of my soul
    and my favourite bug
    is the fly in it
    laying thousands and thousands of eggs.

    My favourite bug
    keeps me company at night
    in my nightmares
    snuggling between the lines
    comfortable in the software.

    Going nowhere.

    --
    "I have opinions of my own, strong opinions, but I don't always agree with them." -- George H. W. Bush
  123. Re:Apple IIe by kallisti · · Score: 2

    The Radio Shack CoCo had a similar parser problem. The basic commands "GOTO" and "GOSUB" were combined together into the tokens "GO", "SUB" and "TO". I wrote a simple dungeon program using the variable "GO", which failed to work at all. Changing the "GO" variable to something else fixed it. It was much later that I found out why.

    Ah, the days of two letter variables...

  124. Printer catches fire bug by metalwheaties · · Score: 2, Interesting
    WAY back in the old line printer days, a former coworker of mine worked as a summer intern at DEC. He was screening bugs in TOPS10 - a mainframe OS in the 70s and early 80s. He got a bug report, with attached tape containing a binary file, that complained: When the attached file is printed on the line printer, the printer catches fire. The REPEATABLE box was checked!

    It seems that a lazy computer operator (remember those guys?) didn't like getting up from his chair to separate the users' print jobs. So, laziness being the true mother of invention, he created a job trailer banner page that included hundreds of overstruck lines completely filled with "_" characters. These had the effect of hammering a line across the paper that eventually cut the paper off at that point.

    Apparently, the drum printers of the day couldn't survive hitting all solenoids simultaneously on every rotation of the drum, so they were overheating, causing (at least) some serious smoking, and maybe a bit of excitement.

    1. Re:Printer catches fire bug by sweet+reason · · Score: 2

      i once worked with a cheap little dot-matrix printer with the same feature.

      it printed 80-char lines. it also had a wide-char mode, which did 40 chars. if you put it in wide mode and printed more than 40 chars on a line the print head hit the right-end stop and sat there smoking! i made a couple of mad dives for the power cord after accidentally printing binary files.

      --
      Everything should be made as simple as possible, but not simpler. -- A.E.
  125. Apple instructor pointer invalid by Kurt+Gray · · Score: 2

    Back in high school, computer programming class using Apple IIe, class is learning to type simple 5 line programs, I'm in back of the class keying code for a space invaders game, the teacher is explaining to the class how to swap the values of two variables (my syntax may not be Apple ][ compliant but it was something like this)

    10 $A = 10
    20 $B = 20
    30 $A = $B
    40 $B = $A
    50 PRINT $A
    60 PRINT $B

    ...so the class enters this code and runs it and everyone sees "20 20" on their screen instead of "20 10" and the teacher for the life of him can't figure what the problem is... so I let them discuss it for while I'm tweaking my game code and eventually I go to the board and write

    A = C
    A = B
    B = C

    The class was baffled that alogrithm worked, so was the teacher. This is why there will always a job market for computer programmers.

    1. Re:Apple instructor pointer invalid by Yunzil · · Score: 2

      A = C
      A = B
      B = C

      The class was baffled that alogrithm worked, so was the teacher.


      So am I, since it's wrong. :)

    2. Re:Apple instructor pointer invalid by edrugtrader · · Score: 2

      C=A
      A=B
      B=C

      this is why there will always be layoffs.

      --
      MARIJUANA, SHROOMS, X: ONLINE?! - E
  126. How about real bugs in the system. by Allnighterking · · Score: 2

    two for you.

    1. 1988 somewhere in a Gov installation on the East Coast of the US: I enter the Switch room (Telephone) and find that all 3000 of the relay's in the switch are opening and closing in sync with the clock relay. Phone calls are going through.... but it's still not right. 48 hours later we find the problem. A large wood roach had crawled across a -48Vdc connection point grounded himself out and ... yep bug in the system.

    2. Microwave tower: Operators noticed that the secondary antenna began degrading rapidly over a two day period. All testing lead to the belief that something must be wrong with the antenna horn. So an antenna team was dispatched to check out the horn. Fortunately when they got up there and before removing the cover someone first noticed a loud buzzing sound, and then a small hole near the top had a lot of.... yep BEES comming out of it and going into it. A peak under the cover reveiled that bees had decided that setting up housekeeping inside the cover was a good idea. The hole they were going through was known but since it was less than 1/8th inch in size originaly it fell under the size needed to "demand" a replacement. The bees did manage to both enlarge the hole slightly and use it to set up a huge nest. Next day.... beekeepers where found to begin learning how to climb up a Tower to get rid of the bees... (Note the Honey is a bigger problem than the bees, without bees to keep it cool you have a HUGE runny mess.)

    --

    I'm sorry, I'm to tired to be witty at the moment so this message will have to do.

  127. My favs... by StevenMaurer · · Score: 2
    In my extended career, I've seen so many bugs I've seriously given thought to writing a book about them. Most of the worst ones have to do with hardware. Here are some of my favorites:

    Random Static Variables
    In some primitive embedded OSes, there is no initialization of globals and statics to zero. This can cause havok when you're trying to port programs.

    Registers that refuse to latch
    "I'm sorry, but sometimes when you write the hardware register, the value doesn't take if the hardware is sufficiently doing something else - we're not going to turn the board, can you fix it?"

    Leads to code like this:
    do *reg = newValue;
    while ( *reg != newValue );

    Interrupts that don't
    'Nuff said.

    Hardware interrupts sometimes need more processing than CPU can deliver before the next interrupt comes along.
    This one is a beaut. Wierd things happen in your system, and you have no clue where to look.

    "Did I mention, in order to perform this HW feature you have to turn off memory refresh?"
    There is only one solution to this - murder the HW designer.

    Maybe next time I'll talk about the top dozen software bugs.

  128. ARRRRG! by namespan · · Score: 2

    Arrrrrrggg! That was the problem?!??

    (Used to write on Linux and BSDI and Solaris, remember distinctly that the Linux version would break for no apparent reason)

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  129. Jet Database and ASP by Tablizer · · Score: 2

    If you did sequential SQL executions in ASP using Jet with ADO, the second SQL command would not "see" changes made by the first one sometimes. After tons of digging around and playing with configurations and transactions, I found the following phrase in a remote MS document: "This caching behavior cannot be turned off." (paraphrased)

    My work-arounds grew real messy and CPU intensive.

    Rumor has it that they decided that fixing it would cut into MS-SQL-Server sales. Their biggest competitor is themselves.

    1. Re:Jet Database and ASP by Tablizer · · Score: 2

      (* Actually I was just using Access 97... I 'm not sure if I got the details right. But I remember it took me quite a while to figure out what was going on. *)

      Do you mean in ASP using Access files, or in Access itself?

      By "figure out what was going on", are you suggesting that you fixed the delay/cache problem, or that you only figured out there was such a limitation of the engine?

  130. Re: C=A, duh! by Kurt+Gray · · Score: 2

    ... and that's why there also be a job market for debuggers!

  131. Demon seeds by Gulthek · · Score: 2

    They're like walnuts, only evil!

  132. 6800 DAA instruction by Milalwi · · Score: 2

    A Long time ago I was working on a project which was being built on a pair of single-board Motorola 6800-based computers. (Yes, 6800.)

    I was in charge of some of the display code. The unit would display results on a thermal printer and an LED display. The problem was... the results were displaying as random junk.

    A fellow undergraduate working on the project and I looked long and hard at the code, but everything seemed ok. Then, after about an hour or staring at the code, one of the grad students on the project came up behind us. This fellow pointed at something on the screen and said "You can't do that" and walked away. We stared at the screen and it hit me...

    The 6800 had two accumulators, A and B. They were identical except... you couldn't do decimal conversions in the B accumulator! I had forgotten that DAA was Decimal Adjust AccumulatorA, not Decimal Adjust Accumulator. Duh.

    A quick breese through the editor, a run of the cross-assembler, and a long time manually punching hex codes into the EPROM burner (no sense buying an interface to the burner when you have free undergrad workers!) and the display unit worked!

    I don't think I'll ever forget that one.

    Milalwi

  133. The GPL Bug by barnaclebarnes · · Score: 2

    Its gone and infected every single line of code I've written for M$ Windows!

    --
    [Please type your sig here.]
  134. Re:Not a bug by mikeee · · Score: 2

    Ok, here's an exercise:

    For a = 1 to N
    x = random (1.0, 100.0)
    round_sum += round(x)
    whole_sum += x

    I assert that if you use the rounding algorythm you describe, round_sum and whole_sum will diverge as N gets bigger, and that this is a bad thing. This will not happen with the other method.

    The problem isn't our lack of formal mathematical training, trust me...

  135. My favorite bug isn't by evilpenguin · · Score: 2

    My favorite bug isn't actually a bug, but I do consider it something they should have addressed when they did the ANSI standards work on C.

    The failing program contained a fragment like this:


    switch (someResultCode) {
    case SOMECODE_01:
    ...
    ...
    break;

    case SOMEOTHERCODE:
    ...
    ...
    break;

    otherwise:
    fprintf(stderr, "Unknown blamnitz in the framitz\n");
    break;
    }


    Do you see the problem with this yet? Four well experienced C programmers (including myself) were given this fragment by a C newbie who couldn't figure out why he was getting funny results (the cases actually did calculations, not ellipses and an fprintf).

    We stared at the code for hours. It compiled cleanly, no errors no warnings (from our compiler -- some do flag this with a warning these days).

    The problem is the newbie wrote "otherwise" instead of "default." We all read what he meant, not what he typed. I think we all also assumed you would get a compiler error if you misspelled this keyword in a switch. The trouble is the C grammar merrily accepts this error as a label (the target of a goto. You know, those things they tell you never to use?). So we have a block of code with an "otherwise" label, but the switch has no "default" case.

    Personally, I wish ANSI had required that labels be declared. It wasn't that radical a departure from what had come before in the evolution of C, and it would have flagged this kind of error right away ("Undeclared label "otherwise" at line XXX").

    Does anyone know if the (was it the X3J11 committee? That rings a bell anyways) ANSI C committee ever considered this, and if they did, why they rejected it? Other than breaking old code, what good reasons exist for NOT requiring the declaration of labels?

    So, my compiler bug isn't really a compiler bug, but I think it should be!

  136. Not actually a bug per se by Desperado · · Score: 2

    this is not exactly a bug but it's still my favorite...

    A programmer at a major aerospace company modified the UNIX login to have a little man dance
    across the screen of the first workstation logged in each day. This was an amusing and well liked "feature".

    However nothing is forever and one day workers couldn't log in. The login would get the username and password and just hang.

    You've probably guessed this had something to do with the little dancing man, and you're right but it took a very long time to figure out. All the workstations had been upgraded over the week end, the dancing man could not dance across the new screens. No dancing man, no login.

    Now all that needed to be done was login and kill the little sucker. Log in? Well there's the rub, no one could.

    An exhaustive search finally turned up a locked office that hadn't been upgraded to the new workstation.

    Login accomplished. No more dancing man.

    Lesson learned.

    --
    If you're not living on the edge, you're taking up too much space.
  137. Re:Not a bug by Dirtside · · Score: 2

    0 doesn't round to anything -- it stays unchanged, as 0. If you round 0,1,2,3,4 down and 5,6,7,8,9 up, you end up with a small upward bias, because *on average*, your rounded values will be higher than your non-rounded values. If you round 5 to the nearest even digit, then your rounded values will average to the same as your non-rounded values, which is clearly better.

    I wrote a simulation in PHP to see which rounding method is more accurate. Even rounding was an order of magnitude more accurate (about 0.01% off, vs. 5-up rounding being 0.1% off).

    Try it yourself. Take a random set of numbers and see which are, overall, more accurate given one method or the other.

    --
    "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
  138. Re:I spend a lot of time on this one by msouth · · Score: 2

    I didn't see any problems, ran the code and worked as expected. any more details? did you have problems with char/int interpretations?

    I tried this and it did what I expected (as written here, garbage come out for v, if you toggle the commenting you get 6):

    #define OP_MULT '*'
    #include <stdio.h>
    int main(void) {

    int v;
    int a = 2;
    int b = 3;
    //int op = '*';
    int op = '-';

    switch(op) {
    case OP_MULT: //operator *
    v = a*b ;
    }
    printf ("op is %c, v is %d\n", op, v);
    }


    --
    Liberty uber alles.
  139. Things that SHOULD be a bug... by wdr1 · · Score: 2
    This got me early in my Perl days. At first I was excited because I thought I had found a *genuine* bug in Perl:
    all_show_me("please", "fire", "timothy");

    sub call_show_me {
    &show_me();
    &show_me;
    }

    sub show_me {
    my ($a, $b, $c) = @_;

    print "a = $a, b = $b, c = $c\n";
    }
    Results in:
    a = , b = , c =
    a = please, b = fire, c = timothy

    Before submitting the bug report (and looking like an idoit), I dig some digging and found this in Programming Perl (section 2.7):

    Subroutines may be called recursively. If a subroutine is called using the & form, the argument list is optional, and if omitted, no @_ array is set up for the subroutine: the @_ array of the calling routine at the time of the call is visible to called subroutine instead. This is an efficiency mechanism that new users may wish to avoid.

    Personally, I don't really buy the efficeny argument. I understand in recursive programming it could be perceived as a big savings, but let's look at how much time it actually saves:
    use Benchmark;

    timethese(100000, { 'Fast' => sub { &allegedly_fast("fire ", "timothy") },
    'Slow' => sub { &allegedly_slow("fire ", "timothy") }
    } );

    sub allegedly_fast {
    &silly_append;
    }

    sub allegedly_slow {
    &silly_append($_[0], $_[1]);
    }

    sub silly_append {
    my ($a, $b) = @_;

    $a = $a . $b;
    }
    Benchmark: timing 100000 iterations of Fast, Slow...
    Fast: 0 wallclock secs ( 0.48 usr + -0.01 sys = 0.47 CPU) @ 213333.33/s (n=100000)
    Slow: 0 wallclock secs ( 0.62 usr + 0.00 sys = 0.62 CPU) @ 162025.32/s (n=100000)

    So far 100,000 function calls, the savings is .15 seconds. Bah! Factor in the number of developer time lost tripping over this silliness, and it's more than what's been saved by probably all Perl programs actually and intentionally using it on the planet. Personally, I hope this goes away in Perl6. :)

    -Bill
    --
    SlashSig Karma: Excellent (mostly affected by moderatio
  140. /dev/random and CryptGenRandom() by cpeterso · · Score: 2

    Java's random number generator probably just calls the platform's standard C library rand(). To get truly random data, you can use /dev/random on Linux and CryptGenRandom() on Windows.

  141. Weird Turbo Pascal 6.0 and I/O checking bug by allanj · · Score: 2

    Back in the days of DOS programming, I was really fond of Turbo Pascal 6.0 from Borland. So I used it a lot. A whole lot, actually.

    It had two modes of operating in terms of I/O checking - either it would fire a run-time error (when using the {$I+} mode), or it would silently assign the variable IOResult an error code (when using the {$I-} mode). Weird system, but it worked - sort of. The problem was, that after exiting a piece of code operating in {$I-} mode, and NOT reading the IOResult variable before switching to code operating in {$I+} mode, whatever I/O operation you performed would fail for sure, and the run-time system would report the error as the one I didn't read out of IOResult. So I could get "File Seek Error" or something when simply printing a string on the screen.


    That took me a *long* time figuring out, and after I had finally figured it out I contacted Borland, and they admitted that it was a bug on their part, but that they weren't going to fix it, since a simple workaround was to always assign the value of IOResult to a dummy variable upon leaving a {$I-} mode section. That helped me switch to C programming - thanks Borland :-)

    --
    Black holes are where God divided by zero
  142. Favorite SUPPORTED bug by wdr1 · · Score: 2

    This is my favorite "supported" bug in Perl:

    my %editors = (
    'good' => [ qw{CmdrTaco Hemos CowboyNeal chrisd Cliff} ],
    'bad' => [ qw{timothy michael jamie} ],
    )

    That allowed dangling comma on the last line makes it easy to move lines around, etc. It works with any list structure in Perl.

    Pretty nifty. :)

    -Bill

    --
    SlashSig Karma: Excellent (mostly affected by moderatio
  143. Try the Mersenne Twister by Wraithlyn · · Score: 5, Informative
    Check out the Mersenne Twister, it's beautiful. Here's a couple points from that page:

    • Far longer period and far higher order of equidistribution than any other implemented generators. (It is proved that the period is 2^19937-1, and 623-dimensional equidistribution property is assured.)
    • Fast generation. (Although it depends on the system, it is reported that MT is sometimes faster than the standard ANSI-C library in a system with pipeline and cache memory.)
    • Efficient use of the memory. (The implemented C-code mt19937.c consumes only 624 words of working area.)


    There are implementations in C, Java, PHP, Fortran, Excel (I assume VBA) and probably others.

    I only have experience with the Java impl, and it is very good. There are two classes, MersenneTwister, which is a true descendant of java.util.Random, and there is also a MersenneTwisterFast class, which does NOT inherit from Random (same public methods, and identical algorithm though), but clocks in at about twice the speed, due to tricks like avoidance of synchronization, and method inlining and finalizing.
    --
    "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
  144. Atari 800 ROM BASIC "Jumping Bug" by isomeme · · Score: 2
    Way back when at the dawn of time, Atari shipped a truly fine set of 8-bit home computers (400, 600XL, 800, 800XL, etc). They featured a pretty decent ROM implementation of BASIC. Soon after the initial shipment, a bug was discovered in the BASIC ROM's code-edit subsystem; if any text line having a positive integer multiple of 256 characters was inserted, the system would lock up.

    Quite quickly, the problem was discovered -- a block move instruction was testing for "less than" rather than "less than or equal to" in its carry emulation. But, this being ROM, there was no way to patch the bug short of shipping new chips. Atari acknowledged the bug and promised it would be fixed in ROM BASIC B.

    Since the bug was so obvious, well understood, and easily fixed, a very junior programmer was assigned the task of fixing it. He found the offending 'lt' compare and changed it to 'le'. Then his eyes wandered to the neighboring routine, the block delete support function, which was doing similar block-move logic. There, he saw a 'gt' (greater than') compare. "Aha!", we can be sure he thought to himself. "I'll fix that one, too, and win praise from my boss for being proactive!" So he changed it to 'ge', submitted the code, and moved on.

    Needless to say, the second compare was supposed to be 'gt', not 'ge'. Unfortunately, nobody caught this in code review or testing. Days after ROM BASIC B shipped, it was discovered that now, if you deleted a positive integer multiple of 256 characters, the system locked up.

    This became known as the Atari "Jumping Bug". ROM BASIC C finally corrected it, ending fears that instead it would lock the computer on 256*n inserts and deletes.

    --
    When all you have is a hammer, everything looks like a skull.
  145. Re:hm. by AndrewHowe · · Score: 2

    0.5 can of course be stored exactly in IEEE format, it is 1.0*2^-1 ...
    Note also that IEEE doubles give you 52/log2(10) ~= 15 full digits of mantissa. However, the exponent is 10 bits plus a sign bit so you get 10/log2(10) ~= (very almost =) 3 digits of exponent. (The exponent also has a sign bit but you didn't include it in the 52 figure... 52+1+10+1=64)
    I don't know why you said that about packed decimal, that takes 4 bits per digit... Is there any other way?

  146. That's a feature by nzkoz · · Score: 2

    The iterator is invalidated when you delete from a container, that's simple enough. To do what you want, just remove_if(hash.begin(), hash.end(), func). Where func is a Predicate constructed as required. Described at:

    http://www.sgi.com/tech/stl/remove_if.html

    It's not annoying at all really. :) And it matches what you're doing quite nicely.

    --
    Cheers Koz
    1. Re:That's a feature by nzkoz · · Score: 2

      Remove_if will shift all the unwanted elements to the end of the collention, and return an iterator pointing to the first invalid element.

      So you'd want to use hash.erase(remove_if(hash.begin(), hash.end(), func));

      That's all. It takes a bit of getting used to but the C++ standard library's collections are extremely flexible, and powerful. Scott Meyers' Effective STL is a great Starting point.

      --
      Cheers Koz
  147. Hissing Cockroach by ColGraff · · Score: 2

    A classmate of mine bought a really cool Giant Hissing Cockroach for an English project, and named his Gregor. Cute little guy - I hope he found a good home -

    Oh, wrong kind of bug? Nevermind then.

    --
    I'm the stranger...posting to /.
  148. IBM Fortran Compiler on RS/6000 by NanoProf · · Score: 2

    Compile short fortran program
    "Internal compiler error. Please contact IBM representative"
    Re-compile from command line using command history.
    Compiled fine.

    --
    Curtains for windows?
  149. 1976 Cobol programmer's bug by vrmlguy · · Score: 3, Interesting

    I once had to debug someone else's code that looked vaguely like this:

    READ A,E,I,O,U
    [...]
    X=A+E+I+0+U

    See the problem? Note that in 1976, programmers would write their code on a form that was given to keypunch operators, who "typed" it onto 80-column punch cards that were then fed into the computer. When the author got back from vacation, I refrained from punching him in the face, and just yelled at him instead.

    --
    Nothing for 6-digit uids?
    1. Re:1976 Cobol programmer's bug by bluebomber · · Score: 2

      Heh. Gotta wonder whether it was one of the keypunchers that made the mistake... I remember having a hard time convincing my mother, who was trained on a typewriter, that "l" (ell) is *much* different that "1" (one) because she was in the habit of hitting (ell) to produce a (one). Older typewriters often didn't even have a (one) key so you had to do this. Of course, she never punched in any of my code for me, but I can see where a rookie keypuncher might make a similar mistake...

    2. Re:1976 Cobol programmer's bug by vrmlguy · · Score: 2

      I'm fairly certain that it was one of the keypunchers. They made zero/oh mistakes all the time, but you'd normally get an error message about an undeclared variable. For instance, you'd be using "TOTAL" and they'd enter "T0TAL". This could sometimes lead to interesting problems because they'd do the initial punching of the program, while the programmers would punch changes. Thus, it wouldn't be until you made a correction to some logic error that you would get the error message. By the time you figured it out, you'd find it easier to use the keypuncher's spelling instead of your own!

      --
      Nothing for 6-digit uids?
  150. NTFS vs. FAT by Captain+Chad · · Score: 2
    The NTFS file system keeps track of how many times a file is opened/closed, while the older FAT filesystem (and maybe FAT32) do not. We had code that would run perfectly on a FAT partition but failed on an NTFS partition (the OS didn't matter).

    It boiled down to the fact that a data file was opened multiple times without being closed. NTFS would only allow one read/write access at a time, so subsuequent read/write fopen() calls would fail. The FAT filesystem did not have this problem, because it would happily allow you to open the same file multiple times.

    --
    Check out Chad's News
  151. Re:Powerbuilder's Toolbar by msouth · · Score: 2

    funny that you say that, because mozilla had a bug a lot like this--a dialog box wouldn't go away until you clicked the button _and_ moved the mouse by a pixel.

    --
    Liberty uber alles.
  152. Re:hm. by AndrewHowe · · Score: 2

    The packed decimal (80 bit extended) format used by the x87 (and others, I am sure) is just BCD, i.e. 4 bits per digit with 6 wasted values. There is no other reasonable way to store decimal in binary form (log2(10)~=3.322 bits) apart from... in binary!
    Well, I suppose, 1024~=1000, so you could get 3 decimal digits per 10 bits. Or 6 in 20 bits. A quick play with my calculator shows 59 digits in 196 bits to be quite acceptable!

  153. Ah, but... by pclminion · · Score: 2
    2.59 is certainly closer to 3 than it is to 2, but by your reasoning, 2 should be the result of the rounding operation.

    It would also be the reasoning of any other scientist. The reason the number gets rounded is because we are agreeing how many significant digits there will be. If we're rounding to the one's place, then the tenth's place is significant in terms of which direction we are going to round -- but we've already just admitted that we're only accurate to within a one's place (otherwise why would we round off there?). Therefore the hundredth's place is even MORE uncertain, and is ignored.

    Mathematically it might be confusing, but with scientific measurements you just can't TRUST those small decimal places, so you pretend that they don't exist -- if the error is distributed symmetrically, the result is a "fair" rounding over many data points.

  154. Windows printf of death by tyler_larson · · Score: 4, Interesting
    Here's a simple program with some unexpected consequences. It works only on windows NT-based systems, including XP.

    #include <stdio.h>
    int main()
    {
    printf(" \b\b ");
    return 0;
    }
    To get the full effect you have to run it by double-clicking on the icon, rather than from a DOS prompt. If you want one you can run from a command prompt, replace the printf above with:
    while (1) printf(" \b\b");

    An infinte loop isn't quite as elegant as a single statement that wreaks havoc on your system, but it's still simple enough. In order to generate the "desired" result, you have to backspace beyond the first character of the terminal window, then output a printing character to the left of the beginning of the buffer. Apparently cmd.exe doesn't check for this condition, and triggers an error in a system-critical process.

    I remember Microsoft bragging about how DOS programs run in their own virtual machine, so a mis-behaved DOS app can't crash your computer. I think this example here is proof-positive to the contrary.

    If anybody has any more technical information about the cause (and possibly history) if this bug, I'd love to hear it.

    What's it do? Oh, yeah, it reboots your computer. No shutdown, no warning. Just like hitting the power switch.

    And aren't you glad you paid over $1000 for MS server software that can be rebooted by any user who executes a 4-character printf?

    --
    "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea...."
    RFC 1925
  155. Windows Registry Access Security by Captain+Chad · · Score: 2

    I found this bug in several commercial programs I've purchased in the past. I would install a program on my WinNT machine and discover it could only be run from an administrator account -- even though it wasn't doing anything that would normally require special access. The tech support people didn't seem to think this was much of a problem, but I go by the philosophy that my run-of-the-mill userid should not have adminstrator authority.

    I tracked it down to the security settings for some of the registry keys. The call to open the key requested full access, which required administrator authority. Apparently the software had been developed and tested on Win9x or administator-level NT, where security does not really exist in the registry. The program did not require full access (read/write would be sufficient), but the coders probably didn't even bother with security.

    The solution was to change the security level for a few registry keys. Once I did that, everything worked fine. I had to use a registry monitor to figure out what was happening.

    --
    Check out Chad's News
  156. Amusing C++ bug by matsh · · Score: 2

    A friend of mine wrote this C++ code once:

    void SubClass::foo()
    {
    BaseClass:;foo();

    // Some other code here
    }

    It became an infinite loop... can you see why?

    Mats

    1. Re:Amusing C++ bug by matsh · · Score: 2

      Plus, an empty ';' is a NOP. :-)

      Mats

  157. Apple II Math by Captain+Chad · · Score: 2
    There was a precision error in the Apple II that was very easy to recreate. If you typed:
    1. 7^2
    It would display something like this (the number of zeros is probably wrong):
    1. 49.00000000001
    --
    Check out Chad's News
  158. Ported Bug by man_ls · · Score: 2

    I wrote an application for an introductory C++ class, and one of the assignments for it was to generate a data file to a certain spec, then swap data files with other classmates and run the second part of your program (a point-of-sale program using dynamic allocation and all of that nifty stuff....really basic for the Slashdot crew I'm sure.)

    I did my own test runs, and moved on to the next person's test runs... ...and my program shit itself. Extra nodes in the list, off-by-1 (or off by more than 1) errors in the names, fields being swapped, etc.

    I rewrote my ENTIRE input function AND my entire display function to try and figure out what was wrong with it.

    Turns out, the kid who's file I got left out a single blank line after the first element. It read the first 2 fine, then glitched up, read a blank, and then read the fields at an offset that increased each time. By the 5th item, I was reading in random garbage from memory, it was so far off.

    I just about killed the kid. Then I got someone else's data and used it instead.

  159. Lost Interrupts Bug by Cato+the+Elder · · Score: 2

    My favorite is the bugs in the Tundra Universe/Universe II.

    In the Tundra Universe, if multiple interrupts come in at different interrupt request levels, the response cycles can get confused. Therefore, applications can really only use one interrupt level.

    In the Tundra Universe II, if more than four boards assert the same interrupt level at the same time, the responding board can not pull the signal high to acknowledge and the bus locks up. Therefore, applications must use different interrupt levels.

    Therefore, you can't really mix Universe and Universe II chips in the same bus application.

  160. Magically changin checksums by DotComVictim · · Score: 2, Interesting

    When doing an rcp from source machine to target machine, if sum is run on the rcp source machine, the value would sometimes be incorrect. After the rcp finishes, the value is correct, there is no data corruption, and the file was transfered correctly to the target machine. If ftp was used, the problem did not occur.

    It took over 6 months and 12 people to find the problem. The hardware was a uniprocessor MIPS R10k with non-coherent cache. The processor is capable of doing speculative execution which can dirty cache lines. The processor doesn't back out dirty bits when the speculative path falls back. So you can have a piece of code like:

    if (foo) *bar = 1;

    Even if foo is false, the speculative execution can cause the cachline containing bar to get marked dirty. Normally this doesn't cause a problem. However, if bar is used as a loop variable, and happens to point just past the end of a memory page, a cacheline for a subsequent page can be dirtied. If this page has an active DMA transfer in progress, then the first cacheline on that page can be overwritten with the dirty cacheline, corrupting the DMA data.

    This was not a problem for userspace, since active DMA write pages were not mapped into userspace, but flipped in on completion of the DMA. In the kernel, the problem exists. The solution chosen at the time was to put a compiler workaround, which put a speculation stopping instruction at each conditional branch target. Since this compile switch was only used for the kernel, user binaries remained ABI compliant.

    However, in "volatile" assembler portions of the kernel code (no compiler reordering permitted), this workaround had to be handcoded. After pouring through all the assembler by hand, no bugs were found. Finally a perl script was written which would check for store instructions lacking a speculation stopper. Some were found, and all discounted as harmless.

    The problem turned out to be that the MIPS prefetch instruction allows you to pass a cache hint. There was a piece of checksum code that passed a write hint in a prefetch instruction. The fix turned out to be a 1 bit change: change the 7 prefetch code to a 3.

  161. Dynamic RAM Refresh by Captain+Chad · · Score: 2
    This is my favorite.

    I have a DSP board from a company that shall remain unnamed. When you perform a DMA between the PC and the DSP board, the board's PCI controller is driving the board's external bus and nobody is refreshing the RAM. (All DRAM must be periodically refreshed, or the memory chip discharges). The hardware design team solved this problem in a particularly bad way. They assumed programmers would set up a DMA operation and then continuously poll the DMA status register until the transfer was complete. Thus, they configured a PLD to handle the refresh, as long as the PCI controller's DMA status register was being polled.

    So what happens if you try to do an interrupt-driven DMA in the background? The system crashes because RAM isn't getting refreshed. The tech support person suggested a test: have one DSP chip do nothing but poll the PCI controller's DMA status register. Suddenly it worked fine. There is no way I could have figured this one out on my own. There was absolutely nothing wrong with my code, except that the hardware design engineers didn't expect anyone to use interrupt-driven DMA.

    Fortunately this was a known issue and the company had an update, although we had to purchase a $150 cable so we could re-program the PLD.

    --
    Check out Chad's News
  162. Re:Self deprecating reference by SirSlud · · Score: 2

    Its fairly useful when you want to assign the tokens to ptrs .. all ptrs will be null terminated without your intervention.

    If you know what it does, and thats what you want, then its all good.

    There are alternatives, no need to pick on an oldie but goodie ..

    --
    "Old man yells at systemd"
  163. Dropping 16 users at a time by elronxenu · · Score: 2, Interesting

    I discovered that the network concentrators at Uni would die on any sequence of 4 "n"s in a row (i.e. "nnnn") in the same packet. I was trying to read a man page and puzzled why the system kept dying before I got to the end. Eventually I redirected the man page to a file and used something like an octal dump to find the sequence without displaying it on the screen.

    I then tested, typed "nnnn" and down went the network concentrator. Unfortunately that killed the other 15 users as well...

    I reported this bug to the University Computer Centre who either didn't believe me or took no apparent action, but sometime later they upgraded to a different brand of gear for the campus WAN. I also reported it on comp.risks. I can find no other documented cases of this bug on the Net using a google search.

  164. Simple: missing return statement (in C) by Christopher+H · · Score: 2, Interesting

    I used to be on UWaterloo's ACM programming contest team. More than once I got bitten by the ever-so-simple yet ever-so-annoying to debug 'missing return' phenomenon.

    It seemed that on some architectures (eg. the local workstation I was testing on), the right value would just happen to be in the right register anyway. On the judges architecture (fortunately this was a local practice contest, not the world finals!) it failed one time out of one hundred. Yeah, yeah, I know, turn on warnings... it wouldn't fit with the contest mentality: vi + gcc and one terminal and you're set.

    Wasted waaaay too much time on that one.

  165. Round to even is not expensive by coyote-san · · Score: 2

    Round to even is not expensive, at least when you're talking about the binary computations in hardware that the IEEE routines address. In this case you just need a lookup table with your guard bits and the last significant digit. Even with 7 guard bits, that's a table with only 256 possible results (do nothing, decrement or increment). With RTE you may only need "do nothing" and "increment."

    Of course, this is just the rounding performed by a single calculation. Most coprocessors use a few extra bytes over what they publish, e.g., the registers for a IEEE double (64 bits) will actually be 80 bits long.

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  166. Re:Now I remember why school sucked... by joto · · Score: 2

    This is quite common with older games. Typically they will time a delay loop at initialization. (If the computer is very fast, the time taken will be zero.) Then a large number is divided by the time, to get a reasonable length for a delay loop inside the game. Have a fast computer? Expect division by zero!

  167. Re:1/2 = 0 by xelph · · Score: 2

    1/2 = 0 looks perfectly normal to me, as opposed to 1.0/2 = 0.0 or 1/2.0 = 0.0 or 1.0/2.0 = 0.0 or...

  168. My Favortie Bug by Type11 · · Score: 2, Informative

    Was having some really bizzare problems with our String class being used in a stl vector and ended up having to trace it into the RougeWave HP stl. It was in vector<_TypeT,_Allocator>::operator= (const vector<_TypeT,_Allocator>& __x)
    below is the change for anyone who might have hit this or runs this setup. Hope it can help someone avoid it and all the time it wasted. Just love problems in the STL! *** are the two lines changed.

    *** _C_end_of_storage = _C_finish = _C_start + __x.size();
    }
    else { // size() < _x.size() < capacity()
    // advance this->end () first
    *** _C_end_of_storage = _C_finish = _C_start + __x.size ();

    Changed To:

    *** _C_finish = _C_start + __x.size();
    }
    else { // size() < _x.size() < capacity()
    // advance this->end () first

    copy (__x.begin (), __x.begin () + size (), begin ());

    // write past original value of this->end ()
    uninitialized_copy (__x.begin () + size (), __x.end (),
    begin () + size (),
    _RWSTD_VALUE_ALLOC_CAST (*this));
    }

    *** _C_end_of_storage = _C_finish = _C_start + __x.size ();

    This of course was becuase _C_end_of_storage should not have been set before the calling of size() as it would be incorrect.

    --
    Just Another Day For You and Me in Paradise.
  169. Re:sneeky colon by AndrewHowe · · Score: 2

    Oh the times you wish people forgot to check "Post Anonymously"!

  170. inc vs. add by coyote-san · · Score: 3, Interesting
    When I was in college, we had an introductory class to digital logic (for physics majors) with the emphasis on switches, latches, etc. We also had a single-board processor (8080) that we programmed with hand-assembled code punched into the hex keypad - one of our first projects was *always* to set up a binary->7 segment display encoder so we could read hex output instead of the binary.

    Anyway, our instructors were physics profs who focused on the hardware and never really put any effort into describing the instructions available on an 8080. We had been working at an extremely low level of logic design. At one point we had to write a program to add two numbers and display the results, and I actually wrote one looking something like

    l1: inc ax
    dec bx
    jnz l1

    I was truly dreading doing multiplication and division, but fortunately someone pointed out the basic math opcodes first.

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  171. Re:My Favortie Bug (HP STL Problem) (Spelling) by Type11 · · Score: 2, Funny

    Apparently I can't spell favorite right... Internal bug number #23456.

    --
    Just Another Day For You and Me in Paradise.
  172. Re:A Big One by AndrewHowe · · Score: 2

    I have to say, I have read this thread slowly tonight, over many beers, and have posted many replies, and I have this warm fuzzy feeling, which may be due to the beers, but I rather feel that it is because the chaps at Microsoft were completely right in this instance. Furthermore, there has been a remarkable breakout of geekness, the kind of geek brotherhood (and sisterhood of course) that we truly share with our counterparts, who currently reside in the dungeons deep inside the Microsoft campus. I speak not of the fabled pointy headed creatures, but of the grunts, who art not so different from ourselves, if everything be considered.

  173. My pet bug by Eil · · Score: 2


    Even though though this question was targeted towards devlopers (and I'm not a developer per se), my pet bug would have to be how Windows 2000 and Windows XP make my motherboard's power LED turn off in Linux.

    Conspiracy, I say!

  174. Re:6502 Bug by AndrewHowe · · Score: 2

    I believe you meant $cfff and $cf00...

  175. Re:Another VBscript Bug by AndrewHowe · · Score: 2

    ??? I would say, rather, that it is good practice to use explicit casts (casts are not statements), if, and only if, implicit casts are not erm... explicit enough! Of course, as much as I like C++ (for example) implicit casts can get you into a lot of trouble if you don't have the entire ISO standard committed to memory. Fucked if I have...

  176. Re:Compiler "bugs" by slickwillie · · Score: 2

    I spent many hours when I was first learning C on this one:

    int divide(int *a, int *b)
    {
    return *a/*b;
    }

    (Hint: /*b is the start of a comment.)

    Then there's the famous FORTRAN bug (if I can remember the syntax correctly):

    CALL ADD(N,5)

    SUBROUTINE ADD(I,J)
    I=I+J
    J=10

    From then on, every time you used "5" you would actually get "10". (Call by reference or something from the dim past.)

  177. Java BigInteger.isProbablePrime(int) ! by karlm · · Score: 2
    A friend and I were implementing Diffie-Hellman cryptographic key exchange and so we needed a large prime number p such that (p-1)/2 is also prime. We looked up the prime used for the Secure Remote Password protocol and double checked that it had the properties we wanted. According to BigInteger.isProbabePrime(int), (p-1)/2 is prime, but not p. We emailed the author of the protocol spec and he graciously provided us with some proper primality tests. My own clean-room impleentation of the Miller-Rabin primality test agrees with the code we were emailed. We also got a short explination of what the problem was. The funny thing is that my own MIller-Rabin test is faster and more accurate than BigInteger.isProbablePrime. Also, one of the earlier JDKs (1.2, I want to say) implements isProbablePrime() correctly. It is broken in the 1.3 and 1.4 JDKs.

    Probabilistic primality tests are supposed to have a miniscule chance of declairing a composite number prime, and zero chance of declairing a prime number composite. I guess it's nice that the Java implementation errs on the side of safety, but it's silly that my Miller-Rabin test is faster and more accurate. The code I was sent works even faster. (The SRP people offered to email me some kind of proof of primality for the number. I'm not sure how that works, but thier code agrees with the stuff I coded up from Applied Crypto, so I'm pretty convinced Sun goofed.)

    <OT>
    Does anyone know a way to get a File object or an InputStream object for a file contained in a jar archive? This is my current reason for wanting to hurt the Java engineers. I'm trying to load an image out of a jar archive. The best solution I've come up with so far is to use Class.getResource(String) to get me a URL and then use java.awt.Toolkit.getImage(URL)
    </OT>

    --
    Copyright Violation:"theft, piracy"::Anti-Trust Violation:"thermonuclear price terrorism"<-Overly dramatic language.
  178. General Motors by ParisTG · · Score: 3, Funny

    Here's one I just received in my email. Enjoy:

    ---

    This is a real story happened between the customer of General Motors and its customer-care executive..

    This complaint was received by the Pontiac Division of General Motors: This is the second time I Have written to you, and I don't blame you for not answering me, because I sounded crazy, but it is a fact that we have a tradition in our family of ice cream for dessert after dinner each night. But the kind of ice cream varies so, every night, after we've eaten, the whole family votes on which kind of ice cream we should have and I drive down to the store to get it. It's also a fact that I recently purchased a new Pontiac and since then my trips to the store have created a problem. You see, every time I buy a vanilla ice cream, when I start back from the store my car won't start. If I get any other kind of ice cream, the car starts just fine. I want you to know I'm serious about this question, no matter how silly it sounds: "What is there about a Pontiac that makes it not start when I get vanilla ice cream, and easy to start whenever I get any other kind?"

    The Pontiac President was understandably skeptical about the letter, but sent an engineer to check it out anyway. The latter was surprised to be greeted by a successful, obviously well educated man in a fine neighborhood. He had arranged to meet the man just after dinner time, so the two hopped into the car and drove to the ice cream store. It was vanilla ice cream that night and, sure enough, after they came back to the car, it wouldn't start. The engineer returned for three more nights. The first night, they got chocolate. The car started. The second night, he got strawberry. The car started. The third night he ordered vanilla. The car failed to start. Now the engineer, being a logical man, refused to believe that this man's car was allergic to vanilla ice cream. He arranged, therefore, to continue his visits for as long as it took to solve the problem. And toward this end he began to take notes: he jotted down all sorts of data: time of day, type of gas uses, time to drive back and forth etc. In a short time, he had a clue: the man took less time to buy vanilla than any other flavor. Why? The answer was in the layout of the store. Vanilla, being the most popular flavor, was in a separate case at the front of the store for quick pickup. All the other flavors were kept in the back of the store at a different counter where it took considerably longer to check out the flavor.

    Now, the question for the engineer was why the car wouldn't start when it took less time. Once time became problem - not the vanilla ice cream, the engineer quickly came up with the answer: "Vapor lock". It was happening every night; but the extra time taken to get the other flavors allowed the engine to cool down sufficiently to start. When the man got vanilla, the engine was still too hot for the vapor lock to dissipate.

    Remember: Even crazy looking problems are sometimes real and all problems seem to be simple only when we find the solution with a cool thinking. Don't just say its "IMPOSSIBLE" without putting a sincere effort... Observe the word "IMPOSSIBLE" carefully... You can see "I'M POSSIBLE"... What really matters is your attitude and your perception.

  179. Re:hm. by moogla · · Score: 2

    The conversion from decimal to binary occurs in the library that interprets input (from a ASCII encoded file or the user at the console). The x87 does not handle BCD at all.
    At this point forward, the number is represented internally by 80 consequetive bits in IEEE form. That is, sign bit, followed by 63 bits of mantissa and 16 bits of signed exponent. These are not BCD coded because they are not in base 10 anymore.

    Furthermore, it would be foolish to store the number if BCD because of the inordinate amount of {stack, register, cache} space wasted, plus it helps to handle International number representation at the OS level (i.e. the French switch the comma and decimal point, group differently, etc.) thus freeing the application code from needing to worry about it.

    --
    Black holes are where the Matrix raised SIGFPE
  180. TI Calculator bug by jpellino · · Score: 2

    About the time they went from LEDs to LCDs, there was a persistent bug in most TI handheld calculators - I seem to remember it into the 1980s - calculate 2^3, minus 8 and you didn't get zero - you got a very small decimal. Doh!

    A check of many calculators today can give you some measure of internal accuracy - I use 123.456, take the square root, then square it. You get 123.456 - no surprise. Then do it sqrt twice, then sq twice, then three times each, and so on - many calculators can do seven down, then seven back up and still end up with 123.456 again. Some crap out after just two. I think the most I've seen is 11.

    --
    "Win treats sysadmins better than users. Mac treats users better than sysadmins. Linux treats everyone like sysadmins."
  181. Error messages by Tablizer · · Score: 2


    "Not enough memory to display error me"

  182. /. threshold bug!! by fractaltiger · · Score: 2

    Yeah, the one right under our noses: you browsing at 4 or 5? Click on the Threshold pulldown menu. What's it say? 35 Comments at 4+, 30 Comments at 5. But it also says -1,0,1,2 and 3 -scored posts add up to 35 each.

    So you can't guess how switching to a lower-scoring level will increase the html file coming down our modem pipes. Try it today ;)

    --
    "Wireless : LAN :: Laptop : Desktop"
  183. a similar story by coyote-san · · Score: 2

    There's a similar story circulating, perhaps in the Jargon files. A guy gets a report that the system will allow the operators to log in when they're sitting at the console, but not when they're standing.

    This makes no sense - there's absolutely no connection between the seat (or raised floor) and the system. How could it possibly know whether the person was standing or sitting?

    The answer was in the keyboard. Somebody had dropped it and put the n and m keys back in the wrong place. While sitting, the operators could touch-type and they hit the right keys. But when standing, they had to look at the keys since they didn't have the muscle memory in this position to touch type. The two keys were in about the right place, they look similar, and nobody noticed that there was a problem with the keyboard.

    The story has a fun personal touch since years before I heard about it I did the same thing with the office phone. We accidently dropped it, and as a joke I put the keys back in the standard calculator/keyboard layout, not the telephone layout. We all knew the numbers were reversed and could dial the right numbers, but one day a phone guy was in the office for some reason and got a very strange look on his face when he saw the phone. He insisted on "fixing" it.

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  184. 8087 stack underflow error, TV programmer bug etc by Michael+Snoswell · · Score: 2

    I recall using an 8086 with the (drumm roll) 8087 floating point accelerator chip (for those too young to remember, that was a separate chip you had the option to buy in early PCs if you wanted to do fast maths calulation. The Microsoft compiler of the time (v3or 4) had a bug that under some condition cause an underflow in the 8087 internal register stack on the 8th call (I think the internal hw stack had 8 entries). It took a real long time to find that, many weeks, I rang Microsoft and they said "Thanks!" and I never heard from them or got a work around. Some things never change...

    I was helping a friend program their TV and found an error in the sequence of assigning frequencies to station numbers, it caused garbage to show where the nice green channel number was meant to be.

    I remember writing a maze program on my trusty HP11C back in about '81 and I gave it to a friend. The bug cause the maze to be reflected on the x and y axes. I was trying out the program and got this creepy feeling as I wandered around the maze 4 times bigger than what the calculator had memory to handle. It was so weird. I took hours wandering around and eventually drew it out before seeing the pattern. Serendipity strikes :-)

    I wont mention the military system I worked on where the laser it fired (don't ask) would switch direction 180 degrees every time it crossed the Tropic of Capricorn (latitude 45 deg south). Or the bug in the artificial life breeding prgram that caused all offspring to remove their brains (controling code) when they were old enough to reproduce. Or the AI system that caused the 2D life to be attracted to a light but when the light was too close they spun in circles until they died - so weird to watch on the screen, very funny at the time.

    --
    pithy comment
  185. My Apple Monitor has a way better DOCUMENTED issue by petree · · Score: 2
    Check out AppleCare Document 58272 in reference to their diamondtron Studio Displays (looks like a big imac on a stand). It's great.

    The Diamondtron CRT used in the 17-inch Studio Display incorporates an aperture grid of very fine, vertical wires to enhance the sharpness of the image. Exposure to cold and or vibration can cause these fine wires to temporarily adhere to each other.

    [...]

    If your display is exhibiting visible thin vertical lines, you can most often break the adhesion between the grid wires by using the heel of your hand to moderately impact the side of your display under the Apple logo on the right, then left side. Using moderate force does not damage your display.

    To avoid scratching or marring the external plastics, remove any jewelry or watches before you tap the display.
    I laughed out loud the first time I saw this, and if you are wondering, yes it works wonderfully and I end up having to do this every couple of months to keep the screen looking pretty.
  186. VMS is my favourite bug by Babel · · Score: 2, Funny

    My favourite bug from the VMS days is the one that reported, under certain conditions:

    Warning: Hardware or software error.

    ... which was immensely useful, and narrowed the problem down to one of two things.

  187. Our favourite webserver: IIS... by guran · · Score: 2
    IIS 4(?) had an extremly annoying bug.

    If you set a session variable in asp, it did not halt execution until that variable was actually set. That meaned that code like:


    Session("MyVar") = "I did this"

    Response.write Session("MyVar")

    Might write the old value of Sesion("MyVar") or simply a blank.

    Guess how strange bugs that could result in...

    --

    All opinions are my own - until criticized

  188. Re: i know it by fferreres · · Score: 2
    --
    unfinished: (adj.)
  189. Re:hm. by AndrewHowe · · Score: 2

    Sorry, the x87 can read and write BCD in hardware. Have a look at your x87 manual. Come back if you have any questions!
    BCD is not foolish, if you are converting to/from decimal!

  190. Re:String.length() by robbieduncan · · Score: 2

    You don't terminate your strings in Power Dynamo - it's all written in Dynamo Script a sort of cludged up, crack-head designed version of server side Java. The entire thing is broken. Never, ever, use this product.

  191. moralizing buffer by sweet+reason · · Score: 2

    i once tracked an application problem down to code that appended to a buffer. if the buffer wasn't large enough, it would double its size before appending to it. if double wasn't enough, well, that's what you get for being greedy!

    --
    Everything should be made as simple as possible, but not simpler. -- A.E.
  192. /dev/random not always an option by SysKoll · · Score: 2

    Well, sometimes you want to run a simulation that needs a random stream of number that is also entirely repeatable. For example, you want to rerun the sim after changing one parm or, err, fixing a bug :-)

    But /dev/random does not spit the same sequence twice on command. So for simulation, an RNG with a seed is often the only choice.

    Note that simulation people demand, in the same breath, absolute randomness and absolute repeatability. And then, we sim freaks wonder why real-world physicists won't take us seriously...

    -- SysKoll
    --

    --
    Mad science! Robots! Underwear! Cute girls! Full comic online! http://www.girlgeniusonline.com/