Segfault with makeStableName
makeStableName on the same object many times causes a segfault. The following triggers this behaviour on both OSX and Linux-x86_64, provided it is compiled (it doesn't seem to occur if the call to
makeStableName is interpreted).
module Main where import Control.Monad import System.Mem.StableName main :: IO () main = replicateM_ 100000 (makeStableName foo) foo :: Int foo = 1
It seems to happen largely at random. The 100000 calls to
makeStableName in the above example essentially guarantee its occurrence, but I have observed it happen with far fewer.
The reason this bug was discovered is it is causing frequent failures in Accelerate on 7.8.2. See https://github.com/AccelerateHS/accelerate/issues/162. In that case it seems to be causing more
strange closure type errors than segfaults, but I assume it is the same root cause.