Code for os::random() assumes long is 32 bits

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 10
    • Affects Version/s: 10
    • Component/s: hotspot
    • None
    • b21

      The function os::random() uses long but the calculations are for 32 bit random number. The function has been in the code since the beginning.

      os::random() also has a _rand_seed which is modified without thread safety. It doesn't hurt anything since most uses for Symbol are called under the SymbolTable_lock.

      If more multithreaded uses are added, this could hurt the randomness of the value returned.

            Assignee:
            Coleen Phillimore
            Reporter:
            Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: