2

I am running a java process where we are passing JVM parameter as -Djava.security.egd=file:///dev/urandom

But when i used Java flight recorder, i can see its still using file /dev/random

enter image description here

Can someone please advise if something is wrong with the setup.

Edit:

Checked further, this issue started occuring after adding a call to SecureRandom.getInstanceStrong().nextBytes(bytes);

Lokesh
  • 7,810
  • 6
  • 48
  • 78
  • How do you know what Java class is reading `/dev/random`? – chrylis -cautiouslyoptimistic- Nov 17 '17 at 05:16
  • @chrylis: I did the flight recording using java mission control and have pasted the screenshot which shows that IO operations are happening on on "/dev/random" rather than "/dev/urandom" – Lokesh Nov 17 '17 at 05:20
  • That's not what I asked. You obviously *are* in fact getting access to `/dev/random`, but what class is doing it? – chrylis -cautiouslyoptimistic- Nov 17 '17 at 05:20
  • @chrylis: I dont know which class, is there a way to find it ? But i am connecting to Oracle DB, so most likely its jdbc driver. – Lokesh Nov 17 '17 at 05:23
  • 1
    @chrylis : Its caused by api SecureRandom.getInstanceStrong().nextBytes(bytes);” – Lokesh Nov 17 '17 at 05:47
  • This is an extremely old problem. `/dev/random` is special-cased in the code, try using `/dev/./random` which bypasses the explicit test. I used to have a link to the bug in the Java database but cannot find it right now. If I find it I'll post an answer. – Jim Garrison Nov 17 '17 at 05:49
  • I remembered it backwards in my answer. Then I had a vague recollection of having answered this before, so I searched my old answers and found it. I've deleted my answer and marked this question a duplicate of the other one (but still gave you the upvote) This "feature" bites people occasionally and having a second way to find it in SO is valuable. – Jim Garrison Nov 17 '17 at 06:36

0 Answers0