June 14, 2009

2,147,483,647 Tweets Ought To Be Enough For Anybody

I've been trying out various Twitter clients on the Mac and had almost settled on Pwitter as a free, light, and most Mac-like choice. But then all of a sudden it started acting up, repeatly showing tweets, losing track of read status, etc. Meanwhile the main website worked fine, so I punted Ptwitter to the curb and thought nothing more of it.

Turned out that I had been hit by the Twitpocalypse, the epochal event where the unique serial number that identifies each individual tweet exceeded the number that can be held in a conventional 32-bit signed-integer variable. The bugs I saw in Pwitter were the typical signs of an index overflow error, as the Tweet-IDs overflowed the variable, wrapped around, and confused the program.

Looks like the author has already fixed the bug, recasting the Tweet-ID variables to be Unsigned Longs instead of the standard Ints. That should hold us over for a while. But he better be ready to update again when we hit 18,446,744,073,709,551,615 tweets and blows up his weak-sauce Long Int.

Posted by mikewang on 09:54 AM