[GHC] #7646: resource busy (file is locked) with multi-threaded file ops

GHC cvs-ghc at haskell.org
Thu Jan 31 22:30:09 CET 2013

#7646: resource busy (file is locked) with multi-threaded file ops
Reporter:  StefanWehr                   |          Owner:                  
    Type:  bug                          |         Status:  new             
Priority:  normal                       |      Component:  Runtime System  
 Version:  7.6.1                        |       Keywords:                  
      Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
 Failure:  Incorrect result at runtime  |      Blockedby:                  
Blocking:                               |        Related:                  
 The sample program attached creates 10 worker threads, each of which takes
 a different file name. Each worker thread then writes the file, reads the
 file, writes the file and so on. File operations use *strict IO*.

 When compiled without `-threaded` everything is ok, that is, the program
 goes on forever without any error messages.

 But with `-threaded`, the program quickly fails with `ERROR in worker 4:
 4: openBinaryFile: resource busy (file is locked)`.

 Tested under Mac OSX 10.8.2 and Linux.
 Tested with both GHC 7.6.1 and 7.6.2.

 I could reproduce the bug without +RTS -N -RTS and with this RTS option. A
 colleague of mine reports that it needs  +RTS -N2 -RTS to reproduce the

Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7646>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

More information about the ghc-tickets mailing list