patch applied (ghc-6.12/ghc): Fix a bug that can lead to
noDuplicate# not working sometimes.
Ian Lynagh
igloo at earth.li
Wed Feb 17 18:04:23 EST 2010
Tue Feb 16 04:34:11 PST 2010 Simon Marlow <marlowsd at gmail.com>
* Fix a bug that can lead to noDuplicate# not working sometimes.
The symptom is that under some rare conditions when running in
parallel, an unsafePerformIO or unsafeInterleaveIO computation might
be duplicated, so e.g. lazy I/O might give the wrong answer (the
stream might appear to have duplicate parts or parts missing).
I have a program that demonstrates it -N3 or more, some lazy I/O, and
a lot of shared mutable state. See the comment with stg_noDuplicatezh
in PrimOps.cmm that explains the problem and the fix. This took me
about a day to find :-(
M ./rts/PrimOps.cmm -8 +71
View patch online:
http://darcs.haskell.org/ghc-6.12/ghc/_darcs/patches/20100216123411-12142-ef26bfaf1f8faf38c895eda0db121bd91c7a773a.gz
More information about the Cvs-ghc
mailing list