from Hacker News

Gangnam Style breaks YouTube viewer count

by stephenheron on 12/2/14, 9:52 PM with 226 comments

  • by gavinpc on 12/3/14, 1:00 AM

    Can't quite tell if this is a joke, but here's a related "story about a bug" from Doug Crockford [0]:

        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=38m

    EDIT: is there a reference for formatting comments? I've never been able to find one.

  • by ChuckMcM on 12/2/14, 11:36 PM

    The interesting meta-point though is that an audience of 20 million viewers is a big hit [1] so a billion views is 20M people watching it 50 times or, 200M people watching it 5 times. And 2 billion views is double that.

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

    [2] http://en.wikipedia.org/wiki/I_Love_Lucy

  • by xanderjanz on 12/2/14, 10:48 PM

    Should have gone with unsigned ints, YouTube!

    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

    When youtube launched in April, 2005, the initial source code was based on another completely unrelated website that I had worked on before, written in PHP and running on Apache and MySQL. It’s always fascinating how implementations of complex systems evolve.
  • by SapphireSun on 12/2/14, 11:46 PM

    I love that they added an easter egg to the actual video. If you hover over the counter, it briefly shows you the negative overflow value.

    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

    The interesting question to me is why this particular video is so wildly popular. I don't generally go in for music videos, but I find this one fascinating and have watched it a dozen times. I read an article that tried to explain to non-Koreans like me the meaning of it all, and apparently there are several layers of parody and social satire. I think I love it for its combination of attitude, surrealism, bizarre humor, and self-mockery, plus the music that seems to fit magically.
  • by Aldo_MX on 12/2/14, 10:56 PM

    Next milestone: 19th January 2038 03:14:07 GMT
  • by rodgort on 12/3/14, 2:13 AM

    Mea culpa. I can't remember why I didn't fix that when I reloaded the entire schema. At least I widened the video ids.
  • by Animats on 12/2/14, 11:34 PM

    This is a minor problem. In the 1980s, the number of tradable things with ticker symbols in US markets passed 32767, and some new issues had to be delayed until it was fixed.
  • by jmount on 12/2/14, 10:56 PM

    Nifty example. Billionaires, trillion dollar budges, billion-view celebrities, fast CPUs, and large memories: all reasons I am done with 32 bit architectures (old article of mine, but only on large memories http://www.win-vector.com/blog/2012/09/i-am-done-with-32-bit... ).
  • by rkachowski on 12/2/14, 11:15 PM

    I saw this a few days ago, at first I thought it was an easter egg on youtube's part - saying "so many views we overflow!"

    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

    It looks like it also broke the formatting on the number of the viewers: "2151501252". This string does not have thousands separators.

    Direct link to the video: https://www.youtube.com/watch?v=9bZkp7q19f0

  • by DigitalSea on 12/2/14, 10:13 PM

    Wow, this is cool. One video was able to exceed a 32 bit integer thus requiring a change to a 64 bit integer, all caused by one man and one video.
  • by ecesena on 12/3/14, 2:15 AM

    I'd be curious to know how they discovered it. Were they monitoring it? Did someone report it? Did an alarm trigger? ...
  • by thibauts on 12/3/14, 6:55 AM

    Why the hell would you want to store a counter as a signed int in the first place ?
  • by adad95 on 12/3/14, 2:39 AM

    There is Easter Egg in the video counter. Hover with your mouse. https://www.youtube.com/watch?v=9bZkp7q19f0
  • by alejandc on 12/2/14, 10:58 PM

    unbelievable
  • by jfmercer on 12/3/14, 1:20 AM

    I will always upvote anything related to Gangnam Style. Always.
  • by tn13 on 12/3/14, 2:33 AM

    Am I the only one who thinks that Google is posting this bug(!) just to make the Google plus post popular ?
  • by IgorPartola on 12/2/14, 10:56 PM

    uint_32 strikes again! And one day we'll stop using it in favor of int_64, and all unique identifiers will be string, and all will be well.

    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

    Every time i check the most viewed videos on YouTube i get depressed and lose all faith in humanity. Landing on a comet gets you 250K views, anouncing the discovery of the higgs gets you less than 100K, latest twerking video or PewDiePie 2M at least...