Skip to content

Segfault when lots of blocked MVar messages

I reduced the original problem I started with in #4835 (closed) to the following example, which spans 3 files. There is still further scope for reducing the test case - I have stopped now it's standalone without any data file or package dependencies. I have reproduced this bug on GHC 7.0.2-rc1.

The program does has some parallelism, and due to a bug in the parallel-io library (since fixed) it causes lots of MVar blocked messages. This program sometimes runs to completion, sometimes gives a blocked MVar, and sometimes segfaults. I see the segfault > 50% of the time.

The program is compiled and run with:

ghc --make Main.hs -threaded && Main.exe

Line 82 of Main.hs does getDirectoryContents "C:/Windows". It seems to crash if I put file or directory operations here, but not if I put sleep or pure computation there. This line can be changed to any reasonably sized directory to get the same effects - there is nothing specific to that folder.

Trac metadata
Trac field Value
Version 7.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information