From: Shyouhei Urabe Date: 2011-05-25T14:13:44+09:00 Subject: [ruby-core:36450] [Ruby 1.8 - Bug #4338][Closed] random number generator not reseeded after fork in 1.8 Issue #4338 has been updated by Shyouhei Urabe. Status changed from Assigned to Closed I think I have fixed this. ---------------------------------------- Bug #4338: random number generator not reseeded after fork in 1.8 http://redmine.ruby-lang.org/issues/4338 Author: Eric Wong Status: Closed Priority: Normal Assignee: Shyouhei Urabe Category: core Target version: Ruby 1.8.7 ruby -v: ruby 1.8.7 (2010-12-23 patchlevel 330) [x86_64-linux] =begin rand should return different values in forked processes like in 1.9.2. This may have security implications for some programs. Remembering to call srand after forking will fix the issue, but remembering is hard especially since 1.9.2 makes it easy :) The following example prints out 3 identical lines in 1.8.7: fork { $stdout.syswrite("#{rand}\n") } fork { $stdout.syswrite("#{rand}\n") } $stdout.syswrite("#{rand}\n") Process.waitall =end -- http://redmine.ruby-lang.org