patch applied (bytestring): Fix elemIndices and split
Duncan Coutts
duncan.coutts at worc.ox.ac.uk
Tue Sep 15 19:42:27 EDT 2009
Sat Sep 12 13:39:50 PDT 2009 Duncan Coutts <duncan at haskell.org>
* Fix elemIndices and split
Ignore-this: 69ae945462b5638c99cc1824ed329e90
They were using inlinePerformIO to lazily delay IO actions within the
scope of a withForeignPtr. Thus the ptr was still in use after the
ForeignPtr went out of scope. This lead to dangling pointers, incorrect
results and segfaults. Nasty. See ghc tickets #3486 and #3487.
Audited the rest of the code base for the same anit-pattern.
Thanks to nwn and people on the haskell-jp mailing list for reporting
the bug with nice test cases and also to Ian, Bertram and Don for
diagnosing the source of the problem.
M ./Data/ByteString.hs -13 +14
View patch online:
http://darcs.haskell.org/bytestring/_darcs/patches/20090912203950-adfee-11f6e1b7cf669beb33b01cdde1dce775570fd4a6.gz
More information about the Cvs-libraries
mailing list