Live data from Hacker News

Chess.com stopped working on 32bit iPads because 2^31 games have been played

chess.com

251–260 of 338 posts

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#251

Earlier quoted context omitted.

We can help you understand how and why! Computers set limits internally on how big numbers can be when they're keeping track of stuff. Your developers had given each game a number to identify it. So your first game was #1, the 40th game was #40, and so on. The limit for how big the number could be was a bit over 2 billion, and your players have just now played a bit over 2 billion games, and so that id number suddenl…

Yes - I understand HOW it happened, just not sure WHY. Meaning, I'm not sure what the developer was thinking, and at this point, I'm not going to track down exactly who it was and point fingers. I think everyone has learned enough through this highly interesting bug. It certainly was interesting to see the slack room exploding with theories and debugging. A new iOS client has been submitted to Apple (hurry plz!!!), a…

I don't think you do understand, you sound like you're upset that a developer "set" this limit. When in reality it's tied to fundamental programming principles. It wasn't really a conscious decision to say, "I'm only going to account for 2bil games"...

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#252
post #149
post #89

Earlier quoted context omitted.

MySQL's silent data truncation is such a nuisance. It's off by default in 5.7, and can be disabled in earlier versions by adding STRICT_ALL_TABLES/STRICT_TRANS_TABLES to sql_mode [1]. I inherited a system where, among other things, the entire response body from a payment gateway callback is saved into a text field using utf8 character set, despite the fact that most of the supported payment gateways send data in iso-…

> MySQL's silent data truncation is such a nuisance. Yes, yes it is - it burned me so badly (catastrophic, unrecoverable production data loss) in the early days of my career (~15 years ago as a junior level dev in a senior level role) that it has forever colored my opinion of MySQL - I will really never trust it again. Long live PostgreSQL!

Long live reading documentation. Otherwise you risk data loss no matter the DB.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#253
post #80

Earlier quoted context omitted.

Signed overflow is IB, not UB.

Alas, no. Signed overflow is UB and compilers can and will assume that it cannot happen when performing optimizations.

Which is a good thing, assuming you did reasonable testing with ubsan etc. Having to assume things that never happen is a big problem for optimization!

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#254
post #8

Self-confidence as a programmer is when starting a new project, storing the transaction ID as a long rather than an int...

It's the smart thing to do - 4.3 billion is not that much. I had some students that asked me if even a long would be enough to handle exponential growth, after all it's only twice as big. As a thought experiement I asked them to come up with a time to fill a 32 bit int completely. They came up with roughly a year. Then as a margin of error I said, let's assume you have 4.3 billion transactions every second instead. T…

2^64-1 is a lot more than 2 times 2^32-1

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#256

Earlier quoted context omitted.

https://linux.die.net/man/1/gcc -- Search for `-fstrict-overflow`. And note how it says The -fstrict-overflow option is enabled at levels -O2, -O3, -Os. In other words, basically every program that you're using is compiled with that option enabled. (Release builds typically use -O2, sometimes even -O3.)

-fstrict-overflow is the opposite of what the parent comment was asking about. You want -fwrapv or -fno-strict-overflow.

I was answering the "not aware that any compilers were doing this" part, hoping that they would be able to answer their second question using the source I linked.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#257
post #255

What would be the best way to test for this kind of issues in advance. Testing at theoretical limits at all endpoints?

I'm not sure this falls under testing. If you start with an empty database each time you start the test you may never hit this issue.

I think this is more of a capacity planning issue.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#258
post #3

How many other examples like this have occurred throughout computing history?

Microsoft Lync has an as-yet unfixed bug where after 49.7103 days (4294967294 aka 2^32 milliseconds) of system uptime, it locks the Lync status indicator to "away". The status indicator is otherwise unusable thereafter until a full system reboot.

See: https://social.technet.microsoft.com/Forums/en-US/1e76e106-4...

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#259
post #46

Earlier quoted context omitted.

Similar to how much effort goes into dealing with things like dangerous strains of bird flu, only to have people complain about how much money was spent on "nothing" when an outbreak doesn't occur.

This is a whole class of problem - I wonder if there's a name for it. More examples include: talking about welfare being unnecessary because no one is starving. Or people on medications stopping because they feel better (while still on them).

The opposite of that is frustrating too.. I see it a lot in SF. Something like "We spend $100M/year on homelessness and we have 3,500 homeless. Why don't we just give them the money and do away with the social services!" As if the $100M isn't keeping many thousands more from living on the streets..
Post reply on HN