Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8066397

Remove network-related seed initialization code in ThreadLocal/SplittableRandom

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b42
    • Verification:
      Not verified

      Backports

        Description

        ThreadLocalRandom (and SplittableRandom) by default computes an initial seed to the PRNG using the mac address obtained via NetworkInterface.getNetworkInterfaces(). This unfortunately can result in high very initialization costs on certain platforms (Windows) which in turn can propagate to other classes such as ConcurrentSkipList*.

        The fallback mode if a mac address cannot be obtained is to compute an initial seed from the current system time, which is no worse than JDK 7.

        The network code should be removed from both classes. This is compliant with the specification which, by default, does not specify the seed strength. Developers that require a cryptographically random seed should set the system property "java.util.secureRandomSeed" to true.

        However, we should revisit this code when there is an enhancement to provide an efficient "system" seed of a certain cryptographic strength that is optimal for the platform and has low initlization costs so it may be used by TLR/SR.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                psandoz Paul Sandoz
                Reporter:
                psandoz Paul Sandoz
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: