by stephenheron on 12/2/14, 9:52 PM with 226 comments
by gavinpc on 12/3/14, 1:00 AM
I made a bug once, and I need to tell you about it. So, in 2001, I wrote a
reference library for JSON, in Java, and in it, I had this line
private int index
that created a variable called "index" which counted the number of characters in
the JSON text that we were parsing, and it was used to produce an error message.
Last year, I got a bug report from somebody. It turns out that they had a JSON
text which was several gigabytes in size, and they had a syntax error past two
gigabytes, and my JSON library did not properly report where the error was — it
was off by two gigabytes, which, that's kind of a big error, isn't it? And the
reason was, I used an int.
Now, I can justify my choice in doing that. At the time that I did it, two
gigabytes was a really big disk drive, and my use of JSON still is very small
messages. My JSON messages are rarely bigger than a couple of K. And — a
couple gigs, yeah that's about a thousand times bigger than I need, I should be
all right. No, turns out it wasn't enough.
You might think well, one bug in 12 years you're doing pretty good. And I'm
saying no, that's not good enough. I want my programs to be perfect. I don't
want anything to go wrong. And in this case it went wrong simply because *Java
gave me a choice that I didn't need, and I made the wrong choice*.
[0] https://www.youtube.com/watch?v=bo36MrBfTk4&t=38mEDIT: is there a reference for formatting comments? I've never been able to find one.
by ChuckMcM on 12/2/14, 11:36 PM
Put in perspective that is probably in excess the number of times the most favored "I Love Lucy" show has been seen. Or put another way, you've got a music video with the same eyeball impact as the highest rated television show ever.
That says to me that either advertising on Youtube is a bargain or advertising on TV is way over priced :-)
[1] http://tvbythenumbers.zap2it.com/2014/02/10/the-walking-dead...
by xanderjanz on 12/2/14, 10:48 PM
EDIT: Which is the solution they apparently implemented, converting signed to unsigned at some higher layer.
by jawedkarim on 12/3/14, 9:29 AM
by SapphireSun on 12/2/14, 11:46 PM
https://www.youtube.com/watch?v=9bZkp7q19f0
EDIT: I just realized that YouTube also posted a comment to that effect just below the video. :P
by leephillips on 12/3/14, 12:17 AM
by Aldo_MX on 12/2/14, 10:56 PM
by rodgort on 12/3/14, 2:13 AM
by Animats on 12/2/14, 11:34 PM
by jmount on 12/2/14, 10:56 PM
by rkachowski on 12/2/14, 11:15 PM
But it's real?! It seems incredibly absurd that it could actually overflow, how are signed values useful for a count of views? How are you going to have negative views?
by antimora on 12/2/14, 11:02 PM
Direct link to the video: https://www.youtube.com/watch?v=9bZkp7q19f0
by DigitalSea on 12/2/14, 10:13 PM
by ecesena on 12/3/14, 2:15 AM
by thibauts on 12/3/14, 6:55 AM
by adad95 on 12/3/14, 2:39 AM
by alejandc on 12/2/14, 10:58 PM
by jfmercer on 12/3/14, 1:20 AM
by tn13 on 12/3/14, 2:33 AM
by IgorPartola on 12/2/14, 10:56 PM
I remember when Twitter had rolled over their tweet ID's because they were using an int type that was too short. Should have gone with variable length strings to avoid that problem.
by dogma1138 on 12/2/14, 11:23 PM