‹ BackHN Continuity

Thread

AMD's random number generator can't generate a 0?

288 points · 220 comments · BruceEel

  1. jstanley · · focus · HN ↗
    This is not the first RNG bug on Zen 2, I recall after I first got mine that some application or other would quit immediately at startup because rdrand always returned -1, i.e. all 1s. It was fixed with a microcode update.

    Do we now learn that they fixed "always generate all 1s" with "never generate all 0s"??

    EDIT: I've been unable to reproduce the problem on my CPU, FWIW. It's a Ryzen 5 3600.

    EDIT2: OK, update, I can reproduce it with rdrand16, rdrand32 is fine but rdrand16 can never generate all 0s. So my CPU does have this problem!

    1. yk · · focus · HN ↗

          return 4 # Determined by fair dice roll.
      1. Gander5739 · · focus · HN ↗
        <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;221&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;221&#x2F; for those not in the know
        1. Betelbuddy · · focus · HN ↗
          <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;bwFWMqQ.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;bwFWMqQ.png
          1. [deleted] · · focus · HN ↗

            [deleted]

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.