Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-6441

Add rule for blocking in SecureRandom

XMLWordPrintable

      SecureRandom has a blocking and a non-blocking mode.
      It should be possible to create a JFR rule detecting if the application is blocked for too long when calling SecureRandom

      The rule would use the Method Profiling Sample Native event and detect if events with a stacktrace similar to the below appear in the recording during an extended timeframe:

      int java.io.FileInputStream.readBytes(byte[], int, int)
      int java.io.FileInputStream.read(byte[], int, int)
      int java.io.FilterInputStream.read(byte[], int, int)
      void sun.security.provider.NativePRNG$RandomIO.readFully(InputStream, byte[])
      SecureRandom sun.security.provider.NativePRNG$RandomIO.getMixRandom()
      void sun.security.provider.NativePRNG$RandomIO.implNextBytes(byte[])
      void sun.security.provider.NativePRNG$Blocking.engineNextBytes(byte[])
      void java.security.SecureRandom.nextBytes(byte[])

            Unassigned Unassigned
            klward Klara Ward
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: