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.

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

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

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

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

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