Slashdot Mirror


Chess.com Has Stopped Working On 32bit iPads After the Site Hit 2^31 Game Sessions (chess.com)

Apple's decision to go all in on 64bit-capable devices, OS and apps has caused some trouble for Chess.com, a popular online website where people go to play chess. Users with a 32bit iPad are unable to play games on the website, according to numerous complaints posted over the weekend and on Monday. Erik, the CEO of Chess.com said in a statement, "Thanks for noticing. Obviously this is embarrassing and I'm sorry about it. As a non-developer I can't really explain how or why this happened, but I can say that we do our best and are sorry when that falls short." Hours later, he had an explanation: The reason that some iOS devices are unable to connect to live chess games is because of a limit in 32bit devices which cannot handle gameIDs above 2,147,483,647. So, literally, once we hit more than 2 billion games, older iOS devices fail to interpret that number! This was obviously an unforeseen bug that was nearly impossible to anticipate and we apologize for the frustration. We are currently working on a fix and should have it resolved within 48 hours.

271 comments

  1. nearly impossible to anticipate? by Eunuchswear · · Score: 5, Insightful

    This was obviously an unforeseen bug that was nearly impossible to anticipate

    Only if you're an idiot.

    --
    Watch this Heartland Institute video
    1. Re:nearly impossible to anticipate? by xxxJonBoyxxx · · Score: 5, Insightful

      The website has a "CEO", so yes, I can confirm.

    2. Re:nearly impossible to anticipate? by Dunbal · · Score: 1

      WORD should be enough for anybody! Pah, who needs DWORD...

      --
      Seven puppies were harmed during the making of this post.
    3. Re:nearly impossible to anticipate? by Nutria · · Score: 1

      LOL

      --
      "I don't know, therefore Aliens" Wafflebox1
    4. Re:nearly impossible to anticipate? by KiloByte · · Score: 1

      WORD should be enough for anybody! Pah, who needs DWORD...

      32-bit iStuff need dwords, apparently -- a 31 bit word (pointlessly signed) just overflowed.

      Unless you mean the Microsoftish way where a "word" is only 1/4 of the actual machine word, that is.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    5. Re:nearly impossible to anticipate? by pz · · Score: 5, Insightful

      Two BILLION chess games?

      I'd have not anticipated that a chess site would become that popular. Yes, it's easy to say that it's an obvious bug, but one has to select a variable size during development. Not everything can be stored in a 64 or 128-bit integer, because that would mean a lot of wasted space. So, would YOU have thought it reasonable to use an unsigned 32-bit integer for the number of chess games? I bet many developers would have.

      The real problem, though, is no one remembered about that choice once the number of chess games crossed some really obvious threshold, like 1 billion. THAT event should have triggered some developer to think, "holy cow, can we even handle that many? What's the limit? Are we in danger of a Y2K problem?"

      But chess games? Two BILLION of them? I'd have thought that would be plenty. Color me very pleasantly surprised.

      --

      Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
    6. Re:nearly impossible to anticipate? by ShanghaiBill · · Score: 1

      Also, this has nothing to do with 64 bit hardware. You can do 64 bit arithmetic on even 8 bit CPUs using sophisticated techniques such as "carry" and "borrow" that are taught in 2nd grade. If you declare a variable as "long long" or "int64_t" the compiler will handle all of that for you.

       

    7. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      > Only if you're an idiot.

      Only at the level where you can't anticipate that 1 is going to be followed by 2, which is then going to be followed by 3, then 4, and so on and so forth, and then that 2^31 - 1 is going to be followed by 2^31, which will overflow your 32-bit variable.

      Give the man a break, that's hard stuff.

    8. Re:nearly impossible to anticipate? by BronsCon · · Score: 2

      I'm sure they knew there would eventually be over 2 billion games played; they most likely thought the older 32-bit devices would have fallen out of support and no longer be in use before that happened.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    9. Re:nearly impossible to anticipate? by K.+S.+Kyosuke · · Score: 2

      Every company needs to have its Critical Error Officer.

      --
      Ezekiel 23:20
    10. Re:nearly impossible to anticipate? by NoNonAlphaCharsHere · · Score: 5, Informative

      Huh. I seem to remember a few years back when a certain "News for nerds" website went down for a couple days when the comment ID number overflowed and they had to change the data type in the database...

    11. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 1

      This was my thought too. The bug only affects 32-bit devices, which have been mostly phased out over the past decade. Which means the developers may have seen the 2 billion chess games issue coming, but figured almost everyone would be moved to a 64-bit device by the time the issue hit.

      Put another way, this is less an issue with the chess.com software and more of an issue with people running obsolete 32-bit software instead of a modern OS. It's nice the chess.com people are fixing it, but really the issue is as much with the owners of devices running 32-bit systems as with the chess software in question.

    12. Re:nearly impossible to anticipate? by pr0fessor · · Score: 1

      Araine 5 $7 billion arithmetic overflow...

    13. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      See their mistake was using a signed 32 bit variable. They could have had 4 billion games if they used an unsigned 32 bit value.

    14. Re:nearly impossible to anticipate? by AmiMoJo · · Score: 1

      2 billion database entries... How many of them qualify as "games" I don't know. Probably very many of them were abandoned, if not immediately then before reaching any kind of conclusion. Maybe some developer was generating a few hundred million for stress testing too.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    15. Re:nearly impossible to anticipate? by __aaclcg7560 · · Score: 1

      Does anyone remember when the Slashdot database had a 16-bit field that caused the website go offline for a few days until that problem got fixed?

    16. Re:nearly impossible to anticipate? by SCVonSteroids · · Score: 2

      It's actually not that much if you consider their choice of game format.
      Consider a game of Bullet Chess, where both players have 1 minute total on their blitz timer and no extra time is added on a move; for example.

      Although I agree anyone making a snarky comment that this should have been obvious is just an asshole and probably wouldn't be very fun to work with.

      --
      I tend to rant.
    17. Re:nearly impossible to anticipate? by AmiMoJo · · Score: 5, Funny

      Was it days? I remember it taking hours to fix, but my memory is barely 7 bits total these days.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    18. Re:nearly impossible to anticipate? by bluefoxlucid · · Score: 1

      I wouldn't have anticipated a Chess site as being that popular. I'd more have expected this to happen to GoKGS or something.

    19. Re:nearly impossible to anticipate? by Zontar_Thing_From_Ve · · Score: 1

      But chess games? Two BILLION of them? I'd have thought that would be plenty. Color me very pleasantly surprised.

      I am not a user of that site, so I'm just speculating here, but I wonder if the games total is so large because a significant number of them are not actually people playing but people using bots to play for analysis purposes. I used to play in official tournaments some years ago and I long ago gave up on chess once computers started getting used for analysis. If you're not a player you might be surprised how much play gets subjected to computer analysis to try to find better outcomes from losses, for example. I know it's had some impact in a few specific cases where a line of play was considered unwinnable for a long time for one color against a good opponent (I'm talking deep into a game like after 15 moves) and computer analysis found ways to revive the line for the color that previously was considered unable to win at it.

    20. Re:nearly impossible to anticipate? by alvinrod · · Score: 2

      It's probably not that surprising. The website states that it has over 15 million members so if only 1/10 are regulars and play about 10 matches per week, it would take under 6 years to exceed 2 billion games.

      According to their site, 1,958,303 matches have already been played today. I don't know what time zone they're using, but assuming that it's the end of the day for them and that today doesn't deviate from the average, then it only takes around 3 years before hitting that billion game limit.

      With the internet becoming more and more ubiquitous and millions of people now having access through their phones, you're going to get a lot of chess players even if there's only a small percentage of the population that plays.

    21. Re:nearly impossible to anticipate? by Nutria · · Score: 2

      they most likely thought the older 32-bit devices would have fallen out of support and no longer be in use before that happened.

      Famous last words since year numbers were encoded as YY to save space. "These systems will be redesigned long before the year 2000!!!!"

      --
      "I don't know, therefore Aliens" Wafflebox1
    22. Re:nearly impossible to anticipate? by NoNonAlphaCharsHere · · Score: 2

      I remember it being most of two day shifts (US timezones). They had to rebuild/migrate the whole database, and there were (PERL (full-body shudder)) slashcode changes as well.

    23. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Or that they'd be making enough money by then that the site/app would have gone through a rewrite and moved to 64bit integers, GUIDs, per-user IDs or something similar. Basically they left the scaling problems until later and never revisited the code.

    24. Re:nearly impossible to anticipate? by thegreatbob · · Score: 1

      I remember it as being when they hit 16777216 (2^24) comments... but yeah, same idea here xD
      found the story:
      https://slashdot.org/story/06/...

      --
      There is no XUL, only WebExtensions...
    25. Re:nearly impossible to anticipate? by D.McG. · · Score: 1

      There are more than 4 billion people on the planet. If everyone played just one game in that app (even just to try the app), the 31-bit value would have overflowed. So yes, I would have chosen a 64-bit number. The chess moves made, with each move time, are using substantially more space.

    26. Re:nearly impossible to anticipate? by thegreatbob · · Score: 1

      We could stave off the year 2038 problem for a few more decades with the same method, but we'd be pretending the 60s never happened.

      --
      There is no XUL, only WebExtensions...
    27. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Bignums, baby!

      No, you don't need to choose a variable size, if you use a decent language.

    28. Re:nearly impossible to anticipate? by __aaclcg7560 · · Score: 1

      I remember it as being when they hit 16777216 (2^24) comments... but yeah, same idea here xD

      That story referenced the earlier incident that I was thinking about with the 16-bit field in 2001.

      Unfortunately, like 5 years ago we changed our primary keys in the comment table to unsigned int (32 bits, or 4.1 billion) but neglected to change the index that handles parents.

    29. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      2 billion database entries... How many of them qualify as "games" I don't know.

      That was my thought. *Maybe* they actually had that many games, but my money would be on a count of moves. Each game stores all the moves, and those probably have a per-move-id as well.

    30. Re:nearly impossible to anticipate? by jareth-0205 · · Score: 1

      This was obviously an unforeseen bug that was nearly impossible to anticipate

      Only if you're an idiot.

      Good to know that my prediction for arrogant hindsight developer comment was confirmed.

    31. Re:nearly impossible to anticipate? by BronsCon · · Score: 1

      Of course, and I was actually going to cite that famous example, but that was more a case of application developers believing their software would no longer be in use, rather than believing the platforms it ran on would have been retired.

      Still a salient example of shortsightedness and selling short one's own work, though. Both of those very common activities are extreme dangers of software development.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    32. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      If you don't remember the 60s, then technically it didn't happen ;)

    33. Re:nearly impossible to anticipate? by Richard_at_work · · Score: 1

      Anyone remember when Slashdot had similar issue with its comments a few years back...?

    34. Re:nearly impossible to anticipate? by Nutria · · Score: 3, Insightful

      Both of those very common activities are extreme dangers of software development.

      Because people who have learned the lessons are continuously pushed out to make room for the latest know-it-all hotshots with their hip Comp Sci languages.

      --
      "I don't know, therefore Aliens" Wafflebox1
    35. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      I failed math in the second grade you insensitive clod.

    36. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Found the windows programmer. What the heck is "WORD"? Is it the native word size of the CPU? That's a moving target and kinda what the intrinsic types are for. Is it some made up size? Why not call it uint32_t or something that has a hint to its size in the name?

    37. Re:nearly impossible to anticipate? by michelcolman · · Score: 2, Informative

      Yeah, it's the users' fault for not buying a new iPad every 3 years.
      (The last 32 bit iPad was discontinued in October 2014)

    38. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Captain hindsight to the rescue.

    39. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      I'm not surprised... If you're into playing chess and you're serious about the game (and improving yourself) this site is hands down the best there is/ever was/ever will be.

    40. Re:nearly impossible to anticipate? by AmiMoJo · · Score: 2

      I'll take your word for it... Odd that I don't remember the withdrawal symptoms or compulsively pressing F5 every ten seconds. Maybe I've repressed it.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    41. Re:nearly impossible to anticipate? by michelcolman · · Score: 2, Funny

      And just wait until they hit 9223372036854775808 games. I bet they'll again say that it was impossible to anticipate.

    42. Re: nearly impossible to anticipate? by Eunuchswear · · Score: 1

      I built an application with a 32 bit message counter. When I noticed we were approaching 1 billion messages I reformatted the database and modified the application to use a 64 bit counter. Been there, done that.

      --
      Watch this Heartland Institute video
    43. Re:nearly impossible to anticipate? by BronsCon · · Score: 1

      That's absolutely true, and damaging to the software industry as a whole. It's something I strive to avoid in my own hiring practices.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    44. Re:nearly impossible to anticipate? by Eunuchswear · · Score: 1

      Not hindsight, foresight.

      (see reply to anonymous cow herd above).

      --
      Watch this Heartland Institute video
    45. Re:nearly impossible to anticipate? by thegreatbob · · Score: 1

      Ouch... had never heard about the previous issue (or perhaps I did, maybe 10 years ago)... makes sense now.

      --
      There is no XUL, only WebExtensions...
    46. Re:nearly impossible to anticipate? by JimFive · · Score: 1

      Except the bug has nothing to do with the fact that it's a 32 bit device. It has to do with the software being written to use a 32 bit signed integer to hold the value. It is completely possible for a 32 bit device to handle 64 bit integers.

      --
      Please stop using the word theory when you mean hypothesis.
    47. Re:nearly impossible to anticipate? by JimFive · · Score: 1

      Most of the games are blitz or lightening timed games (5 minutes or 1 minute). There's a lot of them.

      --
      Please stop using the word theory when you mean hypothesis.
    48. Re:nearly impossible to anticipate? by __aaclcg7560 · · Score: 1

      Ouch... had never heard about the previous issue (or perhaps I did, maybe 10 years ago)... makes sense now.

      Slashdot got bitten by the Y2K bug, albeit not the one that everyone expected.

    49. Re:nearly impossible to anticipate? by BronsCon · · Score: 2

      I think the AC you replied to is indicative of a major problem in the software industry. There's this drive behind the younger developers, telling them that newer always means better, and it's going to come back to bite a lot of them in the ass eventually.

      When it does, those of us who leaned more toward the "tested and stable" side will just kick back in our comfy chairs and laugh as we watch the young'ns scramble to put out the fires, just as we did when we were too dumb to prefer stability.

      ... I type ironically on my day-one Ryzen build ...

      I mean, yes, someone has to use these things, someone has to test them, someone has to prove or disprove their usefullness, reliability, and stability. That someone, however, shouldn't be using them in production until they've been proven. But I've drifted off topic...

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    50. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      As opposed to my 1980 mini-computer that assumed: This will last forever !
      lol, the calendar went from 1970 to 2030 :) We still chickened out for Y2K tho and went PC.

      To be fair the computer DID make 17 years !

    51. Re:nearly impossible to anticipate? by Dunbal · · Score: 1

      What the heck is "WORD"?

      If you have to ask then maybe you're not as smart as you think you are. Go ahead and tell us about how you don't have a TV, ride a bicycle, and don't eat red meat. That would be about as insightful and hilarious as your comment.

      --
      Seven puppies were harmed during the making of this post.
    52. Re:nearly impossible to anticipate? by jareth-0205 · · Score: 1

      Not hindsight, foresight.

      (see reply to anonymous cow herd above).

      Though this was hiding in a client app, and for older models of hardware as well. A bit more tricky to see than a database field as the developers will be of the mindset that the integer is 64bits, as it will be on the devices they develop on.

    53. Re: nearly impossible to anticipate? by Calydor · · Score: 1

      Do you remember the Holocaust?

      --
      -=This sig has nothing to do with my comment. Move along now=-
    54. Re:nearly impossible to anticipate? by war4peace · · Score: 1

      Here, I'll match a third of that: I don't have a TV.

      --
      ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
    55. Re:nearly impossible to anticipate? by Eunuchswear · · Score: 1

      A bit more tricky to see than a database field as the developers will be of the mindset that the integer is 64bits, as it will be on the devices they develop on.

      Yeah, that sounds possible. A good reason to hire older guys like me!

      --
      Watch this Heartland Institute video
    56. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Sorry, but someone programmed for 'comfort', and not reality.

      How long has that website been online? Decades?

      I can see this if they didn't say, do some sort of evaluation maybe a few years ago, for infrastructure, but this site and it's scalability, but never investigated it's code base? Not buying it...

      My guess, any of the original programmers are long gone... and this code was an oversight by current staff.

    57. Re:nearly impossible to anticipate? by Paradise+Pete · · Score: 1, Informative

      The website has a "CEO", so yes, I can confirm.

      Chess.com is a multi-million dollar business. It'd be more surprising if they didn't have a CEO.

    58. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Your comment answers exactly zero of the questions asked. I work with embedded dev environment where WORD is 16 bits in size. I'm going to guess that is what a WORD is. Unless you work on projects where WORD is XX bits. Do you see the problem now?

    59. Re:nearly impossible to anticipate? by nateman1352 · · Score: 1

      So, would YOU have thought it reasonable to use an unsigned 32-bit integer for the number of chess games? ... Two BILLION of them?

      Umm... an unsigned 32 bit integer would allow 4 BILLION (2^32 to be precise) games, not 2 BILLION. They are using a signed 32 bit integer (2^31 - 1).

    60. Re:nearly impossible to anticipate? by Paradise+Pete · · Score: 3, Interesting

      I wonder if the games total is so large because a significant number of them are not actually people playing but people using bots to play for analysis purposes.

      No, they are real games by real people. I personally have a bit over 15,000 games played. At this moment (~1PM eastern time on a Tuesday afternoon) there 28,384 players online and 10,158 games currently in progress. The very large majority of those games are 5 minutes or less. Almost all of mine are 2/1 (two minutes per side with a one second increment after each move).
      Also, it's not a bot-friendly site. There is no API, and no real point to hacking it when other sites are much more amenable to bot play. If they detect a computer-aided game (it's not difficult) the account is banned.

    61. Re: nearly impossible to anticipate? by Dunbal · · Score: 1

      Oh wait - you were SERIOUS? Yeah. Different computers use different word sizes. Guess which word size 90% of the users on 90% of machines use?

      --
      Seven puppies were harmed during the making of this post.
    62. Re:nearly impossible to anticipate? by Paradise+Pete · · Score: 1

      If you're into playing chess and you're serious about the game (and improving yourself) this site is hands down the best there is/ever was/ever will be.

      An argument can be made for chess24, though it's still young.

    63. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Yes, because you know, every website should expect to be this successful. How idiotic of them.

    64. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      That... that was literally the joke. You missed the joke, then explained the things the joke was about back to the person who told it.

    65. Re:nearly impossible to anticipate? by Rockoon · · Score: 1

      Indeed, on the older free internet chess server (fics aka freechess.org) there was a small group of us (6 or 7?) that had a combined game count exceeding 1 million games. That was back around 1990 or so.

      If it took chess.com this long to break 32-bit, then maybe instead of being seen as a success it should be seen as a failure.

      --
      "His name was James Damore."
    66. Re:nearly impossible to anticipate? by sootman · · Score: 1

      $ whois chess.com
      Domain Name: CHESS.COM
      Creation Date: 11-aug-1994

      2 billion / 20 years = 100,000,000. Given that there are ~300M people in just the US alone, if 1/3 of them played 1 game per year, you'd hit that number in a reasonable time. On the one hand, I don't think 1/3 of people play chess; on the other hand, there are several billion people living elsewhere on Earth (I'm told) and I'm sure that many of the people who would bother to sign up to play online would play more than one game per year.

      tl;dr 2 billion is not a lot if you're looking at usage by the whole planet for many years.

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    67. Re:nearly impossible to anticipate? by AK+Marc · · Score: 1

      And why does an App have a CEO that doesn't know what an app is, or how it works?

    68. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Sorry, this fails the sniff test for me.

      1e6/7 = 142857 games per person

      For the sake of argument lets assumes you guys started on ARPANET (no idea) and played for 10 years:
      142857/(10*365.25) = 40.1 games per day.

      That's 40 games a day, every day, for 10 years....

      If every game took 15 minutes (very unlikely) that's 10 hours of playing per day, 70 hours per week.

      Unlikely...

    69. Re:nearly impossible to anticipate? by PmanAce · · Score: 1

      Hmmm, not so hard to imagine, 20 million people playing 100 games each.

      --
      Tired of my customary (Score:1)
    70. Re:nearly impossible to anticipate? by networkBoy · · Score: 1

      When it does, those of us who leaned more toward the "tested and stable" side will just kick back in our comfy chairs and laugh as we watch the young'ns scramble to put out the fires, just as we did when we were too dumb to prefer stability.

      In fact I just described a former co-worker as "young and stupid" and not in the pejorative sense, but rather as to mean young and inexperienced. It's a place that nearly all of us have been before.

      One of my *best* working relationships was with a "fast and loose" coder, while I'm generally the "this branch of code can't happen, I better make sure it's handled just in case it does" type of coder. He'd output a pile of code and I'd end up adding another 100% LoC to it in stability. His overall architecture was very good it's just that in a case where $var *should* only ever have 'foo', 'bar' and 'baz' he'd have an if, else if, and else, or a three statement switch. I'd go in and add that last default case to the switch just in case someone added an element to the enum and didn't look where it could cause problems.

      Between the two of us we covered at least three times more ground than either of us would alone.

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    71. Re:nearly impossible to anticipate? by networkBoy · · Score: 1

      Still a salient example of shortsightedness

      I disagree with this part of the statement.
      Sure it caused issues, but at a time when memory was measured in bytes and priced accordingly, having two extra bytes for YYYY (in more than one place most likely) was a real issue. It was also a reasonable assessment that the code had a high probability of being rewritten outright before Y2K or at least refactored.
      The shortsightedness happened in the early to mid 90's when that code may have been touched with time to spare and memory now more plentiful. Refactoring should have been done then anytime an application was being added to.

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    72. Re:nearly impossible to anticipate? by thegarbz · · Score: 1

      I'm sure they knew there would eventually be over 2 billion games played

      You're designing a game with no knowledge of it's popularity or expected use. Sometimes it is pleasant when the number of games that are played by someone other than the dev team can fit 2 bits of memory storage let alone 32.

      640k of memory should be enough for anyone. Well I would now say no one needs more than 16GB but what would I know I just rubbed my crystal ball, looked into it and the only thing it said was "made in China".

    73. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 1

      I take it you never worked in IT.

    74. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      64-bit probably which does not change the fact that WORD in Windows is still a 16-bit value

    75. Re:nearly impossible to anticipate? by Megol · · Score: 1

      Don't know if I'd want to hire someone that swears at eunuchs... They are people too (or so they say).

    76. Re:nearly impossible to anticipate? by edtice1559 · · Score: 1

      Considering the designers of the Internet got this wrong with IP addresses and had the benefit of huge amounts of collaboration, I fail to see how a relatively tiny operation with a small budget can be considered idiots for this. Probably when they started they were just trying to get an app out at all and intended to fix this if they ever got near 2B games. But probably at the time it seemed like an impossible number.

    77. Re:nearly impossible to anticipate? by BronsCon · · Score: 1

      You're designing a game with no knowledge of it's popularity

      No knowledge of the popularity of the game of Chess? Or online gaming in general, especially when combined with a game as popular as Chess? In 2005?

      or expected use

      I expect that one of the first places some looking for information on the game of Chess will look is chess.com and, if I put my game there, it will probably be pretty damn popular.

      But, even if it's not, it wouldn't have killed me to use 64-bit INTs just in case.

      And clearly I, as the developer in a hypothetical situation, knew this as I chose a database field type that cold hold those values.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    78. Re:nearly impossible to anticipate? by Darinbob · · Score: 1

      In general, lots of idiots have trouble anticipating what might happen in the future, even mind boggling easy predictions such as how long will it take until we have to deal with the problem we're kicking down the road. People who stand up and say that there is a problem that needs to be fixed now are often ignored for standing in the way of meeting the deadlines.

      That said, for a site called "chess.com", are they really putting the very best engineers on this? For game ids, do they haul out the senior engineers who've lived through multiple snafus in the past, or do they get the new hire? Add a startup into the mix and it's a good bet that there's never even a design or code review involved.

    79. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Two BILLION chess games?

      I'd have not anticipated that a chess site would become that popular. Yes, it's easy to say that it's an obvious bug, but one has to select a variable size during development. Not everything can be stored in a 64 or 128-bit integer, because that would mean a lot of wasted space. So, would YOU have thought it reasonable to use an unsigned 32-bit integer for the number of chess games? I bet many developers would have.

      Only developers unfamiliar with online chess would have thought a 32 bit integer would be sufficient. There are players on that site who have played over a hundred thousand games. I've been a member for less than 6 months and I've already played almost 2 thousand games (mostly blitz and bullet games lasting 2-10 minutes each), and I've slowed down quite a bit in the last month or so.

      There are several million players registered there. If each player plays a few hundred blitz games, which is easily done in very little time, you're already pushing the limit of a 32 bit integer. This was extremely poor planning on the part of the developers. No way to sugar coat it.

    80. Re:nearly impossible to anticipate? by Darinbob · · Score: 1

      CEOs are not chosen for their technical competencies. Not even CTOs get to work on technology, they're off full time schoomzing potential customers and investors.

      Even if a company has only two people, the jobs will still be divided between the person who does the real work, and the person who does the sales and marketing and promotion.

    81. Re:nearly impossible to anticipate? by BronsCon · · Score: 1

      Still a salient example of shortsightedness

      I disagree with this part of the statement.

      But, then...

      The shortsightedness happened in the early to mid 90's when that code may have been touched with time to spare and memory now more plentiful.

      So, then, it's still a salient example of shortsightedness?

      I'm just having a laugh and yes, I do get your point. There was a reason I didn't cite that example myself.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    82. Re:nearly impossible to anticipate? by angel'o'sphere · · Score: 1

      Not everything can be stored in a 64 or 128-bit integer, because that would mean a lot of wasted space.
      Let me put that into a perspective for you: suppose my ints are 4 bytes and my longs are 8 bytes, you merely save 4 bytes for your puny little int. How can that be a huge waste of space? (Considering that in C you have to chose either 8 or 4 and can not essily have 5 or 6 or 7)
      On the other hand if you had millions of those ints/longs you could save proportionally more bytes in the millions of bytes.
      Luckily my machine has enough memory that even thousands times of more ints/longs would fit into the memory ...
      Yes, your Y2K quote is half right, but basically repeating only a false internet mem.
      They never used 2 digits for YY to save space.
      They did it because everyone in RL only used two digits! And on top of that, no one expected software written in the late 50s, oops 1950s (in case you are confused) to still be runnin in 2010 (yeah, did not want to make the pun in writing 10 :) )
      Btw. nearly no software I'm aware of changed date fields from YY to YYYY to fix the problem. Mostly a technique called 'windowing' was used.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    83. Re:nearly impossible to anticipate? by angel'o'sphere · · Score: 1

      I guess that was meant to teach their humble readers a lesson?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    84. Re:nearly impossible to anticipate? by jeremyp · · Score: 1

      The implication of that story is that it's going to happen again when comments hit four billion. Your comment appears to be 54,609,763, so I guess there's a way to go.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    85. Re:nearly impossible to anticipate? by angel'o'sphere · · Score: 1

      Erm, "I'll take your word for it", you are confusing me! A single word? A double word? A long word? ;D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    86. Re:nearly impossible to anticipate? by jeremyp · · Score: 1

      Yes, well notice that it's only 32 bit iPad apps that broke. Their server side software is clearly capable of handling larger numbers, so somebody took the decision to represent a (probably) 64 bit integer from the server using only 32 bits in the client.

      Damned right they should have foreseen this.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    87. Re:nearly impossible to anticipate? by v1 · · Score: 1

      Maybe someone who has trouble "anticipating" their product could become a success should not be CEO of any company?

      --
      I work for the Department of Redundancy Department.
    88. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Or, if we're talking about blitz or lightning timed games (1-5min), as mentioned in the GP of the post you were replying to, it's potentially as little as 40 minutes per day, or as much as 3hr 20min. Some people really love their Chess games and will spend 10hr on a Saturday or Sunday (or both), which could net at many as 600 short timed games per day, 1200 per week, just playing on weekends.

      Per person.

    89. Re:nearly impossible to anticipate? by BronsCon · · Score: 1

      You'd actually need 40 million playing 100 games each; each game requires two players.

      But yes, your point does hold up despite the (understandably, as you were making a point and not writing a freakin' dissertation) bad math. I'm just stepping in to explain away the error before someone jumps on you for it.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    90. Re:nearly impossible to anticipate? by brantondaveperson · · Score: 1

      . If they detect a computer-aided game (it's not difficult)

      I'm very interested in how detecting computer-assistance is so easy.

    91. Re:nearly impossible to anticipate? by BronsCon · · Score: 1

      Actually, what the designers if the Internet got wrong wasn't the number of IP addresses needed; they didn't factor in companies hoarding public address space for private use (or, worse, sitting on unused address space), something which should not have ever been allowed and should not need to be accounted for in the first place.

      If IANA were to reclaim incorrectly-allocated address space, we'd have plenty of IPv4 addresses. Not every device needs a public address and, in fact, most should not have one, which is an entirely new problem brought on by IPv6.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    92. Re:nearly impossible to anticipate? by Eunuchswear · · Score: 1

      Not Enuch swear -- Eunuchs ware (i.e. when I made this account I was a UnixWare (svr4.2) user -- "UNIX" == "UNiplexed Information and Computing Service" -- a castrated version of Multics).

      --
      Watch this Heartland Institute video
    93. Re: nearly impossible to anticipate? by Eunuchswear · · Score: 1

      Nope, the vast majority of "machines" in use are = 32 bit. More phones than PC's by orders of magnitude.

      --
      Watch this Heartland Institute video
    94. Re: nearly impossible to anticipate? by Eunuchswear · · Score: 1

      Fucking HTML, I meant <= 32

      --
      Watch this Heartland Institute video
    95. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      If they were exclusively playing each other, it would be half that, but still unrealistic.

    96. Re:nearly impossible to anticipate? by arglebargle_xiv · · Score: 1

      This was obviously an unforeseen bug that was nearly impossible to anticipate

      Ahh, where's Malcolm Tucker when you need him:

      In the words of the late great Nat King fucking Cole, unforeseeable, that's what you are.

    97. Re:nearly impossible to anticipate? by Nutria · · Score: 1

      I see your 1980 mini-computer who's calendar lasts until 2030, and raise with a 1979 mini-computer who's time spans from 1859 to 31068, in 100ns intervals!

      https://en.wikipedia.org/wiki/OpenVMS#Timekeeping

      --
      "I don't know, therefore Aliens" Wafflebox1
    98. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Just curious...what would you typically put into the default case to increase stability?

    99. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      16-bit word?

    100. Re: nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Since at least 90% of new PCs have 64-bit CPU a WORD must be 64 bits in size. Or maybe 90% of 64 bits?

    101. Re:nearly impossible to anticipate? by Rockoon · · Score: 1

      For the sake of argument lets assumes you guys started on ARPANET (no idea) and played for 10 years: 142857/(10*365.25) = 40.1 games per day.

      Yes, only 40.

      --
      "His name was James Damore."
    102. Re:nearly impossible to anticipate? by thegarbz · · Score: 1

      No knowledge of the popularity of the game of Chess? Or online gaming in general, especially when combined with a game as popular as Chess? In 2005?

      No. No knowledge of the popularity of *THEIR* game of Chess. Just because something is popular doesn't mean you will make it big. Try and release a fidget spinner right now and see how many sales you get.

    103. Re:nearly impossible to anticipate? by null+etc. · · Score: 1

      Yes, because all programmers should remember the data type of every variable and function they ever define in every program they ever write.

    104. Re: nearly impossible to anticipate? by BronsCon · · Score: 1

      And I'm sure they couldn't have found time in the 3 years since they hit 1 billion games to fix this? Or did they still not realize how popular their game was? Any way you cut it, they were shortsighted.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    105. Re:nearly impossible to anticipate? by wvmarle · · Score: 1

      A few years ago our favourite web site (/.) fell victim to the same problem: the comment id overflowed. For quite some time it was possible to post comments, but not to post replies to comments... that continued until the database was updated, and the data type for the comment id changed to hold the bigger numbers.

    106. Re:nearly impossible to anticipate? by Eunuchswear · · Score: 1

      Well, yes. :-)

      --
      Watch this Heartland Institute video
    107. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      32 bit ipad?!? WHY?!?

    108. Re:nearly impossible to anticipate? by networkBoy · · Score: 1

      Touche...

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    109. Re:nearly impossible to anticipate? by networkBoy · · Score: 1

      Depends on the target.
      Internal software?
      A printf that says a default at __LINE__ was hit that should be inaccessible please have a look at the code in file foo.c and then the same as for external SW:

      External SW?
      Determine if this is a serious failure, or if there is some safe default output/setting/return that can be used. Use it.
      Throw an appropriate error if required.

      Anything is better than your end user seeing "Unhandled exception" and a stack trace.

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    110. Re:nearly impossible to anticipate? by edtice1559 · · Score: 1

      Or, more likely, they migrated the server to 64-bit when they hit 1B games and also the 64-bit clients but didn't test the 32-bit clients. As BronsCon has pointed out multiple times, they probably got lucky on the 64-bit version in that they happened to have used a size that was platform dependent. I don't know the chess.com protocol, but if it returns XML or JSON or the like, the number ends up in a "string" representation and then converted back to an actual integer type. If they were using RPC or something that had strong typing this would be harder to do. If somebody explicitly cast 64 to 32-bit (or did an assignment that lopped off the high-order bits), that would be a bit more brain-dead.

    111. Re:nearly impossible to anticipate? by edtice1559 · · Score: 1

      No but every *person* may need at least 1 IP address that that's will 6B people and an address range of 2B. When IPv4 was designed, there was no NAT so it was easy to anticipate that even if everybody in the world owned an IBM XT, there weren't enough addresses. In fairness, what many people were doing at the time was running a non-TCP network locally and having just one "gateway" device. But even then, you don't get past the one IP address per person problem. The way that addresses are assigned has certain exacerbated the problem.

    112. Re:nearly impossible to anticipate? by driblio · · Score: 1

      Nothing to do with 64 bit hardware... Except that it worked on 64 bit hardware and didn't work on 32 bit hardware.

      They could have used long long... But they didn't, so the hardware mattered.

    113. Re: nearly impossible to anticipate? by thegarbz · · Score: 1

      And I'm sure they couldn't have found time in the 3 years since they hit 1 billion games to fix this?

      As a matter of interest how many times in your life have you had the spare time or interest to debug perfectly running code that wasn't buggy and wasn't displaying any symptoms of running properly?

    114. Re: nearly impossible to anticipate? by BronsCon · · Score: 1

      It's called refactoring. A developer should constantly be improving any code they touch.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    115. Re: nearly impossible to anticipate? by david_thornley · · Score: 1

      I'd expect the number of 16-bit words out there to be much less than 90%. Last I looked, 8-bit computers were still in heavy use in cheap embedded systems. Machines usable as computers of some sort tend to have 32-bit and 64-bit words.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    116. Re:nearly impossible to anticipate? by david_thornley · · Score: 1

      Sure. I'd suspect a data type (maybe "long") that compiled to 32 bits on a 32-bit machine and 64 bits on a 64-bit machine. Such data types are usable for purely internal processing, but a number that exists outside the program really should have an exact bit length.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    117. Re:nearly impossible to anticipate? by david_thornley · · Score: 1

      I don't think it was a matter of memory. Even back then, two bytes in a record wouldn't increase its size too much. I think it was a matter of punch cards. In memory, the difference between a 79-byte and an 81-byte record is about 3%, but the difference between those records on punch cards is requiring one or two punch cards per record, which is a really big deal.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    118. Re:nearly impossible to anticipate? by Anonymous Coward · · Score: 0

      Not as stupid as a windows programmer that can't understand why having a type called "WORD" is a very bad idea.

    119. Re:nearly impossible to anticipate? by Impy+the+Impiuos+Imp · · Score: 1

      Of course, and I was actually going to cite that famous example, but that was more a case of application developers believing their software would no longer be in use, rather than believing the platforms it ran on would have been retired.

      I'm not even sure that consciously entered into it. The year 2000 was long past when we'd have giant wheel space stations, a sizable city on the moon, and colonies on Mars and further out, to say nothing of robots and flying cars.

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    120. Re: nearly impossible to anticipate? by thegarbz · · Score: 1

      It's called refactoring. A developer should constantly be improving any code they touch.

      I know what it's called. You seem to have an unrealistic view of how often it is done. But then you qualified your statement quite perfectly: "code they touch".
      Perfectly running code with no bug reports often doesn't get touched.

      If it did your boss would likely question why you're wasting time. That's the general nature of business. If you're in a position to refactor random bits of fine working code without reason then I and likely the rest of the world envies you. But that's not now nearly every software program is managed.

    121. Re: nearly impossible to anticipate? by BronsCon · · Score: 1

      If you're not reviewing your codebase regularly for old or dead code, you're in for a world of pain down the road.

      Yes, I realize that it is not considered "normal" to do this; that doesn't mean it shouldn't be done.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    122. Re: nearly impossible to anticipate? by thegarbz · · Score: 1

      Could not agree more.

  2. All of that for -1 by mi · · Score: 5, Informative

    After the Site Hit 2^31 Game Sessions

    The problem could waited twice longer — giving the 32bit iPads time to break down and die of old age on their own — but somebody wasted an entire bit for the possibility to return -1 somewhere...

    Any time you pick ssize_t over size_t, for example, you are making the same decision...

    --
    In Soviet Washington the swamp drains you.
    1. Re:All of that for -1 by Gravis+Zero · · Score: 5, Funny

      Hey, I was born unsigned but my parents had the doctor make me signed by modifying my most significant bit. I can't help but be negative about the whole thing but that's because I'm signed. ;)

      --
      Anons need not reply. Questions end with a question mark.
    2. Re:All of that for -1 by Anonymous Coward · · Score: 0

      At least when you use a signed type for something that cannot ever be negative, you immediately know what's up when you get negative values. In case of an overflow of an unsigned type you get values which are valid in principle.

    3. Re:All of that for -1 by Tranzistors · · Score: 4, Insightful

      It is generally a good idea to store quantities in signed variables, because unsigned numbers overflow into valid numbers, which are less obvious bugs. If you have a game #-2147483648, cause of the bug is clear even to a novice. If an application starts to serve games that are really old even if you asked for the new ones, who knows why? Also, using unsigned numbers will not help much with saving memory space. If the game count reached 2^31, how long until it reaches 2^32?

    4. Re:All of that for -1 by Anonymous Coward · · Score: 0

      It is generally a good idea to store quantities in signed variables, because unsigned numbers overflow into valid numbers

      signed overflow is undefined behavior, you might get "valid" results

      yes, you are an idiot

    5. Re:All of that for -1 by Anonymous Coward · · Score: 0

      Any time you pick ssize_t over size_t, for example, you are making the same decision...

      I totally agree. size_t is the correct type to reference a byte count in C. Although since the article mentions website I suspect this is a JavaScript issue. Any time a JSON or XML API is passing data to a JavaScript application and it returns numbers there can be issues if those numbers exceed 2^31 because that's when JavaScript switches into "floating point mode." It requires a bit of careful coding, both server and client side but it can be avoided. If you find you need to pass IDs around then you should return them as strings from your server API so JavaScript doesn't truncate them.

      And for the JavaScript bashers: This problem exists in other dynamically typed languages. I'm looking at you Python.

    6. Re:All of that for -1 by AmiMoJo · · Score: 1

      Careful though, in many languages signed overflow is undefined. C/C++ is like that, for example. In practice it will probably roll to 0x80000000 but it is entirely architecture and compiler dependent if that happens and what 0x80000000 is interpreted as.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    7. Re:All of that for -1 by Kjella · · Score: 1

      Careful though, in many languages signed overflow is undefined. C/C++ is like that, for example. In practice it will probably roll to 0x80000000 but it is entirely architecture and compiler dependent if that happens and what 0x80000000 is interpreted as.

      Nothing like a nitpicker being wrong, 0x7FFFFFFF + 1 might be undefined but 0x80000000 = INT_MIN = -2147483648 is very well defined as long as you approach it from the negative side.

      --
      Live today, because you never know what tomorrow brings
    8. Re:All of that for -1 by Tranzistors · · Score: 1

      Careful though, in many languages signed overflow is undefined.

      I prefer platform specific behaviour instead of undefined behaviour. Sure, it is bad and should be avoided, but unlike undefined behaviour, platform specific behaviour can't kill your dog (not that you said that, but sometimes I come across such horror stories).

      C/C++ is like that, for example. In practice it will probably roll to 0x80000000 but it is entirely architecture and compiler dependent if that happens and what 0x80000000 is interpreted as.

      I don't think there are that many possible platform specific overflow outcomes. Throwing exceptions, crashing the application, quietly returning INT_MIN are all preferable outcomes compared to returning 0. At least I am not aware of any platform/language where signed integer i = INT_MAX + 1 overflows to a non-negative number. If I am wrong, please correct me.

    9. Re:All of that for -1 by Anonymous Coward · · Score: 0

      The problem could waited twice longer —

      That is incorrect, as it assumes zero rate growth of games per time. I think you mean one doubling period.

    10. Re:All of that for -1 by Anonymous Coward · · Score: 0

      My parents gave birth to me complexly.
      My entire life has been confusing.

    11. Re:All of that for -1 by Anonymous Coward · · Score: 0

      The point they were trying to make is that if you have "quantity" values that are technically unsigned (nothing going below 0), by leaving them signed, when you see a value that's negative, you KNOW something is wrong.

      Of course, all of this could just be handled properly in code, but we all know the reality is less than ideal in almost all cases for various reasons.

    12. Re:All of that for -1 by AmiMoJo · · Score: 1

      0x80000000 is -1 on most current architectures, but not always. Not all systems use 2's compliment, not all signed addition op-codes overflow that way.

      If you write code that relies on that and one day it gets run on some new system with a hot new chip...

      Check the C spec, it's undefined for this reason.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    13. Re:All of that for -1 by Megol · · Score: 1

      Unless C/C++ changed since I last cared one can have a ones complement or signed magnitude machine neither of which can represent -2147483648 in 32 bits.

      Nitpicking points++

    14. Re:All of that for -1 by Anonymous Coward · · Score: 0

      Nope, given the amount of users have increased a lot over time, it could well be that it took 12 years to reach 2 billions games but the next 2 billions games will only take 2 years. Also, millions might have switched from desktop to phone or tablet and play many more but perhaps shorter games.

      Useful lifetime of say an iPad 2 is not known, but at least ten years should be reasonable (it's high end, may be in some cheap leather "case", isn't thrown around like a frisbee). Perhaps it will be locked out from going online because of obsolete encryption before the hardware dies (as far as we know, it could last for 20 years, and not be used every year).
      In any way, I make a cheap guesstimate of over 10 million games played before the iPad 2 is unusable.

      As for people who suggest a 32bit tablet is so obsolete that it should go to the landfill I suggest they have their sanity checked. It's a chess game, and it doesn't even have a chess AI.

    15. Re:All of that for -1 by jeremyp · · Score: 1

      If the game count reached 2^31, how long until it reaches 2^32?

      Well that's twice as many games. I don't know how long chess.com has been around for, but it probably gives you an extra couple of years.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    16. Re:All of that for -1 by jeremyp · · Score: 1

      0x80000000 is -1 on most current architectures

      No it isn't, it's -2147483648. -1 is represented as 0xFFFFFFFF (in a 32 bit int). Also, this was a bug in an iPad app and iPads are ARM which means they do use 2's complement.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    17. Re:All of that for -1 by slimjim8094 · · Score: 1

      Using unsigned for an extra bit is dumb. Unsigned values should only be used for data, not numbers, or if that extra bit is really really important and you can prove it If you want to prove an invariant that the thing is always non-negative, that's what asserts are for. If you think your data type might ever have more than a million of something, automatically reach for 64-bit values. Don't play games about the difference between 2 and 4 billion.

      Using signed values for non-negative numbers have the nice property that overflows are immediately recognizable and generally cause crashes or "entry not found" rather than corruption. For loop counters they prevent infinite loops. And memory (even on phones) is too cheap to worry about the extra 32 bits. Besides how sure are you that you're not wasting those 32 bits anyway inside the allocator's fixed-size buckets or packing issues with your struct? Those yield bigger gains than using a smaller data type.

      --
      I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    18. Re:All of that for -1 by AmiMoJo · · Score: 1

      Proof, once again, that I should not Slashdot from my phone late at night.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    19. Re:All of that for -1 by david_thornley · · Score: 1

      In practice, there's been a considerable convergence of processors since C was designed. Particularly when dealing with computational devices that people use, it's pretty darn safe to assume twos-magnitude notation with wraparound on signed arithmetic overflow.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    20. Re:All of that for -1 by david_thornley · · Score: 1

      The problem with "platform specific behavior" is that it implies that you can count on uniformity across a platform. It's more like "implementation-defined behavior", which is guaranteed to be uniform across a platform, and is in the Standard.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    21. Re:All of that for -1 by Anonymous Coward · · Score: 0

      If the game count reached 2^31, how long until it reaches 2^32?

      Twice as much time.

    22. Re:All of that for -1 by strikethree · · Score: 1

      If the game count reached 2^31, how long until it reaches 2^32?

      Assuming all else is equal, this is easy to answer: Twice as long. Hurray for binary!

      --
      "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
    23. Re:All of that for -1 by Tranzistors · · Score: 1

      Assuming all else is equal, this is easy to answer: Twice as long. Hurray for binary!

      This holds true on the assumption that game play rate is constant. My back of the envelope (literally) calculations indicate, that if the growth of of games played is linear, then after twice the time, the total amount of games will increase fourfold.

  3. wtf by Anonymous Coward · · Score: 0

    so 32bit device cant handle 64bit int?? i'm a little confused

    1. Re:wtf by Cipheron · · Score: 1

      ... yes. See the data types directly hardware-supported on the 80386 for example, it supported 64 bit numbers in hardware, and your compiler can emulate that in software if the hardware doesn't directly support it.
      https://en.wikipedia.org/wiki/...

      It's extremely common for CPUs to support a word size double their "bits", e.g. 8 bit machines generally had a 16-bit integer type, used for addressing 64K of memory.

    2. Re:wtf by petermgreen · · Score: 1

      In general the advertised word size of a processor is the data size of the general purpose registers and the largest data size that most regular instructions can work on.

      The one reasonablly common exception to this is the results of multiplications. Many processors with hardware multipliers have a multiply instruction where the result is double the size of the arguments and stored into two registers.

      Larger additions/subtractions/comparisions can be performed by using a carry flag. Larger multiplications can be performed by a variant of long multiplication. There are ways to do larger divisions too though they get quite copmlex.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    3. Re: wtf by Anonymous Coward · · Score: 0

      Should be enough for anybody. :ducks:

    4. Re:wtf by SuperDre · · Score: 1

      It's propably declared as 'Int' which takes the size of the platform is runs on, so on a 32bit platform it will be 32bit, on a 64bit platform it will be 64bit, and so on.. Personally I don't like declarations like that, always just declare it as what you want it to be (int32, int64 or uint32 if you're not gonna go negative, which would have worked in this case too).

    5. Re:wtf by jeremyp · · Score: 1

      Nope.

      With macOS C compilers, int is always 32 bits. long can be 32 or 64 bits and the Cocoa integer type (NSInteger) can also be 32 or 64 bits.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    6. Re:wtf by SuperDre · · Score: 1

      It all depends on the language and as you say compiler. but who says this app was written in C? it's an iOS app, so I doubt it. It's more likely to be written in cocoa where as you put it correctly int can be 32bit or 64bit.
      But i have no idea, as you cannot develop on windows for iOS (at least not compile and distribute).

  4. Apple's fault? by Anonymous Coward · · Score: 4, Insightful

    I'm not Apple apologist, but come on why point the finger at Apple? This would have happened on any 32-bit architecture. Blame the devs of the game for not knowing how this works, not Apple.

    1. Re:Apple's fault? by Anonymous Coward · · Score: 0

      And if anything, moving to 64bit "corrects" the problem. If not, you'd be seeing it in newer devices, as well. Summary is just full of wrong.

    2. Re:Apple's fault? by Anubis+IV · · Score: 3, Informative

      Exactly. This bug would have happened regardless of Apple's move to 64-bit given that it's a flaw in the site's design that would affect any 32-bit architecture. Apple's move to 64-bit hardware and OSes is the reason newer iPads support the site at all, otherwise the site would be broken across all iPads.

      Also, why Chess.com doesn't just switch to unsigned ints and/or migrate to GUIDs is beyond me. You could just map the existing integers to GUIDs and then use GUIDs going forward. 32-bit OSes and CPUs have no problems dealing with 128-bit GUIDs, and it's unlikely that they'd ever encounter this problem again in the next few thousand years.

    3. Re: Apple's fault? by Anonymous Coward · · Score: 0

      It didn't correct the problem, it just moved the next sign bit overflow event farther into the future.

    4. Re:Apple's fault? by dreamchaser · · Score: 4, Informative

      It has nothing to do with the architecture at all. One can write code that can handle 64 bit values easily on any architecture. Sure it takes a tiny bit more work but people do it all the time.

    5. Re:Apple's fault? by Grishnakh · · Score: 0, Troll

      No, don't blame the devs, or Apple either. Blame the users. It's their fault for continuing to use these ancient 32-bit iPads. Don't they know that you're supposed to upgrade your Apple iDevices every 2 years at a minimum? What's wrong with these people? It's their responsibility to stay current with Apple's latest equipment, even if they have to feed their kids Ramen noodles to pay for it.

    6. Re:Apple's fault? by Grishnakh · · Score: 1

      It'd be simpler and better for them to just tell affected users that they need to upgrade to the latest Apple iPads.

    7. Re:Apple's fault? by Anonymous Coward · · Score: 0

      This would have happened on any 32-bit architecture.

      Almost any 32-bit programming language and CPU since the 1990's support 64 bit integers, and for sure any Intel compatible CPU. So even 32-bit architecture is a very lame excuse.

    8. Re:Apple's fault? by Anonymous Coward · · Score: 0

      Yes, the blame is solely on the devs for not using the proper variable types. My point was that their code on any 32-bit device would have done the same and Apple has nothing to do with it.

    9. Re: Apple's fault? by UnknowingFool · · Score: 1

      Yes but signed 64-bit would hit the max at 9,223,372,036,854,775,807 games (unsigned 18,446,744,073,709,551,615). I have a feeling that the limit is safe for 64-bit devices for the foreseeable millennium or so.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    10. Re:Apple's fault? by Anonymous Coward · · Score: 0

      This isn't even Apple's fault for moving to only support 64-bit. The 32-bit app could have been updated to support an 8 byte integer a long time ago.

    11. Re:Apple's fault? by edtice1559 · · Score: 1

      Does it really take more work to declare something int128?

    12. Re:Apple's Fault? by Anonymous Coward · · Score: 0

      Arguably the requirement on speed of rendering is directly depending on the speed of play so if the players play very fast then rendering must be very fast too.

    13. Re:Apple's fault? by dreamchaser · · Score: 1

      I was speaking more in a language agnostic sense. A 4 bit processor coded with punch cards could handle 64 bit values with enough effort.

  5. Obligatory Answer by D.McG. · · Score: 1

    Everyone please stop using int and long intrinsic types. uint64_t is your friend when you expect so many games. 2^31 tells me it wasn't even unsigned. How could there be a negative number of games played?

    1. Re:Obligatory Answer by D.McG. · · Score: 4, Insightful

      And to the Slashdot editors, don't even try to blame this on Apple's decision to go with 64-bit CPUs. That decision is the only reason it's NOT broken on newer devices; since the apps are compiled natively for both 32-bit and 64-bit. Otherwise ALL devices would have rolled over at 2^31.

    2. Re:Obligatory Answer by Vlad_the_Inhaler · · Score: 1

      As a non-developer I can't really explain how or why this happened seems to apply here as well, that was a ridiculous mistake to make.

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    3. Re:Obligatory Answer by Anonymous Coward · · Score: 1

      The sign bit is often used as a flag.

      For example, game 1000 could be a game in progress, while game -1000 would be the history of that same game after it's completed.

      I'm not going to argue about whether it's right or wrong, complex or simple - I'm just saying that it's done and may have been intentional and functional.

    4. Re:Obligatory Answer by D.McG. · · Score: 3, Insightful

      "Apple's decision ... has caused some problems" is quite a conclusion to jump to when ignorant of the facts. If one doesn't know what they're talking about, don't make such a claim.

    5. Re:Obligatory Answer by D.McG. · · Score: 0

      That would suggest that they intentionally knew that they could only support 2^31 games if trying to bit pack. They obviously used an intrinsic type of unknown size on all platforms. stdint.h and uint64_t is your friend.

      Bit packing metadata into the game number is short sighted. What happens when you need to store more data per game? Steal more bits? No. Store the game state with the rest of the game data, including references to players, moves made, etc.

    6. Re:Obligatory Answer by Nutria · · Score: 1

      Bit packing metadata into the game number is short sighted.

      And archaic! It's 2017, not 1977!!

      --
      "I don't know, therefore Aliens" Wafflebox1
    7. Re:Obligatory Answer by Anonymous Coward · · Score: 0

      Nonsense. 32bit CPUs support 64bit integers, it just takes more CPU cycles because it can't fit them into a register all in one go. You just need to tell your program to use them rather than the default int/long types that use whatever makes sense on your native instruction set.

    8. Re:Obligatory Answer by D.McG. · · Score: 0

      You didn't read the parent post. Already stated that if they used stdint's uint64_t it would have been fine on all platforms. Wasn't suggesting that they should rely on Apple to save them; merely pointing out that the summary is bullshit and Apple did not cause their trouble.

    9. Re:Obligatory Answer by Solandri · · Score: 1, Insightful
      If they're using the same code base for their 32-bit vs 64-bit versions, the int declaration for session ID should be the same on both versions. 32-bit processors can handle 64-bit integers just fine. They just need two clock cycles to manipulate them instead of one. So if they took the same code and compiled it twice (once as 32-bit, once as 64-bit), the same bug should have shown up in the 64-bit version.
      • They're using a different codebase for their 32-bit vs 64-bit versions, and it just so happened the 32-bit version had a bug the 64-bit version did not. It could easily have been the other way around.
      • Or they use the same codebase and there's a bug present in both versions. It just turned into a fatal overflow error on the 32-bit version, while the 64-bit version could continue. (Possible since a 32-bit int compiled for 64-bit would have a bunch of zeroes added as padding - though whether it protects from overflow depends on the endian-ness of the processor).
      • Or there's more going on here, and they're doing some other manipulation of Session ID further down in the code which is causing a crash on the 32-bit version, while the 64-bit version continues to run. (This could explain why the error happens at 2^31 instead of 2^32, even if Session ID were an unsigned long int.)

      So it's not necessarily true that Apple's move to 64-bit is why it runs fine in the 64-bit version. I think the swipe at Apple is because they removed 32-bit apps from the App Store. Even if chess.com had found and patched this bug ahead of time (which they may have since the CEO has admitted he's clueless about this tech stuff), as I understand it owners of 32-bit iOS devices would've had to update their software by downloading the patch directly from chess.com. No auto-update via the App Store anymore for 32-bit apps.

    10. Re:Obligatory Answer by bill_mcgonigle · · Score: 1

      How many fewer ad views would the story have gotten without that bit of technical nonsense? Why does /. exist?

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    11. Re:Obligatory Answer by D.McG. · · Score: 5, Insightful

      I guarantee you that it's the same source code that just declares the variable as a "long" which is 4 bytes when compiled for 32-bit devices and 8 bytes when compiled for 64-bit devices. They should have used "uint64_t" which would have taken away the ambiguity and worked everywhere. It's as simple as that.
      https://developer.apple.com/li...

    12. Re: Obligatory Answer by Anonymous Coward · · Score: 0

      2^31 eh? Sounds like they are running it on Amiga OS. ;)

    13. Re:Obligatory Answer by D.McG. · · Score: 1

      This is a slippery slope.

      So, easily debunked headlines keep the lights on, but makes everyone's blood pressure go up; which leads to needing a higher required dose of heart meds. This ultimately leads to patrons not coming back, which fails to generate ad revenue in the future.

      Proper editing would make me come back more often.

    14. Re:Obligatory Answer by Anonymous Coward · · Score: 0

      It's handy to reserve some number of special IDs for a number of reasons. Negative numbers are convenient for that.

      They saw their billionth game three years ago, so switching to int64_t would have been a good measure around then.

    15. Re: Obligatory Answer by Anonymous Coward · · Score: 0

      You're the guy which calls his datacenter a watch.

    16. Re:Obligatory Answer by Anonymous Coward · · Score: 0

      I am just ...sincere legitimate man of American, from Texas, want to "MAGA", I have been Slashdot poster since , ah, November?

      Do you not think this is maybe a problem when people like "Hillary Clinton" use e-mail server??? or when he did a prank on that poor man Ben Ghazi? That this kind of bad decision making started under Obama maybe??

      We still have 32 bit CPUs, just like Russia, we are not so 64-bit ourselves.

    17. Re:Obligatory Answer by Anonymous Coward · · Score: 0

      Ofcourse it is there fault if they had stuck their guns to 32bit the site would have broken for everyone and i bet that they would put more energy into fixing it when they lose all of their users and not just the cheapskates with old devices

    18. Re:Obligatory Answer by edtice1559 · · Score: 1

      Well, yes, but the problem here is that how does one know the correct range when first starting to build an application? There was probably a design document (or just written on a white board) that the apps should be able to handle 2M games. Then suddenly they are very successful and get 2B.

    19. Re:Obligatory Answer by angel'o'sphere · · Score: 1

      Lucky you are not 'coding' for different target architectures.
      I suggest to read the C/C++ standard(s) and pay very close attention to the section where the size 'relationsips' between short, int, long, long long etc. are described.
      Hint: what you wrote above is utterly and seriously wrong.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    20. Re:Obligatory Answer by jeremyp · · Score: 1

      If they're using the same code base for their 32-bit vs 64-bit versions, the int declaration for session ID should be the same on both versions.

      Not if they declared the id as a C int or a Cocoa NSInteger. Both these types are 32 bits in Clang/gcc 32 bit code and 64 bit in Clang/gcc 64 bit code.

      Or, if they are using Swift, the Swift Int type (which Apple tells you to prefer in most circumstances) is 32 bits wide in 32 bit code and 64 bits wide in 64 bit code. In my opinion, as somebody who likes programming in Swift, this was a real WTF decision.

       

      as I understand it owners of 32-bit iOS devices would've had to update their software by downloading the patch directly from chess.com. No auto-update via the App Store anymore for 32-bit apps.

      I doubt that. There are still quite a lot of 32 bit only iOS devices around. App developers have got to be able to issue patches for their 32 bit software and the only way to do that is through the app store.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    21. Re:Obligatory Answer by jeremyp · · Score: 1

      Oops. I meant long, not int. long is 32 bits / 64 bits, not int which is 32 bits on both platforms.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    22. Re:Obligatory Answer by BronsCon · · Score: 1

      So, wait, when this guy says it he gets a "Well, yes"; but, when I say it, you give me some diatribe about how they probably had separate 32- and 64-bit branches?

      Bit unstable, buddy?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    23. Re:Obligatory Answer by edtice1559 · · Score: 1

      I think your previous post is pretty valuable (and I would mod it up if I could). These two were addressing slightly different points but I do see why there is an inconsistency in my answer. (Calling me "unstable" is a bit over the top but hopefully meant in good humor.) In 2005 nobody was thinking about 64-bit iOS (It came about in 2013) and so there are two problems that one would be facing here. The first would be what the correct range of the unique id should be and the second is forward-compatibility when 64-bit mobile operating systems came about. In 2005, I didn't know anybody who even had a 64-bit desktop OS. So really there were two things so far in the future as to be unimaginable and, in order to avoid this, one would have had to correctly anticipate *both*

    24. Re:Obligatory Answer by david_thornley · · Score: 1

      Another problem with compiling as "long" is that binary file formats aren't necessarily compatible. It took me a couple of days once to track down a case where a file had been produced on a 32-bit computer and read on a 64-bit one without the use of a explicitly defined size for one variable.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    25. Re:Obligatory Answer by Karlt1 · · Score: 1

      Even if chess.com had found and patched this bug ahead of time (which they may have since the CEO has admitted he's clueless about this tech stuff), as I understand it owners of 32-bit iOS devices would've had to update their software by downloading the patch directly from chess.com. No auto-update via the App Store anymore for 32-bit apps.

      That statement is untrue for so many reasons:

      1. As of right now the current OS still supports 32 bit apps and 32 bit phones and iPads. The current OS supports the iPhone 5 and 5C.

      2. Apple does require app developers to submit 64 bit versions of new code but they are perfectly capable of submitting a fat binary that can support iOS versions back to iOS 7 - released back in 2013.

      3. The App Store also allows you to download older versions of current apps when the newest version doesn't support your hardware. This supports goes back to iOS 5-released in 2011. I can confirm this. I did it earlier this year with a circa 2010 1st gen iPad.

  6. You screwed me for the last time Chess.com! by Anonymous Coward · · Score: 0

    I'll never play chess there again! EVER!!

  7. Switch to unsigned, get another 2 billion. by RealGene · · Score: 1

    Yeesh.

    --
    Mission: To provide products that consume time and energy as entertainingly as permitted by the laws of thermodynamics.
    1. Re:Switch to unsigned, get another 2 billion. by Nemyst · · Score: 1

      Some languages, namely Java, don't natively support unsigned types, so this might not even be a choice here. There's always kludges available, but they're rarely pretty. At that point, you'd be better off redesigning for 64-bit IDs and moving on.

    2. Re:Switch to unsigned, get another 2 billion. by RenderSeven · · Score: 3, Interesting

      Switch to unsigned, get another 2 billion

      Might be a fairly short-term fix. Remember Coca Cola's CEO saying "A billion Coca-Colas ago was yesterday morning" and that was 20 years ago.

    3. Re:Switch to unsigned, get another 2 billion. by Anonymous Coward · · Score: 0

      Or use a float. Problem solved!

    4. Re:Switch to unsigned, get another 2 billion. by Anonymous Coward · · Score: 0

      Why not a string? Actually, I think an array if booleans would be best. That way, when it gets full, you can just add another element to the array. Hell, you can even do that programmatically, so no future updates are needed when you reach the limits of the type.

      And yes, I did have second thoughts about actually posting this, but I read TDWTF and hope to see an example of this posted there shortly.

    5. Re: Switch to unsigned, get another 2 billion. by Anonymous Coward · · Score: 0

      Heh, I was just about to snark that.

      Knowing of course that floats begin to lose precision after about 7 digits, this is the worst solution :).

      I think we can compromise with a 14 byte Decimal data type. 10^29 digits without precision loss.

    6. Re:Switch to unsigned, get another 2 billion. by wvmarle · · Score: 1

      Which may be long enough to give time to build a real fix.

  8. Russians by 110010001000 · · Score: 5, Funny

    How do you know it isn't the Russians?

    1. Re:Russians by GuB-42 · · Score: 2

      Maybe it is, indeed, the Russians.

      Chess is notoriously popular in Russia, so it is possible that Russians played a large number of these 2^31 games.

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

      I think we can narrow it down to Putin and leave the rest of the Russians alone. Putin is evil and his dark powers equal those of Lord Sidious - he need no clunky agencies or army of hackers - he is doing it all on his own. Manipulating voters registers, bringing dead to live to vote for him, Terrible. In fact my last night erection problems were his fault too. Where is one then there is his apprentice of course. As it is always the case not the one that we think - in fact I am pretty sure Hillary conspired with him to destroy American dream...

    3. Re:Russians by david_thornley · · Score: 1

      I'm sure that, if it came up, Putin could show pictures of himself playing chess, probably without a shirt on.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  9. Apples fault? by Anonymous Coward · · Score: 1

    I am not sure how Apple going 64bit is the one causing the problems? This particular problem (and most others caused by the discrepancy) would still be a problem if Apple devices were all still 32bit... It would only have been a much bigger problem than it is now.

    Just don't use numeric values for your primary key if you plan on growing.

    1. Re:Apples fault? by MtHuurne · · Score: 1

      It's not Apple's fault, that's just the journalistic tendency to want to tie all recent events together, even if the connection between them is very weak.

      And as you point out, in this case the connection is not only weak, but also described incorrectly, as the 64-bit version of the chess app does not exhibit the problem.

  10. "32bit device cant handle IDs above 2,147,483,647" by JoeyRox · · Score: 5, Insightful

    That's like saying 8-bit processors can't handle (signed) numbers above 128. The processors handle them fine. The programmers on the other hand...

  11. why website is blamed? by kiviQr · · Score: 1

    If you visit my website with IE6 good luck - ancient device not so good experience. If you own iDevice you are supposed to replace it every other year - that is in the contract:)

    1. Re:why website is blamed? by Anonymous Coward · · Score: 0

      not in the contract but for Android even without contract you have to replace it because of no update

  12. Wait what? by barbariccow · · Score: 2

    Wait.... what? First of all.... you can get TWICE that by using an "unsigned" 32-bit.... since there should never be a negative game ID.

    And also what 32-bit machine doesn't have register-combining for 64-bit variables? Just because it isn't representable in a signed 32-bit integer does NOT mean it's 32-bit incompatible...

    This explanation makes absolutely no sense to me.

    1. Re:Wait what? by Anonymous Coward · · Score: 0

      Exactly. Some of us remember 8 bit computers, which had more than 256 bytes of memory.

      Even with 16 bit registers we had more than 64k (side-ways RAM and other malarkey).

      Get off my lawn!

    2. Re:Wait what? by Anonymous Coward · · Score: 0

      Wait.... what? First of all.... you can get TWICE that by using an "unsigned" 32-bit.... since there should never be a negative game ID.

      For some people that depends entirely on the outcome of said game ...

    3. Re:Wait what? by Anonymous Coward · · Score: 0

      Some remember 4bit computers, which had more than 16 bytes of RAM.

  13. Like the time with Slashdot stopped working by Anonymous Coward · · Score: 0

    Sorry for the lack of oblig link to story. If someone can find it, reply.

    Slashdot crashed a few years ago for a day because it hit some 2,147,483,647 indexes in part of the data.

    Simple Lesson today, don't think 2,147,483,647 is be enough and will not be hit.

    1. Re:Like the time with Slashdot stopped working by thegreatbob · · Score: 1

      Pretty sure you're thinking of this, but I wouldn't be surprised if it was something else. https://slashdot.org/story/06/...

      --
      There is no XUL, only WebExtensions...
  14. I can guess exactly what happened. by tylersoze · · Score: 1

    Someone used an int type somewhere in the code whose size is architecture specific. There's no reason a 32-bit iPad couldn't support 64-bit numbers.

  15. I'm confused! by Black.Shuck · · Score: 1

    I typed "2,147,483,647 + 1" into my old iPad calculator app and it said 2,147,483,648!

    I'm not a programmer, but maybe the answer is to just rewrite your website to use the iPad calculator?!

    I hear Apple have sold like, 1 billion of them or something, so you'll be able to use it a billion times two billion at least!

  16. My New Data Base by AlanObject · · Score: 1

    I am currently working on a web site backed by a MySQL data base. The main table has a must-be-unique ID field which is typed as a Java Long object. So my data base is going to break when it hits 2^63 records. Should I be worried?

    1. Re:My New Data Base by wonkey_monkey · · Score: 1

      I don't know, are you likely to end up with 9,223,372,036,854,775,807 records? As a number, that's probably not too far (relatively speaking) from the number of grains of sand on the Earth.

      You could write one record a second for 200 billion years and still not run into a problem.

      --
      systemd is Roko's Basilisk.
    2. Re:My New Data Base by AlanObject · · Score: 2

      You could write one record a second for 200 billion years and still not run into a problem.

      But if I manage to sign up 1 billion users and each user produces 1 record per second on average then I break my data base in a mere 200 years. In the age of IoT including body-embedded devices and 99% global connectivity such a data base is actually a possibility. I am sure Facebook, Google, and NSA have all had to ponder this limit already even though they might not have hit it this year or next.

  17. STOP THAT! by Anonymous Coward · · Score: 1

    You with your reasoned discussion. Knock that off!

  18. Wait, why is this Apple's fault? by wonkey_monkey · · Score: 1

    Apple's decision to go all in on 64bit-capable devices, OS and apps has caused some trouble for Chess.com, a popular online website where people go to play chess.

    Apple's "64-bit only" decision has nothing to do with this.

    --
    systemd is Roko's Basilisk.
    1. Re:Wait, why is this Apple's fault? by UnknowingFool · · Score: 1

      Indeed if anything using a newer Apple device negates the problem as they use 64-bit processors. The same with a PC with a processor newer than an Intel Core 2 (2006). The OS however is another issue as Windows still has 32-bit variants today.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    2. Re:Wait, why is this Apple's fault? by wonkey_monkey · · Score: 1

      Indeed if anything using a newer Apple device negates the problem as they use 64-bit processors.

      That won't help when the program itself was compiled to use a 32-bit integer.

      --
      systemd is Roko's Basilisk.
    3. Re:Wait, why is this Apple's fault? by david_thornley · · Score: 1

      A 64-bit system won't help with a variable declared int32_t. It is likely to with a variable declared long.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    4. Re:Wait, why is this Apple's fault? by wonkey_monkey · · Score: 1

      A long is only at least 32-bits. It might be 64 bits, but it might not be. Whatever it is will be decided at compile time, so I still don't think the OS will make any difference.

      --
      systemd is Roko's Basilisk.
    5. Re:Wait, why is this Apple's fault? by david_thornley · · Score: 1

      No, but the compiler would make a difference. If you were compiling twice, once for 32 bits and once for 64, the meaning of "long" could change.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    6. Re:Wait, why is this Apple's fault? by UnknowingFool · · Score: 1

      Not in the iOS/OS X world (Unix/Linux as well). Long is always 64-bit for a 64 bit processor. Unix uses the LP64 approach. Windows is a different story.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
  19. don't use 32 bit id's by Anonymous Coward · · Score: 0

    Don't use 32 bit id's. Cuz 32 bit id's are bad, m'kay. And using them is bad. So don't be bad, by using 32 bit id's. m'kay.

  20. Ridiculous article by gnasher719 · · Score: 4, Informative

    So according to this article, Apple going to 64 bit is making this site fail. What a ridiculous nonsense.

    1. Apple hasn't changed everything to 64 bit yet. iOS 11 will only run on 64 bit systems and won't run on any device that is 32 bit only, but this hasn't happened yet.

    2. 64 bit applications work just fine. Apparently the application uses 32 bit in the 32 bit version and 64 bit in the 64 bit version, the 32 bit version overflows and the 64 bit version doesn't. So if Apple had killed off all 32 bit versions, which they didn't, everything would have actually been fine.

    3. The problem is not 32 bit vs 64 bit application, it is using a 32 bit counter for a quantity that exceeds 32 bits. But 32 bit applications can easily use 64 bit counters. They are just a tiny tiny bit slower, but work just fine.

    So the problem has nothing to do with Apple, it is using a 32 bit variable for a 64 bit quantity, in other words, an elementary programming error by the application developer.

    1. Re:Ridiculous article by Anonymous Coward · · Score: 0

      So what you mean it was Putin's fault right?

    2. Re:Ridiculous article by Anonymous Coward · · Score: 0

      THIS!!

      THANK YOU, sir! This is the worst article I've ever read on Slashdot, and you guys are outdoing yourselves almost DAILY these days.

      Why the hell did I have to scroll so much to find ONE comment that actually talks about how ridiculous the original article is?

  21. Who'd have thunk it? by niks42 · · Score: 1

    If only there were some way of coping with numbers greater than 32 bits long on a 32 bit engine.

  22. Chess.com by TheOuterLinux · · Score: 0

    This website started in 2005, so unless they saw Nokia brick phones as the way of the future, I really doubt they thought they'd get anywhere close to that many games. Matter of fact, you can blame all (32 and 64) smart phones for this because no one ever seems to close out of their apps. The popular consensus is that most of chess playing traffic comes from old-school Linux users anyway. They could just have games close and delete automatically after a period of time. And, two billion people are never going to be on Chess.com at the same time. But let's say they are, then just use multiple servers. Don't blame the bits for this because the main audience is upgrading anytime soon.

    1. Re:Chess.com by BronsCon · · Score: 4, Insightful

      This website started in 2005, so unless they saw Nokia brick phones as the way of the future, I really doubt they thought they'd get anywhere close to that many games.

      You mean to say they expected to fail before 2 billion games had been played?

      Matter of fact, you can blame all (32 and 64) smart phones for this because no one ever seems to close out of their apps.

      Why? Does the app continuously play games by itself if you leave it open, thereby artificially inflating the number of games played? No, I don't think it does. And we're talking about the number of games played, ever, not the number of games currently being played, or the number of app instances currently open. Whether people close out their apps or not has absolutely nothing to do with this.

      The popular consensus is that most of chess playing traffic comes from old-school Linux users anyway.

      Right. So are you saying that their games don't count toward the total number of games played? Because that's what got pushed over 2 billion.

      They could just have games close and delete automatically after a period of time.

      They could, sure. But, unless they want to deal with data integrity issues, the IDs would continue growing, and it's the ID being too high that is causing the problem. Well, I misspoke there, it's too small of an INT type being used that caused the problem, but that INT is storing the game ID, so it was the ID being too high that revealed the problem.

      And, two billion people are never going to be on Chess.com at the same time.

      Of course not, but two billion games will eventually have been played, as evident by the fact that this has happened.

      But let's say they are, then just use multiple servers.

      And the same number of games would have been played, still.

      Don't blame the bits for this because the main audience is upgrading anytime soon.

      I don't think anybody (except the developer) did this, actually. The fault lies squarely with the developer who used an architecture-dependent INT type rather than forcing a 64-bit INT.

      Just keep showing me how much you don't know about things, Hayden. Oh, and good luck in August; let me know if you need a ride.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    2. Re:Chess.com by Paradise+Pete · · Score: 1

      They could just have games close and delete automatically after a period of time.

      I suppose they could, but all played games are preserved in their entirety. Not doing so would be considered a much bigger error in judgment.

    3. Re: Chess.com by Anonymous Coward · · Score: 0

      It should have been forseeable that their data type needed an adjustment when they passed one billion games. They absolutely should have not predicted two billion when they started, but they should have updated their stuff when they got past one billion.

    4. Re:Chess.com by edtice1559 · · Score: 1

      Who says they used an architecture dependent int type. They very well may have declared an int64 and then, when they ported to 64-bit, changed it to int128 but never merged the change back to the 32-bit branch. Not everybody has one branch that builds for 32 and 64-bit. Often the 64-bit transition is considered "one way" and the 32-bit branch isn't maintained.

    5. Re:Chess.com by BronsCon · · Score: 1

      Who says they used an architecture dependent int type. They very well may have declared an int64 and then, when they ported to 64-bit, changed it to int128 but never merged the change back to the 32-bit branch.

      Just saying that it seems that's what they did; and the numbers at play here overflow a signed int32, not a signed int64, so you're wrong either way.

      Not everybody has one branch that builds for 32 and 64-bit. Often the 64-bit transition is considered "one way" and the 32-bit branch isn't maintained.

      The only valid reason to do that is if you're relying on an external, binary-only library that is no longer seeing updates from its vendor. I would have said the use of assembler might be a valid reason, but I also recently learned that (at least a handful of) modern C compilers will also compile assembler and can even replace 64-bit instructions with 32-bit routines on the fly, so you can even compile 64-bit assembler for a 32-bit platform now.

      Might not run as fast, since you're expanding single instructions into entire routines, but it shouldn't be any slower than native 32-bit assembler, either, given that you'd have had to write similar routines in the first place. If anything, it should be a smidge faster what what you'd have written yourself, given that the compiler author would likely have optimized the routines used, as compilers primarily compete on performance.

      But, all of that is irrelevant when we're talking about an iOS app, where Apple takes an intermediate representation of your app and compiles it for both 32-bit and 64-bit architectures on their end; and they won't accept apps that don't compile correctly, for hopefully obvious reasons. If you don't provide bitcode (either because you're using some library for which bitcode is still not available, or for whatever other reason), Apple still requires a fat binary for anything targeting iOS 5.1.1 or newer; anything older than that is 32-bit only anyway.

      It's basically dictated by Apple that you use a single branch for 32- and 64-bit, so it's not just a safe assumption, but an absolute truth, that the app in question was developed that way.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
  23. long considered harmful by KiloByte · · Score: 1

    There's almost no reason to use "long". The only non-bogus things I can think of from the top of my head are memcpy implementation, bitwise operations and similar things on a block of memory when you want to handle a word at a time -- where doing it byte-by-byte would work just as well, merely slower.

    Either your program needs to handle values >= 2^31/2^32, or it doesn't. In the first case, you use [u]int64_t, in the latter it should be int. Anything else introduces a pointless portability problem: int works as fast if not faster on 64-bit than long, too (at the very least by taking fewer cache lines when stored in memory).

    As for values that deal with structure sizes, there's [s]size_t/[u]intptr_t.

    The only nasty thing is printf() -- when using arch-independent types, you need that ugly %" PRId64 " stuff. It even breaks in C++ where some bright person had the idea to break compat and require a space after the " -- and your C code may be included into C++ when you don't expect.

    --
    The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    1. Re: long considered harmful by Entrope · · Score: 1

      The C standard does not require that [u]int64_t, or any of the other exactly sized types, even exist. So there's one good reason to use int or long.

    2. Re: long considered harmful by KiloByte · · Score: 1

      It does (C11 7.20.1.1.3) if the implementation supports any 32/64 bit integer types. I can't think of any incoming architecture in foreseable future lacking those. Even if not atomic, the compiler will emulate them. Otherwise, the fraction of our available corpus of software that will work on such an architecture would be uselessly small.

      And even there, [u]int_least64_t are required, even in freestanding environment.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    3. Re: long considered harmful by phantomfive · · Score: 1
      --
      "First they came for the slanderers and i said nothing."
    4. Re: long considered harmful by Entrope · · Score: 1

      That's POSIX, not C, and even there it does not guarantee [u]int64_t exists. As I said, C does not require any exactly sized types. It only mandates the intleast_t and intfast_t types for certain N, not including 64.

    5. Re: long considered harmful by D.McG. · · Score: 1

      Not arguing about the C standard. But if one were to use int or long in production code at my company (rather than stdint.h types) they'd be taken out back and shiv'd in the leg; virtually speaking. We build for 5 platforms with different compilers. It's a must for portability.

    6. Re: long considered harmful by Entrope · · Score: 1

      Cool story, bro. Have you submitted it to thedailywtf?

  24. UInt by Anonymous Coward · · Score: 0

    If they had just used Uint, they could've "not forseen" this eventuality twice as long...

  25. Lol by Anonymous Coward · · Score: 0

    Everyone complained at Microsoft because their x64 compiler has 32-bit longs.

  26. Math, Ugh! by sqorbit · · Score: 2

    This is what happens when a bunch of smart chess players pretend to be mathematicians and programmers

    --
    Sent from my TARDIS
    1. Re:Math, Ugh! by Cesare+Ferrari · · Score: 1

      Nope, just looks like a bug to me. They may even have a typedef/using, it could be a one liner to fix.

  27. PLEASE mod parent up by bagofbeans · · Score: 1

    A succint summary of issue and resolution. I'd hire you.

    1. Re:PLEASE mod parent up by Darinbob · · Score: 1

      If someone did not figure this out while still reading the summary, then I hope they're not a professional programmer.

    2. Re:PLEASE mod parent up by bagofbeans · · Score: 1

      Good communication skills aren't as widespread amongst technical folk as I'd expect... hopefully my exposure is below-median.

      OTOH, half of all software engineers are above average :)

    3. Re: PLEASE mod parent up by Anonymous Coward · · Score: 0

      No, half of all software engineers are above median.

      But I do now know of one that is below average.

    4. Re: PLEASE mod parent up by driblio · · Score: 1

      The median is an average. Were you thinking he was thinking of the mean? Ambiguous declarations cause all sorts of unexpected problems...

    5. Re: PLEASE mod parent up by bagofbeans · · Score: 1

      Whaddabout your unambiguous declaration that I'm male?

      Actually, for a random sample distribution, mode would be the average at the centre of the ordered sample distribution.

  28. Missed Opportunity to Highlight Success by Roger+W+Moore · · Score: 4, Interesting

    He not only lacks technical skills he clearly not even competent as a CEO because he missed the golden opportunity to highlight the success of chess.com: "We did not anticipate the huge popularity of chess.com which caused us to exceed two billion chess games which were more games than some of the code could handle. We apologise for the oversight and will be issuing a patch which will let us grow to 2^63, or over 9 quintillion games.".

    Failing because you did not anticipate being a huge success makes you look a lot better than just failing because you think it is impossible to foresee overflowing an integer variable.

    1. Re:Missed Opportunity to Highlight Success by Anonymous Coward · · Score: 0

      Slashdot 2050 "Chess.com Has Stopped Working On 64bit iEyes After the Site Hit 2^63 Game Sessions"

    2. Re: Missed Opportunity to Highlight Success by Anonymous Coward · · Score: 0

      Chess.com -- played by level 1 AGIs across the galaxy!

  29. Apple's Fault? by Ronin+Developer · · Score: 1

    How, exactly, is this Apple's fault? This is a developer programming error based on a lack of understanding how to represent large numbers on systems with limited WORD sizes. Even on the ancient 6502 or Z80 (8 bit processors), we knew how to write code that could handle numbers that far exceed 2^31. And, before they start talking about performance, I need to ask, how many frames per second do you need to render a chess game?

    The developers need to place the blame with themselves where it belongs.

  30. guarantee by 97cobra · · Score: 0

    I guarantee the developers at chess.com have been warning management of this could happen for awhile and have been told "but does it work today?, if so we don't need to fix it"

  31. Does not compute by Anonymous Coward · · Score: 0

    If ONLY there were some way to handle numbers larger than 32 bits on a 32 bit cpu. If only.

  32. The world started in the late 70's. by Anonymous Coward · · Score: 0

    The world started in the late 70's. The 60's were just a figment of my imagination. If you enjoyed them, "you're welcome".

  33. We didn't know it was going to be popular by Anonymous Coward · · Score: 0

    We were just pessimistic and figured that a handful of people would play the game...boy were we wrong, and then wrong again.

  34. Easy fix... by Anonymous Coward · · Score: 0

    Set the db ibdex to -(2^31+1).

    I've been there...done that...several times actually.

    N.B. I'm assuming devs are lazy here and type int as opposed to uint on the app side of things too. Probably a safe enough bet.

  35. Solution by Anonymous Coward · · Score: 0

    Split the games into years or chapters so no one chapter comes close to even a 28 bit limit.

  36. why blame apple slashdot? by Anonymous Coward · · Score: 0

    I don't see anything how the change to go all out for 64 bit arc by apple impacted this in any way.Clearly the devs are at fault here

  37. How is this related to Apple again? by ScienceofSpock · · Score: 1

    The article mentions that on older 32bit iOS devices, games don't run because they can't count that high. Understandable. One would presume that this is also the case on *any* 32bit system, not just iOS.

    And what's with the lede?

    Apple's decision to go all in on 64bit-capable devices, OS and apps has caused some trouble for Chess.com

    What?!? Moving to 64bit means newer devices *won't* have that problem on chess.com or any other site or app that uses very large integers, so I fail to see how this is Apple's doing, or is even related to Apple at all (aside from the problem first being discovered on an old iPad). Just another way to get Apple into the headlines?