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?

985 comments

  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 Anonymous Coward · · Score: 0

      I got Trolled making a comment similar to this one... and you get a score of 4? Moderation is MEANINGLESS!

    2. Re:True story by Anonymous Coward · · Score: 0

      Sounds like the originator of this thread is a bit inexperienced...

    3. Re:True story by Anonymous Coward · · Score: 0

      That got a score of 5? What are these scored on?

      Oh wait... this is slashdot.. anything anti-microsoft is suddenly the best literature ever created...

    4. Re:True story by Anonymous Coward · · Score: 0

      I discovered that Linux 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.

      Hmmmm....I wonder if this will get modded up, too....

    5. Re:True story by The_Rippa · · Score: 0

      hey now, don't say boo about Linux or your Karma will hit absolute zero.

      The comments section of this site is a fucking joke!

    6. Re:True story by Anonymous Coward · · Score: 0

      Well, the guy asking slashdot is finding bugs where there are none. And he is a VBA programmer.

    7. 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
    8. Re:True story by demastri · · Score: 2, Insightful

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

    9. 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.

    10. Re:True story by mrmez · · Score: 1

      Actually, at my last job the guys who only knew VB were pretty incompetent - even writing VBScript! They wound up in sales (or gone) while the coding was continued by the coders who weren't (primarily) VB programmers. The people who went from HTML to VBScript were better coders than the guys who went from VB to VBScript.

    11. 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.)

    12. 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.

    13. 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.

    14. Re:True story by TheOldFart · · Score: 1

      Sure... a black hole where time and space are meaningless...

    15. Re:True story by WinDoze · · Score: 1

      those who follow the herd and say, "VB is an idiot's language," have never even tried VB.

      Actually I've been using it (along with Visual C++) professionally for 6 years, I feel quite qualified to say "it's garbage".

    16. 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.

    17. Re:True story by Anonymous Coward · · Score: 0

      In a nutshell:

      ON ERROR GOTO 1120
      ON ERROR RESUME

      why does VB, a so called "advanced" language still require such poor coding to check for errors? Or, if not, why do all their examples use this style of error checking?

  3. Not a bug by Anonymous Coward · · Score: 0

    That's not a bug. Rounding rules say to round to the nearest even number when you are rounding from 5.

    1. Re:Not a bug by Quixotic+Raindrop · · Score: 1

      Unless you have a predominance of even numbers, in which case you run into the reverse of this problem. 6.5, 8.5; mean = 7.5 Rounding with conventional rules, 7, 9; mean = 8 Rounding with these "new" rules, 6, 8, mean = 7 Both rounding types introduce errors. Why would either have an advantage over the other? They're both wrong.

      --
      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Einstein)
    2. 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
    3. Re:Not a bug by howardjp · · Score: 0

      Okay, I am tired of seeing uninformed shit here about rounding. Five always rounds up:

      0,1,2,3,4 -> down
      5,6,7,8,9 -> up

      That way, you get an even alignment.

    4. Re:Not a bug by Mantorp · · Score: 1
      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.

    5. 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
    6. 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.

    7. Re:Not a bug by Rocket_Sci · · Score: 1

      Read the other replies.

      You are wrong on this one. I ran into this a few years ago and I had to sit down and prove it to myself on paper.

      Use positive and negative numbers when you run a test. It's true. 5 is not actually closer to the higher number. It's right in the middle. You have to round it up half the time and round it down half the time to make the rounding come out equal.

      When I first saw this, I was pretty adamant that it was wrong too, but it isn't. It makes sense.

      Do the math. Prove it to yourself.

    8. Re:Not a bug by Anonymous Coward · · Score: 0

      I got two words for you, "interval arithmetic".

      Bugs are a sputnik of programming. Syntax checking is done by the compilers mostly, using type theory, type checking. Semantic errors are harder to analyze, which is why people program them. Then there are system type bugs, the old initialize variables and check return values. Compilers are good, they can be better or worse.

      In pointer free languages the memory programming can be a hitch. I guess that is about resource sharing with the other processes on the chips, in a way.

    9. 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.

    10. Re:Not a bug by Anonymous Coward · · Score: 1, Funny

      Sorry, in every scheme I've seen, zero is rounded UP!

    11. Re:Not a bug by lightcycler · · Score: 1

      ceil() or ceiling() round up towards positive infinity

      floor() round down towards negative infinity

      int() or parseInt() rounds 'down' towards zero

      round() 'rounds off' towards the nearest integer, or if there is no nearest integer ( x%1 = 0.5), then towards positive infinity. (i.e. 3.5 rounds to 4, whereas -3.5 rounds to -3)

      Hence it's not weighted, as you'll see from a graph of x against round(x) from -10 to 10

    12. Re:Not a bug by Anonymous Coward · · Score: 0

      Obviously having a four-digit id doesn't indicate intelligence. Why don't you read some of the other posts and then come back and correct yourself. How about a simple proof - what is 5 - 4.5? 0.5 right? Ok now what is 4.5 - 4? 0.5 again. In other words .5 is exactly in the middle. There are 0's on both sides not just on the bottom. 01234|5|67890.

      I guess old habits just die hard.

    13. 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
    14. 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.
    15. Re:Not a bug by Theodrake · · Score: 1

      No you're wrong. You don't round numbers and then calculate the average. You round as the last operation. Under both rounding rules 7.5 rounds to 8.

    16. 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...

    17. Re:Not a bug by Theodrake · · Score: 1

      It's been too many years since I took Numerical Methods, but I stongly believe your last paragraph is completely wrong. This mistake I believe is due to not having to learn how to use a slide rule. Rule one, you can't get a greater accurracy out of something then what goes in. If we are rounding to three digits, then we must not look to the 5th digit for information. Only the fourth digit is considered significant in rounding. So taking 82.451 as an example. When rounding to 3 digits we first truncate to 4 digits, giving 82.45. Next we apply our rounding rule which gives 82.4 as the correct answer.

    18. 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...

    19. Re:Not a bug by Anonymous Coward · · Score: 0

      Well, I'm glad you disagree because it makes for discussion, but every major organization for mathematics, physics, engineering, or computer science that does numerical work says that always rounding up on 0.5 causes an overall upwards bias. I'm not aware of a single exception that says otherwise. I'm also not aware of any floating point hardware that supports always rounding up on 0.5 rather than rounding to even on 0.5.

    20. 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
    21. Re:Not a bug by Mantorp · · Score: 1

      Exactly, now try to make those 5 always rounds up people get it.

    22. Re:Not a bug by Anonymous Coward · · Score: 0

      Wonderful. A link to a proper rounding method gets modded to 0 Redundant, and the inaccurate response gets 5 Informative.

    23. Re:Not a bug by Anonymous Coward · · Score: 0


      Wonderful. A link to a proper rounding method gets modded to 0 Redundant, and the inaccurate response gets 5 Informative.



      Must be some bug in slashcode when rounding the
      5 Informative to 0 Redundant, obviously...



      — Pyrdek.


  4. MFC - variable initialization by jemele · · Score: 1
    or lack thereof!! want to guess what happens when a UINT isn't initialized to '0' when rolling through their print preview code ...

    fuckers.

    1. Re:MFC - variable initialization by Anonymous Coward · · Score: 0

      in c++, variables that are not global are not instantiated. you'll get some really bizarre data.

  5. 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"
    1. Re:Dialog boxes by Dalcius · · Score: 1

      About two weeks ago, Perldoc had the description of the open() function backwards when refering to pipes. It was backwards from the following:

      From Perldoc, opentut:
      If the leading character is a pipe symbol, open starts up a new command and open a write-only filehandle leading into that command.
      If the trailing character is a pipe, you start up a new command and open a read-only filehandle leading out of that command.


      Note that they fixed it. =)

      --
      ~Dalcius
      Rome wasn't burnt in a day.
    2. Re:Dialog boxes by Dalcius · · Score: 1

      I suppose what I should have added (doh!) is that this confused me for about 45 mins while I started at a working open() statement that returned a filehandle that wouldn't spit back data. =P

      Somehow I got the idea to check for other documentation on it. =P

      --
      ~Dalcius
      Rome wasn't burnt in a day.
  6. Obvious by Ubergrendle · · Score: 1

    Check out my favorite list: http://update.windows.com Obvious, yes, but as all good comedians say "know your audience"... :)

    --
    John Maynard Keynes: "When the facts change, I change my mind. What do you do?"
  7. 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 Mirage · · Score: 1

      That is the best (worst?) story ever.

    2. 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

    3. Re:1802 bug by Anonymous Coward · · Score: 0

      LOL!!~

    4. 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. Re:1802 bug by DuranDuran · · Score: 1

      Are you sure (unsure?) if you have (don't have) that right (wrong?).

      --
      "You can justify anything by putting it in quotes, adding a famous name and making it a sig" - Albert Einstein
  8. 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 Jobe_br · · Score: 1

      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 $$ transactions.

    2. Re:82.84499 by Anonymous Coward · · Score: 0

      Informative???? What the hell are you moderators smoking? This has NOTHING to do with floating point precision, read any other thread in this story for the correct explanation!

    3. Re:82.84499 by tpledger · · Score: 1
      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

      That was my first reaction too. But in this case, 82.845 = 2714665/32768. The denominator's an exact power of 2, and neither it nor the numerator is overly big, so 82.845 does happen to have a precise representation in the usual 4-byte floating point encoding (IEEE F, IIRC).

      --
      You have received this message in error.
    4. Re:82.84499 by SLi · · Score: 1

      Unfortunately, yes it does (with that too), since VB probably doesn't represent 82.845 quite exactly, which isn't even possible in base 16 unless you use rational numbers.

    5. Re:82.84499 by MooseGuy529 · · Score: 1

      That's a stupid bug but I assume it is because it stores the decimal part as pure binary... still stupid though

      --

      Tired of free iPod sigs? Subscribe to my blacklist

    6. Re:82.84499 by Anonymous Coward · · Score: 0

      82.845 != 2714665/32768.

      2714665/32768 ~= 82.8450012207031

      The double-precision IEEE representation of 82.845 in hex is 0x4054B6147AE147AE, with the 147AE... repeating

    7. Re:82.84499 by Fosberry · · Score: 1

      Actually, it depends on whether you are using 4 or 8 byte floating point values, and further what type of floating point value you are using.
      The 4-byte IEEE float representation of 82.845 is 82.8450012, but the 8-byte IEEE representation is 82.844999999999999. Approximately, of course....
      IEEE format actually stores the fractional part as a binary fraction with a fixed number of bits. See http://www.psc.edu/general/software/packages/ieee/ ieee.html for more details.
      So, VB was correctly rounding assuming it was using 8-byte IEEE format under the covers.

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

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

    9. Re:82.84499 by tpledger · · Score: 1

      Whoops! You're right. Mea culpa.

      --
      You have received this message in error.
    10. 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.)

    11. Re:82.84499 by crossconnects · · Score: 0

      it is a rational, but repeating number in binary, and thus impossible to accurately handle in the cpu.

      --
      no big sig
    12. 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...

    13. Re:82.84499 by Anonymous Coward · · Score: 0

      VB can represent 82.845 exactly by storing it as an Currency type (integer), which for 99% of VB applications is more useful than floating point vals.

    14. 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).

    15. Re:82.84499 by Anonymous Coward · · Score: 0

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

      No, no, no.
      It's probably your imagination.

    16. Re:82.84499 by Anonymous Coward · · Score: 0

      It means that using MySQL's numerical functions is THE ONLY CORRECT WAY to handle $$ transactions.
      It isn't called "banker's rounding" for nothing.

    17. Re:82.84499 by Anonymous Coward · · Score: 0

      Currency types can be rounded too, and it *still* uses banker's rounding, because it's supposed to.

  9. I had a pet virus once. by Unknown+Poltroon · · Score: 1

    It was on of the aincent init boot viruses. It took up something like 2 k of memory, and tried to put itself on bootable floppies. Seeing as how I never used bootable floppies on that system, and it had 200 meg of memory, it was more amusing to keep it alive than kill it. Alas, it died in the great hard drive purging of '01. Sad.

    --
    All Troll + "offtopic" mods are meta moderated as "Unfair", because you abused the system.
    1. Re:I had a pet virus once. by Anonymous Coward · · Score: 0

      Guess what dipshit, resident boot sector viruses infect EVERY FLOPPY you put into the computer. So glad to know you were spreading newbug (Anti-EXE) or it's cousins until 2001.

      Some people have no fucking clue.

    2. Re:I had a pet virus once. by Unknown+Poltroon · · Score: 1

      Really, Mr. Rocket scientist, then how come none of the floppies ever set of the virus check on my other computers unless it was bootable? I may have the TYPE of virus wrong, but I made sure it wasnt transmitting itself accidently.

      Some people do have a fucking clue.

      --
      All Troll + "offtopic" mods are meta moderated as "Unfair", because you abused the system.
    3. Re:I had a pet virus once. by ivan_13013 · · Score: 1

      Yes. That's 100 percent correct.

      ALL boot sector viruses are required by ANSI (surely you've heard them, they are the infamous cabal of hackers that invented the "ANSI bomb") to infect floppies within 5 seconds of accessing the disk. Since virus authors are required by Canadian law to adhere to these standards, it seems VERY doubtful that someone would write a boot sector virus that did not conform to the specification.

      ...

      Some of my favorite and bugs along this line:
      * The bug in 1813/Jerusalem-B that caused it to re-infect the same files over and over again.
      * The bug in MacMag (the advertising virus!) that caused it to crash the MacII after infection.
      * The bug in Cascade that caused it to infect systems with IBM BIOS's even though it tried to avoid them.

      -=Ivan

  10. Not a bug by Agthorr · · Score: 0, Redundant
    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. A more accurate method is shown here , which matches the behavior shown.

    -- Agthorr

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

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

    1. Re:Heisenbugs by Anonymous Coward · · Score: 0

      Only in crappy unsafe languages like C and C++...

    2. Re:Heisenbugs by Anonymous Coward · · Score: 0

      Yeah, those are so much more annoying than the nice, reproducible Bohr bugs.

      Damn quantum computing.

    3. 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.

    4. 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.
    5. Re:Heisenbugs by Anonymous Coward · · Score: 0

      Kewl. I bet you read that in the Jargon file, and you've been saving it up to spring on us when the right topic came up.

    6. Re:Heisenbugs by Anonymous Coward · · Score: 0
      Programs complied from such code are often called Beta tests.

      Oh, wow. Here we call that FCS. Huh.

    7. 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.
    8. 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.
    9. Re:Heisenbugs by Ami_Chan · · Score: 1

      Speaking of heisenbugs, can bug-antibug pairs spontaneously create each other and get annihilated? And what happens when a black hole is near the created pair and the antibug gets trapped; is the black hole seen to be radiating bugs?

    10. Re:Heisenbugs by Anonymous Coward · · Score: 0

      > 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.

      In my experience it hasn't been a fairly-weighted average; more like 60+/40- in favor of it being bugged.

    11. Re:Heisenbugs by Anonymous Coward · · Score: 0

      > Speaking of heisenbugs, can bug-antibug pairs spontaneously create each other and get annihilated?

      Sure; the result is usually an explosion of glossy marketing brochures.

    12. Re:Heisenbugs by Anonymous Coward · · Score: 0

      A colleague once spent something like 4 weeks tracking down a bug in an HPIB card. Under normal use, the machine (Windows and everything) would lock up solid after a random period of time (but usually multiple hours). When debug code was added, no problems happened.

      Turned out that there was a critical timing problem in the HPIB communication. The debug code slowed it down just enough to work without problems.

      And as it happened, HP already knew about the problem - they had just not bothered to tell anyone... The card is the 82340, later replaced by the 82341, if you're wondering. Same card, but the problem is gone.

      I wish those guys would do a Linux driver for the card...

    13. Re:Heisenbugs by AndrewHowe · · Score: 2

      Solution: leave the debug code in?
      Only joking!

    14. Re:Heisenbugs by brain159 · · Score: 1
      Bugs and antibugs can quite easily cancel each other out - many times I've made a +1 mistake somewhere and a matching -1 mistake elsewhere and they've gone unspotted until later.

      As for "radiating bugs", we're venturing into Bogon Theory, whereby your working code fails when you show someone else, or your error vanishes when you seek help.

    15. Re:Heisenbugs by epischel · · Score: 1

      We had one such bug. Just the day when testers from the customer were in the office, our java web app decided not to work. after incrementally adding debug code to it - it worked again. (after 2 hours or so). we commented out the debug code - it still worked. we didn't change any "real" code. so what to say about this?

    16. 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...

  12. 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 geogeek6_7 · · Score: 1

      Those errors are telling you that your source code does not work correctly. That is what a compiler is supposed to do.

    2. 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
    3. 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
    4. Re:GCC 2.x and 3.x compiler by Anonymous Coward · · Score: 0

      I thought it was funny. But I am just an AC, so sucks to your karma.

      Thbbbt!

    5. Re:GCC 2.x and 3.x compiler by unsinged+int · · Score: 1

      Probably declaring a to be volatile would have worked too.

    6. 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
    7. Re:GCC 2.x and 3.x compiler by Anonymous Coward · · Score: 0

      printf() is a varargs function. Parameters to
      varargs functions are passed on the stack, rather
      than in registers. So addind a call to printf
      to your code means that variable a is forced to
      reside in memory, changing how gcc can optimize it
      and hence making the "bug" come and go.

    8. 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. :)

    9. Re:GCC 2.x and 3.x compiler by naasking · · Score: 1

      That's nothing! In writing an operating system kernel for my design project, gcc would generate code that crashed when my keyboard source file started with a 'k'! As soon as I renamed it, no other changes, it compiled and executed correctly. Just try to picture it:

      $ ls

      kybd.c ... (blah)

      $ make

      (compiling)

      (try the kernel, it crashes)

      $ mv kybd.c pskybd.c

      $ make

      (compiling)

      (try kernel and it runs perfectly)

      $ mv pskybd.c kybd.c

      $ make

      (compiling)

      (try kernel and crashes again!!!)

      $ diff kybd.o pskybd.o

      Binary files kybd.o and pskybd.o differ

      WTF?!? Inconceivable! Doing a 'diff'

    10. 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.)

    11. Re:GCC 2.x and 3.x compiler by Captain+Chad · · Score: 1

      Perhaps gcc has a kybd.o file in one of its libraries. Libraries are organized by filename (not function name). Your kybd.o would take precedence over the other one.

      --
      Check out Chad's News
    12. Re:GCC 2.x and 3.x compiler by naasking · · Score: 1

      It shouldn't matter. I'm compiling a kernel here don't forget, which means I'm not linking against ANY libraries; all purely my own code. Besides, didn't you see the diff at the end? Compiling kybd.c and pskybd.c produced different object files, and that's mind boggling.

    13. 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.
    14. Re:GCC 2.x and 3.x compiler by Anonymous Coward · · Score: 0

      Actually, you could write a VB front end for GCC if you realy wanted to...

    15. Re:GCC 2.x and 3.x compiler by naasking · · Score: 1

      No, you are correct. The object file maintains the file name as one of it's symbols IIRC. But the tests I ran weren't so simplistic. I remember stripping the object file of all symbols(so it was just instructions) and diff'ing and it was still different. I just didn't want to go into that much detail. ;-)

    16. Re:GCC 2.x and 3.x compiler by Captain+Chad · · Score: 1

      Let me double-check this. You didn't use ANY of the built in routines -- which means that you didn't #include any of the gcc include files and didn't even use standard C functions like memcpy() or vsprintf()?

      --
      Check out Chad's News
    17. Re:GCC 2.x and 3.x compiler by naasking · · Score: 1

      Correct (unless I misunderstood/misapplied the compile-time options). Compile options:

      GCC_FLAGS= -Wall -O2 -finline-functions -fno-builtin -nostdinc

      LD_FLAGS= -Bstatic -Ttext 0x220000 -s -nostartfiles -nostdlib

      So it doesn't check the standard library includes, and it doesn't link against any standard files, including the Linux start files. Unless I missed something, it thus doesn't link against anything except my own code. Some of my own code implemented some routines like vsprintf, etc. but I didn't use those functions in the code (and I didn't have any structures in kybd.c so gcc wouldn't have referenced them implicitly).

      The source for the keyboard driver is here if you want to see for yourself.

      The root header include path is explictly set to src/include, so that's the stdio.h include you see pskybd.c referencing. That's where you'll find invoke.h and types.h too. If you're really curious (and adventurous), the whole project archive is there for the download. I apologize if the source in incomprehensible. ;-)

      I'm not sure if the problem still occurs since I haven't touched this code in months and work is pretty much done (project is over). I originally didn't have enough time to try and figure out what was going wrong in this situation, so it's still kind of a mystery.

    18. 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.

  13. sneeky colon by LedZeplin · · Score: 1

    staring at code for an hour trying to find the error, all because a colon looked like a semi-colon on my screen.

    1. Re:sneeky colon by Captoo · · Score: 1

      That reminds me of the times when I spent hours tearing my hair out trying to figure out why the compiler was complaining. There were a couple of times when I left a semicolon out of one file and the compiler kept returning errors that referred to a completely different file! The other file didn't even mention the problem file anywhere. Or vice versa.

    2. Re:sneeky colon by Anonymous Coward · · Score: 0

      Reminds me of the time i let loose an earth-shattering fart and shit my pants.

    3. Re:sneeky colon by Tom7 · · Score: 1

      This happens frequently when forgetting the semicolon at the end of a class or struct definition in your header file. Since it's pasted into the source file you compile, and the parse error doesn't happen until *after* that file has ended, it reports the error in the source file, not the header file. I had this one on a job interview once. ;)

    4. Re:sneeky colon by Jaycatt · · Score: 1

      I despise this kind of error so much it's the reason I've never involved myself much with programming.

      --
      "Shared pain is lessened; shared joy is increased. Thus we refute entropy" - Spider Robinson
    5. Re:sneeky colon by avalys · · Score: 1

      Aren't most compilers polite enough to spit out a "Line xx:expected ';' " error in that case?

      --
      This space intentionally left blank.
    6. Re:sneeky colon by nic · · Score: 1

      Back in 1978, when I studied PL/1 at SSU in Minnesota, I went nuts trying to figure out why my program, the first assignment of the class, wasn't working. I re-read every punch card (yes, punch cards!) and I still couldn't find the bug. Between each run of the program, I had to wait 30 minutes for my "job" to get it's turn (good ol' batch processing).

      I focused all of my energies on card 47, column ten - the debugger was sure that there lay the problem. It was just what I expected, though, a period! Finally, a classmate came into the lab, and I asked if I could see his card #47. I held the two cards up to the light, and sure enough, there was a difference. My card and his had a different punch pattern for column 10! Turns out that I had a comma and not a period, but the print head on the card punch machine was broken, and wouldn't print any descenders, so what looked like a period was actually a comma!!

      I dropped the class the next day, and never took another programming course. I have been programming ever since, but never again in PL/1.

      --
      All opinions expressed are mine, if you want them it'll cost you.
    7. Re:sneeky colon by AndrewHowe · · Score: 2

      Oh the times you wish people forgot to check "Post Anonymously"!

    8. Re:sneeky colon by Anonymous Coward · · Score: 0

      My favorite bug ever. I was the senior perl programmer, and they'd hired a summer intern who "knew perl inside and out." I spent a day looking at code like this:

      my $i;
      for ($i = 0, $i $MAX, $i++)
      { do something to $array[$i] }

      The problem was that it didn't ever alter anything past $i[0] and $i[1]. I spent the better part of two days trying to work out this bug. I looked at the perl source code. I retyped the line, and it worked.

      The bug? The guy who "knew perl inside and out" used , instead of ; -- and perl didn't complain, because the alternative was meaningful -- a foreach (0, 1, 0), basically.

      That intern wrote a *lot* of code. I left before I had to deal with maintaining any of it.

  14. 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 misterklaw · · Score: 1

      It is probably a female.

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

      How is that offtopic that was my first though while reading the article....

      --
      This must be Thursday, I never could get the hang of Thursdays.
    3. Re:Spider by Anonymous Coward · · Score: 0

      Good story :-)

    4. Re:Spider by Anonymous Coward · · Score: 0

      He is our hero.

    5. 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.
    6. Re:Spider by I+am+Jack's+username · · Score: 1
      > 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

      ...and if you don't want him to crawl on your PC you just put an ASCII art picture of robots on a nearby folder?

  15. Yeah by Anonymous Coward · · Score: 0

    I know what you mean about the bugs!
    I have had my fair share too!

    Later!
    Theo

    1. Re:Yeah by Anonymous Coward · · Score: 0

      If you were really Theo The Rat, you would have used caps, swore and called someone an idiot for no reason. You're far too cheery (All those exclamation marks?!) to be Theo The Rat. I'm not convinced.

  16. A QBASIC story. How embarassing. by Mister+Snee · · Score: 1

    Yeah, yeah, it was a long time ago. But a friend and I were somewhat blown away to find out that the QBASIC code:

    PRINT #2, INPUT$(1, 1)

    Or some close equivalent to that, intended to write to file handle #2 a single byte from file handle #1, ended up outputting the single byte to stdout instead. We spent half an hour trying to figure out what our mistake was. It wasn't. It was just a strange, stupid interpreter error in a program language that's rife with them.

    Yeah. Heh. Well, I thought it was funny.

  17. Yet another MS feature by Shamanin · · Score: 0, Troll

    Allowing Basic to be a programming language (in any incantation) is a BUG!!!

    --
    come on fhqwhgads
  18. Bugs? by Tymeless · · Score: 1

    Java: Need I say more??? http://www.tymeless.com

    1. Re:Bugs? by Anonymous Coward · · Score: 0

      Java 1.4 has so few bugs, especially impressive for its features.

      However, the last few decades of C have been majorly flawed; whole features of the Standard C listing were missing.

      Only within the last few months has anyone actually created a complete C compiler.

  19. Borland C memory models by RussRoss · · Score: 1

    Remember tiny, small, medium, large, and huge memory models under DOS with Borland C? Huge existed to provide pointers that were normalized and could be compared like integers (offset was always less than 16), unlike large. Under pre-32 bit x86, all memory addresses were of the form segment + offset, where segment might be implied. The actual address was segment * 16 + offset. This was useful for some things, but it was abandoned in favor of a much better system (virtual memory).

    Unfortunately, pointer normalization didn't actually work, at least in the version I used. It took me forever to figure that out--after all, the whole purpose of the huge memory model was to provide that functionality. After the clumps of hair that I'd pulled out grew back, I wrote a bunch of ugly C macros to do the job.

    Such a dumb bug, but it was so frustrating that it immediately jumped to mind.

    - Russ

    1. Re:Borland C memory models by snofla · · Score: 1

      You remember 16 bit protected mode, and having far callable functions and the mantra: set DS right!? Ugly.

      --
      i don't like style guides
    2. Re:Borland C memory models by Anonymous Coward · · Score: 0

      char far* and all that yuk

    3. Re:Borland C memory models by Anonymous Coward · · Score: 0

      This is one of the only +Interesting posts. Mod this up or I'll meta mod all you fuckers to hell.

  20. What bugs? by Anonymous Coward · · Score: 0

    csh never had any bugs!

  21. 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 Jobe_br · · Score: 1

      Reading a book or the PHP manual on PHP functions would have helped you out here, me thinks :) PHP defaults to "by-value" function arguments. See here:

      http://www.php.net/manual/en/functions.arguments .p hp

      Cheers!

    3. 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.

    4. Re:Personal Favorite by Anonymous Coward · · Score: 0

      Pascal uses pass by value. C/C++/Java uses pass by reference for structures and pass by value for scalars. Most pure object oriented languages use pass by reference for everything.

    5. Re:Personal Favorite by PissingInTheWind · · Score: 1
      That's "pass by value", while you were expecting "pass by reference".

      It's pretty common in programming languages, and not a crack-headed design as you might think.

      Examples in C:

      • int foo (int bar) {...} ---> pass by value
      • int foo (int &bar) {...} ---> pass by reference
      • int foo (int *bar) {...} ---> passing directly a reference
      --

      A message from the system administrator: 'I've upped my priority. Now up yours.'
    6. Re:Personal Favorite by Anonymous Coward · · Score: 0

      Just because PHP uses pass by value instead of pass by reference does not make it crack headed.

      C defaults to that behavior, too. If I have a struct 'bob' and a function 'foo', then:

      foo(bob);

      also sends a copy of the object.

    7. Re:Personal Favorite by davidmccabe · · Score: 1

      In Java there is no concept of value vs. reference. Everything is a reference.

      If I want a reference to a copy of this object that I have a reference to, I call its clone method:

      foo = bar.clone();

      Otherwise, whatever I pass is a reference. Even owning objects in variables and members is an illusion; you only have a reference to the object.

      I'm not sure if this applies to the primitive types which Java unfortunately still has, but all object stuff is done by reference transparently, so there is no confusion, and no weird pointer syntax.

      We don't even have pointers.

    8. Re:Personal Favorite by Anonymous Coward · · Score: 0
      This is pass-by-value. The S language does this, though the newer implementations don't actually make a copy until you try to change your local copy. This means that you have far fewer side effects, which can make for cleaner programs with fewer bugs.

      Some languages do pass-by-reference, in which you pass the object itself. This is fast and space efficient, and can produce side effects, which can produce bugs.

      I suggest that if you want function to modify $object, you say $object = function($object), and take advantage of the facilities your language offers. Don't try to make everything into C.

      By the way, how does one get the less-than sign to show up in html? I wanted to use less-than minus-sign to indicate assignment, but only the minus sign showed up.

    9. Re:Personal Favorite by pizza_milkshake · · Score: 1
      I believe they've changed it so that all you need to do is change the function definition. Whereas once once needed:

      function f($o){ print_r($o); } f(&$o); one can now do the simpler:

      function f(&$o){ print_r($o); } f($o); This is easier to deal with because, as you've pointed out, hunting down everyhwere one calls a function can be a pain.

    10. Re:Personal Favorite by Anonymous Coward · · Score: 0
      The worst "bug" that I can remember is the one with the portable GNU Assemler. Me and my friends were coding embedded assembler code into our C project and couldn't get the "accelerated" assembler functions to work.



      ...until my friend found out that the portable GNU Assembler mixed one Intel CPU comparison with its negation because of some (typing) errors in the Intel CPU command reference (8086 or 80286 CPUs - before our time anyway). It was later on fixed in the manuals, but the GNU developers wanted/had to to maintain this mix-up feature, because so much code had been already made and they had to keep'em working :)



      After we "mirrored" the assembler commands (as stated in the misprinted manuals) everything worked fine.



      Which was nice. Later on I have trusted the optimization capabilities in the C-compilers (like gcc) in order to avoid this problem/bug again.



      Cheers!

    11. Re:Personal Favorite by von+Konrad · · Score: 1

      If you read the docs for the more recent PHP engine, you'll find it only makes a copy upon a change to the variable. So, when you call a function without pass-by-reference, the passed variable is pointing to the origional (though it can never change the origional).

      ~Rob

    12. Re:Personal Favorite by Anonymous Coward · · Score: 0

      all primitaves(SP?) (ie int, float) are pass by value and all objects (ie Integer, Double, String, Array) are pass by reference.

    13. 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)

    14. Re:Personal Favorite by tetsuji · · Score: 1

      This is usually wonderful and occasionally annoys the hell out of me when an object I want to clone doesn't implement Cloneable properly, and so while the object is cloned, private members referenced by that object just have their references copied and so you end up corrupting the original object anyway if you change one of the members.

    15. 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/
    16. Re:Personal Favorite by Anonymous Coward · · Score: 0

      Except he wasn't passing int, he was passing an object. When you pass an object in C, it only "pass-by-value" copies the pointer to the object (you can't reassign the variable to another object). It essentially is a pass by reference by default. Works the same way for arrays. It is confusing for C programmers to live in a system that copies EVERYTHING.

    17. Re:Personal Favorite by Lordrashmi · · Score: 1

      Actually, PHP currently supports the =& thing. It works great. Also, PHP doesn't copy the variable when you first pass it, only when you change it.

      For example,
      $bar = 5;
      $foo = $bar;// both foo and bar point to the value "5" in memory.
      $foo = $bar + 1;// bar still points to "5", but foo now points to a new value in memory "6"

      However, with
      $bar = 5;
      $foo =& $bar;

      foo and bar always point to the same value in memory

    18. 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/
    19. 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

    20. 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.

    21. 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...

    22. Re:Personal Favorite by Random+Bystander · · Score: 1

      Also, for Java, everything is passed by value. (Just that for object types, the value is the reference address, not the object itself). So it will duplicate the value that the variable holds when passing it off to another method. There are no exceptions, but there are many misconceptions.

    23. Re:Personal Favorite by Anonymous Coward · · Score: 0

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

      Not in C, C++ or Java. All of these have pass-by-value as the default, except for arrays which are by-ref.

      (Yes, in Java it's pass-pointer-by-value, but it's still pbv.

    24. Re:Personal Favorite by Anonymous Coward · · Score: 0

      > We don't even have pointers.

      Incorrect; you only *have* pointers. The only way to create a Java object is

      MyObj myVar = new MyObj();

      and myVar is a pointer to a MyObj. It's automatically dereferenced, like a C++ reference, but it's still a pointer. That's why if I were to say

      myVar = new MyObj();

      again, the address of the first myObj is lost and the object will eventually be garbage collected; you've changed the value of the myVar pointer.

    25. Re:Personal Favorite by davidmccabe · · Score: 1

      Actually, there are not pointer, they are references, which in C++ terms are different.

      References are basically pointers except that you don't see them. They are transparent pointers.

      C++ has references. I don't remember exactly how different they are from C++ pointer, but they are two separate things.

    26. Re:Personal Favorite by Mr+Z · · Score: 1

      C is pass by value for structures also. You get pass-by-reference by passing a pointer to the struct (or whatever you want to pass by reference). The following code example illustrates:

      struct foo
      {
      int field;
      };

      void modify_argument(struct foo bar)
      {
      bar.field = 42;
      }

      int main()
      {
      struct foo baz;

      baz.field = 69;
      printf("Before call: baz.field = %d\n", baz.field);
      modify_argument(baz);
      printf("After call: baz.field = %d\n", baz.field);

      return 0;
      }

      This will print out:

      Before call: baz.field = 69
      After call: baz.field = 69

      See? Pass by value, not pass by reference.

      ObNit #1: Some ABIs actually define the calling convention for structs so that structs are passed by reference. However, if you read closely, those same ABIs also mandate that the callee must copy the argument before writing to it, thereby preserving pass by value semantics. The advantage is that not all calls result in a copy, if the callee treats the struct as read-only.

      ObNit #2: C seems like it's pass-by-reference for arrays, but only because it's impossible to have an array argument. You can only pass pointers, structs and scalars to functions. (The subtle irony: Structs can contain arrays.) So, when you want to pass an array to a function, you end up really passing a pointer to the array's first element. (An array reference decays to a pointer to the array's first element.)

      --Joe
    27. Re:Personal Favorite by Anonymous Coward · · Score: 0
      We don't even have pointers.

      The only effective difference between references and pointers is that pointers can also point to individual array elements and be incremented/decremented/moved along the array, right? Otherwise, what's the difference, aside from spelling?

    28. 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.
    29. Re:Personal Favorite by Anonymous Coward · · Score: 0

      C does have structs, which are passed by value.

      In C++ everyone does not "work with pointers anyway". You can, but you can also pass an object by value, provided that the object you are passing implements a copy constructor (When you pass an object by value, you create a copy of that object and then pass the copy to the method or function your're passing too).

      You can also pass an object by reference by E.g. object inst;method(&inst); Not that in C++ the reference operator (&) is not the same as the C "address of" operator (Which is long* foo=)

      Disclaimer: I've only writting in C++ for a year or so, and I may well be wrong on the finer details here. My code compiles with -Wall though ;)

    30. Re:Personal Favorite by some+guy+I+know · · Score: 1

      &lt; --> <
      And if you want to display the ampersand (&):
      &amp; --> &

      Or just pick "code" formatting from the drop-down box.

      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
  22. The bug I hate the most by Cmdr+Taco+posted · · Score: 0, Troll

    is the bug that keeps posting these stupid 'Ask Slashdot' questions. I really need to fix that.

  23. round(84.245) != 84.25 by Anonymous Coward · · Score: 0

    The most analytical way to round is defined as rounding the 5 up if the digit to the left is odd, keeping the digit to the left the same if it's even. So, rounding 84.245 should be 84.245.

    Rounding 84.255 should give 84.26.

    1. Re:round(84.245) != 84.25 by Anonymous Coward · · Score: 0

      So, rounding 84.245 should be 84.245.

      I'm not quite sure you understand the concept of rounding.

  24. 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

    1. Re:Funkified Variable Name by Anonymous Coward · · Score: 0

      That's not called "stupid previous programmer", it's called "job security".

    2. Re:Funkified Variable Name by Anonymous Coward · · Score: 0

      I knew a guy who once implemented just about every function this way:

      int function_name(string arg1, string arg2, string arg3, string arg4) { ... }

      What was worse was that arg2 and arg3, you see, could be integers. Before calling you were expected to use ltoa() to turn your integer into a string, only to have the function call sscanf() to covert it back. Why sscanf() instread of atol()? Drumroll, please...

      "Because that makes it easier to change the parameter to a float later on."

    3. Re:Funkified Variable Name by Anonymous Coward · · Score: 0

      When programming, you really should use a font where l and 1 (as well as O and 0) look different.

    4. Re:Funkified Variable Name by Anonymous Coward · · Score: 0

      I agree. It's not a "previous programmer" problem, it's a "stupid programmer wanting fancy screens" error.

    5. Re:Funkified Variable Name by pheonix · · Score: 1

      Hey, that's not stupid, that's job security. I pick the most irritating variables and the most difficult to understand commentary simply for the fun of watching the other programmers try to puzzle out my 220 line bubble sort...MUAHAHAHAHAH!

  25. Memo fields in MS Access... by thot · · Score: 1

    ...have to be set last in an update command when using the ADO library.

    It took me 2 days (actually it took me up to the point where a friend said "oh yeah, set those last") to find that bug.

    1. Re:Memo fields in MS Access... by barnsleyBigUn · · Score: 1

      I had one where you took two Memo fields into two String Variables...that was fine.

      But then concatenate them and you end up with loads and loads of binary garbage after about 251 characters...

      But getting ADO to concatenate them in the SQL returned fine...

      Now I'm follically challenged and I know why!!!

  26. String.length() by spahn · · Score: 1

    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"

    1. 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
    2. 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.

  27. 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 tomhudson · · Score: 1, Funny
      I guess this is another example of Microsoft's "embrace, extend" culture ... they've changed the way the round() function should work.

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

    2. 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.

    3. Re:From MSDN... by optikSmoke · · Score: 1
      I guess this is another example of Microsoft's "embrace, extend" culture ... they've changed the way the round() function should work.

      Ahem,.. no. There are other languages that do this (PHP is the first thing that comes to mind), its called "banker's rounding" and, as the first poster implied, it is for statistical reasons.
    4. 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.

    5. 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.

    6. 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.
    7. 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!

    8. Re:From MSDN... by tomhudson · · Score: 1

      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.

    9. Re:From MSDN... by Anonymous Coward · · Score: 1, Informative

      "If you're trying to find the difference of a series of numbers", THEN WHY ARE YOU ROUNDING THEM FIRST?

    10. Re:From MSDN... by tomhudson · · Score: 1
      Well, let's look at the facts regarding computers and numbers:
      100 / 3 * 3 == 100 will always be false because computers don't understand fractions the way humans do, and can only store an approximation of many fractions.

      So, the correct way to test is to select a difference, and see if the comparison falls within your allowed difference:
      (100 / 3 * 3 - 100) < 0.00001

      The same thing goes for rounding - there is no proper way to round .5, because it's exactly 1/2. This is a defect in our number system.

      Any system we come up with is going to be inconsistent, but I think it's better to have the inconsitencies always go in the same direction - causes fewer problems when doing comparisons, for example.

      Unfortunately, rounding up depending on the previous digit will only work "properly" if you have a perfectly distributed data set, not very likely in the real world.

      There are lies, damn lies, and statistics ...

    11. 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.
    12. Re:From MSDN... by Anonymous Coward · · Score: 0

      the average error over a statistically random or infinite set.. many are not, of course!

    13. Re:From MSDN... by tomhudson · · Score: 1

      Example: Maybe they're being saved to a device with limited storage space first (eg: an embedded sensor)?

    14. Re:From MSDN... by Anonymous Coward · · Score: 0

      My Casio CFX-9850G calculator thinks that 100 / 3 * 3 == 100

      Just thought that you should know :-)

    15. Re:From MSDN... by tsg · · Score: 1

      And it's for good reason: 2.5 is NOT closer to 3 than to 2.

      This is only true in the very specific case where there are no digits to the right of the digit your using to round. 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. In fact, if the digit to the right of the rounding point is 5, it's going to be closer to the higher digit than the lower except in the very rare case that the number you are rounding is exactly equal to the number truncated after the 5. If your numbers are only being rounded off by one decimal place consistently, you may want to re-evaluate why you're rounding them off.

      For the record, I learned 0 through 4 round down, 5 through 9 round up. Half go down and half go up. Zero is included because very often there are non-zero digits to the right of the zero you care about.

      ObPeeve: People who insist that "about 10 inches" is "25.4 centimeters".

      --
      People's desire to believe they are right is much stronger than their desire to be right.
    16. Re:From MSDN... by Theodrake · · Score: 1

      And as a math professor of mine once said. With computers you should just remember how you rounded last time and do it different the next time. So just choose to round up the 1st time, down the 2nd, up the 3rd, down the 4th, etc.

    17. 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.

    18. Re:From MSDN... by bmwm3nut · · Score: 1

      yes but it's no where near as fast as an x86. a calculator uses differnent ways to store numbers so that it's more precise, but it's god awful slow compared to a computer.

    19. Re:From MSDN... by GeckoX · · Score: 1

      So does MS calc ;-)
      Guess I'm not running windows on a computer then ehh?

      --
      No Comment.
    20. Re:From MSDN... by yakovlev · · Score: 1

      NO, NO, NO, NO, NO!!!

      Look at the post again.

      0.1 goes down. As does 0.01, and 0.001, and 0.0001...

      And likewise:
      5.1 goes up. As does 5.01, 5.001, 5.0001...

      The only question is 5.0000000...

      This doesn't matter though, because it is highly unlikely that 5.0000000 would ever occur. (probability 0)

      Problem is, 5.0000000 occurs a lot in real-world data sets, even though it shouldn't statistically.

    21. Re:From MSDN... by Anonymous Coward · · Score: 0

      yep. I was taught to round that way long before computers were involved.

    22. Re:From MSDN... by Anonymous Coward · · Score: 0

      banks would love that for calculated your savings interest (reverse for your loan interest.

      We rounded up the last time, so round down.
      We rounded up the last time, so round down.
      We rounded up the last time, so round down.

      oh-- must've been a bug. We'll try to fix it. ;>

    23. Re:From MSDN... by Anonymous Coward · · Score: 0

      Ummmm No, you are a moron! This is not the mathematically standard definition of round. This spec MS is using is WRONG WRONG WRONG. It might obery some statistically accepted standard, but then again, when is the last time statistics were right??

    24. Re:From MSDN... by JudgeDredd · · Score: 1

      Incorrect. Take 100 numbers: .00, .01, ... .98, .99
      50 of them become 0, 50 become 1
      Who cares whether the number is changed? Are you saying that there is some problem with .00 rounding to 0?

    25. Re:From MSDN... by Anonymous Coward · · Score: 0

      No, there are 5 numbers that are changed... you forgot to include 0

    26. Re:From MSDN... by mentin · · Score: 1
      We learn it is Russian schools too.

      But obviously you don't need school education to blame all your problems on Microsoft, and post an article about this to Slashdot.

      --
      MSDOS: 20+ years without remote hole in the default install
    27. Re:From MSDN... by Anonymous Coward · · Score: 0

      Last time I was in Russia, your sister gave me such good brains... practice makes perfect and MAN was she perfect!

    28. Re:From MSDN... by cheezedawg · · Score: 1

      Yes- not to mention the FPU in x86 processors defaults to this rounding. So even if you code in asm it will use bankers rounding (unless you change the FPU control word). This has nothing to do with VB.

      --
      "The defense of freedom requires the advance of freedom" - George W Bush
    29. Re:From MSDN... by Economist · · Score: 1

      Never trust MS Calc:

      try this: 3 + 3 * 3 =

      In standard mode it equals 18
      In scientific mode it equals 12

    30. Re:From MSDN... by 1729 · · Score: 1

      This is only true in the very specific case where there are no digits to the right of the digit your using to round. 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.

      No, 2.59 is rounded up. You have to look beyond the first truncated space when rounding correctly. Rounding on a computer is typically done in binary, but since .5 has an exact binary expansion, this sample program should demonstrate correct IEEE round-to-nearest:

      #include <stdio.h>
      #include <math.h>

      int main()
      {printf("%f\n%f\n%f\n",rint(2.5),rint( 2.59),rint(3.5));
      return 0;
      }

      Compiled with gcc on Solaris, I get the following output:

      2.000000
      3.000000
      4.000000

    31. Re:From MSDN... by Anonymous Coward · · Score: 0

      I simply am amazed that anyone has the gaul to argue this one. GO GET A FUCKING EDUCATION. Wait, isn't it slashdot that has a story every other week about how a degree is not needed...

    32. Re:From MSDN... by zoydoid · · Score: 1

      what's wrong with that? standard mode is 'as you enter' scientific mode uses operator precedence.

    33. Re:From MSDN... by 1729 · · Score: 1

      truncated space

      Errr, truncated digit.

    34. Re:From MSDN... by Anonymous Coward · · Score: 0

      MS changing the round function?????

      MS-BASIC's round function has always worked that way. If they changed something, it was 20 years ago.

    35. 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.
    36. 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.)
    37. Re:From MSDN... by Anonymous Coward · · Score: 0

      Just because the system is agreed to, doesn't make it correct.

      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?

    38. Re:From MSDN... by Anonymous Coward · · Score: 0

      The bug is that they're rounded, not how they're rounded.

      In everyday mathematics, using bankers rounding *decreases* the average error.

    39. Re:From MSDN... by mmol_6453 · · Score: 1

      hear hear!

      I've recently begun noticing the sheer lack of organization that people have when they see anything they can make into an "anti-Microsoft" claim. Things like not reading articles before paraphrasing them, or attacking the stability of Whistler before anyone had run it.

      Don't get me wrong...I'm a politically active anti-Microsofter, writing to senators and representatives frequently. I signed a petition to keep the current operator of OPN, and I run Linux on every box I have control over. My family finally told me to shut up after I spent months trying to get them to try Linux. My step-dad is surprised every time I describe something I can do in Linux, even though he programs QNX.

      I'm just tired of brainless bashing.

      I don't know whether I'm growing up or not.

      --
      What's this Submit thingy do?
    40. 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.
    41. Re:From MSDN... by optikSmoke · · Score: 1

      I agree completely

      More importantly, I find it annoying when people assume that every supporter of linux is mindlessly anti-Microsoft, just because of the joe-average mindless Microsoft hater. Another time I find this particularly annoying is in "desktop wars", where KDE or GNOME users brag about one feature that they are so proud of and that they don't think exists in the other desktop (and it does). When a flame war breaks out between GNOME and KDE users, there will invariably be more than one user from each "side" that does this, every time. Even more annoying (sorry about the rant here, also somewhat OT....) is when people write articles that have this kind of stupidity, and those articles always incite the greatest, and most useless, flame wars.

      In any case, I wish people would think before they talk :)

    42. Re:From MSDN... by mmol_6453 · · Score: 1

      The worst part is, a lot of it can't be avoided. Take the argument denouncing M$'s round() function. Just because it didn't do what I (along with many, many others) had always been taught "was the only right way to round", someone posted the message.

      There's no way to keep people from assuming they know everything important about a particular topic. That's unpreventable to the point of being the cause of nearly every bad decision in history.

      And if a person thinks they know enough about something to say something wise about it, then by all means they should say something. I don't remember where I heard this, but this situation is like the one quoted: "No society can be both free and safe."

      In this case, no social gathering can be both speak and alwasy be intelligent.

      --
      What's this Submit thingy do?
    43. Re:From MSDN... by Anonymous Coward · · Score: 0

      Anon Coward 1 needs to get an ******** education himself if he spells gall gaul. Hasn't he heard of Asterix the Gaul?? (French dude who kicked Roman ass)

    44. Re:From MSDN... by PipianJ · · Score: 1
      random() only returns 666 if you use a demon seed!

      Or if you have a copy of Urutsukidoji encoded in DivX hidden on you machine.

    45. Re:From MSDN... by Anonymous+Coed · · Score: 1

      Your calculator is still a binary computer. It's just doing some behind-the-scenes magic so your brain doesn't explode.

    46. 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...
    47. Re:From MSDN... by matguy · · Score: 1

      I would think that splitting it in to two different functions (unless they alredy did) would release a little of the confusion. Personally I would make round do it the gradeschool/accountant way and a statistical round function (sround?) that does it the "correct mathematical" way. That way, people haphasardly coding would use the round function predictably, but people who want the statistical version could read the documentation to find what seems to be a more advanced implementation.

      --

      matguy(.com)
  28. 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).

  29. Code Warrior Problems by DetrimentalFiend · · Score: 1

    I remember when I had some code than ran on other compilers but wouldn't run on Code Warrior. After hours of trying to figure out what was the problem I finally found that the problem was that Code Warrior re-allocated them memory for a certain variable in the middle of a function. The variable simply stopped existing in between two lines of code. I still, to this day, don't know how it happend. In the end, I fixed it by making the variable static.

  30. 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.

    1. Re:older eds by vrmlknight · · Score: 1

      common karma that site can be found here http://slashdot.org and the best way to get older articles is here

      :)

      --
      This must be Thursday, I never could get the hang of Thursdays.
  31. Bugs? What bugs? by Doom+Ihl'+Varia · · Score: 1

    My code has no bugs. Bugs... Pfft. Damn whipper snaper inexperienced coders and their "bugs".

  32. heh, how timely by Anonymous Coward · · Score: 0

    I'm working on oneright now. VC++ on my machine doesn't load/save any of the resource names in the .rc file, while in everyone else's it does.....If I check my file into CVS then all the names are gone for everybody. In essence, if I do anyhting I ruin it for everyone. So, I don't get to do my work (hence me reading slashdot ;)

  33. It IS 83.84 by Transcendent · · Score: 1, Redundant

    That is not a bug.... but the truth. Dispite what your elementary teachers taught you about rounding, the rules are different...

    Basically... if the number (infront of the 5) is even, it stays even... if it's odd, then it goes even. The reason for this is to get rid (as much as possible) of rounding errors. So odd numbers round down, and even numbers round up... it evens out at the end...

    Rule of thumb: when rounding, try to get an even number...

    1. 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.

  34. A Big One by borgasm · · Score: 1

    I have had a few bugs.

    They mostly go by the names Windows and IIS.

    Happliy they are updated every so often to keep us all on our toes.

    1. Re:A Big One by Anonymous Coward · · Score: 0

      Ew. You are so witty. Oh please come sit next to me and entertain me with your original humor. Oh I am rolling laughing. You must be the smartest, funniest person in the world. Oh and your username - Borgasm. What a classic. I will be sure to steal it the next time I am at a Star Trek convention dressed up like Spock.

    2. 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.

  35. Rounding with scientific digits by Anonymous Coward · · Score: 0

    4.5 rounds to 4, while 5.5 rounds to 6. Which direction to round depends on if the rounding digit is odd or even. Mixing the rounding direction minimizes distortion. Yay 11th grade chemistry class.

  36. 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.
    2. Re:OpenGL Matrix Stack by Anonymous Coward · · Score: 0

      Well, gl doesn't exactly tell you when an error occurs. You have to ask for the error with glGetError, otherwise it will keep going. And you can always query for the stack depth using glGetIntegerv with GL_MODELVIEW_STACK_DEPTH or GL_PROJECTION_STACK_DEPTH. And just like a well-designed OO class, it won't let you at its private stack directly, you have to use the public function glPopMatrix to clear it.

    3. Re:OpenGL Matrix Stack by Anonymous Coward · · Score: 0

      I don't think that's a bug. You have to match up pushes with pops just about anywhere with computers, especially in loops.

      sh

  37. 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 Anonymous Coward · · Score: 0

      It automatically converts (I havn't found this on mine)? But, why do you need a calculator to add on 273.15?

    2. 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.

    3. Re:TI-8x and Negative Kelvin... by cybermace5 · · Score: 1

      *picks up TI-85*
      *presses ON, 2nd, 5, F5*
      *presses (-), 5, 0, F1, F3, Enter*

      Hot diggety dang!

      -50 C -> K
      -323.15

      I'd say that's a bug.

      --
      ...
    4. Re:TI-8x and Negative Kelvin... by Anonymous Coward · · Score: 0

      Yes, it is operator precedence. The conversion happens first, then your - gets used on the result, changing the sign. Try putting the C value in parentheses first ...

    5. Re:TI-8x and Negative Kelvin... by cybermace5 · · Score: 1

      Well, yeah, if you put the negative in with the number in parentheses, it does work correctly. However, it's pretty counter-intuitive. When were any of us taught that TI-85 conversion are higher in the order of operations?

      --
      ...
    6. Re:TI-8x and Negative Kelvin... by Anonymous Coward · · Score: 0

      TI-86's also claim that pounds is a unit of mass and a foot-pound is a unit of force.

    7. Re:TI-8x and Negative Kelvin... by Papineau · · Score: 1

      Actually, I recall reading (on Slashdot? Can't remember) that negative absolute temperatures were the only solution to some kind of physics problems. Although the conversion by TI is simply overly simplistic (no bounds checking), they do exist.

    8. Re:TI-8x and Negative Kelvin... by Drunken+Coward · · Score: 0
      I was taught that the lb-ft unit as the correct measurement of force in the imperial system. Technically it should be called the slug, but that name isn't very widely used.

      As for whether or not the pound is a proper measurement of mass, I ask you, do you have an alternative unit to be used in the imperial system?

      --
      Have you been stalked by Seth today?
    9. Re:TI-8x and Negative Kelvin... by xenocidex · · Score: 1

      The TI-86 has a really good bug that lets you take the factorial of a decmil number, and gives you a result that as far as I can tell is random since i've spend quite alot of class time trying to reproduce the answers it gives, and failing miserably.

      --
      There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.
    10. Re:TI-8x and Negative Kelvin... by Anonymous Coward · · Score: 0

      It is possible that here the TI-86 is using the Gamma function, which is defined as: Gamma(x)=Integral(t^(x-1)e^-t dt,0,+inf). This is basically an extension of factorial (Gamma (x) where x is an integer is x!) to allow decimal numbers. The integral converges for x>0, according to my Diff Eq book. Interesting fact: Gamma(1/2)=sqrt(pi)

    11. 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

  38. 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.

  39. 6502 Bug by Anonymous Coward · · Score: 0


    I remember a bug in the 6502 processor where if you jumped indirect at an address that spanned a 256 byte page, the resulting address would come from the last byte of the page and the first from the beginning. For example, jump to the 16 bit address contained in $CFFF and $D000 would actually jump to the address contained in $CFFF and $C000. There were some programs that took advantage of this for obscure copy protection but that was a big failure as only some processors had this bug. I probably have this all wrong but it has been a while.

    1. Re:6502 Bug by AndrewHowe · · Score: 2

      I believe you meant $cfff and $cf00...

  40. 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 Transcendent · · Score: 1

      This is why I never design a site to work in netscape... If i can make a simple fix, then I can, but if it takes me a lot of time, I just say "screw netscape" and move on...

      ...6.x has gotten better... but 4.x is my worst enemy...

    2. 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...

    3. Re:CSS In Netscape 4.0 by Anonymous Coward · · Score: 0

      that's why you develope in netscape 4.X. it is such a shity and unforgiving browser that it is a god send tool for development. chances are, if it looks good in netscape, it will look good in anything else.

  41. 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!

    2. Re:VisualC++ Linker by 3waygeek · · Score: 1

      Strange; I've been using Visual C++ for over a decade (going back to 1.x), and i've never seen this one.

    3. Re:VisualC++ Linker by ccoakley · · Score: 1

      Try using it on 95 or 98. Use a source code generator or something to build about 1-3 Megs of source code, nesting or recursion not required. I've seen it too. No pattern other than all were medium sized projects. I have not encountered it on NT or 2K.

      --
      Network Security: It always comes down to a big guy with a gun.
    4. Re:VisualC++ Linker by Anonymous Coward · · Score: 0

      I have seen it too, yesterday.

    5. Re:VisualC++ Linker by flonker · · Score: 1

      My favourite/em VC++ism is when VC++ crashes, but maintains the file lock on the project file that was open at the time of the crash. Again, the only way to fix it is to use the magic button on the case.

    6. Re:VisualC++ Linker by Anonymous Coward · · Score: 0

      yep, seen that a few times before. I also enjoy when it starts to crash while compiling a file... giving a message to contact MS with an error number and source file (ya, right.. i'll call right now). Usually Rebuild/All does the trick, but I have actually had to *rename* the source file to get it to compile. Never have figured out why this happens, although now that I think about it... it hasn't happened in a few years and the only difference I can think of is that I have 512MB of memory now. So... my guess is that it was running out of memory.

    7. Re:VisualC++ Linker by Anonymous Coward · · Score: 0

      Don't press the magic button, either

      use kill -f (found in the resource kit i think)

      or open a debugger, connect to the process then quit debugging

    8. Re:VisualC++ Linker by Jim+the+Bad · · Score: 1

      My favorite is this one. For no reason whatsoever, after a trivial code change, the VC++ linker comes out with:

      mfcs42.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in myobjectfile.obj

      ...and your code will never link again. To make it worse, MSDN has the cheek to try to pretend that this is by design! I agree with the earlier poster, the VC++ linker is wonky.

      --
      -- And when Justice is gone, there is always... Force. --Laurie Anderson, "Oh Superman"
    9. Re:VisualC++ Linker by kefoo · · Score: 1

      Hmm... I've only seen this on Win2K. Another developer here also has encountered in on 2K. He regularly gets the BSOD while the computer's idle.

  42. 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 kirn_malinus · · Score: 1

      netscape isn't assuming percentages there, it tends to always bloats tables to fill the screen unless you somehow force them to do otherewise.

      --
      All circuits busy.
    3. Re:My favorite browser "feature" by rherbert · · Score: 1

      Man, you should upgrade to Mozilla!

      Er, wait. We're talking about bugs, not spewing Mozilla propaganda.

    4. 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.

    5. Re:My favorite browser "feature" by nybble_me · · Score: 0

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

      You should have tried well-formed HTML. You know, like where you end ALL of the quotes.

      --

      reenigne
    6. Re:My favorite browser "feature" by Anonymous Coward · · Score: 1, Interesting

      And, for the record, the most solid workaruond is to set each cell to 1% width, and then use transparent GIFs to push out each cell's width.

    7. Re:My favorite browser "feature" by oaksey · · Score: 1

      I tend to find it rounds it to the nearest multiple of 5. So 92 would become 90 etc. Reading some of the other observations I could have got it wrong but when I realised it didn't look right and adjusted images etc. so the cutoffs were in multiples of 5, it always seemed to work out ok. Actually that was for frames, not sure if the same applied for tables.

  43. Apple IIe by Sheetrock · · Score: 1
    I never actually owned one, but the Apple IIe systems at my school had an interesting bug in the BASIC parser that only showed up for me in the following case:

    10 FOR C=A TO B

    Would be interpreted (and shown with a LIST command) to be:

    10 FOR C= AT O B

    --

    Try not. Do or do not, there is no try.
    -- Dr. Spock, stardate 2822-3.




    1. Re:Apple IIe by scotfl · · Score: 1

      That's not actually a bug -- the AppleSoft BASIC system parsed all input on a line by line basis, and the first step in that was to remove all whitespace. So the parser saw:
      10 FORC=ATOB and tokenised it as: 10 [FOR] [C] [=] [AT] [O] [B] it also truncated all variables to two letters, just to be difficult...

      --
      "In my values, freedom is more important than 'serving users' in a mere practical sense." -- RMS
    2. 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.

    3. 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...

    4. Re:Apple IIe by Anonymous Coward · · Score: 0

      Dude, this made no sense to me until I read the post you were responding to... a couple of screen lengths down. (it's only two posts away, but there's a decent number of replies).

    5. Re:Apple IIe by DaCool42 · · Score: 1

      That has nothing to do with the precision of floating point. That's just printf's default formatting. Who's to say it should print 0.3 and not 0.30000000000? hUH?

      --

      ----
      All of whose base are belong to the what-now?
  44. 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.

    4. Re:strtok by Anonymous Coward · · Score: 0
      it's in the Linux man file

      No, it is not. It is in the man page for strtok. There is no man page for "Linux" at least on any system I've ever used. I'm not Richard Stallman and I'm not going to insist that you call the OS "GNU/Linux." But I'm getting absolutely sick to death of people saying "oh, yeah, use the Linux spreadsheet program" or "log into Linux" or "Linux web browser is broken". Linux is a kernel. It is used to power various types of operating environment with many varying user interfaces, libraries, and applications available. This particular man page comes from a set of man pages originally written for a then-Linux-specific C library (libc4), since updated for glibc1 and then glibc2. But it is not and never was a "Linux man page" - it's ALWAYS been the strtok man page, as installed on some systems powered by Linux. There are systems powered by Linux with other man pages (or no man pages) for strtok. There could easily be systems with the same man page which have nothing to do with Linux.

      Finally, this isn't even a bug. The function is supposed to work that way. That happens to not be what most people really want and thus advice is given to avoid it (though it doesn't bother to mention strsep(3), presumably the best alternative). The glibc infodocs describe the operation of strtok in greater detail and discuss the same shortcomings but (correctly) do not indicate that this unfortunate choice of semantics is a bug. It is not. It's a part of the C language that was not well thought out, period. A bug is a situation in which the implementation differs from the specification. This does not. strtok is every bit as broken on Windows, OpenBSD, and MacOS, because that's the way the specification says it should work.

      Sorry for the rant.

    5. Re:strtok by zimbu · · Score: 1

      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

      That reminds me of a bug in C, when I free() a pointer and then read and write to it, sometimes it works fine and sometimes I get data coruption, weird! I guess I'll just stick to Atari BASIC.

  45. 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!

  46. 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?
  47. 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.

    1. Re:Conspiracy Theory by SuiteSisterMary · · Score: 1

      VERY well done. Kudos to you, good sir.

      --
      Vintage computer games and RPG books available. Email me if you're interested.
    2. Re:Conspiracy Theory by Anonymous Coward · · Score: 0
      An attempt to track and retrieve these e-mails failed to account for six of the copies.
      "It looks like you want information about my mother."

      BLAM!
  48. Rounding 82.845 by justfred · · Score: 1

    I keep running into this problem. Floating point stores values as binary calculations - x plus (y divided by z) and 82.845 (and many other numbers)cannot be stored exactly as binary - it's stored as 82.84499999... (like 1/3 can't be stored as decimal, it's 1.3333...

    round (82.84499999,2) is currectly 82.84, not 82.845.

    A way to correct this is to store and use fixed-point decimals instead of floating-point (wherever possible), especially when you're referring to monetary amounts. (I call this the Superman problem, from the Superman movie where Richard Pryor took all the discarded fractional cents from payroll and added it to his own - and showed up the next day in a Ferarri.)

    Aside from this, my most annoying and time-wasting "bugs" are either nulls (I think of NULL as "hasn't been set yet" rather than "don't know" so 5 + null is 5!), or general error messages that give you no information on specifically what went wrong or how to correct the problem (Thanks, M$!).

  49. Annoying things? by iONiUM · · Score: 1

    ASP (VBScript):
    There's no CEIL function, or FLOOR function
    There's no way to dynamically include files
    When comparing a .MoveNext with an original in a recordset they for some reason return true (?), they're not even the same type, it should just return an error.

    ASP in general is just horrible... I really wish I could just PHP instead..

    1. Re:Annoying things? by Anonymous Coward · · Score: 0

      I'm gonna go with "duh" on that one iONiUM.

      Heres something I see tossed around a lot by people like you.

      RTFM before you start to rant and make yourself look like an idiot.

      "Its better to appear an idiot then to open your mouth and remove all doubt."

    2. Re:Annoying things? by iONiUM · · Score: 1

      i didnt force you to read my comment.
      hey, why dont you go outside? you know that thing, that thing in the sky? ya it's the sun.

  50. 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.

  51. 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 Anonymous Coward · · Score: 0

      No, _you_ are stupid and very annoying. You simply don't compare floating point values with ==.

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

      so true. This kind of stuff makes up like 10% of bogus bug reports on bugs.php.net - very stupid and annoying. Ok, maybe not quite 10%, but way more than most people are willing to tolerate. :(

      --

      Jobs? Which jobs?
    3. 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
      }
    4. Re:1 != 1 (precision) by cacav · · Score: 1

      Judging by the two comments telling me I shouldn't be using == on floats, perhaps I should clarify that this is Skill, a scripting language used in VLSI design (I work in microprocessor design) using the Cadence Design System. It's based on a combination of C and Lisp/Scheme (i.e. list based with cdr, car, etc).

      Under Skill, == is the only way to test equality as far as I know (according to the Skill Reference Manual published by Cadence). Skill doesn't have datatypes in general, so X can store a float or an int. Instead of float or int datatypes, it uses a numeric datatype. It doesn't matter. So you have no choice but to test equality on different numerical datatypes.

      In my example, the problem is that I wanted to test what was going to be a float result against an integer multiple. Skill doesn't have typecasting though, so I can't do (int)X==1 or something like that. I suspect it auto-typecasted the int to a float (1.0 or something like that), which failed the test (1.0!=1.0000001). I can't get around it.

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

    5. 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.

    6. 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"
    7. Re:1 != 1 (precision) by AndrewHowe · · Score: 2

      Yeah, about 10.000000000001% of them!

    8. 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.

  52. CodeWarrior DSP56800 C compiler... by mjander · · Score: 1

    The docs say: "#pragma interrupt for C." You no longer need to write you ISR's in assembler. This #pragma will tell the compiler to save all registers it used as well as emitting an RTI in the epilog. Sounds great, but the truth is: It still doesn't save those damn registers ... Local variables are completely corrupted in an ISR ... By the way, this C compiler isn't compatible with GCC. I think i would go better with Analog Devices. At least with their GCC port it shouldn't be so hard to port something done in a *NIX enviroment. Greetz

    1. Re:CodeWarrior DSP56800 C compiler... by Anonymous Coward · · Score: 0

      This ISR issues was fixed with the latest vesion for codeWarrior for 56800 (5.01).

      And the compiler was not ported from GCC.

  53. 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
  54. 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 Anonymous Coward · · Score: 0

      the ones that are missing are probably not slashdot.org but rather *.slashdot.org, where * is apple, yro, bsd, science, developer etc...)

    2. 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.

    3. Re:Hidden Slashdot posts by wompser · · Score: 1

      This is not true at all, some stories from all catagories get skipped somehow. I was just trying to figure this out earlier today in fact. I found that instead of going to the slashdot.org main page if you do a 'search' with all the boxes in their default setting you will see *all* slashdot stories. Try it out sometime, read the stories "they" don't want you to see.

      --
      .....
    4. Re:Hidden Slashdot posts by Merlin42 · · Score: 1

      Slashdot is devided into sections ... look to the left to see what they are. If you want _ALL_ sections to show up on the main page go to Preferences: Homepage and select "Collapse Sections".

      I just 'discovered' this very recenently, after enabling the '10 hot comments slashbox' which would show comments for articles I had never seen.

    5. Re:Hidden Slashdot posts by Anonymous Coward · · Score: 0

      That's not a bug, it's a feature.

    6. Re:Hidden Slashdot posts by Media+Tracker · · Score: 1

      Well, all these confused people demonstrate that the interface is clearly not intuitive enough...

    7. Re:Hidden Slashdot posts by MooseGuy529 · · Score: 1

      Some are excluded by default. QUOTED FROM SLASHDOT FAQ: Editorial ...Why do some stories show up in the index, but not on the homepage? ...We post many stories in the sub sections that don't appear on the homepage. Examples are Ask Slashdot, Your Rights Online, and Apache. Each of these sections has a smaller, more devoted group of readers with a more specific interest in these subjects...

      --

      Tired of free iPod sigs? Subscribe to my blacklist

    8. 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.
    9. Re:Hidden Slashdot posts by wompser · · Score: 1

      not to be arguementative, but the search feature is as up to date as anything on Slashdot. Search does not just search the archives, but searches everything that is on the site, right up until the time you press the button.

      I'm sure the first post lusers know all about this, it is the fastest way to see what is current in ALL of the sections not just what is on the front page. If not, they do now...

      Unless I am crazy that is.

      --
      .....
    10. 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.
    11. Re:Hidden Slashdot posts by Mizery+De+Aria · · Score: 0

      Create a shortcut directly to http://slashdot.org/search.pl and you won't miss any posts.

      --
      If you're religishitty, KILL YOURSELF!
  55. Another VBscript Bug by wardbekker · · Score: 1

    As every programmer knows, it's good practice to use implicit cast statements. Well, Vbscript's Cstr function (and all the other type converting functions) returns an error a big ugly error instead of just returning a empty string. For god's sake why did they gave that function such stupid behavior.

    1. Re:Another VBscript Bug by alphaCoward · · Score: 1

      if you are that concerned with this "bug" then you can override (not quite oo overiding but its functionally usefull) the cstr function and catch the exception in an errorHandler.

    2. 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...

  56. Buggy microsoft products by Anonymous Coward · · Score: 0

    Yeah, those microsoft products are full of bugs. I think the worst i ever ran across was in this one old version of microsoft office (can't remember which one) where every time i would open a new worksheet and press F5, then type X97:L97 and press enter, then press Tab, then hold down Ctrl-Shift while i clicked the toolbar's Chart Wizard button, the program would go haywire and crash in this wierd crazy-ass way where like this 3d flight simulator popped up on my computer screen and made me play it. Happened EVERY TIME. It was so obnoxious! I can't even begin to imagine what kind of screwed-up quality assurance practices would let a big ol' bug like that one slip through. Drove my boss crazy too, every time he came in and saw i'd gotten stuck in the darn flight simulator again he got so upset.

    And then there's that stupid bug in Windows XP where the multicolored interface elements send out mind control waves that force me to play pinball. Don't even get me STARTED on that one.

    Well, gotta stop reading slashdot and get some stuff done.
    cheers,
    Melinda

  57. 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. "
  58. IE multipart/form-data bug by siberian · · Score: 1

    If you set a form to multipart/form-data IE won't send the coordinates of the click if you use a type of image for your submit button.

    Works fine in Netscape/Mozilla, just not IE. Took awhile to find that one.

  59. 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 Anonymous Coward · · Score: 0

      ehehe.
      Yeah, they suck at programming.

    2. 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!
  60. current annoying bug by ralico · · Score: 1

    when working with relatively new parts of APIs, determining whether something is a bug or a "feature".
    My current one is with Xerces SAX parsing.
    I'm trying to validate a filtering package we've developed (by undoing the changes and doing diffs), but the #IMPLIED values from the DTD creep into the attributes of the output, even though the feature "http://xml.org/sax/features/namespace-prefixes" is set to false. The org.xml.sax.Attributes interface incidates that the implied attributes should NOT be in the parsed output, but it is. So I'm searching the web for docs on this and digging into the Xerces SAX source to see what gives.

    I'm trying to determing if whis the behavior

    --

    SCO to Hell
  61. Not a bug though by ece · · Score: 1

    That's why college is so important. That's what happens when you think that a couple of programming classes will get you to the top. Get an education.

    1. Re:Not a bug though by Anonymous Coward · · Score: 0

      Common /.er response: "But I am a educated man man, I know all about cahlculous and about politicking and I code really good."

    2. Re:Not a bug though by Anonymous Coward · · Score: 0

      Try hacking some code and eating source for breakfast.

      That other way of 'getting an education' sure as hell won't get you to the top.

  62. 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....

  63. Phi by Anonymous Coward · · Score: 0

    phi = 1.618033989

    phi^2 = 2.618033989

    (phi^2) * 1.2 = pi

    (n / phi) + ( (n / phi) / phi) = n

  64. 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 dthable · · Score: 1

      Want another fun bug in Java with Windows I/O. Create a File object and get a stream. Close the stream and then try to use File.delete(). For some reason, Windows doesn't release the file right away and the delete fails. Even more fun, the delete method is the only method that doesn't throw an IOException. Looks like Sun dropped the ball on this one.

    2. Re:Current bug in Windows I/O.... by paranoidia · · Score: 1

      Acutally, I was just working with files like that too. I would open a file in binary for writing in one program, and the same file for reading in another program. When I wrote to the file, the file pointer in the reader moved sometimes, but not always to the new end of file, without even reading anything. Oh well.

    3. 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
    4. Re:Current bug in Windows I/O.... by MrCawfee · · Score: 1

      I have acually noticed this in linux as well (but this was with c++'s fstream.h, once it reaches the eof it will not do anything until you call the clear() function, it took me weeks of pulling my hair before i figured that one out)

  65. 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 ;-).

  66. Only Apples have bugs. by Anonymous Coward · · Score: 0

    Bah, only Apples have real bugs. When was the last time you heard of worms inside Windows?

    Hehehehe. I apologize for my unprovoked use of a pun.

  67. Banker's Rounding by Anonymous Coward · · Score: 0

    This is more commonly known as "Banker's Rounding." And it is common in other compilers as well. What you are likely "expecting" to see is probably "asymmetrical rounding." Netiher one is really right or wrong. They are just used for different applications.

  68. Microsoft Visual C++ by Anonymous Coward · · Score: 1, Interesting

    The code (without line numbers, silly):

    1 void function(void)
    2 {
    3 label:
    4 }

    Gives:

    (3) : error C2143: syntax error : missing ';' before '}'

    If you have a label immediately followed by a closing bracket '}' it won't compile. Which is annoyingly stupid.

    1. Re:Microsoft Visual C++ by Jim+the+Bad · · Score: 1

      That's not a bug, its a feature!

      Seriously, it's the correct behavior. A label MUST be followed by a valid line of code.

      --
      -- And when Justice is gone, there is always... Force. --Laurie Anderson, "Oh Superman"
  69. 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 Yeep · · Score: 1

      You're FindFirstFile()/FindNextFile() bug in Windows NT is no bug. You say that fNextFile || dwLastError!=ERROR_NO_MORE_FILES is a problem because the for loop only terminates when fNextFile is FALSE AND dwLastError equals ERROR_NO_MORE_FILES, but since when is || a boolean AND? That's a boolean OR. So the loop stops if fNextFile is FALSE OR dwLastError equals ERROR_NO_MORE_FILES. The function isn't buggy.

    2. Re:These are a few of my favorite (Microsoft) bugs by glitch · · Score: 1

      Actually, swm is correct.

      The relevant offending code:
      for (int i=0; fNextFile || dwLastError!=ERROR_NO_MORE_FILES; i++) {
      // yadda yadda yadda...
      }

      As swm suggested, consider the scenario where fNextFile is false and dwLastError is ERROR_CANT_READ_DIRECTORY (Note that I made up this constant's name because I'm not sure of the actual one). Then the condition necessary for the loop to repeat can be described as follows:

      fNextFile || dwLastError!=ERROR_NO_MORE_FILES
      false || true
      true

      ...and so the loop continues endlessly.

    3. 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.

  70. seriously by Anonymous Coward · · Score: 0

    That's not crackheaded design. By default, VBScript passes everything by reference. It leads to some difficult to diagnose bugs. Default byval calls is better, though less efficient. 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?

    1. 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/
  71. Code Composer Studio Argghh by Joel+Ironstone · · Score: 1

    I'm using the TI code composer studio to develop some DSP stuff. When you connect a development board to your PC you can debug the code, set traps and all sorts of wonderful things. IF you happen to unplug the device from the parallel port while code composer studio is running or turn of the power to the device even for a second(even if you are not currently running anything on the target) the program crashes.

    This is annoying, as the software reset function doesn't always work, and it forces you to close the program to turn off the board to start your code again if you have made any mistakes. Now I was alwyas under the impression that these debugging tools were supposed to make it easier to fix mistakes.

    Thanks for listening.

  72. Distrust ... by tekisama · · Score: 0

    I always liked how Visual C++ 6 refused to allow friend functions ... just a minor bug that made me learn gdb to finish my Intro to C++ class ...

  73. 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
  74. MSVC++ 4.0 Bug... by RyuuzakiTetsuya · · Score: 1

    Yeah, it's popluar to take shots at MS, but I always LOVED the fact that MSVC++ 4.0 (Atleast) limited you to only 16,384 local variables, including array members... Quite annoying it was trying to write a simple database that held large amounts of data...

    --
    Non impediti ratione cogitationus.
  75. 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).

  76. 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.)

    3. Re:Pablo? Come to Florida honey, we miss you. by cburley · · Score: 1
      So I didn't know that C supported integer math expressions.

      Here's a true story you might enjoy. When my dad was teaching me PDP-8 assembler (I was about 12 at the time, so that was really cool), he told me about his early experiences writing code for the -8 (maybe the -5, actually) as a salesman for Digital.

      There were the historical challenges, of course:

      1. Write the assembly code down by hand.

      2. Hand-assemble the assembly code into machine code by hand.

      3. Convert the machine code into the coding system needed by the paper-tape loader of choice (RIM, BIN, names like that come to mind, but I don't have my old -8 books handy at the moment), by hand

      4. Find a teletype, turn on the paper-tape punch, and punch the codes.

      5. Feed the tape into a PDP-8 (after making sure it is on and has the appropriate loader entered, e.g. via the control panel).

      Okay, so far, so good, pretty much everyone has to go through that at the time, since whacking out a Fortran compiler over a weekend wasn't considered possible.

      But my dad said he made things a lot more difficult for himself by not really understanding that, in the first place, those assembly-code mnemonics turned into machine code simply represented numbers in memory -- numbers that could be entered directly into the initial memory image if needed as initial data values, for example.

      The upshot? Until he was clued in, my dad's early PDP-8 assembly code contained lots of extra instructions that'd gin up constants by clearing the accumulator (CLA), incrementing it (INC, I think), shifting it (ARL?), and so on, then storing them in memory for later use by the program he really wanted to write in the first place.

      Presumably that was a modest source of bugs itself -- can you imagine not being able to trust that a simple concept like "add 4 to A" might be misprogrammed by yourself such that 4 was actually 2, or 8, or something?

      (My own misunderstanding, roughly corresponding to his, was specifically that the opcode mnemonics, such as TAD, DCA, JMP, JMS, ISZ, and so on, corresponded to specific values, 3-bit ones for the opcode field in those cases, only in the context of PDP-8 assembly language. I'd already learned BASIC on the -10, and understood that "10 GOTO 20" was stored as a sequence of ten 7-bit bytes, a "coding system" that worked for BASIC code as well as any other text -- context-specific encoding wasn't a concept I'd learned at that point, at least not as a concept per se. So, when taught the -8 assembly language, I spent far too many mindcycles trying to understand what might happen if, instead of coding TAD, I coded TAE, and how three ASCII 7-bit, or even 6-bit, characters could fit into 3 opcode bits! When I finally understood what was going on, it was one of those "AHA!" moments, like when I first grokked recursion studying the PDP-10 assembly code commonly used to print values in decimal.)

      --
      Practice random senselessness and act kind of beautiful.
  77. 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 Anonymous Coward · · Score: 0

      One-ups-man-ship is so irritating.

    4. Re:You think YOU had a rounding bug???? by Anonymous Coward · · Score: 0

      I could top that because I worked on interprocessor dev. at a DSP startup. Even though we had logical analyser & source some bugs took weeks to discover. Especially when two processors start asking stuff simultaniously to an SD-RAM controller, then, _after a while_ the integrity of the data was lost. Can't say more because of an NDA.

    5. Re:You think YOU had a rounding bug???? by Anonymous Coward · · Score: 0

      So are sup-er-flu-ous hy-phen-a-tion and supernumerary letters.

      One-upmanship

    6. 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.

  78. 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.

  79. Am I the only one by tie_guy_matt · · Score: 1

    Who saw the title of this story and thought: Oh, here is Henry my Cock Roach. I taught him to roll over, play dead, and survive a nuclear war?

    1. 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!

  80. 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 ackthpt · · Score: 1
      [6502 zero page bug]First time I saw it used was in some copy-protection code in the C64 version of Sim City..

      C64 used the 6510, some of which had this bug fixed. I recall testing it on mine and it jumped correctly. I think that could be a headache to use for copy protection. One of the assemblers I used had an option to warn on these in compile, can't recall which, though, but it was a sweet compiler. I still have it, along with an interface for controlling a C64 directly from an Apple ][ (ah, the compiler was on the Apple, not running on the C64, it was for C64 development, the card maker eventually made a variation on this called the ISE Pick, for cracking games, but I'm wandering off topic :o)

      --

      A feeling of having made the same mistake before: Deja Foobar
    2. Re:6502 microcode bugs... by schon · · Score: 1

      C64 used the 6510, some of which had this bug fixed.

      I've never seen one, although I'd heard about it.. In my packrat days (before I got married :o) I picked up a C128 a few years ago from a garage sale.. it should have a "fixed" one.. maybe I'll take it out of storage and play with it..

      the card maker eventually made a variation on this called the ISE Pick, for cracking games, but I'm wandering off topic

      I saw one of those once, and saw several pirate copies of games that used it (Hard Hat Mack was one, IIRC..) I had a SuperSnapshot, which I thought was pretty cool... the built-in machine monitor was my favourite feature..

      *sigh* thanks for the memories :o) It's been awhile since I thought about my c64 days..

    3. 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

    4. 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.

    5. Re:6502 microcode bugs... by jovlinger · · Score: 1

      erm. Intel? I said that? Brainfart.

    6. Re:6502 microcode bugs... by bjb · · Score: 1
      Ah. good old cisc. IIRC, the 6502 was still pretty snappy, getting most ops done in one or two cycles.

      Well, a few of the load/save operations took 4-7 cycles, but they shaved a few off when the 65C02 came out.

      Funny that you mention "good ol' CISC", because whenever I try to explain CISC VS RISC to people, I use the analogy that the old 8-bit 6502 is almost RISC in that is has much fewer instructions to contend with. Yes, this isn't quite accurate, but in the argument that I build up, it helps drive a point home.

      --
      Never hit your grandmother with a shovel, for it leaves a bad impression on her mind...
    7. Re:6502 microcode bugs... by jovlinger · · Score: 1

      well you can argue definitions 'till the cows come home, but I always thought that the R in RISC referred to reduced _complexity_ of instructions rather than reduced _number_ of instructions. So risc cpus don't have any get-from-memory-and-jump-
      indirect style instructions. So this page load bug would be a bug on a load instruction, rather than a jump.

      To muddy the waters, the PowerPC has a RLWINM instruction, which does a rotate left for x bits and ands with a mask. Which is kinda ciscy. But it doesn't do any memory indirect addressing, so it passes that test, and gets the job done in one cycle, so passes that as well.

  81. Busted MSVC 6.0 Enterprise by LordHunter317 · · Score: 1

    Here's one I found and never figure out why:
    The busted line was :

    number 8;

    To bitshift the number left 8 times.
    When I ran it, no matter what, I got a Floating point error.

    Worked in GCC. Gotta love Micro$haft(TM).

  82. 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.

    2. Re:7^2 vs. 7*7 by rjamestaylor · · Score: 1
      You're so incredibly anal it's funny.

      ...

      I bet you processed both the "You're" and the "it's" twice to make sure they were used correctly.

      It's fun to use "anal" when speaking of homonyms...asshole

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

      "You're so incredibly anal it's funny."

      Thanks. I try.

      "It's fun to use 'anal' when speaking of homonyms...asshole"

      It's also fun to use your brain. If you somehow learned to enjoy that experience, you would know that 'anus' and 'asshole' are synonyms, not homonyms . This is particularly disappointing, since I linked to the definition of "homonym" in my previous post.

      I'll gloss over your confusion of "anal" ("of or related to the anus") and "anus" for now. In fact, I'll just cut this comment short. I'm sure that my frequent usage of the word "anus" has gotten you pretty hot and bothered by now. Even if you don't understand what "homonym" means, you certainly seem to be familiar with the meaning of "homo." At least you're halfway there.

    4. Re:7^2 vs. 7*7 by Anonymous Coward · · Score: 0

      No, dipshit. "Anal" sounds like something to do with the anus to people. I didn't say "anus". Stop masturbating and join the rest of the world.

    5. Re:7^2 vs. 7*7 by Anonymous Coward · · Score: 0

      Wow.. so defensive! Get a grip.

      It's not his fault you're a fucking grammar retard. And I'll bet English is the only language you know.. and you can't even get that right.

      Loser.

    6. Re:7^2 vs. 7*7 by rjamestaylor · · Score: 1
      LOL! Thanks for the laugh.

      You entered two periods instead of one (for a sentence terminator) or three (for an ellipse). Nanny-nanny-boo-boo! You are quite moronic--just how hard is the period to master?

      Coward.

      (offered in the spirit of, "If you can't beat [the crap out of] them join 'em.")

      --
      -- @rjamestaylor on Ello
  83. Any bug that's not my fault... by Kook9 · · Score: 1, Interesting

    I think one of the greatest joys (and greatest frustrations) of programming is finding some erroneous behavior in your code is caused by a third-party library and is thus not your fault. Once I stayed at work with my manager until 10PM because text that was formatting properly on my development system was not formatting properly in production. After beating our heads against the wall for hours tweaking the code, recompiling, making sure it ftp'd correctly, etc., we realized it was a JRE bug. Oh, sweet vindication!

    Now you might ask why my development machine had a different JRE than production... You'd be right. This is not a company that is still in business. 'Nuff said.

  84. SQL Server 7.0 & 2000 Bug by Rary · · Score: 1
    Not so much my favourite as just one that has always really annoyed me. In Enterprise Manager for Microsoft SQL Server 7.0, after creating/editing a table, if you click the Close (X) button without saving your changes first, it prompts you to save your changes. Now, in most applications (definitely in the ones I design), the message box will provide three options: "Yes", "No", and "Cancel". Clicking "Yes" will save the changes and close the window. Clicking "No" will ignore the changes and close the window. Clicking "Cancel" will not close the window at all, allowing you to continue. That last option is quite handy if you happen to click close by mistake. However, in Enterprise Manager, the options are "Yes", "No", and "Help".

    Unfortunately, "Help" doesn't provide the kind of help that you need when you're in a situation where you've accidentally clicked close, but don't want to answer "Yes" because the changes you've made aren't correct. So, you click "No", and then start over.

    When I first got SQL Server 2000, I went immediately into Enterprise Manager to see if they'd fixed that.

    Alas, they had not.

    While typing this post, I discovered an interesting quirk that I had never noticed before. There is an animated advertisement at the top of this page. I'm using IE, and if I have the advertisement visible while I'm typing, my cursor blinks frantically. If I scroll down far enough that the advertisement is no longer visible, my cursor blinks at a normal rate.

    Cool.

    --

    "You cannot simultaneously prevent and prepare for war." -- Albert Einstein

    1. Re:SQL Server 7.0 & 2000 Bug by barnsleyBigUn · · Score: 1

      The Flash plugin player thing causes me all sorts of problems with both IE and Mozilla...cursor blinking fast, scrolling to be jerky and extremely weird...

      I end up uninstalling the Flash plugin for long periods of time!

  85. 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 ElementCDN · · Score: 1

      +2 for using a sig from one of the Dead Milkmen's song.

    4. Re:Best Error Message Ever... by hardcode · · Score: 1

      I think it was MPW C that used to issue a "Can't go mucking with a void *" error

    5. 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?
  86. 2/0 = 0 by macrom · · Score: 1
    Last time I used CodeWarrior on a Mac, this code ran without a hitch :

    // assume main and all that other stuff
    long x = 0;
    cout << "2 / x = " << 2 / x << endl;
    // end
    Most platforms will throw some sort of exception, presumably one that originates at the processor level. The output of this on OS X was :
    2 / x = 0
    2 divided by zero equals zero sounds like a bug. Yes, I know there are registers you can check in the PPC...but it still sounds bad to me. Maybe there's a math person out there with a reason why this expression would be evaulated this way. The fact also remains that there isn't a good way in C++ to catch this problem/exception without writing some assembler.
  87. Why, PHP bug #15983 of course by chris88 · · Score: 1
    Nothing exciting about it.
    http://bugs.php.net/bug.php?id=15983

    I was adding on session vars to old code (Which, of course, was very large), and noticed half the new sessions weren't getting through. Spent more than 3 hours fighting with it every which way. Went on #php (OpenProjects), people told me it was bad coding on my part, you must be ridiculously stupid to mess up sessions (of course they didn't look at it), made me even more mad. Finally someone sent me the bug I've listed above.

    What's even worse, is even after knowing it's a PHP bug, there were still very few workarounds (even less ones that were pretty).

    In the end, it was decided by myself and a friend that "PHP is a fickle mistress".

  88. 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.

    1. Re:AMI BIOS and beeping console by bozoman42 · · Score: 1

      Along those lines, on most older DOS machines, if you hold down most of the modifier keys (Ctrl, Shift, etc) it will start emitting a slow, paced, beeping sequence. Very odd. Except some Packard Bell's -- they hardlock.

    2. Re:AMI BIOS and beeping console by Anonymous Coward · · Score: 0

      In 1993 I worked in a company which developed SPI solutions based on a custom database. There was a problem with the REGX counter of the database, and all unfound queries would always return faulty inodes. I had to stay a whole night with an assembler debugger, until I could finally fix it. It was just a XOR/AND instruction in the wrong parameter file! Go figure...

    3. Re:AMI BIOS and beeping console by ArcticChicken · · Score: 1

      That's not a bug, nor is it odd. That's the system letting you know that the keyboard character buffer is full. This happens if the system hasn't been able to process the incoming keystrokes fast enough because the system is busy (probably dealing with the flood of keystrokes you're sending it by sitting on your keyboard). Instead of just dropping the keystrokes, the computer is smart enough to store them in a buffer in the hope that the system will soon become responsive enough to process them.

      The PC keyboard buffer has a maximum capacity of only 32 characters. Once you hit that number, the system will beep each time you try to send it another keystroke and the new keystroke will not be stored. CTRL + BREAK will clear the buffer, at which point you're free to clog it up again if you're so inclined.

    4. Re:AMI BIOS and beeping console by Atlantix · · Score: 1

      True, but the poster mentioned holding down just the modifier keys. It is my understanding that the keyboard only uses those keys internally and sends their state as flags when a "real" key is pressed. Thus you could never poll for a "shift key down" event because it would never be placed into the system's input buffer.

      --Atlantix2000

    5. Re:AMI BIOS and beeping console by orlovm · · Score: 1

      You make an interesting argument, which is slightly wrong and completely irrelevant.

      It is slightly wrong, because the circular keyboard buffer has the capacity of 32 bytes, which suffices for 16 keystrokes, each represented as SCAN + ASCII.

      It is completely irrelevant, since modifier keys status is kept in bytes 417h and 418h. Instead, when a modifier + regular key combination is pressed, ASCII is 00h and SCAN reflects the combination.

      Thus the necessity to redirect INT 9 interrupt if handling modifier key events alone is required.

    6. Re:AMI BIOS and beeping console by ArcticChicken · · Score: 1

      Well ... at least you found it interesting.

      Then again, at least I tried to offer an explanation.

    7. Re:AMI BIOS and beeping console by bozoman42 · · Score: 1

      In addition to the reasons given by the others, the other reason this is odd is because unlike a "keyboard buffer full" beep, this was a different sequence of beeps. A slow paced beep, like I said, as opposed to the "buffer full" barrage of beeps. You can tell it's from something different. And what purpose does it serve? Oh well. :-)

  89. 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 RevHippie · · Score: 0
      #!/usr/bin/perl -w
      use strict;
      print("Hello,");
      print(" World.");
      print("\n");

      This seems to work fine for me. Was this in perl4 or something?

      --
      prel -e 'echo "Just another bad perl hacker./n"'
    2. 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
    3. Re:I know, it's a feature. by wildsurf · · Score: 1

      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.

      This reminds me of my own favorite slashcode bug, or perhaps missing feature. Each Slashdot story has a popup menu listing the number of comments of each score, and my threshold is typically 3, so it will say e.g. "3 - 27 comments." However, there doesn't seem to be a way to view exactly those 27 comments, and no others. (For instance, if a score 3 comment is posted as a reply to a score -1 comment, you'll have to set your threshold to -1 in order to view the +3 comment.) I'd like to be able to see the +3 response, even if the original -1 post is not shown. With the usual practice of quoting the relevant chunk of the original post (as I am doing in this post), not much context will be lost. Am I missing something obvious here?

      --
      Weeks of coding saves hours of planning.
    4. 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!

    5. Re:I know, it's a feature. by vrt3 · · Score: 1
      (For instance, if a score 3 comment is posted as a reply to a score -1 comment, you'll have to set your threshold to -1 in order to view the +3 comment.) I'd like to be able to see the +3 response, even if the original -1 post is not shown.

      I believe "Reparent Highly Rated Comments" in Comment Options of your user preferences does just that.

      --
      This sig under construction. Please check back later.
    6. 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.

    7. Re:I know, it's a feature. by eison · · Score: 1

      Bug. Reparent Highly Rated Comments does not work if you have 'Hard Threshold' mode on to get rid of those annoying "X replies below current threshold" message.

      So, if you want reparenting to work, turn off hard threshold.

      --
      is competition good, or is duplication of effort bad?
    8. Re:I know, it's a feature. by Leviat · · Score: 0

      Want to prevent that from happening? Just turn on the autoflush by setting $| equal to 1.

      $| = 1;
      print "alpha";
      sleep 1;
      print "beta";
      sleep 1;
      print "delta";
      print "\n";

    9. Re:I know, it's a feature. by IHateUniqueNicks · · Score: 1

      Umm, maybe I'm missing somethine, but isn't that what "Nested" is for?

    10. 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.
    11. 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"...
    12. Re:I know, it's a feature. by Anonymous Coward · · Score: 0

      MSVC++ isn't an API.

      You can use fwrite() or WriteFile() assuming you're capable of putting a nul in a char buffer. If you're not, you can use fput.

      Please don't bash Microsoft if you don't have a clue.

  90. 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!

  91. 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 IMarvinTPA · · Score: 1

      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.)

      I can't help you on the col*r thing.
      IMarv

    4. Re:spelling of functions by Anonymous Coward · · Score: 0

      Sorry. The correct spelling is coloure.

    5. 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.

    6. Re:spelling of functions by AndrewRUK · · Score: 1

      Since we're in an "international thingies" mood...

      A pound sign look like this: £
      # is called a hash.

  92. 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

    1. Re:Debugging bugs by Anonymous Coward · · Score: 0

      Idiot.

    2. Re:Debugging bugs by styxlord · · Score: 1

      If you want to have real fun, try using __LINE__ with "Edit and Continue Debugging" in Developer Studio (which is the default for new projects).

      At least they acknowledge this one in the Knowledge Base.

  93. Old VC++ bug by beej · · Score: 1
    Years ago the version of VC++ I was using had a preprocessor that would ignore directives on the last line of the file. Things like:

    #ifndef _FOO_H_
    #define _FOO_H_

    // some stuff

    #endif

    would complain about a missing #endif. Very frustrating until I added another blank line to the end of the file, at which point the bug was simply reclassified to "irksome".

    1. Re:Old VC++ bug by FukawiTribe · · Score: 1

      Used to see this 'bug' many times from our beloved developers on NT passing over stuff for the Un*x builds. Basically, have to train them to realise that a text file is not a valid text file if it doesn't have a terminating newline.... classic example is 'Parse file with file names in (with sed,perl,whatever), do something with each file'

      Guess what.. nothing gets done with the last file if there's no terminating newline and all hell breaks loose further on down the line.

      Guess this is really a feature, possibly a mis-feature. Is also a good way to get Windows developers to look at the damn output of their parsers ! (eventually :)

  94. strncpy() by snofla · · Score: 1

    Newbie did this:

    char buf[13]; /* 8 + 3 + '.' + '0' is 13 */

    strncpy(buf, "long-file-name.ext", sizeof buf);

    and wrongly assuming that strncpy() would null terminate the string.
    I hit newbie with K&R.

    --
    i don't like style guides
    1. Re:strncpy() by Anonymous Coward · · Score: 0

      wow, u r so smart!!!
      C is cool!

  95. Solaris/Motif libraries by OpenMind(tm) · · Score: 1

    Apparently, when compiling Motif apps on Solaris, the application will crash without cause unless libXm is the first lib you link in. This is an ancient, but still unfixed bug. It took me forever to figure out what was wrong with a program because of this.

  96. 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.
  97. Now I remember why school sucked... by Hepkat · · Score: 1

    back in HS, I had a program that would work just fine on my home DOS PC w/ Borland C++ but would give me "Cannot divide by 0" at school on a very similar PC... Never did figure that one out... the most annoying thing... there was no division in any of MY code...

    1. Re:Now I remember why school sucked... by BlueArchon · · Score: 1

      I don't know if this is the same bug, but this exists in Borland Pascal.
      If you are using the crt unit on a machine faster than about 200 MHz it would crash the program at startup. The reason is that it inizialises the delay function and on a fast enough computer it takes 0 time units (milliseconds, whatever), and BANG, runtime error 200, division by zero.

    2. 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!

  98. Netscape sucks by thelordx · · Score: 1

    How about this: if you incorrectly build tables (and I've built some complicated tables), and miss the terminating table tag "/table", then Netscape completely crashes out with no warning (I don't know if this is still a problem - I worked with someone at netscape and believe they were going to release a patch.. but who knows?)

  99. 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 xrm · · Score: 1

      And when GCC (using -Wall) complains when you are formating dates into a string using 2 digits for the year and you REALLY want the 2 digits??

    2. 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

    3. Re:GCC funkiness. by ChadN · · Score: 1

      This is probably a result of C99 deciding that these keywords ("xor", "and", "or", etc.) were now acceptable (There were introduced by C++). However, they are only supposed to be enabled by a certain include. Anyway, possibly not a bug, and almost certainly an overridable option.

      --
      "It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
  100. Learn how to round by duplicate-nickname · · Score: 1
    Yes.....it's time to move beyond your grade school math class.

    Maybe you should read this and edumacate yourself.

    --

    ÕÕ

  101. 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 Anonymous Coward · · Score: 0

      that's not a bug. that's called a "function pointer." you are either a troll or an incompetent programmer.

    2. 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.
    3. 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.
  102. Still Looking for Work... by yumyum · · Score: 1

    So, OK. I'm not a wiz at unit conversions. Who is?! Like the U.S. has tried time and time again to move over to metric. I'm no different.

    And I still argue with potential employers that the second crash was really a bug at all...

    Software Bugs and Crashes

  103. Javascript slip-up by maiden_taiwan · · Score: 1

    After several hours of trying debug a mysterious JavaScript runtime problem, I finally uncovered:

    <script language="text/javascript">
    ...
    </script>

    where "language" should have been "type". I must have read that line a hundred times without seeing the problem.

    1. Re:Javascript slip-up by mooman · · Score: 1

      Or another insidious one that has to have bitten lots of JS developers at one point or another...

      Javascript treats integers with leading zeroes as octal! So when you're toiling away kicking out code for dates and times like yyyy-mm-dd and hh:mm, you get this weird bug where any August and September dates (08, 09) get reset to 00 but July and October (07,10) are fine!

      This is sure to drive a tester and developer bonkers when the tester keeps insisting it's broken (because they just happen to use the numbers 08 or 09) and the programmer keeps swearing that it works for him (because he's using something like 05). ...right up until the developer stands over the shoulder of the tester and then gets red-faced as he realizes what's happening.

      Nope, never happened to me! Not once! Nosiree.... ;)

      --
      In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
  104. Weird MS Visual-C for-loop bug by Demandred · · Score: 1

    About five years ago I was using MS Visual C and needed to perform some calculations which required very large for loops (>100,000 iterations)...the problem was that after the loop finished, what ever variable I was using inside the loop to hold the value of my calculation would get assigned to the last value of the loop iterator....but only for loops which had 100,000+ iterations...it didn't do this for small loops( 10 or 100 or even 10,000 iterations).

    I ran it through a debugger and right before it would break out of the loop my variable had the correct value...but as soon as it left the loop, it would get assigned the last value of the iterator.

    ex>

    for(i=0; i 100000; i++)
    {
    somevariable = some computation
    }

    somevariable=i!!!!

    Weird.....

    --
    "...Beer..."
  105. 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();
  106. Page widening bug by Anonymous Coward · · Score: 0

    I.like.the.page.widening.bug.on.slashdot.because.i t.only.effects.microsoft.internet.explorer.kay?

  107. Code Scope and Duff's Device by Dasein · · Score: 1

    About 10 years ago there was a debugger called Code Scope (I think that was the name). Anyway, if you compiled up Duff's Device with MSC and stepped through it in the debugger, it didn't execute correctly. However, if you just set a breakpoint at the end, it would run fine.

    I was asked to evaluate the debugger for general deployment and after I tried this, I had to pass.

    As far as most anoying bug -- about any MSC version before 6.0 and try

    func(i > 0 ? Class1() : Class2());

    Basically the lifetime of temporary objects was pretty messed up -- especially when combined with the ternary operator.

    --
    You are not a beautiful or unique snowflake -- but you could be if you got off your ass.
  108. Ancient bug in Microsoft C by RockyMountain · · Score: 1

    I found an interesting one in a Microsoft C library back in about 1987.

    They had some sort of io port writing library call poke_io(addr) or some such. Since the 8086 instruction set only allowed constant addresses rather than variables, they used self-modifying code to implement the poke. But the 8088 CPU had a small instruction-prefetch queue that was not coherent, and the instruction being modified had sometimes already been prefetched by the time they modified it.

    So, the code randomly failed some times and not others. Also, the code loading allignment made a big difference in how likely it was to fail. Re-link, and it failed. Add a printf and it started working again, etc....

    When I reported it, Microsoft eventually fixed it, but of course I had to write my own routine in the interim.

  109. 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.

  110. Or maybe I'm just stupid... by Null_Void · · Score: 1

    This is pretty non-specific since it was for a college programming project a while ago.

    I was using VC++ and trying to input from the keyboard. I don't remember why I used the particular function that I used, but... anyway. There were a series of inputs in a while loop. For some reason, the first time you input something, it would duplicate the carriage return (causing the second input to consist of just a carriage return). But each following input, even though it was going through the same thing... would act normally.

    I know that wasn't so clear, but hey, my mind is fried from doing years of this stuff.

    Guess you could say *I'm* the biggest bug...

    Null_Void

  111. msvc++ 6 internal compiler error by Anonymous Coward · · Score: 0

    Occasionally, I can't compile anything with msvc++ 6, win2k. On the first line of code of every file it tries to compile, I get a message like, "Internal compiler error on line 1794 of vc.cpp. Contact technical support". The solution? Open up the path environment variable as if you were going to edit it, but just click 'ok' without changing it. Voila! The problem magically disappears. Weird, man. I spent half a day on the phone with a M$ rep before I figured that trick out by myself.

  112. 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
  113. 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).

    1. Re:Commercial UNIXes by greensquare · · Score: 1

      This reminds me of a bug I found once in a homegrown toolkit I was helping to maintain. It had had a class which could log and printout everything there was to know about the program it was created in. It printed out the link date, the size of the binary, and the explicit full path to the binary, arguments, run date and a bunch of other stuff.

      I noticed one day that whenever we turned on this object, the programs that used it would get slow. For some people they would start really slowly, adding 20 - 30 seconds on to a 5 second runtime. Come to find out, the guy who wrote the code was using system() to call the the shell "which" command. And this caused a new shell to be created and even cause .cshrc to be sourced. Interestingly, had anyone executed a program from .cshrc that used this feature, there would have been an infinite recursive system() call loop.

      Some of these people had so much crap in their .cshrc file that it took 20 seconds to start a new shell! But that was back when 20 people with "X terminals" ( not xterms.. ) were sharing a Sparc 10 that had 128 megs of RAM.

  114. Re:worst bug by cracker8myass · · Score: 1

    what a gay response

  115. 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 ElMiguel · · Score: 1
      It was interrupt 20, wasn't it?

      No, it wasn't. It was interrupt 21h. Interrupt 20h was a CP/M compatibility leftover.

    3. 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.

  116. make vi core dump by greensquare · · Score: 1

    6 or 8 years ago I found a bug in vi which would cause it to core dump. I've either forgotton how to do it, or it's fixed now. Not sure.

    vi would core dump in a very specific case and only when making a mark using a certain letter. As I recall you had to make a mark using a specific letter, and then move your cursor past the mark, and then use "'C" to "change to the end of line" or something like that. It was a keystroke command that didn't make sense if the cursor was passed the mark.

    Anyhow, it was the only time I ever had vi crash, and I only found it because I was copy/pasting string key sequences into vi, otherwise I probably never would have been able to reproduce it.

    Later I saw that very bug documented on a website.

    Can't cause it to happen now. Does anyone remeber this one? I recall trying it on several Unix OSes at the time and vi core dumped in every case.

  117. coldfusion and stored procedures by Anonymous Coward · · Score: 0

    for some odd reason i was passing a coldfusion UUID into a MSSQL stored procedure and a uniqueidentifier. the problem with this is that the CF UUID and MSSQL UUID aren't compatable. well needless to say the code worked just fine on my development machine. After we uploaded the code to the new website, the thing blew up in our face. Good thing it only took 5 minutes to fix. But it was still something I can't understand why it worked fine locally and not remotly.

  118. This just happened to me today... by idfrsr · · Score: 1

    Now I haven't yet fully acertained exactly what is causing this bug, but it seems to be a java thing, rather than a me thing

    It has to do with using v1.3.1 and java.util.Enumeration to iterate through a collection and calling interated object's equals method. Any sane person would think that
    a.equals(b) == b.equals(a)

    should return true. In this case, it doesn't. (All test cases not using the cast and enumeration stuff before hand behave sanely)

    If anyone slashdotters have run accross something like this before please let me know, otherwise I will be begin a 1 man coffee bean offensive on java!

    --
    "The large print giveth, and the small print taketh away" -Tom Waits
    1. Re:This just happened to me today... by Arthur+Dent · · Score: 1
      Easy to see how this could happen:
      Class a{
      public boolean equals(Object o){
      if( this == o) return true; // ignore nulls
      }}

      Class b{
      public boolean equals(Object o){
      return false; //I am Unique!!!
      }}
  119. ah, you mean passing by value? by Anonymous Coward · · Score: 0

    nt

  120. Some weird VBScript bugs by PissingInTheWind · · Score: 1
    this is fucked up:
    if 0 then ... --> false
    if not 0 then ... --> true
    if 1 then ... --> true
    if not 1 then ... --> still true...

    wtf?

    Also, this kinda puzzled me:

    randomize(now())
    gives a constant 'random' seed. Don't do crypto in VB.
    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
    1. Re:Some weird VBScript bugs by cheesestraws · · Score: 1

      As regards your top 'bug':

      If I remember correctly, false is 0, and anything else is true. So:

      0 -> false
      not 0 -> 0xFFFF (or however many bytes) -> true
      1 -> true
      not 1 -> 0xFFFE (or however many bytes) -> still true.

      I think that's right; it's been a while since I did any VB whatsoever.

  121. 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.

  122. First Post Bug..... by Lord_Slepnir · · Score: 1

    Whenever there a story on slashdot is posted, there always seems to be a series of troll posts that say "FP" or something of the like. While this bug is harmless, it seems to annoy the hell out of people who try to read a thread down to -1 who must sort through tons of junk.

  123. 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

  124. Ah, the feds... by doorbot.com · · Score: 1

    I remember this one time we knew the Feds had a wiretap running on our phone system, and more than a few listening devices placed covertly around the office. We'd say the most outrageous things, and everyone would try to out-do to the others. One time we looked out in the parking lot and saw a bunch of black-clad men rolling around laughing on the ground behind their white van. What was really outrageous was where the bugs were placed; one was in the bottom of one coder's coffee cup, another in a VP's toupee, and another one in women's restroom. We'd play copyprotected Celine Dion CDs into them at full blast (in a sound proof room of course so as to not harm our own employees).

  125. "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)
  126. Here's A Bigger One: @# +500,000 ; Winner @# by Anonymous Coward · · Score: 0

    The company!: Microsoft and Its Chief Evil-Doer
    Bill Gates

    Be Patriotic: Smoke Amerikan grown marijuana!

  127. Re:A QBASIC story. How embarassing. by jon+doh! · · Score: 1

    i had a program i was doing for a final project back in 8th grade. it was in basic and for some reason i couldn't get it to work. it followed the same basic frame i'd used all semester, but it would error out at some point (i don't remember where, that was too long ago). i had my teacher look at it and a friend of mine also. neither of them could see where it went wrong. i debugged it for hours. i ripped it apart and threw it back together. i printed it out and rewrote the whole thing. i never found out what it was doing wrong. my teacher even gave me an 'A' on it cause he thought it had no reason for not working and couldn't figure it out.

  128. E-Commerce Site Quantities by Glove+d'OJ · · Score: 1

    One of my favorite bugs from the "old west" days of e-commerce (96-97, when everyone was rolling their own site) dealt with quantities. At one store (name undisclosed!) I was able to get a refund processed to my credit card when I ordered -1 lamps, books, cards, etc. After about $200, I decided to let it be, lest someone start calling me for all the lamps, books, cards, etc. That I owed them.

    About a week later, the site had the appropriate javascript in place to detect negative values.

    ----
    WWJD? JWRTFM!

    1. Re:E-Commerce Site Quantities by Anonymous Coward · · Score: 0

      scholors believe it's likely that Jesus was illiterate ..

  129. 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.

    --

    -... --- .-. . -.. ..--..
  130. pre jdk1.1 by jaaron · · Score: 1

    There were some bugs in the old java compiler (I think it was pre 1.1) so that when you converted bytes to Strings it didn't work right. Such as this:

    String(byte[] ascii, int hibyte)

    They're depricated now, but boy, stuff like this threw me for a loop for a while.

    --
    Who said Freedom was Fair?
  131. I vote for awk's "Bailing out near line one." by Christian+Hicks · · Score: 1
    In the original awk interpreter, makes NO DIFFERENCE what the error is or what line it is on. All you get is, "Bailing out near line one."

    This is particularly irritating when line one is commented out.

    Christian

  132. Re:How about this bug.... by Anonymous Coward · · Score: 0

    Nah, "Someone set up us the bomb" was a much bigger bug. I mean, if you get someone to set up a bomb for you and then nearly blow yourself up, that's a pretty big bug in the R&D process.

  133. So unload the DLL's yourself... by gatkinso · · Score: 1

    ...rather than relying on Windows to do it for you.

    Surely you know how to use FreeLibrary()???

    --
    I am very small, utmostly microscopic.
  134. 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.

  135. Long, long ago, in a galaxy far far away... by Anonymous Coward · · Score: 0

    Before Borland came out with Tubo Pascal (~1984, or 1985 if you round up) there was a p-code compiler for cpm-80 called JRT Pascal. The Delete (string, start, length) procedure would not operate on the string specified in the parameter, but instead deleted characters from the string referenced on the next line of code! It was so bad we laughed for days!

  136. Pet bug by Garion911 · · Score: 1

    POKE 59458, 33 (forget actual number)

    --
    Slashdot is like Playboy: I read it for the articles
  137. Why not 83? by KevinGale · · Score: 1

    I don't use VB but the round function in most languages returns an Integer.

    Banker's rounding still applies to the .5 values.

  138. 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.
    1. Re:Favorite solution to a bug by Anonymous Coward · · Score: 0

      That is not a "solution"!
      They shouldn't let people like you program!!

    2. Re:Favorite solution to a bug by Anonymous Coward · · Score: 0

      Try turning all optimizations off.

      Probably the compiler was thrown off by your non-sensical code and produced non-optimized code in the vicinity of your statement.

      Every programmer should have to maintain their code for a few years. Eventually most learn to avoid hacks like these and try to figure out the real reason behind the bug.

    3. Re:Favorite solution to a bug by Simon · · Score: 1

      That's sounds like a stack corruption bug. Inserting an "int k" changes the layout of the stack and avoids the bug (kind of). Using "k=k" stops the compiler from optimising your "int k" away...

      just guessing

      --
      Simon

  139. 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 Anonymous Coward · · Score: 1

      I'm guessing it saw the "\" at the end of the comment line and treated the typedef as part of the comment.

    2. Re:When comments are more than comments... by Anonymous Coward · · Score: 0

      wrong slash. should be \\ tom 7 was here - 1998 //

    3. Re:When comments are more than comments... by Anonymous Coward · · Score: 0

      > wrong slash. should be \\ tom 7 was here - 1998 //

      uh... what???

    4. Re:When comments are more than comments... by 0x20 · · Score: 1

      no.. it should be --==:{ Tom 7 was here - 1998}:==--

    5. Re:When comments are more than comments... by soulcuttr · · Score: 1

      That's an arguement against ASCII art in comments right there. To be honest, though, it seems as though that backslash should never get processed (the compiler should skip processing the line after the // comment begins), but then who has ever made a standards-conforming compiler, eh?<BR><BR>

      *grin* Good one.<BR><BR>

      -Sou|cuttr

    6. Re:When comments are more than comments... by binner1 · · Score: 1

      Run this through gcc! I just ran it on RH7.2 with gcc 2.96, and it's still borked...gcc 3.x may have fixed the problem, but I wouldn't know.

      #include

      int main(void)
      {
      int a = 60, b = 6, c = 10;

      printf("%d = %d\n", (int) (((60/6)*0.3) + (10*0.7)), (int) (((a/b)*0.3) + (c*0.7)));

      exit(1);
      }

      -Ben

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

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

      Ha ha.

    8. Re:When comments are more than comments... by nickbrown · · Score: 1

      Even stranger! try this;

      >gcc bob.c
      >./a.out
      10 = 9
      >gcc -O2 bob.c
      >./a.out
      10 = 10
      >

      Is this a known bug?

    9. 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.
    10. Re:When comments are more than comments... by jeffy124 · · Score: 1

      crap, part of that #include line got eaten thanks to the < and > delimiters on the

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    11. Re:When comments are more than comments... by jeffy124 · · Score: 1

      ok, i just fed the below into gcc 2.96 on rh 7.1:

      #include <stdio.h>

      // --- jeff was here --- \\
      typedef unsigned char uchar;
      int something (uchar c);

      int main ()
      {
      something('c');
      return 0;
      }

      int something (uchar c)
      {
      printf ("%c\n", c);
      return 0;
      }

      bash$ gcc sample.c
      sample.c:5: parse error before `c'
      sample.c:14: parse error before `c'
      sample.c: In function `something':
      sample.c:16: `c' undeclared (first use in this function)
      sample.c:16: (Each undeclared identifier is reported only once
      sample.c:16: for each function it appears in.)

      bash$ gcc sample -E

      ---preprocessed stdio.h, i'm not about paste all 800+ lines---

      int something (uchar c);

      int main ()
      {
      something('c');
      return 0;
      }

      int something (uchar c)
      {
      printf ("%c\n", c);
      return 0;
      }


      So we see that I was correct (at least for my compiler) in that the \ at the end of the line is removed, then replaced with the contents of the following line, effectively removing the typedef from being compiled.

      For verification, I'll remove the \\ from the above and retry--

      bash$ gcc sample.c
      bash$ ./a.out
      c
      bash$


      As expected, the only output is the character 'c' followed by a newline.

      --
      The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    12. 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.

    13. Re:When comments are more than comments... by yoderm · · Score: 1

      That's actually a fascinating little niche of code that is basically implementation-dependent: Does the // (or # for perl,shells,etc) have higher or lower precidence than the \ ? Does the fact that it's a line-comment make the \ meaningless, or does the \ bring in the next line, too?

      Different compilers do this differently, and perl and shell implementations even vary. It's pretty amazing.

      -Mike

      --
      This sig no verb.
    14. Re:When comments are more than comments... by akihabara · · Score: 1

      That's actually a fascinating little niche of code that is basically implementation-dependent: Does the // (or # for perl,shells,etc) have higher or lower precidence than the \ ? Does the fact that it's a line-comment make the \ meaningless, or does the \ bring in the next line, too? No, it's well-defined, and as usual GCC gets it right.

    15. Re:When comments are more than comments... by Anonymous Coward · · Score: 0

      Ohh man, you're really bright. Lot's of respect man!

  140. my assember course.. by MP*Birdman · · Score: 1

    I managed to create a random number generator in x86 assembly that instead of working properly, would instead open another (picking at random.. who knows how it even got the file names..), opened it, and printed its contents to the screen..

    I don't use assembly anymore, amazingly enough..

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

  142. The Y2K bug... by Real+World+Stuff · · Score: 1

    Man, it was THE bug. Armageddon and the end of computing as we knew it. Wait a minute...ummm... :)

    --
    If we don't fight for ourselves no one will.
    1. Re:The Y2K bug... by Salsaman · · Score: 1

      How strange...we both posted the same thing at exactly the same time :-)

  143. Bizarre HotSpot bug by Westley · · Score: 1

    The strangest VM bug I've come across in Java experience was one that would crash the VM completely. I still don't know the exact circumstances, but the cure was very strange indeed: cast a reference.

    We ended up casting the reference in question to Object, which is *always* a no-op... but in this case, it stopped the VM from crashing. Strange indeed.

    Jon

  144. Metrowerks Codewarrior by toaster13 · · Score: 1

    found out that its C++ getline function wouldn't return EOF in time for a loop I designed. turned out it compiled on every other system i tried but MetroWorst kept segfaulting every time i ran the program. took me 3 days to figure that one out and I had to beg my teacher to let me compile it at home so that it would work.

  145. 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.

  146. PHP by Anonymous Coward · · Score: 0

    Well, recently the most annoying bug I've dealt with is PHP's bluescreen response to exec() shell_exec() and system() calls under a Windows platform!

  147. 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 dlgree1 · · Score: 1

      The company I work at had a similar problem with the personal Solaris boxes. Apperently the hard disks had some bad berrings and the company was to cheap to replace them all. This ment that if for some reason the machine was powered off, about 40% of the time, it would refuse to boot. When you called the Help Desk you were told to:

      1) Lift the front right side of the case 3 inches above the desk.
      2) Drop

      This almost always fixed it on the first try. I myself never had it fail to work.

    4. 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?
  148. oh my golly gosh yes by Anonymous Coward · · Score: 0

    pleased to be letting me frost your wheaties yes?

  149. sendkeys by Anonymous Coward · · Score: 0

    try doing 2 sendkeys in Access, it turns off the damn numlock!

  150. JDK 1.3.0 something on Linux by Anonymous Coward · · Score: 0

    My fellow programmer had following line in his Java-code:

    return x;;

    It compiled fine on his Windows-machine, but caused error on my Linux -box. Reason was obvious - my compiler thougth that there were a clause after the return and didn't want to compile that. Stupid.

    1. Re:JDK 1.3.0 something on Linux by thedarkstorm · · Score: 1

      Umm, actually that's illegal according to the JLS. Jikes (Open Source High Performance Compiler) won't even compile that. The WIndows Javac from Sun is just 'forgiving'. Heck in 1.4 it'll even let you do implicit type-casts from String to Int and vice-versa. Big no no.

      --
      ... hey ... I had a .sig, bu then MicroSo$$ embraced it...
  151. Bugs I haven't laughed at... by MrFenty · · Score: 0, Interesting

    It's nice to think of bugs that can make us smile, but I was shook up by one bug in hardware, the infamous Intel Pentium f00f bug. This caused calculations to go wrong, sometimes. Not often, quite rarely, but sometimes. Now, my job (or anyway, part of it) was to design programs that ran calculations to calculate the risk of a serious (fatal) genetic disease being inherited by an unborn from its mother. For some serious diseases, the hospital I worked at offered abortions for those mothers, if they wished. Whatever your views on such terminations, I made damned sure my code was clean and as bug free as I could make it. Then, I come across Usenet messages that the Pentiums I am using have a floating point bug. This is when such bugs become - literally - life or death problems for users. I believe that we were never effected (we reacted quickly and ran on 486's until we found that the cpu's we had were bug free), but it is a sobering lesson.

    1. Re:Bugs I haven't laughed at... by srichman · · Score: 1

      Uh, I think you're confused, duder. The f00f bug never caused calculations to return erroneous results. That was a contemporary FP bug. F00f just made your machine hang, regardless of OS protection. Read yr link.

  152. Another old favorite by Anonymous Coward · · Score: 0

    My old favorite bugs revolved around the C compiler and Unix libraries that came with OSF/1 (before it became known as Digital Unix).

    I wrote a piece of straight, inline C code to display quick message with a spinning cursor and then call some system commands. The system calls would always run before the strings were output!? I tried flushing the streams, etc. to no avail and the problem never showed up on any REAL Unix environments...

  153. Page widening bug by Anonymous Coward · · Score: 0

    Everybody here is familiar with it (well, except users of certain browsers which will be mentioned in replies to this) and everybody hates it. Except PWP DeKlerck and his troll buddies.

  154. 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
  155. NS 4 and dynamically written code by Frobozz0 · · Score: 1

    The best one I can think of was with (no suprise) Netscape 4.x. In order for the DOM to be properly updated, I needed to write a different SCRIPT tag for each item I wanted present to the ensuing code. In other words, each tag I wrote dynamically with JS had to be closed out, with a new one opened, in order to exist in the NS 4 DOM. IE/NS6, etc. all update after the document.write.

    What a royal pain in the arse.

    --
    "Politicians find new names for institutions which under old names have become odious to the people."
  156. This wasn't a bug so much as a missing feature by Jonathan_S · · Score: 1

    I was programming a simple program for work MS windows, Visual Studio, MSDN. Anyway, the program had to have the ability to grab an updated file from a remote computer over one of several protocols, HTTP, FTP, windows file share, and I was just using the Microsoft foundation classes to do it since the program already used them and they had internet protocol support.

    I decided that it would be a nice thing to provide a status meter to show how much of the file had been downloaded (a simple % meter).
    I got it working for HTTP no problem and started to implement it for FTP. There was a function FtpGetFileSize, it would do exactly what I wanted grab the size of the remote file. Clearly documented a piece of cake to add. The only problem is this useful function that was fully documented didn't actually exist!! It generated link errors. I finally did a string dump of the whole dll containing the FTP related function and there wasn't any function that allowed grabbing the file size. All the other FTP functions in the MSDN documentation were there, just not FtpGetFileSize...

    Very weird.

    1. Re:This wasn't a bug so much as a missing feature by cerberusti · · Score: 1

      Try exporting the entry point. Sadly, I have do this far too often (I use BCB4).

      --
      I'm a signature virus. Please copy me to your signature so I can replicate.
  157. Java2D axis flipped by The+Swedish+Chef · · Score: 1

    An early release of Java2D had a bug were mouse event coordinates where flipped about the x axis. I was implementing a dartboard widget at the time, and I was always getting the wrong numbers when I clicked on various regions of the widget. It took me forever to find out that it was a library problem and not a bug in my code.

  158. Hardware bug... by Bobo_The_Boinger · · Score: 0

    I had a bug with a microprocessor that will remane nameless. We were disabling interrupts around some code that modified a range of memory we were using to store characters received over the serial interface. The problem was, if a character arrived while interrupts were turned off, we'd get one more interrupt, and then none after that. So we lost incoming serial communications. Of course, it was difficult to find the problem because at our serial speed, and the small amount of processing that happened in the ISR, the problem only came up about once every few days!

    We got around the problem by using some memory access routines that could write from the ISR at any time during the read operation without trouncing all over each other. And it was a better design anyway, so we weren't too upset.

    --
    --David
  159. 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 :)

  160. '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
  161. I say by Anonymous Coward · · Score: 0

    I say that .5 should always round up to the next digit in the N+ world.

    why? simple:
    8.0, 8.1, 8.2, 8.3, 8.4 => 8.0
    8.5, 8.6, 8.7, 8.8, 8.9 => 9.0
    Do you see the balance ? 5 on each side.

    If you don't do that there is no balance.

    Artaxerxes

    1. Re:I say by muck1969 · · Score: 1

      but on a larger scale, rounding to the nearest even number...
      0.5, 2.5, 4.5, 6.5, 8.5, etc rounds down
      while
      1.5, 3.5, 5.5, 7.5, 9.5, etc rounds up
      Simply because x.1 - x.4 (four) versus x.5 - x.9 (five) is where the imbalance is and rounding to the nearest even number provides the opportunity to balance it out.

      --
      m.mmm..myyy ... sssissxxxtthh bbboottle offf mmmmmoouunnnttain ddeeewww.. in thhe pppassst ffffif
  162. This bug... by Anonymous Coward · · Score: 0

    Wasn't so much a bug but fun programming ignorance... When I was a kid I learned that handles were simply pointers to pointers. So when I first started programming on my Apple IIgs with TML Pascal I would load my images into arrays of bytes and then try to call the Apple Toolbox calls to manipulate the image. Well, of course, the toolbox wanted "handles" so I just stuck a pointer in front of the array pointer and voila! :)

    The sad thing is it actually worked for a while until the program got larger and the memory manager tried to relocate the handle and then realized that it wasn't in it's list!!!

    Ah the good ol' days!

  163. My favorite... by Anonymous Coward · · Score: 0

    was in every version of PC/MS-DOS I ever tried:

    REM > filename

    The "REM" of course is supposed to comment out the line.. but apparently it parsed the redirection first. That meant that it opened a file of "filename" of zero length. Funny.

    Or, if "filename" existed, it made it zero length.. which was no longer funny.

    It was actually fairly useful in batch files, once you got past the initial horror and amazement...

  164. 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.
  165. Java... public boolean Boolean.getBoolean(String) by gr8deevo · · Score: 1
    This does not do what you think it would do. My first guess it would look for 'T' / 'F' chars and report true for 'T' and false for 'F'.

    getBoolean(String name) Returns true if and only if the system property named by the argument exists and is equal to the string "true".

    What does system properties have to do with a primative class in java ??

    Easy solution is to create a new Boolean from a string and use getBooleanValue to get it's value.

  166. Quite recent really by Anonymous Coward · · Score: 0

    The latest Visual C++ (.NET) has caused my a few problems already. If you refer to a type and forget to include the header file, it carries on compiling the file assuming you actually meant "int", but never actually emits an error to tell you where the problem was. I've also had other problems with it's error "recovery", where I tried to invoke a non-existent method of an object. Instead of reporting the problems, VC just emitted the object file minus that statement.

  167. 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 MImeKillEr · · Score: 1

      How about these HTML bugs:

      1) The one that won't allow me to change the threashold for this thread.

      2) The one that won't wrap the text in all the comments for this thread.

      3) The one that won't allow me to reply to parent, only to this or other comments..

      Dunno if my settings are fudged, or if IE is taking a dump...

      --
      Cruising the internet on my TI-99/4A @ a whopping 300 baud!
    2. 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.
    3. Re:how 'bout HTML bugs? by drew · · Score: 1

      perhaps you dont remember this, or weren't working in html at the time, but netscape versions before 4.x (3.x and i believe 2.x as well) also implicitly closed the tr and td tags. i was an anal bastard and closed all of my tags anyway, but my best friend, who started coding in html around the same time as me swore up and down that the closing tags were optional.

      of course six months later when ns4 was released all of his web pages stopped working.

      ns4 was kinda the gcc 2.96 of the browser world. they abandoned backward compatibility in the name of progress, but released too early to be truly forward compatible.

      --
      If I don't put anything here, will anyone recognize me anymore?
    4. Re:how 'bout HTML bugs? by Anonymous Coward · · Score: 0

      Doing a bit of research, the end tags for TH/TD/TR have been optional ever since they were first introduced (in HTML 3.0), so Netscape 4.x was definitely at fault.
      Being an anal bastard like yourself, I also always close the tags. It makes the document easier for me to read (making it easier to modify).

    5. Re:how 'bout HTML bugs? by TKinias · · Score: 1

      Actually, the current HTML spec (dated 26 January 2000) is XHTML 1.0 -- and close tags are required for <tr>, <th>, <td>, and all other elements. XML, of which XHTML is an application, doesn't allow implicit closure of elements.

      --
      In principio creauit Linus Linucem.
    6. Re:how 'bout HTML bugs? by Quietust · · Score: 1

      I'm not counting XHTML 1.0 because it isn't (in a strict sense) HTML; besides, the bug in Netscape 4 deals with HTML (where the close tags should be optional), not XHTML (where they are required).

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

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

    --
    That is all.
    1. Re:Pet bugs? by GoogolPlexPlex · · Score: 1

      Crikey! Look at the size of that one!!
      Actually, "Walking Stick" is an American term for something that in Australia is simply called a "Stick Insect". Figuring this out made a lot of the puns in "A Bug's Life" make much more sense.

  169. Another /.er with no sense of sarcasm by GuanoTO · · Score: 1

    It's a pity really, life is much more humorous when you get the joke....

    1. Re:Another /.er with no sense of sarcasm by Anonymous Coward · · Score: 0

      Then why are you not laughing?

  170. Modula-2 by Anonymous Coward · · Score: 0

    Back in the good old days, the Modula-2 compiler would get really confused even on the most simple statements. The end result was that sometimes you would need to put 2 or EVEN 3 semi-colons at the end of a single statement to get it to compile. ;; ;;;

    Weird, wild, stuff!

  171. 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
  172. 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.
    1. Re:0 is NOT NULL! by Simon · · Score: 1

      Speaking of things that are also not NULL, Oracle (I think) has a very annoying misfeature/bug where it likes to translate empty strings ("") into NULLs. So, if you have a column in a table that takes strings but is set to NOT NULL, and you try to insert an empty string, the DB barfs and complains about a NOT NULL constraint being violated. But I was inserting "" and not a null! Needless to say it's very confusing until you figure out what's going on.

      "" and NULL are not the same thing dammit!.

      --
      Simon

  173. 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.
    2. Re:vi on Solaris 5.7 still crashes! by greensquare · · Score: 1

      Good Catch.

      For those who aren't familure with marks, that last command should have been c'd not c'm as I wrote.

    3. Re:vi on Solaris 5.7 still crashes! by nutznboltz · · Score: 1
      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.


      Version 3.7, 6/7/85 on 2.11 BSD on a p11 PDP-11 emulator just beeps when you do that.
    4. Re:vi on Solaris 5.7 still crashes! by nutznboltz · · Score: 1

      I always use "x" as the default mark name. The c'd worked on 2.11BSD vi version 3.7, 6/7/85 which is the oldest one I have handy.

      I'd be interested in seeing what SunOS 4.x.x does. I bet that this is a result of that train wreck with SysV crashing into SunOS.

  174. GOTO Handled Subscripted Labels Improperly by ec_hack · · Score: 1

    A program I was working on for an IBM 370 under the DOS/VS PL/I Checkout compiler had a problem handling a GOTO statement that used a subscripted label as a target. It choked on a statment of the form:

    I = some lookup function result
    GOTO LABEL(I);

    LABEL(1):
    processing code
    LABEL(2):
    more code

  175. 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.
    1. Re:here's one... by pater+noster · · Score: 1

      sorry, it's not gcc's fault that there "coders" out there cannot code. sure, it's true that with gcc (and any c compiler) you can produce code that contains buffer overruns. but that's just one reason why you should switch your mind on *before* you start coding. there are are thousands of other reasons. don't blame c and gcc.

    2. Re:here's one... by pater+noster · · Score: 1

      yeah, i know. and it's not gcc's fault that there are posters out there that cannot post.

      with the first sentence i meant:
      sorry, it's not gcc's fault that there *are* "coders" out there *which* cannot code.

  176. Time to show my age... by Anonymous Coward · · Score: 0

    The most annoying bug I ever came across was in the "Programmer's Guide for OS-09" (think Tandy CoCo, not PC) which documented the MOUSE structure as returning certain fields, but those fields were in an entirely different order from the same fields documented in the mouse.h file. Unfortunately the ones in the manual were correct, and the mouse.h file had to be editted to match the manual, but that didn't stop Tandy from issuing an erratta sheet for the manual, which did the reverse: reprinted the page to match the incorrect mouse.h.

    One word: auughhhhhhhhhh!

    Okay so that's not a word, but it serves the purpose.

  177. 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.
  178. Jet Database and VB by JahToasted · · Score: 1
    The microsoft JET database engine that Access uses and Visual Basic would assume dates in different orders. One assumed date to be in the form DD/MM/YY and the other was in MM/DD/YY (regardless of what was set in the regional settings control panel). I made a simple function to calculate age based on the date of birth entered. Just a couple of lines, but it took me days to figure out why it wouldn't work. Thanks Microsoft!

    The workaround was to go into window's regional settings, and set the date format to be dd mmm yyyy, so that it would write the first three letters for the month instead of the numbers. That way there would be no confusion whatsoever what date format was being used. Not sure if they ever patched it, nor do I care.

  179. 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 Citizen+of+Earth · · Score: 1

      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.

      I think that a better long-term "round-sometimes" mechanism would be to break the phase of the moon into 1000 different segments and and round up on even-numbered segments and down on odd.

    3. 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!

    4. Re:beat a-round the bush by thetman · · Score: 1

      LOL

    5. Re:beat a-round the bush by webprogrammer · · Score: 1

      Why do we have to use a base 10? If we used a base 9, or 17, or 5,169 we'd never have these problems...

      --
      Tim ODonnell (trying to be the most
    6. Re:beat a-round the bush by databyss · · Score: 1

      Somebody should create a rounding function that first converts the number to a base 9 system then round.

      --
      Hmmm witty sig or funny sig? Maybe elitest techy sig!
    7. 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).

    8. Re:beat a-round the bush by FrostedChaos · · Score: 1

      There is no finite decimal expression for 1/2 in base 9. Thus, you'd have to round first, not after.

      --
      "Any connection between your reality and mine is purely coincidental." -Slashdot
    9. Re:beat a-round the bush by Anonymous Coward · · Score: 0

      You are dumb! It would convert things ending in 5 to infinite repeating decimals and you would have exactly the same bias problems.

    10. 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.

  180. 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 ?

    1. Re:C/C++ Internal Compiler Error by jra101 · · Score: 1

      Yup, gives an error instead of a fatal error

      --
      I write code.
    2. Re:C/C++ Internal Compiler Error by Anonymous Coward · · Score: 0

      Holy hell, there are about 500 of those in gcc! Try a little harder...

  181. 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.
    2. Re:An oldy but a goody by Anonymous Coward · · Score: 0

      The Windows calculator had that sort of bug for 10 years or more (it was only fixed during the Pentium FP scandal).

  182. VB Null by Anonymous Coward · · Score: 0
    My favourite VB Bug, i used to include scrun.dll in my visual basic projects (visual basic scripting support), and there you have the
    constant:
    vbNull
    which is declared as "1". So if you do "lMyVar = vbNull", it is actually initialized to "1" *sigh*

    Or another goodie:
    If (Null = Null) Then Debug.Print "True" Else Debug.Print "False"
    Try to guess the output, yes it's "False" ;-).

    Or try passing a ADO RecordSet between ActiveX DLLs and check for any Null Values, you'll get really strange results (depending on the state of your moon)
    Public Function SomeCheck(pRS As RecordSet)

    If (Not IsNull(pRS.Fields("PK_SomeValue"))) Then

    If (IsNull(pRS.Fields("PK_SomeValue"))) Then
    ' Normally you aren't supposed to get here
    ' but try it a few times with a null value
    ' and set a break point...believe it or not
    ' you'll reach this point... ;-)
    End If

    End If

    End Function
    1. Re:VB Null by The+Bungi · · Score: 1
      OK, I couldn't resist.

      which is declared as "1". So if you do "lMyVar = vbNull", it is actually initialized to "1" *sigh*

      *Sigh* indeed. This proves that you have absolutely no understanding of variants in COM. MyVariant = Null would have given you what you needed. If you've taken the time to look for 'vbNull' in the runtime library you'd even found out what it's actually used for. RTFM?

      If (Null = Null) Then Debug.Print "True" Else Debug.Print "False"

      "Goodie"? Null cannot be compared to anything. That's why there's an IsNull() function. RTFM.

      Try to guess the output, yes it's "False" ;-)

      Ha-ha. RTFM.

      If (Not IsNull(pRS.Fields("PK_SomeValue"))) Then

      Ever bothered to look into how COM/IDL define default member methods on objects? Or how VB uses them? Do you even know what a type library is? No. Do you know *what* you are testing against in that IsNull() call? I don't think so. RTFM.

      Good thing you posted as an AC, d00d. I bet you're one of those quasi/semi/part-time "VB programmers", yes? It's so easy, anyone can do it kinda deal? Including, but not limted to, you? The very fact that you...

      used to include scrun.dll in my visual basic projects (visual basic scripting support)

      ... shows you are nothing but a glorified script coder. Let me guess: you're really good with ASP, eh? Do you know why it's called "Scripting runtime"? Because it's supposed to be used from scripting languages that have no native I/O support. But I guess that would have required you to look at the VB file access functions in the help file, and actually learn how to use them. And *that* would have been just too much RTFM for one day.

      RTFM.

    2. Re:VB Null by Anonymous Coward · · Score: 0

      If (Null = Null) Then Debug.Print "True" Else Debug.Print "False"

      "Goodie"? Null cannot be compared to anything. That's why there's an IsNull() function. RTFM.

      Then why does VB let you do it? Why is that not a compile-time (yes, I know) error?

  183. 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 ...
  184. when CS teachers go stupid by toaster13 · · Score: 1

    I had a CS teacher in high school who had to get the standard AP libraries off the college board web site. Now, instead of downloading them through some normal fashion (shift+click sounds good to me) he (get this!) printed every page and hand typed every header and library source over the summer.

    We all were very impressed when late May came around and nobody had encountered any problems with the foolishly reproduced libraries. I was the farthest ahead of the class in the assignments so i started working with APVector but kept getting odd (changing) compile time errors that pointed to various parts of my code. After days of frustration I determined that my code (most of which was reused anyway) had no syntax flaws in it despite the compiler's insistence.

    Under some divine inspiration, I decided to try compiling on my linux box to see what g++ had to say about my code. It complained about the APVector library, which made a lot more sense and was consistent. FINALLY I got the idea to check the actual AP library and see if my idiot teacher made a mistake. Surprisingly enough he had. There was a forgotten semi-colon about 15 lines down. To this day he insists that it wasn't his fault.

    1. Re:when CS teachers go stupid by rebill · · Score: 1

      Back in the days of VAX/VMS, and multiple class user accounts one the same machine, a teching assistant at the University of Louisville had his Pascal programming class open a data file, read the contents of the file, and write a new file with some calculation.

      Of course, he made his data file W:RWE, so that any joe schmoe could overwrite the contents of the file. It's amazing how many times the base data file was blown away by malfunctioning code written by neophyte programmers . . . and how many times I reloaded the original contents of the data file those over the next two days.

      The truly sad part is that I wasn't even in the guy's class - I was a student consultant in the computer center, and his students were coming to me to beg for help when their code that was working just fine 5 minutes ago suddenly started blowing up.

      I finally found the guy on Saturday and talked him into fixing the file protections, but by then we had figured out the three people who were trashing the file and had gotten them to fix their code.

      sigh

      --

      Chivalry is not dead, it's just frequently misspelt. - M. Langley

  185. 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 ...
  186. Ugghh! Fortran by tiberus · · Score: 1

    Sadly, I don't recall all the details... I ran across a bug in a Fortran function, believe it was toint(). Given a character it was supposed (documented) to return the integer value of that character but, nothing was working right.

    We later learned that it was returning the ascii value of the character, so after a little subtraction all was well.

    This is what I get for trying to dynamically format text in Fortran.

  187. FP Error by FunnyPolynomial · · Score: 1

    A large multi-threaded, event driven application. With a particular dataset we'd get a floating-point exception thrown. I tracked down the offending line, set breakpoints, single-stepped... It's fine! Waddaya complaining about! Those numbers are perfectly legal (the FPE was NaN or something). Naturally, I went to the MSDN, did a bit of searching. It turns out that if a floating-point op raises an error, that error isn't actually thrown until the NEXT floating point operation. Potentially a gazillion instructions ago. Tracking it down was not easy. Spent a lot of time shaking my head about the logic of it all.

    --
    // todo: implement sig
  188. Maybe not a bug... by CoderByBirth · · Score: 1

    ...but the most annoying type-o ever:
    if(thisIsAnExtremelyLongConditional && thisIsAnExtremelyLongConditionalAsWell); {
    }

    The long line went beyond the editor, and since the conditionals were complicated I kept searching for an hour for the reason the conditionals checked out when they shouldn't.

    This has probably never happened to anyone else. My coding sk1llz are meager. Damn.

  189. 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
    1. Re:Early Adobe TWAIN error by 3waygeek · · Score: 1

      That's the name of the error as documented in the TWAIN SDK -- check out the twain.h file.

  190. 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.

  191. thats at least two stories today.. by VoiceOfRaisin · · Score: 1

    that are taking shots at microsoft. yet if you actually read the attached stories or look into it (like this not being a bug at all) youd find out that they are truths and nothing to be heckled at. yet if you read the comments at +3 or more MOST of the comments are jokes poking fun at microsoft. pretty sad.

  192. 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

    --

    -... --- .-. . -.. ..--..
  193. 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.

  194. 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.

  195. Powerbuilder's Toolbar by kaizot · · Score: 1

    Working in PB4, I encountered a strange bug where if the user pressed a button on the toolbar that openned another screen and didn't move the mouse, the screen wouldn't open.

    If you moved the cursor off the toolbar, the screen would open as normal.

    To fix this, I wrote code to automatically move the cursor down and to the right. A couple of weeks later I got the same bug report back. The user was moving the cursor back over the toolbar (after it was automatically moved) and so the screen was still not openning.

    Our official responce was... "Don't do that!!!"

    1. 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.
  196. I spend a lot of time on this one by Anonymous Coward · · Score: 0

    Can you find it:

    switch(op) {
    case OP_MULT: // operator *
    v = a*b ;

    }

    1. 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.
  197. I am a whipper "snaper" by Anonymous Coward · · Score: 0

    Important Stuff:

    Please try to keep posts on topic.
    Try to reply to other people comments instead of starting new threads.
    Read other people's messages before posting your own to avoid simply duplicating what has already been said.
    Use a clear subject that describes what your message is about.
    Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page)
    Problems regarding accounts or comment posting should be sent to CowboyNeal.

  198. rexec under load by dbrower · · Score: 1
    I was sent to an integration site with another programmer to resolve a problem being seen under stress test load. A client program would start a server on another machine using rexec, and then communicate with it using messages. If there was an interrupt event, rexec sends a message over another channel, then signals the remote client. If a user hit ^C, it sent an interrupt to the remote server using this, then they traded messages to clear out what was in progress.

    What was being seen is that the two sides sometimes appeared to be getting out of sync with each other during this interrupt exchange, and then get hung; this only happened when the load average on the server side got to 10 or 20. The other programmer watched a test run for an hour, declared victory, and flew home. I stayed, and ran the test case over and over, with more and more logging to get a clue.

    What turned out to be the problem was this: The client side would send it's interrupt, then it would send it's 'clear' message. The server was supposed to get the interrupt, send it's clear, then look for the clear message from the client. What was happening was that the server was getting the client clear message, ignoring it because it was noise in a normal exchange, -then- get the signal. Why? Whafo? Because the rexecd program processing the signal had been paged out, while the server reading the normal message stream was not. While the signal message got to the server first, it sat queued while the rexecd paged in; in the meantime, the 'clean' message was processed by the application server. Then, when the rexecd had been paged in, it would read it's signal message and happily signal the application server process.

    The fix was to have the client wait to send it's clear until the server sent it's clear, acknowledging the interrupt first.

    This got me a two week trip to London to solve, and a big fat bonus for fixing.

    -dB

    --
    "It if was easy to do, we'd find someone cheaper than you to do it."
  199. My favorite bug... by 3waygeek · · Score: 1

    was a firmware bug in the built-in fax modem (based on a Sierra chip) in the old Momenta pen computer. Back in 1992/93, I was at Alien Computing, pioneers in PC-based faxing. We had an existing Windows 3.x product we were porting to Pen Windows under an OEM agreement with Momenta, and my responsibilities included pen-ifying the existing Windows UI and adapting the TSR-based communications module to the custom modem chip.

    In the process of testing the comms module, I noticed that many of the received faxes were a bit garbled, as though bytes were being corrupted or dropped. After almost a week's analysis of the modem's raw datastream, including decoding the CCITT data, I discovered that the modem would at random intervals repeat a single nibble of the raw data, corrupting the image.

    Once I found the bug, I then spent over a week convincing the Momenta engineers of the bug's existence -- they were conviced their modem firmware was bulletproof. I finally got through to them, but as I recall, the bug was never fixed, probably because Momenta wasn't doing well financially -- the pen computer, it turns out, was about a decade ahead of its time.

  200. 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.
  201. 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
    1. Re:Hmm. My favorite bug by J'raxis · · Score: 1

      It needs a for(;;) loop (or while(1) if youd like).

  202. 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?
  203. You're SUPPOSED to round 82.845 down by alteran · · Score: 1

    ...(for example, 'round(82.845)' returns '82.84' instead of '82.85').

    I know at first it seems a little weird, but modern statistics teaches that you should round to the nearest even number, not the next number up.

    By always rounding up, you assure that your numbers will be slightly too high. By rounding to the nearest even number, the odds are greater that you'll end up closer to the real answer.

    This is especially important in computers where you might by rounding thousands/millions of times.

    I don't know the vagaries of VBScript, and wouldn't be shocked if the documentation said otherwise-- but rounding to the nearest even number is correct-- it's not a bug.

    Can't speak to the rest of VBScript, though. :-)

    --
    Who is RTFM and when will he help me with Unix?
  204. Actually you've got it backwards... by Steveftoth · · Score: 1

    Everything in java is passed in functions by value. The wacky thing is that all Objects are accessed by reference. That's why you can't do
    Object o;
    o.toString();
    Which you can do in C++ because in C++ it thinks that you want to create an Object on the stack with the default constructor. You can't do that in java. You have to do
    Object o = new Object();
    o.toString();
    Which is like the code in C++
    Object *o = new Object();
    o->toString();

    Pass by reference and pass by value are 2 different things that can look like the same thing if you're not careful. Since all java objects live on the heap and cannot live on the stack ( like in C, C++ , C# structs ) references are how you access them. Technically, you are passing a reference.. by value. not passing a value by reference since you never had the value of the object to begin with.

    So the java function:
    String myFunc( String s , int x )
    would look like this in C++:
    String* myFunc ( String* s, int x)

    Primitives in java live on the stack in functions or in the object on the heap. You can't have a random primitive on the heap. Has to be contained in an object somehow (arrays are objects).

    Fun java fact of the day:
    Java primitives have a Class too. though the only way to reference it is special. The wrapper classes (Integer,Long , Short ..etc) have a static final field that contains the Class object representing that primitives class.

  205. set_tracker() by iaamoac · · Score: 1
    Way back in the day of high school (about 10 yrs ago), I once had the misfortune to write a checkers program in C on the school's ICON computers. For some bizarre reason, whenever the routine set_tracker() was called for the third time and only the third time, the cursor would disappear from view. The cursor was being used not only to select the piece, but also to identify whose turn it was, so this was a problem. It was still being tracked, but it could not be seen. I never could figure what caused it, but the work-around was simple--call set_tracker() four times at the very beginning of the program. It worked "perfectly" after that.

    Iaamoac

  206. 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.

    1. Re:Most annoying to me. by Anonymous Coward · · Score: 0

      In these parts we don't call that a bug. We call it a nigger.

  207. Perl & ODBC by xaeridus · · Score: 1

    There is a bug in the ODBC module for perl that will populate all of the fields with the same name, with the same value. If your SQL has a.name and b.name, they will both get the same value, even if the selection would pull different ones. I guess you could call this a feature, but it sure gave me a headache before I found it.

  208. common c bug by Anonymous Coward · · Score: 0

    Calls to strtok in multi-threaded environments cause huge memory leaks. It is a well known problem, but it usually takes hours of debugging to find.

  209. major database bug by Anonymous Coward · · Score: 0

    I wrote some apps using a major SQL db. It took me days to figure out that the app was failing because "select count(*)" would return 0 for tables with exactly 1 row. Apparently the function worked correctly on most platforms, but not on the particular SysVR3 386 Unix I was using at the time.

    Yech!!!

  210. floor() on an integer value drops to integer-1 by Anonymous Coward · · Score: 0

    Using Visual C++ I had an integer value placed in a round, used the floor function on it and it returns integer - 1, e.g. floor(5) returns 4! How can this be correct? I thought the point was to drop the remainder?

  211. 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();
    3. Re:How to BSOD Windows.. by CTho9305 · · Score: 1

      it doesn't crash for me, it just takes FOREVER to finish because there are so many files being listed over and over again.

    4. Re:How to BSOD Windows.. by Anonymous Coward · · Score: 1, Interesting

      How to BSOD Linux:

      opensocket();
      closesocket();
      writesocket();

      Oh, and about 10,000 others. Typical Linux FUD, always pointing out flaws in others while completly ignoring their own.

    5. Re:How to BSOD Windows.. by Anonymous Coward · · Score: 0

      I'm at a complete loss to understand your reply. I must assume you're trolling, because your statements are highly fanciful.

      (1) You imply the original poster is a Linux user bashing Windows. I can't find anywhere in his post where he says he's a Linux user.

      (2) You imply that because he described a bug in Windows without pointing out bugs in Linux, he's saying Linux is bug-free. He also didn't point out bugs in MacIntosh, Amiga, Atari, Java, etc. In fact, *you* didn't point out any bugs in Windows. Can I make the same assumption about you?

      (3) I translated your exploit pseudo code into real code and compiled and ran it on my Linux system. It didn't crash the system. When I tried to write to the closed file descriptor, the kernel returned an error value (just like it's supposed to) and the application gracefully handled the error. If you can provide actual code to prove your exploit, please do. If you just posted something you dug up from some old security archive, or something you simply made up, don't waste your breath.

      You've made some strong statements, but provided no actual facts to support them. If you can prove your words, then now's your chance to stand up for yourself. Otherwise, I'll assume your response was written purely out of spite and has no real value.

  212. 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.

  213. M$VC 6 C run-time bug in swscanf by Myria · · Score: 1

    There's a stupid bug in swscanf() I found at work ^^ int a, b, c, d; swscanf(L"123.234.12.34", L"%d.%d.%d.%d", &a, &b, &c, &d); That crashes the program. swscanf() is trying to write to the first parameter, which M$VC puts in a read-only section. Stupid bug, took me hours to figure it out. ^_^

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
  214. inferior generic SPAM by Anonymous Coward · · Score: 0

    The other week I got an email promising "New low mortgage rates for NULL!!". Along with a couple others for the mysterious mr NULL.

    1. Re:inferior generic SPAM by J'raxis · · Score: 1

      Ive received many with $variables like this in them.

  215. 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.
    1. Re:The answer ... by nagora · · Score: 1
      I've never heard that before. It makes some sense: half the time you round up and half the time down so it balances out.

      TWW

      --
      "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
  216. 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
  217. Win2k ATI/Half Life bug by happyhippy · · Score: 1
    Dunno whats causing it but i know its in the ATI Rage Fury drivers for win2k.

    On startup of Half Life the monitor puts itself on standby for no reason at all. A total reboot is needed.

    Pity me I cant play CS. But then again its shit now.

  218. Pentium Floating Point Error by cybermage · · Score: 2

    We are pentium of borg, you will be approximated.

  219. Old Borland C++ std::string resource leak by proub · · Score: 1

    Years ago at Galacticomm, our web-video server would just die, mysteriously, after several hours of use. No errors, no event log info, nothing. Just gone. This was under NT 4.

    We were using Borland C++, and made heavy use of STL - the string class in particular.

    Turns out that they allocated the strings using placement new, for a variation on an old C trick -- declaring a structure whose last element was a 1-char array, then actually allocating a bigger area so that array was as large as needed. So they allocated the needed space - something like:

    char *space = new char[sizeof(strstruct) + extraLen];

    then they created a string data structure in that space. Unfortunately, when they deleted the data later, they just deleted the plain char data -- neglecting to call the destructor, which must be done explicitly in such a situation.

    The structure had a Win32 MUTEX data member, which was released by the (never-called) destructor. So the MUTEXes just piled up and up, until the app finally died for want of resource handles. And the error-reporting code itself needed Mutexes, so that did no good.

    We patched the RTL source, all was well. Reported it to Borland, don't know if it was ever fixed -- it certainly wasn't in the next year of patches.

    -paul

    --
    "Irony is so September 10th"
    Matt Miller, alt.fan.spinnwebe
  220. MSVC v2 Memory exhaustion. by Anonymous Coward · · Score: 1, Interesting

    On very old (version 2.0 IIRC)Microsoft Visual C++ compilers the following code snippet would cause the compiler to grind away for a long time (I got it to go for 2 hours), finally run out of memory and crash.

    void main()
    {
    delete(int);
    }

  221. Early Borland/Turbo C++ bug by Orac · · Score: 0

    The very early versions of Turbo C++ for DOS had an wonderful object destruction bug. If you constructed an object on the stack in a destructor, like this:

    Foo::~Foo()
    {
    Bar b;
    ...
    }

    then the destructor for "b" was called TWICE.

  222. 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 Anonymous Coward · · Score: 0

      I wanted to wipe my hard drive using /dev/random. Had to move my mouse for 10 hours to gain enough entropy to overwrite the entire drive.

    3. Re:In all seriousness, random libs *suck* by Anonymous Coward · · Score: 0

      I absolutely concur. Furthurmore, these random number generators really annoy me because my MP3 player, when set on random, goes through funny cycles and plays the same stuff over and over.

    4. Re:In all seriousness, random libs *suck* by ccwf · · Score: 1
      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.

      Oh? Do you have some information on weaknesses in Java's SecureRandom class (e.g., its seeding, although it sounds like correlation is more of a concern for you than seeding) that you would care to discuss? The literature I've read indicates that SecureRandom is decent, especially for cross-platform code, except possibly for the seeding (which is admittedly a big exception), although there are known to be better algorithms.

      FYI, Here is an IBM article discussing generating random numbers in Java and C.

    5. 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)...

    6. Re:In all seriousness, random libs *suck* by Verizon+Guy · · Score: 1

      The coolest thing to do is to su root, then cat /dev/urandom > /dev/mem !

      --

      Aw, fuck it. Let's go bowling. - The Big Lebowski

    7. 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.)
    8. 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!"
    9. 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.

    10. 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.

    11. 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).

    12. 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).

    13. 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?
    14. Re:In all seriousness, random libs *suck* by sir99 · · Score: 1

      You should have just hooked up a radio to the sound card or something :)

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
  223. 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!!!

  224. 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.

  225. 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>
  226. 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.
  227. F00F by mprindle · · Score: 1

    Hey yall,

    Well I guess my favorite (since I'm a hardware guy) would have to be the Pentum 1 F00F bug. When that instruction was issued to the Processor it would lockup tighter than a drum. :) If you are bored you can go here to find out more about it.

  228. New slogan! by doorbot.com · · Score: 1

    One remote hole in the default install, in nearly 6 years!

    .
    .
    .

    See for yourself!

  229. 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)

  230. My Favorite by telstar · · Score: 2

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

  231. 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.

  232. 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.

  233. 82.845 iis an -estimate- of a real number by ishmalius · · Score: 1
    Since there is no exact floating representation of 82.845, the internal double- or single-precision float is probably storing it as something like 82.844999998... or some other (82.845 + or - a small epsilon value).

    Don't you remember your CSCI 101 prof tell you to never trust '=' when it comes to floating point numbers? Yet in your argument, you start off by assuming that the number is exactly equal to 82.845. QED. ;-)

    Just kidding.

    So the rounding function is probably correct.

  234. Apache Tomcat by von+Konrad · · Score: 1

    While working on a corporate intranet web app, I stumbled across an 'interesting feature' of Tomcat. For apparently no reason, my code would throw an exception from within the tomcat java libraries while processing GET/POST input.

    I spent a few days reviewing my code before finally jumping into the Tomcat code itself. I checked it over and everything looked fine. After a little over a week of getting to know the Tomcat codebase better than I would have liked to, I found the bug in the HTML!

    In Tomcat (or at least that older version), the code would crash when trying to parse the response from a malformed HTML form element. In this case the trouble was in the form "INPUT name=something value somevalue". You'll notice I accidentally left out a '='. I can't remember exactly what was happening, but the data the browser sent was only mildly awkward. Tomcat still shouldn't have died such a horrible death!

    On another note, my second biggest bug was encountered while trying to write a spider. It's amazing how different web servers don't always follow the RFC!

    ~Rob

  235. 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

  236. bugs by Anonymous Coward · · Score: 0

    Borland Turbo C (2.0 I think) had an interesting bug that surfaced only on the 80286 chip. Integer divides (or floating point) sometimes went astray.

    I will never forget seeing 5/2 = 2.4999999999.....

    In MSC 5.0, there was a bug in the optimizer that generated bad code (I forget the exact reason). We had apps with reported bugs that we could not reproduce in Codeview. Everytime we compiled for debug, the optimizer was turned off (required under Codeview); MS finally fessed up to that one.

  237. OFFTOPIC?? by Anonymous Coward · · Score: 0

    The headline was Pet Bugs. Jackass moderators. This was (+1 interesting).
    (and this AC is not the author).

  238. My radio system bug by Muzzarelli · · Score: 1

    In the early/mid 90s I worked for a company that was developing a radio station automation system. It was one of the first software based systems, most of the competition was doing audio compression/decompression in hardware in those days.

    Our first customer was a pacific island christian station, which would have frequent quote Reverends, and Priests from the pacific islands. Another thing that was a 'feature' of this station was when they would begin broadcasting at 6 in the morning they had a rooster crow jingle. All of these jingles, sermons, and anouncer's voice breaks were recorded onto the system, and assigned a track number, which was usually 5-6 digits long.

    The bug in the software was somehow related to track numbers, under some situations the digits of the track numbers would somehow get overwriten with data from other fields... leading to this situation :

    One of the most highly respected reverends in Tonga was going to have one of his sermons/preachings played on the radio for the first time... he invites all his friends around to his house so they can sit around listening to it.

    The anouncer's voice breaks were recorded ahead of time, it went something like "... and that was Apia High School Brass Band, and now we shall have a small word from the Reverend blah blah". At which point the bug kicked in and the wrong track was played... instead of the sermon being played it somehow got the trackid of rooster crowing jingle : "Cock a doodle do", followed by another voice break saying "... thank you to the Reverend blah blah for those words. And now...".

    There were a few very unimpressed people around... the boss went on a bug hunting jihad shortly afterwards :)

  239. My Buggy Fish by FireAtWill · · Score: 1

    I was once working on a program that would simulate fish and the sharks that would eat them. The idea was to foster behavoiral evolution by randomly modifying the behavoir of baby fish based on the behavoir of their parents (and some random mutation). The goal was to create a form of evolution.

    I was testing the mechanics of the system, watching little fishies chasing after food while the big fishies chased them. The sharks were indeed able to catch the slower little fish and eat them. But I hadn't implemented reproduction yet so it would only be a matter of time before the little fishies were extinct. So I waited as the sharks devastated the fish population.

    But two survived. One eybrow raised, I kept watching as these two little fish outran twenty sharks. They appeared immune.

    My heart started beating but my rational side pointed out that there's no way they could've evolved. That part of the code wasn't written yet.

    Well, it was a bug. Fishes that got created after the sharks would move after the sharks in every turn. So a shark would move onto the fish but then the fish would move away before the end-of-turn collision detection. Ooops.

    But of course, I *did* just watch evolution in action. Or did I?

  240. 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.
    1. Re:Great. by Anonymous Coward · · Score: 0

      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.

      But what the hell did you expect when
      to
      MS
      3.0 + 1.0 is 95?
  241. Visual Studio .Net by Anonymous Coward · · Score: 0

    When editing HTML pages, you cant use ®, and codes like that... it converts them to the symbol equivalent, which is displayed as ?

  242. 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."
  243. Slashdot posting by Chacham · · Score: 1

    HTTP/1.1 200 OK Date: Wed, 26 Jun 2002 21:15:51 GMT Server: Apache/1.3.26 (Unix) mod_perl/1.25 mod_gzip/1.3.19.1a X-Powered-By: Slash 2.003000 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1

    OK

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, pater@slashdot.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

  244. 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.
  245. Zortech / Oracle 64 bits by Anonymous Coward · · Score: 0

    I've got two bugs, that I'll never forget. The first one was in Zortech C++, around 1989. I had written:

    char** p = new (char*)[8];

    but the compiler messed it up and gave me something like:

    char** p = (char**) *(new char[8]);

    This was in Dos 3, so when I used the pointer, which was in the first 256 bytes (obviously), I often messed up the 18Hz interrupt vector. So, after a nice random amount of time after executing this, my machine froze. After I figured out why, I learned about typedefs.

    The other one was in the Oracle 7 API. They had a nice struct (documented and all) which was used to transfer data between the client application and the Oracle libraries. Unfortunately the field types were completely unsorted, mixing 1, 2, 4 and 8 byte types at random. No computer on earth could produce the exact alignments that were specified in the documentation.

    After defining our own structs came the surprise. In 64 bit environments, this struct, which was allocated by the client (thank you Oracle), was 512 bytes instead of 256. This was clearly stated in a 4 point sized footnote in manual #17. How could we possibly have missed that?

    Our client program was a garbage collected thing (similar to Java), using bucket allocation and all kinds of neat tricks. This resulted in the next 256 byte buffer that was allocated was actually the second half of the Oracle buffer. That was a very unusual size for our data types, so sometimes the program worked for hours before the bug appeared. Only at a customers site, in HongKong. We were in Sweden. The HongKong people couldn't speak English if their life depended on it. It was a somewhat stressful spring that year.

  246. Tell that to the IRS by Anonymous Coward · · Score: 0

    May God help you if you're using that rounding algorithm in a financial setting. Look what happened to the guy at WorldCom who didn't round up the way the Feds like.

  247. Here's how COBOL does it by jbohumil · · Score: 1

    From the IBM COBOL Manual

    The ROUNDED phrase is an optional phrase that can be coded for certain arithmetic statements.

    It indicates that any fractional result that exceeds the number of places provided in the recieving field is to be rounded (i.e., the
    least significant digit that will fit is incremented by 1 whenever the most significant digit in the excess portion is greater than or equal to 5). When ROUNDED is not specified, a fractional result that exceeds the number of places provided is truncated.

    Given the items defined below:

    05 WS-ROUNDED PIC S9(3)V99 COMP-3 VALUE +8.
    05 WS-TRUNCATED PIC S9(3)V99 COMP-3 VALUE +8.

    The following DIVIDE statements would give the results shown to the right of each statement:

    DIVIDE +3 INTO WS-ROUNDED ROUNDED. 2.67
    DIVIDE +3 INTO WS-TRUNCATED. 2.66

  248. 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.

    1. Re:Memories of ICONs. by Clubber+Lang · · Score: 1

      You could fix the fading problem if you new juuuuust where to hit the thing. If I recall... there were 2 slightly different monitor problems. One was fixed by firmly taping the machine on the top, dead centre about 2" back from the front of the screen. The other was fixed by smacking it really hard on the right side (hand moving left).

      --
      Actuaries - making accountants look interesting since 1949
  249. F16 flipped upside down when crossing the equator by parabyte · · Score: 1

    ...while controlled by the autopilot is my favourite pet bug.

    --
    Without order, nothing can exist. Without chaos, nothing can be created.
  250. hm. by Rozzin · · Score: 1

    a calculator uses differnent ways to store numbers so that it's more precise, but it's god awful slow compared to a computer.


    What's the difference between calculating and computing? :)
    --
    -rozzin.
    1. Re:hm. by bmwm3nut · · Score: 1

      i can't seem to find the source i had that explained this. but i did read somewhere a while ago that calculators don't use the IEEE 754 standard for storing floating points, they go about it a different way, thus keeping more precision at the cost of speed. it may actually be a decimal type storage where each digit is represented by a few (4 ish) bits. this way there's not loss of precision at all. i'll try to find the info i had and get back to you.

    2. Re:hm. by bmwm3nut · · Score: 1
      ah ha! i did find what i was looking for.

      remember floating point numbers are stored in a format (mantissa)*(base)^(exponent)

      in IEEE 754:
      mantissa: 52 bits wide
      base: 2
      exponent: 11 bits wide

      the TI-85 and TI-92 use a different method
      mantissa: 12 decimal digits wide
      base: 10
      exponent: 3 decimal digits wide

      remember that each decimal digit take 4 bits (unless they used packed decimal digits which i won't talk about), so the mantissa is 48 bits wide.

      if the numbers are stored this way, then values like 0.5 can be stored exactly, where as in IEEE 754 they cannot. on a calculator, you want 0.5 to be exactly 0.5. i guess you want that too on a computer, but you give it up for the super duper increase in speed by not having to sore each digit with 4 bits and do all the extra work needed to do math on these numbers.
    3. 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?

    4. Re:hm. by bmwm3nut · · Score: 1
      yes, you are absolutely right about 0.5 being exact in IEEE. i was thinking 0.1 when i wrote that. 0.1 cannot be stored exactly in IEEE. it gets stored as 0.9999999999999....

      yes, i know i excluded things like the sign bit and the assumed 1 in the mantissa. i didn't need that to explain the difference between ieee and the calculator notation

      and there is a difference between packed and unpacked decimal notation.

      to represent decimal values 0-9 you need 4 bits, but 4 bits will get you 0-15, so you're wasting extra space. in the packed notaion you use something like 3.2 or so bits per digit. you have some bits spanning digits.
    5. 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!

    6. 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
    7. 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!

  251. When the first time ... by disco_stu00 · · Score: 1

    I run my code and it works.

  252. 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.

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

      The Commodore PET apparently had a design flaw where if you accessed this one memory mapped I/O location in a tight loop, you could make some component on the mainboard overheat and fry.

      ooops!

  253. Backgound images in tables. by sideshow · · Score: 1

    If you put a background image in a cell and then nested a table inside that cell, each cell in the nested table would grab the background image of the outside cell and start it over.

    So if the big cell had a picture of the Mona Lisa as it's background a 9 cell table inside that cell would show up that image 9 times with each cell only showing the upper left corner.

    --

    Hollow words will burn and hollow men will burn.

  254. 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
  255. Bug.Not by The+Bungi · · Score: 1
    It's called 'banker's rounding' (as opposed to what you were expecting, which is arithmetic rounding) and that's how the VB and VBScript runtime (and actually the COM runtime libraries themselves) are designed.

    You may think it's a bug, or even hope it's a bug, but if you've bothered to RTFM you'd figured out in no time instead of submitting to /. for the world to ponder your programming prowess (even in VBScript, which is simple enough).

    Here's a helpful link that should come in handy next time.

    Hope that helps. And RTFM/Google next time!

  256. format bug by greenrom · · Score: 1
    I remember a bug in format.com that would let you make a disk unreadable. If you have access to an old dos machine, try putting a floppy in the drive and typing this:

    format a: /select /u

    The /select is an undocumented option that causes format to write unformatting information to the disk. The /u option means do an unconditional format without storing and unformatting information. If you use them both together, sector 0 gets overwritten with 0xF6 and you can't read the disk.

    In college, this was fun to use at the end of the quarter back when everybody was finishing up their term papers (back in the days when people still used floppies.)

  257. WellsFargo ATM bug by pankaj_kumar · · Score: 1

    This happened with me around a year ago. I deposited a cheque of $4.01 at the ATM ( got from one of those mail-in rebates ). THe ATM helpfully asked if I would like to take out money from the deposit. I pressed YES by mistake. This is where the interesting bug reared its head. The ATM will allow me to enter only $20.0 or more but a subsequent logic will not let me take out $20.0 as the original deposit amount was less. There was no way I could get out from this loop. Eventually I left the ATM without my ATM card and the ATM in a deadlock !!

  258. 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 DrVxD · · Score: 1

      I've seen something like this as an error message from a printer driver somewhere (IIRC, it was a Linux box, but I may be wrong) - something like "Printer not responding. Is it on fire?"

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
    2. 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.
  259. ANSI C vs. Microsoft C++ porting bug by Anonymous Coward · · Score: 0
    This probably is probably a Microsoft "feature" but according to ANSI C, in the statement
    for (int x = 0; FOO; BAR)
    x is *suppose* to be local to the loop. Not the case with my Microsoft compiler (VC++ 6). Very annoying when porting a large app. On the bright side it just gives a compiler error, nothing too wacky.

    My favorite bug was my first stack hosing experience (I was a novice...). It happened when I converted
    int x = -1;
    while (++x < FOO)...
    to
    for (int x = -1; x < FOO; x++)
    where x is used as an array index in the loop.
  260. AIX and shared libraries nightmare by pruneau · · Score: 1

    I do not remember the AIX version it was (3.x or 4.x, x<2), but when you used shared libraries, it was mandatoy to 'rm' the old version. If you dared to 'mv' it, the system insisted of using the old version until you 'rm'ed it or rebooted the machine.

    And NO it was not because the shared library was not unloaded or still open...

    We wasted two weeks on this one, unable to fix a bug that was fixed in the source code, but not willing to dissapear until the test server crashed...

    Just try to guess the amount of cursing/hair tearing/head banging we did.

    But the funniest thing was that customers where telling us that everything was OK, but we were not able to reproduce the correction !!!

    --
    [Pruneau /\o^O/\ warranty void if this .sig is removed]
  261. 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 Anonymous Coward · · Score: 0
      A = C
      A = B
      B = C

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


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


      indeed. kurt meant C = A, A = B, then B = C. how embarassing! HAHAHAHAHAHAHAHAHHAHAHAHAHAHAAHAHA. good chuckle.
    3. Re:Apple instructor pointer invalid by Captain+Chad · · Score: 1
      My favorite method to swap 2 variables (in C):
      1. a ^= b ^= a ^= b;
      It works.
      --
      Check out Chad's News
    4. 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
  262. 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.

  263. This isn't exactly a bug but... by ruby31sar · · Score: 1

    ...in Excel 97, if you went to a given field and executed a set of key strokes you would end up in a Flight Simulator. You would then fly around and the developers names were carved into the side of a mountain.

    I've gotta run, I'm feeling bloaty.

    1. Re:This isn't exactly a bug but... by mooman · · Score: 1

      No, that's called an easter egg...

      There are sites out there devoted to them:
      http://dir.yahoo.com/Computers_and_Internet /Softwa re/Easter_Eggs/

      --
      In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
  264. 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.

  265. 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.
  266. while()/list() bug in php by mojumbo · · Score: 1

    Here's one that stumped me for a while (no pun intended...)

    when using:
    while(list($k,$v)=each($array) && list($a,$b)=each($anotherarray));

    php hangs. no errors. no warnings. just hangs.
    at least, it did in 4.0.6

    i managed to take down two webservers because of this bug. php and apache would run away with memory and eventually new processes couldn't spawn. it was loads of fun...

  267. 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 JahToasted · · Score: 1

      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.

    2. 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?

  268. Re: C=A, duh! by Kurt+Gray · · Score: 2

    ... and that's why there also be a job market for debuggers!

  269. Favorite gcc bug by crwulff · · Score: 1

    Hey, so the best one I've run across so far was in something like gcc 2.95 when the optimizer was turned on... short x = 0x1122; short y = 0x2222; if ( ((BYTE)x) == ((BYTE)y) ) { return true; } else { return false; } And yes... this returned false with -O and true without optimization. It has long since been fixed (and included in the test suite) but it must have taken me a week to find why my code was breaking with optimization.

  270. MSVC++ and throw specs by DrVxD · · Score: 1
    One version of MSVC++ (I'm not sure which one, but its not particularly recent) chokes on:
    class Foo {
    Foo() throw();
    };
    But is happy with:
    class Foo {
    Foo() throw();;
    };
    (For those that missed it, the second version has an extra - syntactically invalid - ; after the throw spec.) At least it's a compile time problem.

    Going further back in history, there was a version of the (pre "Visual") MS C compiler - I think maybe 4 or 5 - which would die (at runtime) if you called the following function:
    void foo()
    {
    int i = strlen( "a" );
    {
    int j = i+1;
    }
    }
    The problem turned out to be that, if you used the wrong combination of optimiser switches, it allocated stack space for both i and j, but only released the stack space for i, so the return from the function effectively went to a random address.
    --
    Not everything that can be measured matters; Not everything that matters can be measured.
  271. Demon seeds by Gulthek · · Score: 2

    They're like walnuts, only evil!

  272. 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

  273. 32767 != 32k by Whatever+Fits · · Score: 1

    The MSDN has a few references to 32k as the limit to their buffers for Win 9x APIs. These limits do not apply to NT versions. I was developing on an NT system with the code being tested on a 98 system. Here is the problem:

    You can make a call to these APIs with a buffer sized at 32768 and the call will fail, returning an empty buffer, no error message, no error code, and no exception. If you pass in a buffer size of 32767 it works flawlessly. The documentation does state in one place that 32767 is required, but you have to look for it. Why does it not work at 32k? It took me several hours of work over a few days to find this problem.

    --
    My name fits again.
  274. Compiler that can't add by gafferted · · Score: 1
    My favorite was a C compiler on CP/M back in the 80's which had difficulty adding. The test was:

    Start with 0

    Add -0.1 gives -0.1

    Add -0.1 gives -0.2

    Add 0.1 gives -0.1

    Add 0.1 gives -0 (note the negative!)

    Add 15 gives 12 (?!)

    It was in the mid-80's. Sorry I can't remember which C compiler.

  275. 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.]
  276. not really a bug but.. by pyros · · Score: 1

    The coolest compiler error I ever saw was when I accidently had the class constructor defined as a private member, so the compiler told me the "constructor is private and has no friends."

  277. No, no no! It's called banker's rounding! by mbwall · · Score: 1

    It is not a bug, per se, as it is on purpose. And all of the "mathematical reasoning" posted so far is so incredibly far from the reason for it, I have to believe that everyone is pulling this from their hindsides.

    The numbers are rounded based on the preceding digit when they end in a 5. This is because often number sets are NOT completely random. In banking (hence, "banker's rounding") it is often common to have many .5s (more than a random sample). By rounding ALL of these up, we get an uneven distribution. By using banker's rounding, the rounded set will contain much less bias than traditional rounding.

    As for ways around it, its pretty trivial in VB. Just stop spouting all nonsense. MS did this on purpose, for a legit reason, and, of all things, documented it! Read up on it next time.

  278. char* bug in MS C++ compiler by tulmad · · Score: 1

    I was working on my senior design project for my bachelor's degree in CSE when I found a nice bug in Microsoft's C++ compiler (Visual Studio 6). Create a bunch of char pointers as character arrays. Then delete them in any arbitrary order. Most likely, you'll get a memory error. The problem is the way the deletion is done. You MUST delete them in the exact opposite order you created them for it not to give you a memory error every time. This is even if you don't change the data stored in memory.

    That cost us about 4 or 5 hours of debugging time before we realized exactly what it was doing...

    --
    "In case of emergency, break glass. Scream. Bleed to death."
  279. 3 Favorite Bugs by connsmythe96 · · Score: 1

    #2 is a bug I found in Borland C++ Builder (can't remember which version, may have been a demo.) All programs built with that compiler won't run on the first of January every year. It's not a Y2K think, either. No error or anything, they just don't run at all. I got like 5 emails from people using one of my programs telling me it suddenly stopped working and sure enough, I tried it and it wouldn't start. Neither would my other programs. Next day it started up fine. I didn't even use any dates in the programs. Go figure. #2 isn't really a bug, but a problem with floating point arithmetic. The fmod() function (floating point %) doesn't always return 0.0 when it should. I set up a breakpoint and checked the values going in and it was very obvious that the one was divisible evenly by the other, but fmod returned a very tiny number instead of zero. Or it return a number just barely smaller than the divisor. I tried putting in some tolerance, but it wasn't a predictable tolerance and always seemed to return a number just outside of my range. Hmmph. Oh, and one more! MS decided to use macros for the max() and min() functions instead of inline templates, so I spent all day trying to find a bug caused by an expression being evaluated twice inside a max() macro.

    --
    if(!cool) exit(-1);
  280. Pet bug by Garion911 · · Score: 1

    1st thing I thought of:

    POKE 59458,64

    Not sure of the actaully value to poke into 59458, but for all who don't understand, this said poke command would FRY a Commodore PET machine. As in smokey-melt-down.

    --
    Slashdot is like Playboy: I read it for the articles
  281. 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!

  282. pointer... by marcovje · · Score: 1


    Pointerbugs or unitialised variables that behave differently when compiled with debugging is on.

    (because the mem layout of the program with debug info is different, the debugger initialises variables or some statements are optimized differently)
    ---

    I also worked with a open source compiler when it was new a year of 4 ago, and that still had codegenerator bugs. It is very frustrating to
    encounter a cg bug if you create a program with more than a couple of hundred lines.

    The only way to trace them is to narrow the spot down, and then check the assembler directly for all relevant places

  283. Re:1802 bug - new one on me by Anonymous Coward · · Score: 0

    that was one cool chip, perfectly symmetrical, if something could be incremented, it could be decremented, shift left and shift right with or without the carry bit... ya had to love a processor that had 16 sex instructions. it was also the first cmos processor, and that scared a lot of people who weren't sold on the nmos stuff yet. but i never heard of or ran into any hardware bugs with it. i won't even swear that the 1802 had a nop. 00 was idle, maybe 38 or c8 was a nop. hell, the 1802 was so slow i never needed a nop for timing, decrementing a register always took long enough all by itself. but 71 never cared where i put it, as long as the x register was pointing somewhere sane (r0 at reset).

    71 30 - disable interrupts, pc=r0, x=3
    90 b3 - get hi r0, set hi r3
    f8 08 a3 - load d with 08, put lo r3
    d3 - pc=r3
    ... rest of code follows (at 0008), that's the quickest way to kill the interrupts and then get the program counter the hell out of r0 before a dma request comes along. yeah, ya could shave a byte with
    90 b3
    f8 07 a3
    71 33
    but yer ass is hanging wide open for 10 machine cycles for an interrupt to ruin your whole day. and i find it absolutely terrifying that i remember this shit, i haven't touched an 1802 for at least a decade.

  284. Don't Worry! by Anonymous Coward · · Score: 0

    There's this excellent programming language called C# which will save the industry!

  285. 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.
  286. Re:Not a bug (nearest even digit, motives) by Beryllium+Sphere(tm) · · Score: 1

    Once upon a time, long, long ago there were no personal computers. There weren't even pocket calculators.

    Calculations were done by hand.

    When someone back in those days put a tape measure up to a live dinosaur and got N.5000000 centimeters, they'd round to the nearest even number because an even number *might* make the next operation easier to do.

  287. Bugs by Anonymous Coward · · Score: 0

    My personal favorite comes from a casio calculator,
    one of those old green display models....
    type:
    -2 sqrt =
    and you get

    -1.414

    no i, no error...... cool

  288. $question = 2 . " B " || ! 2 . "B"; by techwolf · · Score: 1

    I had an old perl bug where explicitly defining a variable and using eq to test it failed.

    Something along the lines of...
    $var = "String";
    if ($var eq "String") { ... }

    The workaround was to use a regexp (/^String$/). To this day, I always use regular expressions instead of eq or ne.

    -techwolf

    --
    I don't do this for karma, I do it for cash. It's much better.
  289. 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
    1. Re:Things that SHOULD be a bug... by dismayed · · Score: 1

      I think this is another one of those Larry the Linguist (tm)? things... efficient as in, "efficient to the programmer". It is like a spoken language... you can use reflexives in most spoken languages but, most second language learners wouldn't at first because they are confusing until you have experience with the language...

      An example I guess:
      My fast and crazy dog can fetch well. He likes to chase frisbees.
      vs.
      My fast and crazy dog can fetch well. My fast and crazy dog likes to chase frisbees.

      A lot of other perl things treat the programming languague like a spoken language... @_ is the best example of this I think.

  290. Oh lets see by hardcode · · Score: 1

    Kofax Image Processing Platform where CreateCompatibleImageDescriptor() created an incompatible image descriptor.

    Or an ADA compiler that failed to compile only if there were comments on some lines, but noit the others.

    hc

  291. NT4, downed with a forward slash by TheJerkstoreCalled · · Score: 1

    My favorite bug is in NT4. I changed the LMHOSTS file, after which I rebooted. During the bootup process, I got the dreaded BSOD, which caused me to reboot, during which I got the BSOD...

    I suddenly realize I'm probably going to be stuck rebuilding this machine, seeing as how its all NTFS thus I couldn't use a boot disk to fix whatever the mysterious problem was (at the time I was unaware of the linux ntfs-enabled bootdisks, alas.) I spend some time thinking back on what I was doing, really all I had done was change this one little dinky thing in the lmhosts file. Then I realized I had a copy of the lmhosts file on the network drive where I had originally edited it. I opened it up, and noticed my new entry had a forward slash instead of a backslash. Surely this couldn't be the root of my problem could it? Yes, experimentation throughout the rest of the day proved that making an entry with a forward slash instead of a backslash caused the machine to crash on bootup (when the network is loaded) and thus renders said box unusable.

    I then called Microsoft to report this highly irritating problem. They asked me to send them my lmhosts file, which I did. They said they tested it on several machines there and most of them were fine with it, although a couple exphibited the behavior I described.

    Here's the kicker. When you report a bug to Microsoft support, they don't charge you for the support call. Even though they reproduced it on at least two machines and basically made an entire NT4 server USELESS they determined it was NOT A BUG and said I just shouldn't use forward slashes, and that I would not be receiving credit for the call.

    This was the day I swore upon god that I would never give them a single dollar of my money ever again.

  292. What, bugs in VB? by Anonymous Coward · · Score: 0

    I couldnt be less suprised to hear of bugs in Microsoft products. I prefer Java and avoid VB like the plague. I know many VB programmers who have developed extremely bad programming habits and spend lots of time writing workarounds for undocumented or poorly documented features that dont behave as expected. VB is old and crappy, dont expect it to be a solid language for anything. Run away, find a real language with real documentation. Geez.

  293. Bugs in Java "Compiler" by xelph · · Score: 1

    I find bugs in the Java "compiler" once in a while. The last one is that the following line won't compile: package com.import; As a result, the good people from import.com are not allowed to name their packages correctly. That may be why they are still under construction, as per their Web site www.import.com. Another one I found a week ago is that if you have two methods with two different signatures but the exact same name, and if one is in a Java file's main class and the other is in some inner class of that main class, then you cannot invoke the first one from the inner class, because the compiler will erroneously report that the parameters' types are wrong. This one has a solution, though... just prefix the method call with MyClassName.this. and it will compile fine.

  294. /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.

    1. Re:/dev/random and CryptGenRandom() by Thorgal · · Score: 1

      No, there is Knuth's LCG implementated in java.util.Random. Check the sources.

      --
      "Man in the Moon and other weird things" - wfmh.org.pl/thorgal/Moon/
  295. Windows and Installshield by Grayswan · · Score: 1

    One of the funniest bugs I've ever run across came from a combination of behaviors of Windows and installshield. We built an install script using installshield and test ran it. It promptly installed the program directly into the Recycle Bin. When I had picked myself off the floor, I puzzled out why. After a previous install of the program, instead of uninstalling the program, somebody just dragged the program directory to the Recycle Bin. Windows must have trapped that and changed all the program registry entries to indicate the new program location and the install script reinstalled over the existing program.

    --
    If you open your mind too wide, people will throw trash in it.
  296. 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
  297. 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
  298. hm.. by gabec · · Score: 1
    I'm looking around and all i see are a bunch of people rambling on about rounding. the point was to discuss problems we've had.

    so. at an acm programming team contest we had to find a series of numbers that were cubes of other numbers .. i don't remember the details but basically what was happening was that every four or five iterations we'd be off by some miniscule amount (at least as far as the example was concerned). it turns out that the pow() function in c++ is done through some crazy natural log thing (that i understood at the time) and because of all the flipping around eventually there is some minor precision loss. anyway, so after digging around forever in our code we finally changed the lines of y=pow(3,x); to y=x*x*x; and got the right answer.

    further, at that same contest we kept turing in this one program that was behaving *perfectly* for us. we turned it in over and over and over after making minor changes that we desperately made until finally we gave up and asked the proctors to take a look at. apparently the judges were using some dos-based pre-made script to compile, run, and test our Visual C++ programs... and when we just used the "!" icon in the IDE it was compiling the programs with different compiling options. It took us another 20 minutes after it was revealed to us that this was even possible.. we were checking in a loop to the size of a string, that is, the possible length of a string, not the actual length. so if we had string1[30] then we had a for loop going to 30 instead of the number of characters in string1. using the standard build this was OK, MSDev was apparently "smart enough" to stop for us but because of the more strict (and accurate) methods of the judges we lost an insane amount of time on that program.

    *sigh* we only got 3 programs of the 7 provided. still, i was proud considering it was my first one :) anyway, I don't think that second one counts as a "bug" in Visual C++, it just, well, sucked.

  299. The Fixed Point solution :) by AltaMannen · · Score: 0

    using the smallest kept bit (kept==not truncated after rounding) to determine whether to round .5 up or down is probably ok for statistics and such, but for a fixed point number where you want to make an integer out of a 12:4 (bits) and the value is something like %11000 after a multiplication operation (with a down-shift) it is much more probable than not (1/16 in this case) that what was removed was exactly zero, so rounding the fixed point ".5" up in all cases is more likely to end up closer than doing it in every second case. I guess you could also use the 4 (in this case) least significant kept bits as a random seed to determine whether you go up or go down.

    But if those mathematicians want it some other way they don't need to know what my rendering code does under the surface ;)

    The only good way to round is to jsut pretend to the user you're rounding and use "%.2f" when you display the result and let sprintf worry about the rules.

  300. These aren't bugs! by lordaych · · Score: 1

    0 is always false. Anything but 0 is true. "Not 1" is -2, as opposed to "0" which you assumed it to be, which is not 0, therefore, "Not 1" is "true."

    As for using "Now()" with Randomize... If you want a so-called "Random" seed, just call "Randomize" by itself, which uses "Timer" as the seed. You aren't supposed to use "Now()" with Randomize, as it's not a "numeric expression." (Try MSGBOX VAL(NOW()) to see why this happens, you are essentially seeding the generator with "6" every time.) Of course, the documentation isn't too clear about this, it says to use a "Variant or Numeric Expression." It would still be a bad idea, because it's only precise to the second, whereas Timer uses fractions of a second.

    But using the system timer in this way still isn't a good idea for cryptography (nor is VB in general). This is why programs like PGP have you dance away at the keyboard in order to properly seed the generator.

    1. Re:These aren't bugs! by John+Courtland · · Score: 1

      I guess it depends on your (or VB's) definition of NOT. I would bet that anyone who's familiar with assembler or boolean logic would choke on this error too. I certainly would and have been programming ass for 5 years. There is no nice way of saying it but VB is not good. I think it's sole purpose is to piss off programmers who are more advanced than Mr. Gates by locking them into a shitty implementation. Just a thought.
      -Me

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    2. Re:These aren't bugs! by PissingInTheWind · · Score: 1
      Ok, it's just that for me 'NOT' has the meaning of boolean negation, so I was expecting some sort of explicit conversion from '0' to 'false' and then the negation of 'false' to be 'true'.

      And about the 'timer()' thingy to seed the rand, my problem was that time returns the number of milliseconds since midnight, so it means that at the same time each day you always have the same seed (admitedly, there is little chance trouble could be caused by that in a simple application).

      --

      A message from the system administrator: 'I've upped my priority. Now up yours.'
  301. 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
    1. Re:Try the Mersenne Twister by Anonymous Coward · · Score: 0

      Troll. But good.

  302. Debugging from Antarctica... by dargaud · · Score: 1
    I spent two years writing a data acquisition system using DSP cards for a Sodar (remote sensing) device. Then I was sent to Antarctica several times to install it and run it.

    On the last trip, in 2000, we bought two new PCs just for that purpose. I checked the systems before leaving but couldn't run a real time check because all the instrumentation was already on the ship.

    So I get there and install the stuff. Lo and behold, all the acquisitions run 4 times too fast. I spent 10 days and nights... err, no, no nights there... debugging the crap out of it. Apparently each time an external interrupt was called, the motherboard would generate 4 interrupt calls instead of one.

    Tech support calls over a satellite phone from Antarctica were costing about 20$/minute ["Please hold." NO!!!]. I never solved it but rewrote the interrupt routine (wearing gloves) to throw out interrupt calls that came too close to each others. Never could figure out what was wrong with that motherboard. Lost 10 days of data but saved the next two months.

    --
    Non-Linux Penguins ?
  303. The Linux Bug by Anonymous Coward · · Score: 0

    Its the one where all the Linux geeks get annoyed because they know Linux will never rule the desktop (even though THEIR mom installed RedHat and uses it on a daily basis) yet still refuse to believe that Linux is too complicated for the rest of us....

    How many replies will this troll get...

  304. Re:Hmm. My favorite bug (Correction!) by i_am_pi · · Score: 1
    Aack woopsy
    Corrected version
    #include <stdio.h>

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

    Pi
  305. Ask any chemist. .5 rounds to nearest even. by chipotle_pickle · · Score: 1

    First week of chemistry 101 you learn that 0.5 rounds to the nearest even. This is a rule from lab measurements; it predates CS. The CS folks were correct to follow the standard already in place.

  306. 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.
  307. There IS a bug in IE for the Mac by Stomper · · Score: 1

    There is a bug in IE for the Mac:
    Q216593 - PRB Scripting Differences in Internet Explorer for Macintosh
    http://support.microsoft.com/support/kb /articles/Q 216/5/93.ASP

    That article claims the following:

    "ECMAScript (JavaScript) is supported; the same version of the JScript
    script engine that ships with the Windows version of Internet Explorer
    also ships with Macintosh Internet Explorer. "

    The above is not true because it seems like the Mac IE reports the array
    length for the second set of radio buttons on a page as 0 (zero)
    regardless of the length. The first is not affected, nor is the third.

    I have written a short demo script for those of you that would like to
    try this. Just copy the entire code and give it a try in your browser.

    Set 1 value 1

    Set 1 value 2

    Set 2 value 1

    Set 2 value 2

    Set 2 value 3

    Set 3 value 1

    Set 3 value 2

    Set 3 value 3

    Set 3 value 4

    The values *SHOULD* be 2, 3 and 4 for set1, set 2, and set 3
    respectively. This is NOT the case with IE for the Mac. It reports 2,
    0, and 4.

    I just want you make everyone aware of this problem. To get around
    this, you have to check the status of the radio buttons using the elements
    array.

    This bug cost me some time a while ago.

    Mike

    1. Re:There IS a bug in IE for the Mac by Stomper · · Score: 1

      Ok, so my demo does not work so well (stripped). Email me if you want it, but easy to reproduce.

      Mike

  308. Not a bug by taustin · · Score: 1

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

    This isn't a bug. It is the "even/odd" rule, long established in formal math, not commonly used in Real Life.

  309. Mysterious Windows Bugs by praxim · · Score: 1

    Though they're not very interesting, I have encountered at least two bugs in MS' famed product line. In Win2k without an SP applied, CreateIconFromResource is hopelessly broken. Also, strangely enough, the WININET functions tend to break unpredictably on WinME.

  310. Well written sir by gazbo · · Score: 1

    Take solace in the fact that you don't look like a fucking prick.

  311. 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 Anonymous Coward · · Score: 0

      It would be except that the poster prefers extra virgin pure C code to cruddy C++. STL would never do in such a squeaky-clean codebase.

    2. Re:That's a feature by vladkrupin · · Score: 1

      nah, I didn't care for pure C, as I said. I guess, it took me too long to dig to find remove_if. I wonder how to actually release the memory after I am done traversing through the hash. The phrase The iterators in the range [new_last, last) are all still dereferenceable, but the elements that they point to are unspecified. makes me think there is junk left after I delete things in such a way. Oh, well, I got it solved in a prettier (albeit, way more painful ) way.

      Thanks a lot for the suggestion anyway.

      --

      Jobs? Which jobs?
    3. 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
  312. 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 /.
  313. Load the resulting HTML into IE 5.x by Anonymous Coward · · Score: 0
    Load the resulting HTML page into IE 5.x and watch it blow up. Netscape handles this OK.
    print "<html>";
    print "<head><title>colors</title>< / ead>";
    print "<body><pre>";

    my $count = 16 ** 6;
    for (my $i=0; $i<$count; $i++) {
    if($i % 100 == 0) {
    printf("\n");
    }
    printf ("<font color=%06x>-</font>", $i);
    }

    print "</pre></body><html>";
    1. Re:Load the resulting HTML into IE 5.x by Anonymous Coward · · Score: 0
      Also notice the bug with Slashdot's handling of the
      <ecode>
      tag. The second print statement has the proper closing of the head tag but Slashdot doesn't show it.
    2. Re:Load the resulting HTML into IE 5.x by The+Kenman · · Score: 1

      ROFL!! now THAT is comedy!!! Thanks, I needed that. What irony!

      --
      ASCII silly question, get a silly ANSI.
  314. 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?
  315. 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 maroberts · · Score: 1

      Ah the halcyon dayas of coding forms. I think you were lucky that it was only a number/letter confusion.

      When I did this stuff, any resemblance of the entered program to the one I wrote on the form was purely coincidental.

      --

      Donte Alistair Anderson Roberts - hi son!
      Karma: Chameleon

    2. 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...

    3. 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?
  316. My bugs by Anonymous Coward · · Score: 0
    • My first bug - 1973:

      I wrote some lame game in basic in elementary school that was a sort of Battleship with moving ships in a secret 10x10 grid. Ships started at one end, and moved one space across the grid (up, down, left, or right) after each turn.


      The bug was that after my turn, the computer would advance the ships, and half the ships completed their journey across the grid (when they were only supposed to move one space). The bug was that I was serially searching the 10x10 grid and advancing the ships right across the page.

    • My favorite bug - 1984/85?:
      I was working the HP Response Center, in from out of town, and a user called with a problem in their COBOL program on an HP 3000 Series 40. I Debuged that thing down to the line of code, where the move was to take place.. and then down to the line of machine code where the move took place. It was a simple


      move toadrdess, fromaddress


      - statement in machine code, and the darn MOVE didn't work! I looked at that for a few minutes, and then ended up calling the HP factory and talking to the guy who wrote the microcode for the HP3000. (Those were the days! You could get a guru on the phone!) He thought it was Way cool that I could pinpoint the problem to that level.

    • My worst mistake as a programmer - 1977:
      I put my name in a program I wrote in high school, and NO LIE, I got a call at home, 22 years later, asking if it was Y2K compliant! (Note to self: Never ever ever again put comments in code.) Of course, they wanted me to honor my 1977 rate schedule of $10/hour for programming.
  317. Self deprecating reference by npsimons · · Score: 1
    this has to be the most memorable one.


    Oh yeah, I remember that one. Even now, years later, when I see code that uses strtok(), it sends shivers down my spine and makes me see red.

    1. 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"
    2. Re:Self deprecating reference by Anonymous Coward · · Score: 0

      I suspect that this is a self deprecating reference because you realized, later, that you only called strtok() once in your example code?

    3. Re:Self deprecating reference by npsimons · · Score: 1
      I suspect that this is a self deprecating reference because you realized, later, that you only called strtok() once in your example code?


      Correct. However, I still have to agree with the man page for strtok() in Linux, especially when there are much better options available. Avoid strtok() at all costs. As has been said before "do not follow the NULL pointer, for therein lays madness."

  318. Big source files. No, bigger than that. by ringrose · · Score: 1

    While I was a graduate student at MIT, I was using SD/Fast, a program which wrote C code for simulating system dynamics. The input and output formats of SD/Fast could have been more user friendly (I have no idea if they are now), but I had written software which made it relatively easy to create input files, even large ones, for SD/Fast and integrate the results into physically realistic simulations. You could describe the creature you wanted, and it would eventually write everything except the control system itself. Including making input to SD/Fast, running SD/Fast, and incorporating the results.

    In one case, someone was (ab)using it to simulate a tree with 100+ degrees of freedom. The file generated by SD/Fast was multiple megabytes of undecipherable C source code. We couldn't even figure it out enough to break it into multiple files (and the process of creating it was thoroughly automated, we didn't really want to).

    So we showed it to the Sun C compiler. It churned for about an hour... and ran out of some internal resource. I never found out what, nor did I find out how to resize it.

    So we showed it to the IBM C compiler running on the machine across the room. Lo and behold, it compiled and ran, doing a good imitation of Zippy the Wonder Slug.

    So we took the -g flag out. After all, its working, we don't need debugging information.

    Fortunately I'd limited the core dump size. Otherwise, some of the users who shared that disk space would have been really annoyed when it segfaulted.

    IBM wanted the program, so they could try and figure out why it was different with the debugging information included.... We advised them of the size of the source code and the number of libraries in the MIT AI lab it depended on, and they said "Uh... we'll send you this patch which might be it."

    This patching process happened a few times. Eventually, the program worked and the poor undergraduate who was trying to do this finished his project.

    As a closing note, soon after that SD/Fast sprouted options to break the output into multiple files.

    --
    There's always one more bu6
  319. Windows CE and mulptile dlls of same filename by Anonymous Coward · · Score: 0

    Windows CE has this incredibly annoying 'by design' issue. It has a single, global linked list of dll's, which are identified by their local name(ie "foo.dll" rather than "\MyApp\Foo.dll"). So, this means if two apps have their own foo.dll, only the one that runs first will function correctly. The second to load will be presented with the first app's foo.dll. Quite annoying.

    From MSDN:
    Two different modules cannot have the same file name, given that the extensions are different. These effectively have the same module name. For example, if LoadLibrary is made on Sample.cpl, the operating system will not load Sample.cpl, but instead will again load Sample.dll. A similar limitation exists for modules with the same name but residing in different directories. For example, if LoadLibrary is called on \\Windows\Sample.dll, and then LoadLibrary is called on \\MyDir\Sample.dll, \\Windows\Sample.dll will simply be reloaded.

  320. MSVC++ for WinCE bug by mr_vauxhall · · Score: 1
    Real, subtle nasty one. We had an internal data representation that use large numbers of 7-byte structs. So sometimes you copy them with

    s1=s2;
    Well, the compiler drops in the code to copy 8 bytes! This manifested itself as occasional corruption of data. We ended up changing the structures to classes, and giving them copy constructors and assignment operators that did member copies.

    Warning! As far as I know, this bug still exists!

  321. The weirdest TI-83+ bug I have run into by Yosi · · Score: 1

    On a TI-83+ (or TI-83) take int(5/13*13) - you get 4.
    So then you do fpart(5/13*13) and get one.
    so then you do fpart(5/13*13) - 1 and get zero,
    and ipart(5/13*13) - 4 = 0

    huh?

  322. Oracle XML Package by zrgn · · Score: 1

    I don't recall the specifics, but I remember a bug on Oracle's XML pacage that drove me just about batty. In the XML specifications, a particular function was supposed to return null if no children were available. However, the package had been programmed to return the empty string. Long story short, the Apache SOAP implemenation I was using which needed the Oracle XML package crashed whenever I tried to use it because it was not expecting the empty string.

    In the end I had to get the source code for the SOAP package (Oracle's was propriatary) and re-program it to work. It was quite the character building experience.

    Alan

  323. 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
  324. 2 bugs by Anonymous Coward · · Score: 0

    Remember when Visual C++ (what a piece of crap) would generate an error message for ANSI-standard "const char* const foo;" The error message said too many consts. Sheesh.

    But my favorite bugs were the ones I wrote myself in the unprotected unsafe-computing MS-DOS days, when a wild pointer would write to video RAM (remember B800:0000?) and leave me with a frozen machine and little blinking smiley faces, among other characters, on the screen.

  325. IBM Series/1 programming by Bradlegar+the+Hobbit · · Score: 1

    On the Series/1, the EDL language had a construct like:
    (VARNAME,#1)
    which means, "Take the value in register 1 [#1] and add it to the address in memory of variable VARNAME". Handy for things like tables and lists, and essential for working with strings. Kinda like adding to a pointer.

    We had a program that crashed when we ran it in production, but worked when we were testing it. It turned out that on the production machine, the program ran higher in memory than in testing. The value in register 1 eventually got so large its high bit got set, which turned it into a negative number ... so the program started writing into the memory space before the variable and not after it.

    --

    I haven't lost my mind; it's backed up on a CD-R somewhere
  326. sort(1) was one of my worst by Antity · · Score: 1

    I had to "port" one of my shell scripts in my company to another machine (source was SunOS with bash). The target platform was Linux/SPARC, in fact RedHat 6.2 (with lots of fiddling applied, but in core still RPM) on a Sun Netra. (Pretty baby. :->)

    But it didn't work. There was some data collection mechanism that didn't give me a clue to why it was failing (well, it didn't simply fail; it just gave perfectly wrong results as output).

    Several hours later, even after "backporting" it from bash to /bin/sh, while replaying all the data flows in the script I found the bug.

    The bug was in sort(1) from the GNU textutils shipped with RedHat 6.2/SPARC. When using the -n option to do numeric sorting, this simply didn't work. sort shifted some numbers around within the data stream, but what went out was far from sorted.

    I couldn't even believe that and spent some more time searching around for known bugs in GNU textutils. When I didn't find anything in the textutils ChangeLog that matched this bug, I just tried to compile a new package from scratch. Wonder - it worked.

    Maybe RedHat just used a broken compiler for this default RPM, but this was a nasty, nasty thing that cost me half a day.

    (Would you expect something like sort(1) to be broken on a system that has been running and used for months?)

    Taught me something.

    --
    42. Easy. What is 32 + 8 + 2?
  327. 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.

  328. Turbo C 1.0 by Gumby · · Score: 1

    When Borland shipped Turbo C 1.0, we ran out and grabbed a copy. Within a couple days I discovered a bug which was confirmed by Borland technical support: constants initializers in the form of a division expression where inverted. For example int x = 1.0/3.0 would equal 3.0 It was very consistant. All my other calls to Borland ended up being about my bugs :)

  329. 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
    1. Re:Windows printf of death by Anonymous Coward · · Score: 0

      If you are going to get high and mighty, please at least learn the difference between DOS and Windows and how to configure your computer to show crash traces (blue screens).

  330. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  331. 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
    1. Re:Windows Registry Access Security by Captain+Chad · · Score: 1

      I should clarify the preceding post. My non-administrator account had access to the key for read and write -- it simply didn't have some of the more esoteric access levels. By default, only administrators have all levels of access to all registry keys. Even though my account had the necessary access, the program was requesting full access -- so it could not open the key.

      --
      Check out Chad's News
  332. Web developing and IE XHTML quirk mode by Eol1 · · Score: 1

    While not as fancy and cool as the all the *real* programming bugs :P .... as a web developer, nothing pisses me off more than the IE XHTML quirks bug:

    Guess what. This throws IE5.x and IE6 into quirks mode (instead fo strict like ?DOCTYPE is supposed to) ... plays hell with the supposed IE css1 compliance.

    Hopefully m$ can get off their butt and fix this KNOWN bug (been an issue since IE5.x) in 6.x

    -Eol

    --
    De Oppresso Liber
  333. strange qbasic fix by Anonymous Coward · · Score: 0

    There was an interesting bug in qbasic code that I saw not so long ago, when I was poking through some source that a guy had done a while ago.

    [code..]

    x + 1

    x - 1

    [code..]


    I asked him WTF he was doing there. Turns out that was a fix to reset some sort of flag which would cause the program to occasionally behave strangely.

  334. 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 Michael+B.+Davis · · Score: 1

      He he he! I can see why! Even though I've never once used a label myself in C or C++ code. That's brilliant.

      --
      Cheers, Michael From sunny Toronto
    2. Re:Amusing C++ bug by matsh · · Score: 2

      Plus, an empty ';' is a NOP. :-)

      Mats

  335. 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
  336. 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.

  337. Daylight savings in GMT in JAVA by Anonymous Coward · · Score: 0

    My favourite (or most frustrating) was that in a couple of versions of JAVA the GMT timezone had daylight savings applied. So GMT was GMT+1 for parts of the year.

    These days I always create my own GMT timezone and don't trust the built in one.

  338. Visual C++ stl bug by Michael+B.+Davis · · Score: 1

    Hi, I remember when MS came out with their first version of the Standard Template Library. Or maybe it was a subsequent release in which they introduced this bug. Anyway, it was a few years ago. The code in question was there to copy a string or a container class. It was a trivial function. Source code was included, and it looked something like this. Please forgive me if the syntax isn't right, I've been writing Java, Python, Php and Perl this week, and it's been ages since I did templates:
    template copy( T * dest, const T * src )
    {
    while ( src )
    *dest = *src++;
    }
    Notice how dest doesn't increment. And this is a development library from Microsoft. No wonder we're in such an aweful mess. Does anyone else remember this one?

    --
    Cheers, Michael From sunny Toronto
  339. Lotus Notes @commands by furry_marmot · · Score: 1
    I had to do some development in Lotus Notes 3.3, years ago. One of the most annoying features (which I considered a huge design bug) was the separation of @Commands and @Macros. @Macros were functions like @truncate, @date, etc., while @Commands corresponded directly to menu commands. I created a help desk application and included a feature to check all the fields in a form before sending. The feature/bug was that @Commands ALWAYS executed before @Macros (as per the documentation, as I found out), no matter what order you wrote them in. The script would be written something like this:
    1. Check fields.
    2. If an error, AlertBox and Exit.
    3. Else, send form.
    but it would always execute like this:
    1. Send form.
    2. Check fields.
    3. If an error, AlertBox and Exit (a little late).
    Until they created LotusScript, it was almost impossible to do anything useful with it. And it was still an awfully strange system.
  340. 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.

  341. Another NT4 bug... by vpreHoose · · Score: 1

    ...that did get fixed. Code that produces logfiles for debugging purposes should loop nice and safely so it doesn't get too big. Or as one of our coders implemented, start a new file every 10k. Pretty soon there were lots of files in a single directory. Once you bluescreened, or simply rebooted, the system wouldn't start back up. You'd be surprised how many re-installs we had to do before finding this one.

  342. 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.

  343. One case where .5 should always round up (or down) by seanscottrogers · · Score: 1

    One of the reasons that children (more accurately students) are taught that .5 should always round up is because of grading. While it is mathematically correct to distribute the "round ups" and "round downs" to the nearest even integer, tests where 1/2 points are often given but not recorded certainly provide a reason to be consistent! Otherwise, you will end up with a score of: 12.5 and 13.5, which has a 1 point difference, becoming 12 and 14, which is a 2 point difference.

  344. Spelling error. by Anonymous Coward · · Score: 0

    You misspelled C++.

  345. 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
  346. Does this beat it? by DotComVictim · · Score: 1

    http://slashdot.org/comments.pl?sid=34867&cid=3774 509

  347. My First O/S Bug... by blrichwine · · Score: 1

    The first O/S bug I found was in the TS1000. Remember that thing? It was a Timex version of the Sinclair ZX80. Would you even call it an O/S? The only thing the TS1000 had over the ZX80 was you didn't have to solder it together and it's 1KB of static RAM was twice that of the ZX80 so at least you could fill the whole screen with characters with out running out of memory...

    The bug it had caused me to get a "B" on a computer assignment in my Senior year science class because the square root function would return incorrect results some where around 2.5 or so. Even though I could prove to my teacher the computer was making a mistake by simply doing something like:
    10 PRINT SQR(2.5)
    he insisted that computers never make mistakes and that I must have been doing something wrong. I later read where I could call some number in England and they would send a new ROM chip to fix that and other errors...

    (And, yea, I remember being irked bad when a friend got one of these a couple month later and it came with 2K of RAM! Wow 2048 Bytes... Damn.)

    The funny thing is I remember people actually sold chess programs that ran on these things.)

  348. Isn't "phi" one of those pseudoscience constants? by The_Dougster · · Score: 1

    Like I read Velikovsky some years back and he seemed to be claiming that it was some fundamental constant of his vibratory model of the universe and it predicted the respective orbits of the planets around the sun. I didn't know that

    phi = sqrt( pi() * 1.2 )

    That is a pretty interesting property, namely
    that:

    ( n / phi ) + ( n / (phi^2) ) = n

    Weird...

    --
    Clickety Click ...
  349. Two from Borland days by jazman · · Score: 1

    It's been a while so I can't remember too many details...

    One was in 4.0 where if you saved a file with exactly 1000 lines, regardless of size of file - it was the line count that mattered, the IDE crashed.

    Later (4.5?) I had a graphics problem with something appearing a few pixels off where it should have been. Thought I'd got the maths wrong so I added an offset to put it in the right place (as a precursor to finding the cause of the problem) but then the graphic was off where it should have been by that offset! Moved the offset towards zero, and when it was zero the graphic was in the right place, but without that +0 on the equation it didn't give the right result.

    Then there was one, oh that's three, never mind, where I tried adding a TTime and an int, and I got an ambiguous error because it didn't know whether to cast the int to long or the TTime to a TDate, cos it knew about TTime+long and TDate+int. Ok, not a bug (unless you consider that TDate+int would have given a vastly different result to TTime+long(int)), but one of those interesting little logic problems that make programming such fun.

    And I'm not even going to get into the Losedows API. CreateBitmap and CreateDIBitmap; which one creates a device independent bitmap? That's right - NOT CreateDIBitmap.

  350. Not all of those are C. by Mr+Z · · Score: 1
    • int foo (int &bar) {...} ---> pass by reference

    That only works in C++, I'm afraid. C only supports pass-by-value (the first one), and explicit pass-by-reference (the third one).

    --Joe
  351. 1/2 = 0 by eske · · Score: 1

    The other day I was testing some of my c++ code for a A.I project, I get some wired errors 1/2 = 0
    (if you must know redhat 7.3 upgradet from 7.2) and I have others problems with the upgrade:
    emacs syntax-h in latex don't works
    as-spell from emacs don't works.
    etc
    etc
    so I think it is a problem with the upgrade because it alle workd fine before

    --
    What rimes on recursion What rimes on recursion What rimes on recursion What rimes on recursion
    1. 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...

  352. 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.

  353. Damnit moderators! by Anonymous Coward · · Score: 0

    This guy is WRONG. And now you're perpetuating this! Look at all the arguments against this ALL OVER this topic and you'll quickly understand why 'Aspirin' is incorrect.

    Shit. There goes a whole generation of kids who now have a broken understanding of the subtleties of number theory. :(

  354. ICMP.dll by Anonymous Coward · · Score: 0

    Microsofts ICMP.dll can make ping applications fail. I use Win2k at work, and maintain over 500 DSL connections going to various remote network appliances. I noticed one day that if a ping stopped returning replies, I could restart the app and get responses. I tried this next to a BSD shell, ran ping on both and watched BSD ping like a champ while Win2k started to fail.

    Funny, only Microsoft could bork something as common as ping. Shameful even, and no, I never bothered to report the bug. Why? I paid for bug ridden software, its not like they will pay me for the QA service!

  355. 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.

  356. 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
    1. Re:Round to even is not expensive by Mr+Z · · Score: 1

      The main place I come across it is in fixed-point computations. Suppose I'm rounding away N bits of a number. Pure truncation is simply:

      result = value >> N;

      Traditional rounding (round 0.5 up) is:

      result = (value + (1 << (N - 1))) >> N;

      Unbiased rounding is like so:

      result = (value - (value < 0)) >> N;

      Round-to-even is:

      result = (value + ((1 << (N - 1)) - (value & (1 << N)) == 0)) >> N;

      It's little question in my mind which one is the most expensive, at least in software. :-) Also, as hardware is unlikely to actually use a lookup table, I'd imagine the hardware cost is similar as well.

      As an aside, when I have performance-critical code which needs to do a lot of rounding, and the slight bias of "round up" gets in the way, I've sometimes eliminated the bias by setting half my rounding terms to "1 << (N - 1)" and half to "(1 << (N - 1)) - 1", effectively making half my rounds "round 0.5 up" and half "round 0.5 down." My IEEE-1188 compliant IDCT implementation does this -- the IEEE-1188 spec is sensitive enough to pick up the slight bias.

      --Joe
    2. Re:Round to even is not expensive by Mr+Z · · Score: 1

      Ack! Damn small text-box. I missplaced a paren in the "round-to-even" code:

      result = (value + (1 << (N - 1)) - ((value & (1 << N)) == 0)) >> N;

      Also, the unbiased rounding should be either:

      result = (value + (value < 0)) >> N;

      Or

      result = (value - (value >> 31)) >> N; /* assuming >> sign-extends and 'value' is 32 bits */

      Talk about a brain-fart. I had mentally combined the two, giving "extra biased rounding".

      --Joe
  357. Thank god this was a late post by Anonymous Coward · · Score: 0

    Praise the lord this post comes down along the chain, well after anybody has ready the facts about upward biasing.

    Typical slashdot reader. "hee hee, typical MS programmer doesn't know shit. Oops. You mean MS was right?"

    Any moderator who modded this ups deserves their privs removed.

  358. visual basic by Anonymous Coward · · Score: 0

    Visual Basic 6.0. It has plenty of nice concepts, but the whole implementation is a bug.

  359. Or hell, even base-3. by Mr+Z · · Score: 1

    It's a problem in base-2 also. Base-5 wouldn't have the problem, though.

    Base-3 for computers would solve the problem. Apparently, in the very early days of computing there was some interest in base-3, although it never took off.

    You could represent base-3 with -1, 0, 1. This is called balanced ternary notation. Quantum computers may end up using that variant of base-3. (I wish I could find a better quantum computing link. One of my former coworkers was doing his PhD on this stuff, and it was really quite fascinating.)

    --Joe
  360. Heh I experimented with this using "bc" by The_Dougster · · Score: 1

    A little algebraic maniputation and I put
    the phi equation into Newton's for for an
    iterative solution, and it converges.

    Try this:

    scale=500
    define p(x) { return 1 + 1/x; }
    phi = 2
    while ( phi != p(phi) ) { phi = p(phi); }
    phi
    1.6180339887498948482045868343656381177203 09179805 762862135448622705\
    26046281890244970720720418939 113748475408807538689 175212663386222353\
    69317931800607667263544333890 865959395829056383226 613199282902678806\
    75208766892501711696207032221 043216269548626296313 614438149758701220\
    34080588795445474924618569536 486444924104432077134 494704956584678850\
    98743394422125448770664780915 884607499887124007652 170575179788341662\
    56249407589069704000281210427 621771117778053153171 410117046665991466\
    97987317613560067087480710
    p i = 4 * a(1)
    pi
    3.14159265358979323846264338327950288419 7169399375 105820974944592307\
    81640628620899862803482534211 706798214808651328230 664709384460955058\
    22317253594081284811174502841 027019385211055596446 229489549303819644\
    28810975665933446128475648233 786783165271201909145 648566923460348610\
    45432664821339360726024914127 372458700660631558817 488152092096282925\
    40917153643678925903600113305 305488204665213841469 519415116094330572\
    70365759591953092186117381932 611793105118548074462 379962749567351885\
    75272489122793818301194912
    a lpha = pi / ( phi^2)
    alpha
    1.199981614864326661115777753316806 926562499505529 057521467556375365\
    65366911971939538998103033029 198186568648125360010 705945389334340348\
    88059128154218261667046851147 606295498586362400290 970525243087795168\
    45783734896228552041375905719 677253907789930645432 415922185240842172\
    53789388243835236701554956620 971071808916879413135 748981466258466101\
    75082909148572184813756929300 859726696097114760127 693023059888230457\
    87920803491717102325547950045 977539807233206560329 157466678939790854\
    34041365040685351056856224

    Neato!

    --
    Clickety Click ...
  361. PHP concat prob... by Anonymous Coward · · Score: 0

    my "famous bug" appeared in something like php 3.x:

    $mv = dechex(255).dechex(255).dechex(255);
    should result in $mv "FFFFFF"

    but the result was:
    "FF00FF", the zero switching positions one by one, so called in a loop it produced
    FF00FF
    FFFF00
    00FFFF
    FF00FF

    I used that for color calculations, damn they WERE funny...

    my resolution was this:
    $mv = dechex(255);
    $mv .= dechex(255);
    $mv .= dechex(255);

    - which worked fine. Time to get the bug: about an hour :)

  362. 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.
  363. 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
  364. Geeks. by Anonymous Coward · · Score: 0

    Good lord people, did you read the last few lines of the post? This wasn't supposed to be Rounding Theory 101.

  365. 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.
  366. Ever seen one of these? by Wyzard · · Score: 1

    This isn't exactly a bug, but it's one of those things that makes you wonder how anyone could let it slip by...

    Keyboard error or no keyboard present.

    Press F1 to continue.
  367. rounding... by smash · · Score: 1
    When the last digit ends in 5, some rounding implementations round to the *even* number.

    Possibly this is what was happening.

    Not sure why this is the case, but unless told to round in a particular direction (up or down) this is how we were taught where I went to school (in Australia).

    Personally, I usually round to the worst case scenario (ie, up on my tax, down on my available funds, etc ;)

    smash

    --
    I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
  368. Let's put an end to the rounding-confusion by theskov · · Score: 1
    There seems to be some uncertainty about all this rounding, so lets take it step by step:

    We have a number n with a certain precision pn.

    We need to represent it as a number r with a lower precision pr.

    We want r to be as close to n as possible.

    The rounding must not have a tendency to increase or decrease the value of n.

    Whenever we round n to r the last pn - pb digits are thrown away as they are implicitly 0's in r (ie 5.1 = 5.1000000.....)

    Unless the digits we throw away are all 0's, we are going to alter the value of our number, and it is this alteration we wish to minimize. We do that by rounding to the number of precision pr that is closest to n.

    This is trivial for all numbers except those where the most significand digit lost in the rounding process is 5 and all the rest (if any) of the lost digits are 0's (f.ex. when rounding 4.5 or 4.50000 to the nearest whole number). These are not trivial as rounding up and down changes n by the same amount. In other words: Two numbers of precision pr are equally close to n.

    The easy solution is then to just choose to always round up or down, and stick to that. It's an optimal solution when it comes to minimizing the difference between n and r, since there was no better solution than the one we chose (only one that was just as good). But does the solution have a tendency to either increase or decrease the value of n?

    Look at all numbers of precision pn between two adjacent numbers, r1 and r2 of precision pr, adjacent meaning that there is no number rn of precision pr such that r1 < rn < r2. For every number n1 that is rounded towards r1 by an amount m there exists a number n2 that is rounded to r2 by the same amount, except where m = ((r1 - r2) / 2), which is excactly the non-trivial numbers discussed above. That means that in order for our rounding to be symmetrical, the rounding of the non-trivial numbers has to be symmetrical. And it is not symmetrical when we have chosen to always round up or down. And that is why other methods of rounding has been introduced - round to even being the most widely known.

    I hope this can put an end to all the "count-the-roundings"-posts... I would have expected stuff like that from no-brainer journalists reporting on stuff they don't understand - but from inside the slashdot-crowd? never! Its devastating for our reputation for being brainy...

    - Skov

  369. 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!

  370. Ancient FORTRAN bug by Gznork · · Score: 1

    While working on a remote weather station for NOAA, we found that the Interdata FORTRAN compiler we were writing the controller software with did an interesting thing at runtime. If you declared a 4-byte integer, it would reserve two bytes at compile time, then use the following two bytes (to get the full four) for the rest of it at runtime. The solution was padding the declaration with a wasted variable that got sacrificed to the bug gos when you ran the program.

  371. RTFM by Anonymous Coward · · Score: 0

    As always the biggest bugs are introduced when the programmer cannot even read the documentation provided to understand how and why a function operates. Round() in VBScript and VBA both perform banker's rounding where if the number falls halfway between, it is rounded to the nearest even value. If that involves rounding down, so be it. This behavior is clearly documented.

  372. link order by Mr+Z · · Score: 1

    Link order may depend on the alphabetical ordering of files, so you may end up with some initialization-time weirdnesses. I seem to recall the way the Linux kernel walks through driver initializers is link-order dependent, so your driver might be dependent on some other driver whose name comes after kybd but before pskybd.

    Having the binary files differ means nothing -- some of the metadata in the object file will include the source filename, and the two source files names differ. Also, if any macros you used have a reference to __FILE__, you could get some differences there too.

    --Joe
    1. Re:link order by naasking · · Score: 1

      Link order may depend on the alphabetical ordering of files, so you may end up with some initialization-time weirdnesses. I seem to recall the way the Linux kernel walks through driver initializers is link-order dependent, so your driver might be dependent on some other driver whose name comes after kybd but before pskybd.

      Negative. It was a microkernel, so there are no internal drivers to speak of. kybd.c was a stand-alone executable application, so it did not link against anything, so link order should not matter at all. Good idea though, I may look into it some more if I have time.

      Having the binary files differ means nothing -- some of the metadata in the object file will include the source filename, and the two source files names differ. Also, if any macros you used have a reference to __FILE__, you could get some differences there too

      IIRC, I stripped the files of all symbols and they were still different.

    2. Re:link order by Mr+Z · · Score: 1

      You might try generating assembler dumps from the compiler. (With GCC, use -S to specify assembly output rather than object code output.) Then you can do a textual diff to see where the differences are.

      Another possibility (grasping at straws here) is that the various symbols in the file were inserted into the memory map in symbol table order, and the symbol table's structure may be slightly different if the file's name changes. For instance, the symbol table is some self-balancing structure like an AVL tree, but the dump order is by level or pre-order, or something, and so the insertion order and exact list of symbols can make a difference in the ordering, even if some symbols don't generate entries in BSS or on the stack.

      --Joe
  373. Ick, no. by Mr+Z · · Score: 1

    Really, for repeatability, you want something that's static with respect to the number. That is, I can always look at the number and tell you how it will be rounded, with no external memory biasing the decision. Otherwise, it becomes impossible to programmatically compensate for the bias in the places where it matters.

    --Joe
  374. C-style string in JDBC by Anonymous Coward · · Score: 0

    This one took me a long time to solve. When you do a myResultSet.getString(n) using Oracle's JDBC driver (from 8.1.6 at least), you get back a null-terminated string. You'll never know if you just print it, but if you look at each character, you'll find a null byte at the end. It seems this usually doesn't matter, but I discovered it when I was trying to do this:

    String className = rs.getString(1);
    Class c = Class.forName(className);

    Java just wouldn't find that class definition! It took me a whole day to figure this one out.

  375. Ah...sleep() and Changing constants by Anonymous Coward · · Score: 0

    My two favourites (the first from personal experience):

    1. Back in 1992, Motorola's System V Unix sleep() function used a longjmp() within the alarm signal handler to jump back to the pre-alarm setup state in the original function call. Took us several weeks to figure out why our own signal handling routines were abitrariliy getting wiped off the stack (disappearing in mid-function call). Not only that, but it took more than just a few phone calls to get Motorola to _believe_ that the problem was at their end. Even the final engineer
    who admitted the problem would only believe it after we read out the disassembled code that proved it :)

    2. Fortran compilers on (I believe) the old IBM VM systems had a wonderful handling of constants. If you passed a constant by reference, and then CHANGED it, any constant in the entire program that happened to be the same value during compile time miraculously changed its value.

  376. C switch statement by Lips · · Score: 1

    This code (or code to this effect you pedants) compiles cleanly:

    switch (c) {
    case 'a':
    break;

    case 'b':
    break;

    defualt:
    /* do something */
    }

    But unfortunately will never get to the default case. It seems funny now, but as a young brand new C programmer, I just couldn't work it out or even read it seems. hehe

  377. double click on title bar makes window fly by drew · · Score: 1

    at least that was the bug description in our company bug tracking system (a whiteboard mounted on the wall accross from my desk)

    we were writing an mdi aplication in javascript (complete with draggable/resizeable windows) and double-clicking on a window title bar would snap the top left corner of the window to the mouse cursor position, thus causing the window to "fly" accross the screen.

    it wasn't until my next job some six months later that i finally figured out that the second onMouseDown event started processing before the first onMouseUp event finished, and i was clobbering the values for the position of the window at the beginning of the drag before i was doing final positioning of the window.

    we had another one at the top of the list for some time saying that our product "needs more user friends" - our ceo's horrible typo of an attempt to tell us that the product needed to be made more user-friendly.

    another baffler that i encountered is the fact that select widgets totally ignore the z-index property in all version of internet explorer. they are always on top, period. it turns out this isn't actually a bug- it's a well(?)-documented feature. not that this feature makes any sense whatsoever. this of course makes implementing an mdi application that uses pulldowns in the windows a bit difficult, to say the least, because the pulldowns from lower windows will "bleed-through" and obscure the contents of the focused window, unless you do some fancy tricks.

    --
    If I don't put anything here, will anyone recognize me anymore?
  378. 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.)

  379. Odd calculator by pablob · · Score: 1

    This is not exactly a software bug, but I thought it quite funny when I found it.
    A long time ago, I don't remember why, I wanted to find 2^32 in my Casio FX3800p calculator. You can imagine my surprise when the display shows "4294967295"!! It's the only calculator I know that does not worry about a power of two being odd... Odd, isn't it? ;-)

    Pablo B.

  380. Basic Apple IIe by Anonymous Coward · · Score: 0

    I recall basic not allowing a " after a = without whitespace.

  381. Test by zulux · · Score: 1, Offtopic

    to see if counter jumped over 1000, this will be interestins. Writing crap to see dkhfsa;jlks
    fdsfdsjaf
    dsafjds
    fds
    af
    dsf
    ds
    f
    dsaf
    s

    --

    Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.

  382. 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.
    1. Re:Java BigInteger.isProbablePrime(int) ! by arnwald · · Score: 1

      For your graphics reading problem :

      http://developer.berlios.de/snippet/detail.php?t yp e=snippet&id=8

      It is a snippet from Tyrant II which is hosted on this site.

      T.

      --
      My other sig is Funny.
  383. 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.

  384. Favorite NT bug... by Xaroth · · Score: 1

    I once recieved an error message that read: "Unable to delete files due to lack of disk space. Try deleting unneeded files to free up more space."

  385. Someboy moved the goalposts! by mrlsd · · Score: 1

    I've been programming for twenty-six years (I really must go home one day) and the worst bug I've seen was when the previous programmer had changed stdio.h.

  386. SNOBOL 4 by rowlingj · · Score: 1

    There used to be a bug in SNOBOL 4 (1979) that caused a stack fault if you called the divide routine.

    The SNOBOL 4 compiler was written in FORTRAN 77 so I guess no-one really wanted to look at it.

    A shame really, it was a neat language for its time. But these days you can do a lot better in PERL.

  387. Errors within errors. by HippieChick · · Score: 1

    Once upon a time there was a database programming language called Dataflex, which only three people on the planet have ever used. The Dataflex compiler worked wonderfully well until one day, for no identifiable reason, the error messages given at compile-time underwent a mysterious transformation. Certain characters in the alphabet became swapped with other letters. For example, all S's became C's, and all U's became E's. So an error that contained the word "SHOULD" would instead contain the word "CHOELD". The bug, or whatever, didn't seem to affect anything else, so we lived with it for awhile and took no further note of it until one day we filled up the hard drive and it tried to display the message "ERROR: DISK FULL". Go ahead, do the math. I'll wait.

    No, I'm not kidding. It really said that.

    --
    HC
  388. Waste of joules... by bryans · · Score: 0

    All this drama about rounding numbers????From so many people. What an unproductive way to use humanity's resources. Go do something useful for a change...

  389. The Borland Pascal CRT by Anonymous Coward · · Score: 1, Interesting

    Awhile back, there was a bug in the way the CRT initalized some timer increment in Borland Pascal. It tried to calculate how many clock tics it took to complete a loop, then used that as the divisor in another calculation. But any computer that ran over ~200Mhz could complete the loop in under a tic, so a /0 error would pop up. It was kind of frustrating to have a program work perfectly while my laptop was unplugged, but get an error *before* the first instruction while it was plugged in.

  390. Long ago, I found out that rand() was not random by frascone · · Score: 1


    In a statistics class in college, we were instructed to run a formula on 100 numbers picked from a telephone book (pretty random) The end result of the equation was supposed to be e (2.71.. yatta yatta)

    Anyway, being the computer geek I was, I instead grabed a few thousand numbers from rand(). They were so statistically NOT random, that my equation returned something closer to 2.9. I had to re-do the exercize by hand to figure out what the answer was supposed to be!

    So, I stand firmly in the "random sucks" camp :)

  391. Beware of Lunch! by Format_C · · Score: 1

    Back in the days of punched paper tape, I spent a day on a program that always fell over in the same way. I worked out where the problem was, put the printout of code looked perfect.
    In desperation, I looked at the tape (reading the holes was always a challenge) and found a smear of butter in the appropriate place. The TTY used mechanical fingers to detect holes, but the computer used an optical sensor which looked through the butter and saw holes that weren't there.
    Of course we weren't supposed to eat in the computer room, but ...

  392. 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."
  393. a slashdot bug by alonsoac · · Score: 1

    When you set you comment threshhold by default to 3 for example then in the Threshold pulldown list you cannot see how may comments there are for lower thresholds, below the one you set the same number appers. So there is no way to know how many comments are at -1. But then why does it correctly show how many comments are at 4 or 5? This is old and wierd too.

  394. VB by Caez · · Score: 0

    Why the hell are you using VB?

    --
    http://www.mistersampo.com
  395. Error messages by Tablizer · · Score: 2


    "Not enough memory to display error me"

  396. /. 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"
  397. XOR MSVS6 by vectra14 · · Score: 1

    the ^= operator didnt work correctly in msvs6 for ints... i tended to use the x^=y^=x^=y; trick alot to swap x and y and was really annoyed when it did weird stuff

    i think this was inbetween two patches. it was there and then it went away after an update and i havent heard from it since (thankfully) :)

  398. 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
  399. Various Bugs by Anonymous Coward · · Score: 0

    This weird behavior ocurrs in VB 6, VBA. I don't know if it was fixed in VBNet.

    on error resume next
    if (3/0)= 2 then
    debug.print "Why does this actually execute?"
    endif

    The worst bugs I've ever seen Atari ST Basic. Certain floating operarions gave wrong resuls, some others bombed ST. It was from the same guys that made tha infamous AmigaDOS.

  400. Netscape "Layer" bug by Anonymous Coward · · Score: 0

    The night before I delivered a web site (a BIG one with a lot of layers), I noticed that some versions of Netscape place all my layers in the upper left corner of the screen...

    Advice: *never* start the name of your layers with an underscore or you won't sleep... argh !!!!!

  401. 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
  402. 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.
  403. Not strictly a bug by DrSpirograph · · Score: 1

    but this used to crack me up when I had to use VB in MS Access.
    The help was broken, so if you hit F1, a dialog popped up saying "Cannot open Help".
    The dialog had two buttons "OK" and "Help"!

  404. Neato Python nuance... by NNland · · Score: 1

    When using classes and default arguments with dictionaries via:
    def __init__(self, arg1 = {}):

    if you assign that arg1 to a class variable, any modification of that class variable will show up in all instances of the class.

    Thusly, if you have this in the body of the aforementioned __init__ definition:
    self.arg1 = arg1

    and you evaluate the following:
    k = someclass()
    l = someclass()
    k.arg1[5] = 5

    the below will return 5.
    l.arg1[5]

    I only found that earlier today, though it makes sense considering the documentation about using default arguments as state variables in the documentation. Quite fun anyhow, be careful!

  405. smoke and mirrors by sixSecondsOfDefeat · · Score: 1

    that is most likely due to an error-checking routine that checks specifically for 2 sequential complementing operations of the same number to bring you back to your original number. the computer still has no concept of the real solution to that problem as humans do, it just has a special instance error-checking for that type of problem.

  406. It's a cold day in hell by russh347 · · Score: 1

    Many years ago I worked on a mission critical aircraft survivability system for combat aircraft. Before fielding the system we had to pass environmental testing, including running the system at -55C. At -55C the system would occassionally go deaf, dumb, and blind. The environmental chamber we had wasnt particularly large, not that I really wanted to climb inside for a debugging session. We ended up making extra long cables for our logic analyzer and soldering test leads to various points on the board. Needless to say things went very slowly. Every time we wanted to instrument a different test point, we had to warm up the chamber, change the test leads around and then wait for the chamber to cool off again. Eventually (after 6 weeks) we discovered that at low tempuratures the power line monitor circuit was passing glitches on it's own power supply line right through to the main CPU. The glitches weren't long enough to reset the CPU. However, at -55C the CPU would happily pass the glitches along and reset all the peripherals. We ended up scrapping a few thousand boards that had already been fabricated. The fancy power line monitor circuit got replaced with a pair of transistors and a few resistors.

  407. 1802 had no relative branches by Anonymous Coward · · Score: 0

    3x and cx opcodes were absolute jumps, 3x took the following byte and replaced the program counter lo with it (30 88 would jump to 0x88 on the same page of memory), cx jumps took the two following bytes and replaced the pc hi and lo with them (c0 3f c4 would jump to 0x3fc4). all the other 3x and cx test and branch opcodes worked the same if the test was true. if a short jump was at 0x00ff and the jump-to address was at 0x0100 you'd jump to somewhere in the 0x01 page, not back to the 0x00 page because the program counter had already incremented to the next page to read the destination byte, but you just used a long jump if they were straddling a page boundary and had to go back to the previous page. i think there was even a warning about that in the databook. not a bug, just a fact of life with the 1802.

    damn, i miss that chip. if only rca (or someone else) had made it in hcmos. hell, i'd use it today if it was available in a super-fast version, it was a hell of a little controller. i wrote some good code on the 1802.

  408. Minesweeper by vectra14 · · Score: 1

    you know that silly game you waste 90% of your cubicle life playing?

    1. start a game (that is, start the timer)
    2. win-d (minimize all)
    3. unminimize - voila! the timer stops! but you can keep playing :)

    (doesnt work if window has been minimized beforehand)

  409. Bugs caused by development environment... by Flu · · Score: 1
    While I was learning C (several years ago), I had some great problems with gcc; I tried to bit-mask an ulong, but the result sometimes was quite unexpected.

    On a non-gcc compiler, the result was correct. On gcc running on a motorola 68020 system, the result was correct, too, but the same gcc version on a sun sparc system returned random data in the two upper-most bits....

    As a side-note, compiler bugs still cause me problems; The Keil C167 compiler I use at work doesn't support the %-operator between two ulongs. No compiler error, but random result when the code is executed! The debugger for that compiler isn't exactly bug-free, either: Watches set on variables pointed out by pointers does most oftenly display data located at a random location, rather than the location pointed out by the pointer!

    :-)

    /Fredrik Lundström
    Software Designer

  410. Atari 400 killed Pythagoras' Theorem by Jill+Bates · · Score: 0

    Yet another precision problem from the old days, shaken the very foundatation of my math teacher, he can't figure out what's wrong and he refused to accept what he's seen.

    First part was the actual session, second part was my debug session

    ------

    LIST
    10 INPUT "1st side", A
    20 INPUT "2nd side", B
    30 INPUT "3rd side", C
    40 E = SQRT(A*A + B*B)
    50 PRINT "This is ";
    60 IF E C THEN PRINT "not";
    70 PRINT " a right angled triangle"
    80 END
    OK

    RUN
    1st side
    3
    2nd side
    4
    3rd side
    5
    This is not a right angled triangle.
    OK

    -------

    PRINT SQRT(25)
    5
    OK

    PRINT (SQRT(25) - 5) * 10000
    0.00001
    OK

    Damn!
    SYNTAX ERROR

  411. 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.

  412. kermit by Anonymous Coward · · Score: 0

    I had a very annoying problem with a kermit script long ago that was fixed by putting a space anywhere in the top half of the file.

    never did understand that one

  413. My favourites are: by Anonymous Coward · · Score: 0

    My favourite bug ever was both created and fixed by myself. I thought myself to be a hell of a C programmer, so I set off to make a character recognition program. The main function was severely damaged when I started use a local variable both as input and output argument. Therefore when the stack hadnt been touched, you got the right result and garbage otherwise. The funniest part is that I rewrote the rutine in such a way that when a failure was detected, the process will start all over, until it got it right. I even optimized this failure-detection code!.

    In other word I jumped over my own bug instead of fixing it. Bad code doing his work!

    Best regards

    Vicente

  414. My Fav Bug by Anonymous Coward · · Score: 0

    My favorite Bug? I was trying to hack a Macintosh game by combining code ressources from a real game (which needed a serial number) and a demo. My first (and last) attempt to crack something, mind you..

    Well, the first time I started the new program, my Mac froze. And couldn't start again ("no system folder found"-icon). When I started using the CD-ROM, my harddisk didn't appear on the desktop. And "Norton Utilities" said "I can't repair your harddisk because there is no harddisk there".

    "Shit", I thought, "they have some really bad anti-cracking measures in this game which now killed all my data, my harddisk, and changed the harddisk firmware so that it didn't respond again". Well, I was very wrong...

    I turned out that in the exact same moment my computer crashed, the connector to my harddisk became so loose that there was no connection anymore. After realizing this, I just needed to plug the hd-cable back in, so everything was fine again.

  415. Re: InputStream from JarFile (was: Java BigInteger by dth · · Score: 1
    this
    JarFile jf = new JarFile("foo.jar");
    JarEntry je = new JarEntry(jf.getJarEntry("image.gif"));
    InputStrea m is = new InputStream(jf.getInputStream(je));
    will do what you ask.
  416. 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

  417. Linux C library bugs? by Raato · · Score: 1

    I'm not sure if this is compiler (m68k-elf-gcc 2.95.3) or C-library (uC-libC) problem but
    sprintf(buf, "%s %i", "n: ", n), where n might get negative _sometimes_ produces only "-" sign without the actual value. So now I'm trying to go around it with something like this:

    sprintf(buf, "%s%c%i", "n:", (i > 0 ? ' ':'-'), (i > 0 ? i : -i));

    Other scanf related bug in x86 Linux (gcc 2.95.3, glibc-2.2.4):

    struct mPos{
    long long int tt, id;
    double lat, lon;
    int bm, alt;
    };

    void handleMsg(const char *buf)
    {
    struct mPos p;
    sscanf(buf, "FOO: %lli %i %lf %lf %lli %i", &p.id, &p.bm, &p.lat, &p.lon, &p.tt, &p.alt);
    submitData(p);
    }

    when done _first_ time I get NAN to the lon... so no I have to do that sscanf twice in the function when it's entered first time (had to include static boolean first_time in the function to accomplish that).

    Why on earth printf and scanf are so hairy? I could avoid them but why? They are standard ANSI-C functionS so they really should behave correctly!

    --
    Microsoft? Is that some kind of a toilet paper?
  418. RTTI under VisualC 6 by Anonymous Coward · · Score: 0

    During my PhD, I implemented a compiler for a non-standard language. I have been forced to do it using the non-integrated "environment" gcc/xemacs by a VisualC6 bug: The code got compiled, but the code generated for the RTTI was false. ;) sniff

  419. ASP using the Interdev by Anonymous Coward · · Score: 0

    Writing ASP code (VB script) in M$ Interdev does not auto space every line you type in as it does when using the visual studio IDE and VB.
    Which means that you get VERY odd errors when trying to concatinate strings and you leave no spaces between the ampasand and the strings you are joining.
    I removed 200 lines one line at a time trying to find what was giving me errors and it was one damm space !!

    for everything else there is we.ownz.u.mastercard.com

  420. Turbo C 3.0 versus Borland C 3.0 bugs by Anonymous Coward · · Score: 0
    I once had a strange bug with the peekb (or was it peekw) function in C 3.0. Whenever I wanted to read out a memory address in a lower segment than where my program resided in memory the Turbo C version was off by 2 segments, whereas its heavyweight brother worked correct. Handy if you want to check 0040:0013 to see if the top of memory has changed (boot sector virus check). TC3 looked at 003E:0013 :-( Took me two months to reverse engineer and spot the differences....

    Come to think of it, Turbo Assembler incorrectly compiled the cmp cx,0001 function to some signed check (cmp cx,+1), which is also undesirable for reading a harddisk using int 13h and you need to check if the master boot record is read. Like this:
    is_hd: cmp cx,1000
    org $-2 ; very filthy thing to get rid of a turbo
    dw 1 ; assembler problem (check if abs sector 1)
    je is_mbr ; Yes, it is the MBR they try to access
    Sometimes programming is a hell, as if introducing bugs in your code is not bad enough already the developers of compilers give you this as an 'extra feature'.
  421. Re: i know it by fferreres · · Score: 2
    --
    unfinished: (adj.)
  422. Re: i know it by Anonymous Coward · · Score: 0

    he got score 2 for not saying anything? crazy...

  423. PC Hardware Bug by Anonymous Coward · · Score: 0

    The Parallel port on the IBM PC used to (presumably still does) generate an interrupt by bringing the interrupt line up for a short period and then back down.
    The UART expected the interrupt line to remain high until the interrupt was cleared by the Interrupt Service Routine.
    If you were printing under interrupt, you sent out a character, and once the parallel port had finised with it, you got an interrupt to tell you you could send another. If the machine was dealing with another interrupt, you often "missed" the printer's charachter sent interrupt.
    In order to restart printing you had to have a timer interrupt running which checked how long it was since you last sent a character to the printer and if necessary to kick off the next one.

  424. Sinclair(tm) Spectrum(tm) basic bug by Anonymous Coward · · Score: 0

    There was a bug in the Sinclair(tm) Spectrum(tm) ROM, which meant that you couldn't backspace from line 1 to line 0, and if you backspaced from line 0, memory corruption occurred.

  425. My favourite error message by Hasie · · Score: 1

    I have a piece of paper in my office that I inherited from someone who left a while back. It is a genuine Windows NT error message that he encountered trying to do something:

    Windows NT encountered the following error:

    The operation completed successfully

  426. damn this.... by Anonymous Coward · · Score: 0

    C:\> gcc winnuke.c
    Bad command or file name.
    C:\> gcc winnuke
    Bad command or file name.
    C:\> gcc apache-scalp.c
    Bad command or file name.

  427. My pet bug. by pmsyyz · · Score: 1

    No CSS2 attribute selectors in MSIE.

    input[type=submit], input[type=button] { }

    I only use Mozilla, but I know most people use MSIE.

    --
    Phillip
  428. Very weird FP bug by Birdie-PL · · Score: 1

    Back in the old days, I came over quite a weird bug in BASIC's floating point code on 8-bit Atari (XE series, at least).
    1^43 was 1 (^ being 'power' operator)
    1^44 was 2
    Now, some time after doing numerical analysis on university I still fail to see a possible reason for this. It really does not make any sense.

    --
    e-mail: karol at tls-technologies.com
    www: http://www.tls-technologies.com
    sig: not found
  429. TRUE TRUE by sn_moore · · Score: 1

    I've hit something like this one occasionally using VB5....

    lbWhatever = TRUE
    .....
    if lbWhatever then
    debug.print "True"
    else
    debug.print "False"
    end if

    and on a number of occasions I've gotten back "False"!!!!! Seem Microsofts trying to redefine TRUE & FALSE....

    sm.......

  430. Javascript in IE4 by Arjuna · · Score: 1

    I can't remember the version, but this was back in 1997-8. I read about Javascript and was thinking, OK I should give this a try, fired up Jscript in IE4 (can't remember the precise version now) and tried doing some simple arithmetic.
    5+5 gave 1, 2, 254, -5 but never ever gave me 10.
    The same code worked flawlessly in Netscape. That turned me off Javascript until, well, forever.

  431. Hair pulling pulling out date bug ... by mclemenc · · Score: 1

    Way back when I was working on a simple database
    on the Commodore Pet (how long ago ? ...) when I noticed that a lot of people in the database had birthdays on 29th of february - don't even ask how I spotted this.

    After many weeks of stuggling it turned out that the database held dates internally as julian day counts and converted them to day/month/year for
    display. However, if the year was a leapyear then every access to that persons record actually subtracted 1 day from the record until, yes you guessed it, it hit Feb 29th at which point it stopped. Thank goodness we had the source code but nonetheless, all the dates in leap years were corrupted.

  432. Qbasic by Anonymous Coward · · Score: 0

    In qb... Log(128)/Log(2) = 6, where it should = 7. That's what you get for using QB I guess.

    Andrew.

  433. Division by zero in Java by Hector73 · · Score: 1

    0/0 = DivideByZeroException
    0.0/0.0 = +NaN = Infinity.

    Why, Sun, why?

    1. Re:Division by zero in Java by Anonymous Coward · · Score: 0

      That's actually pretty common. Often it's more dependant on the CPU than the language.

      Anyway you may want to be using the "assert" keyword before this condition arises along with some fail code or just some test cases, etc.

  434. my favorite bug by Anonymous Coward · · Score: 0

    OK how many of you can remember the Merlin Pro Compiler for the Apple II? I spent DAYS trying to figure out why a rather large assembly program was spontaneously exploding after I made a few innocent changes.

    The compiler allowed you to define labels, to be used as addresses. These could be defined anywhere, including after where you accessed them because the compiler was two-pass. Great idea, but it had a very obtuse bug. On the first pass, the compiler counted bytes and calculated labels, which include labels such as those defined manually, as well as jump point labels.

    Problem was, if you defined a label as a one byte value, (0-255) the compiler still counted it as a two byte value when considering memory loads/stores using the label as an address. On the 2nd pass, it would hapily optimize these accessing opcodes to zero-page address mode, save a byte, and cause every jump label after that to be one byte off. This made branches and jumps land at the wrong points, the program then going wild executing data, and usually would end up slamming into a BRK somewhere up in ROM.

    I sent them a letter informing them of the bug, but it was already becoming the time of the Macintosh and the PC, and they had no plans to release a new version of the compiler. Owell.

  435. netscape 4 and layers by mydigitalself · · Score: 1

    i spent DAYS trying to figure out why netscape wouldn't implement some style-like features on particular named DIV elements.

    i had named all my layers menu_first menu_second etc...

    i was so desparate for a solution at the end i thought, oh, what if i take out the underscores in the layer names. AND IT WORKED!!!!

  436. MSVC 1.52 Backwards Bug by jolshefsky · · Score: 1

    Among other people, I found a bug in the editor in Microsoft Visual C 1.52. Given 2 files, A and B where A is read-only and B is not, open them both in the editor. Make sure B is the foreground window. Switch to another application, modify A and set it back to read-only. Switch back to MSVC. You'll get a dialog that "A is modified, would you like to reload it?" Confirm the reload. Type some text in B. The characters are inserted but the insertion point doesn't move, so the text appears backwards.

    --
    --- Jason Olshefsky

    Karma: Poser (mostly affected by adding this line long after everyone else did)

  437. Not Beta Tests, It's... by kcb93x · · Score: 1

    ....The newest version of Windows!

    --
    There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
  438. HUGE Bug! (kind of) by D4rkm1lk · · Score: 1

    I didn't actually see this one personally (I'm not that old!) but apparently IBM once issued a program for their mainframes which must be the shortest program ever with a bug - a program with a single instruction!

    It was IEFBR14, a standard utility program to branch on register 14; i.e. return immediately. Sounds trivial, but is actually quite useful in the weird and wonderful world of JES and JCL.

    The fix for this program sounds huge though: it had to double in size to fix the bug!

    For those who have not spotted it yet, the problem was that simply returning immediately does not clear register 15, the return code - hence if another program left register 15 nonzero, IEFBR14 would appear to fail!

  439. tangent bug in MS Developer Studio C++ compiler by bjt062659 · · Score: 1

    Years ago, I was using Developer Studio's (version 1.0) C++ compiler to make an app that did a lot of trignometric computations. I found that, the longer the program ran, the numbers produced were increasingly far from correct. It took me a long time to figure out that there was a bug in the tangent function. If the argument was a small negative number the sign of the result would be flipped. [tangent is an odd function, so a sign flip was a big deal.] I had to do a work-around of creating a new tangent function, that called sine divided by cosine. After many emails with MS programmers, they finally fixed the bug, but not until the next version of Developer Studio. I had to provide them with a four line program that demonstrated the bug before they would belive me.

    Bill

  440. Disappointed by tenter · · Score: 1

    Thought I'd hear better ones than most listed here. For example:

    1. A failure that happened every day at a gradually changing time. Cause: heat from sunlight on a system. The failure happened after the sun came through a window at the correct angle. The time was changing as the sun moved with the season.

    2. A falure that happened once a year at the same time: 10/10, at 10:10AM. The time was represented in BCD, and using IBM Bisync protocol, the bytes were escaped. That many 10s caused a buffer overflow.

  441. Bug in Girlfriend.lib 1.0 by Twitch42 · · Score: 1

    Try executing Girlfiend.GetBeer() and see what happens. I usually get output similar to "#%$&*!". Setting either Girlfriend.submissive or even the undocumented Girlfriend.wench to "true" has no effect. Be careful with debugging; repeated attempts in too short a period of time have resulted in actual hardware damage to the submitting hardware.

  442. Bad magic number by oopsatwork · · Score: 1

    any of you java cats had a run in with the "Bad magic number"? try editing the first character in a .class file...this is a way to force it to happen...but if you've ever used JRun, you've almore certainly had the evil first encounter...

    -oOpS

  443. 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.
  444. Visual C++ Linker Limit by Anonymous Coward · · Score: 0

    A few years back I was working on a program to convert some proprietary binary data to XML format. The scheme involved using macros to create thousands of small structures that held the appropriate conversion information, for each type of data. I was expanding the number of structures, and passed 32767 total. I got a linker error saying that it couldn't find item number -32768 --and the error message displayed
    the 32-bit form of that number! So somewhere in
    the compiler or linker was still a 16-bit counter that was sign-extended to 32 bits, instead of being a true 32-bit counter.
    I told Microsoft about it, but dunno if they fixed it.

  445. Uh, isn't that the correct behaviour? by Blake · · Score: 1
    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').

    I'll be the first person to admit that I don't know VB/VBScript, but I seem to remember from my high school math class that a number which is equidistant from two other numbers should always round to the even one. So 2.5 rounds to 2, and 3.5 rounds to 4. Extending this analogy, shouldn't 82.845 round to 82.84, just like it is?

    Later,
    Blake.
  446. Re:DOS-box backspace of death by Jhan · · Score: 1

    The program may be boxed, but the box has an exploit... In Unix terms: Apparently, it's about the csrss.exe process which I gather is the DOS box. The backspace characters reset the 'cursor' to before the beginning of the text buffer, and the subsequent space causes a segv, crashing csrss. Unfortunately, csrss is considered a system vital process, so NT has a kernel panic over this.

    The bug is even easier to cause by having a sequence of tabs before the backspaces. Each tab counts as one character in the buffer, but when removing them the pointer goes back 8 positions... You should be able to cause this bug by simply using 'type' on a text file with a bunch of tabs, followed by the same amounts of backspaces, followed by a space. You have to have enough tabs to backspace past all previous output in the dos window (that's what your second program does, except it doesn't use the tab shortcut and so has to loop many times more. Change that string to "\t\b ").

    This bug was first reported a couple of years ago. It affects every version of NT ever. Since NT4 won't get any more service packs it's permanently flawed. The bug pops up in many unexpected places. For instance you can make IIS crash the server by doing something like this.

    Hmm... This machine is w2k. I'll post, then make a little experiment... I'll report back.

    --

    I choose to remain celibate, like my father and his father before him.

  447. null 0 is null by Anonymous Coward · · Score: 0

    not false in VB

  448. Re: i know it by Anonymous Coward · · Score: 0

    but at least he didn't say anything stupid.

  449. Re: i know it by Anonymous Coward · · Score: 0

    Talking is silver &mdash Silence is gold...

  450. Re: i know it by Anonymous Coward · · Score: 0

    No, I think he said "cogito ergo sum" and disapeared.

  451. I've got something interesting to say by Anonymous Coward · · Score: 0

    1. Re:I've got something interesting to say by Anonymous Coward · · Score: 0

      That's so insightful!
      Please mod parent up!

  452. /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/

  453. ( ! false ) != ( true ) by bethorphil · · Score: 1

    I had a program once which flipped the value of a boolean every time the inner loop executed. You would think that "x = !x" would acheive this effect nicely, but it didn't.... x always remained true.

    Eventually, I discovered that the compiler I was using "x = x XOR 1" instead of "x = (x==0)" for it's logical NOT operation. Because I didn't initialize my boolean, there were some upper bits set in the (16-bit) boolean I was using. The "!" operator was only flipping the last bit and ingnoring all the other bits... which is why the variable never became false.

    my head was spinning for days after this one.

    --
    There are a thousand hacking at the branches of evil to one who is striking at the root.
  454. Re:number precision by User+956 · · Score: 1

    There is no "proper" way to reduce the precision of a number under all circumstances.

    You could use an original pentium chip. With the divide errors, it'd be perfect.

    --
    The theory of relativity doesn't work right in Arkansas.
  455. Buffer Overflow by some+guy+I+know · · Score: 1

    Yeah, it's common knowledge now, and I don't overflow buffers any more.
    But back around 1980, when I was just starting to use C, I checked for a buffer overflow in the length of a string, but forgot about the terminating null character.
    The definition just after the buffer definition was for the file descriptor of the output file.
    I couldn't figure out why, sometimes, output would suddenly start appearing on the console, until I realized that the null was overwriting the value of the file descriptor with 0, which is standard input, and when standard input is the console, you can write to it (at least on the version of UNIX that I was using then).

    --
    Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
  456. What is 2+2? by I+am+Jack's+username · · Score: 1

    Sometimes my programs display rounded numbers, but I still use the actual values to do calculations:

    If the displayed 2s were both 1.5 (both the banker (commercial) and engineering (scientific) rounding methods shows 1.5 as 2), then the result should add the original 1.5s and get 3. If the original 2s were both 2.5 (and the display rounded them using the banker (commercial) rounding method, showing 2.5 as 2), then the result should add the original 2.5s and get 5.