Currently, we open a file descriptor to /dev/urandom, which can sometimes fail to open. Using arc4random_buf instead should get around this issue.
Created attachment 259034 [details] Patch
Comment on attachment 259034 [details] Patch r=me
Comment on attachment 259034 [details] Patch Clearing flags on attachment: 259034 Committed r188489: <http://trac.webkit.org/changeset/188489>
All reviewed patches have been landed. Closing bug.
This is a pretty surprising change. How did you come to this conclusion, and what other options have you considered? Is there even a bug anywhere tracking the symptom? More specifically, how did you decide to not use CCRandomCopyBytes, and what can make opening /dev/urandom fail?
Whoops, I forgot to attach the associated radar (rdar://problem/21939126) to this bug. Alexey, I chose to use arc4random_buf because we just needed something that didn't open /dev/urandom. Although, looking into arc4random_buf further it appears that it opens /dev/urandom anyway.
Thank you for the link! > Although, looking into arc4random_buf further it appears that it opens /dev/urandom anyway. Should the patch be rolled out then?
> Should the patch be rolled out then? I'm not sure it's worth it. I am finishing up a patch that uses CCRandomCopyBytes instead. I'll CC you on that.