[San-diego-pm] another bug in perl: rand/OSX?
cabney at ucsd.edu
Thu Jun 3 12:22:44 CDT 2004
perl -le 'fork or exit print rand; fork or exit print rand; fork or exit
print rand; print rand'
This works the bug.
On Thu, 2004-06-03 at 09:39, Chris Radcliff wrote:
> Is it possible that Randal's example is different from the one Charles
> presented? For instance, Charles doesn't call rand() before forking, so
> delaying srand() until the rand() call in 5.8.4 would mean each child
> called srand() separately.
> Just a thought, based solely on the thread. I don't know a fork() from
> a spoon() otherwise.
> On Jun 3, 2004, at 7:52 AM, C. Abney wrote:
> > It's platform specific, however... I get completely different behavior
> > on Sun/sparc or Linux/P4.
> >> You can illustrate this well known bug with:
> >> perl -le 'print rand; fork or exit print rand; fork or exit print
> >> rand; fork or exit print rand; print rand'
> >> The behavior has nothing to do with OSX. It's completely generic to
> >> Perl.
> >> I just verified that on my OpenBSD box.
Polymorphism Research Laboratory, 0603
UCSD School of Medicine
9500 Gilman Dr.
La Jolla, CA 92093-0603
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.pm.org/pipermail/san-diego-pm/attachments/20040603/5e7e136b/attachment.bin
More information about the San-Diego-pm