Discussion:
[jruby-user] SecureRandom hangs jruby 1.7.12
snacktime
2014-06-19 00:03:23 UTC
Permalink
So I use Sinatra which uses the securerandom gem. Been using it under
vmware/ubuntu 12 for a while and went to run my app on Digitalocean, and
sinatra wouldn't start.

doing a require sinatra would hang irb had to CTRL-Z to get out.

Tracked it down to the call to SecureRandom.hex().

I'm guessing this is some bad interaction when running under KVM possibly?
That's what digitalocean uses. Been running the same app with same bundled
gems under vmware and it works fine. Only other difference is that I use
ubuntu 12 at home and on digitalocean I used 14.

Chris
snacktime
2014-06-24 22:48:06 UTC
Permalink
This is a big enough issue now that bundle install hangs completely on KVM
guests with some gems. I didn't bother to track down which ones were doing
it this time, as it would just be a never ending battle that I don't want
to fight.

The workaround is to comment out this entry in java.security:

securerandom.source=file:/dev/urandom
Post by snacktime
So I use Sinatra which uses the securerandom gem. Been using it under
vmware/ubuntu 12 for a while and went to run my app on Digitalocean, and
sinatra wouldn't start.
doing a require sinatra would hang irb had to CTRL-Z to get out.
Tracked it down to the call to SecureRandom.hex().
I'm guessing this is some bad interaction when running under KVM
possibly? That's what digitalocean uses. Been running the same app with
same bundled gems under vmware and it works fine. Only other difference is
that I use ubuntu 12 at home and on digitalocean I used 14.
Chris
Loading...