Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
IOS Apple Games IT

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

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.
This discussion has been archived. No new comments can be posted.

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

Comments Filter:
  • by Eunuchswear ( 210685 ) on Tuesday June 13, 2017 @09:42AM (#54609381) Journal

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

    Only if you're an idiot.

    • by xxxJonBoyxxx ( 565205 ) on Tuesday June 13, 2017 @09:44AM (#54609401)
      The website has a "CEO", so yes, I can confirm.
      • Every company needs to have its Critical Error Officer.
        • Re: (Score:2, Funny)

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

      • by Roger W Moore ( 538166 ) on Tuesday June 13, 2017 @11:35AM (#54610411) Journal
        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.
    • by Dunbal ( 464142 ) *
      WORD should be enough for anybody! Pah, who needs DWORD...
      • by Nutria ( 679911 )

        LOL

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

    • 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?
      • by D.McG. ( 3986101 ) on Tuesday June 13, 2017 @09:55AM (#54609505)
        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.
        • 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.

          • by D.McG. ( 3986101 ) on Tuesday June 13, 2017 @10:06AM (#54609587)
            "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.
            • How many fewer ad views would the story have gotten without that bit of technical nonsense? Why does /. exist?

              • by D.McG. ( 3986101 )
                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.
        • Re: (Score:2, Insightful)

          by Solandri ( 704621 )
          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 t
      • 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

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

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

    • by pz ( 113803 ) on Tuesday June 13, 2017 @09:50AM (#54609465) Journal

      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.

      • 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.
        • by Nutria ( 679911 )

          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!!!!"

          • 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.
      • by AmiMoJo ( 196126 )

        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.

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

      • 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 exam

        • Re: (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 inc

      • 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 t
      • by D.McG. ( 3986101 )
        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.
      • 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).

      • by sootman ( 158191 )

        $ 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

      • Hmmm, not so hard to imagine, 20 million people playing 100 games each.
    • 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.

       

    • by NoNonAlphaCharsHere ( 2201864 ) on Tuesday June 13, 2017 @10:09AM (#54609617)
      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...
    • Araine 5 $7 billion arithmetic overflow...

    • 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?
      • 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/... [slashdot.org]
        • 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.

          • Ouch... had never heard about the previous issue (or perhaps I did, maybe 10 years ago)... makes sense now.
            • 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.

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

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

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

  • All of that for -1 (Score:5, Informative)

    by mi ( 197448 ) <slashdot-2017q4@virtual-estates.net> on Tuesday June 13, 2017 @09:46AM (#54609417) Homepage Journal

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

    • by Gravis Zero ( 934156 ) on Tuesday June 13, 2017 @10:13AM (#54609659)

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

    • by Tranzistors ( 1180307 ) on Tuesday June 13, 2017 @10:36AM (#54609851)
      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?
      • by AmiMoJo ( 196126 )

        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.

        • by Kjella ( 173770 )

          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.

        • 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/lang

  • Apple's fault? (Score:4, Insightful)

    by Anonymous Coward on Tuesday June 13, 2017 @09:49AM (#54609447)

    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.

    • Re:Apple's fault? (Score:4, Informative)

      by Anubis IV ( 1279820 ) on Tuesday June 13, 2017 @10:05AM (#54609581)

      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.

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

    • Re:Apple's fault? (Score:5, Informative)

      by dreamchaser ( 49529 ) on Tuesday June 13, 2017 @10:09AM (#54609621) Homepage Journal

      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.

  • Russians (Score:5, Funny)

    by 110010001000 ( 697113 ) on Tuesday June 13, 2017 @09:52AM (#54609479) Homepage Journal
    How do you know it isn't the Russians?
    • by GuB-42 ( 2483988 )

      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.

  • by JoeyRox ( 2711699 ) on Tuesday June 13, 2017 @09:54AM (#54609501)
    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...
  • 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:)
  • by barbariccow ( 1476631 ) on Tuesday June 13, 2017 @10:05AM (#54609577)

    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.

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

  • 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!

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

    • 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.
  • Ridiculous article (Score:5, Informative)

    by gnasher719 ( 869701 ) on Tuesday June 13, 2017 @10:43AM (#54609915)
    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.
  • If only there were some way of coping with numbers greater than 32 bits long on a 32 bit engine.
  • by sqorbit ( 3387991 ) on Tuesday June 13, 2017 @10:57AM (#54610057)
    This is what happens when a bunch of smart chess players pretend to be mathematicians and programmers
  • 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.

Help fight continental drift.

Working...