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.

36 of 271 comments (clear)

  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 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.
    3. 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.
    4. Re:nearly impossible to anticipate? by K.+S.+Kyosuke · · Score: 2

      Every company needs to have its Critical Error Officer.

      --
      Ezekiel 23:20
    5. 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...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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