Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace call to crypto:rand_uniform with random:uniform.

We have observed a crash in crypto:rand_uniform on Solaris.  Post 0.14.2
we have changed the build process for building the embedded erlang
packaged in the riak release and how openssl is linked.  Additionally,
the code for listing keys has been reworked on the 1.0 branch and no
longer requires a seed for the ebloom call.

Lowest risk option is to replace the calls to crypto:rand_uniform
with random:uniform instead.

Fixes: zd://865
  • Loading branch information...
commit 0caab74a6baa8cb907356259f509edfcd086db4f 1 parent 4bf9ec5
@jonmeredith jonmeredith authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/riak_kv_keylister.erl
View
3  src/riak_kv_keylister.erl
@@ -50,7 +50,8 @@ start_link(ReqId, Caller, Bucket) ->
init([ReqId, Caller, Inputs]) ->
erlang:monitor(process, Caller),
- {ok, Bloom} = ebloom:new(10000000, 0.0001, crypto:rand_uniform(1, 5000)),
+ random:seed(now()),
+ {ok, Bloom} = ebloom:new(10000000, 0.0001, random:uniform(5000)),
{Bucket, Filter} = build_filter(Inputs),
{ok, waiting, #state{reqid=ReqId, caller=Caller, bloom=Bloom, bucket=Bucket,
filter=Filter}}.
Please sign in to comment.
Something went wrong with that request. Please try again.