Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  99 Posts | 0 Stories | 212 Comments | 236 Trackbacks

News

Archives

Post Categories

Blogroll

A week ago, my colleague encountered a weird bug where a SOAP call via AXIS stopped responding and it kept hanging. Interestingly, this problem never happened on the other box or in windows machine. We dumped the stacktrace and found that SecureRandom implementation of JSSE is the part of the problem. A quick check via google yields something about /dev/random. It seems that Linux Kernel 2.4.X seems to have a problem with /dev/random. After it dumped out a couple hundreds bits, it will just block the stream as it seemed to wait for more entropy. However, it never gave any more bytes from the stream at all. To fix this problem, we had to set system property called “java.security.egd” to use /dev/urandom instead to solve this problem.

The other ways to solve this problem are

1. Use J2SE 1.5 as its JSSE uses /dev/urandom instead.

2. Upgrade kernel to 2.6. This problem seems to be fixed in 2.6 kernel.

posted on Sunday, March 12, 2006 7:38 PM