#2924: createDirectory: permission denied
------------------------------------+---------------------------------------
    Reporter:  simonmar             |        Owner:             
        Type:  bug                  |       Status:  new        
    Priority:  normal               |    Milestone:  6.12 branch
   Component:  libraries/directory  |      Version:  6.10.1     
    Severity:  normal               |   Resolution:             
    Keywords:                       |   Difficulty:  Unknown    
    Testcase:                       |           Os:  Windows    
Architecture:  x86                  |  
------------------------------------+---------------------------------------
Comment (by NeilMitchell):

 A possibly related issue:

 I've got a multi-threaded application which occasionally generates
 failures in openFile. I haven't been able to reproduce the errors
 reliably, the code is way too large to send over, and any small
 attempts at invoking the same problem don't seem to work. Despite the
 uselessness of the bug report, I thought I'd share what I've seen and
 how I fixed it.

 I have many threads, which read and write files. Every so often one
 thread will write a file, then another thread will read the same file
 - but fail during the open call. There are locks to ensure that the
 write call finishes before the read call begins. I modified the code
 to give:

 {{{
 do print ("READ START",x) ; res <- readFile x ; print ("READ STOP",x)
 ; return res

 do print ("WRITE START",x); writeFile x src ; print ("WRITE STOP",x)
 }}}

 I then get on the console:

 {{{
 WRITE START foo
 WRITE STOP foo
 READ START foo
 openFile doesn't have permission to open foo.
 }}}

 The writeFile/readFile are happening in different threads, and they
 usually succeed - but not always. The bug seems to go away when I add
 performGC just after writeFile. My guess is that something in the
 openFile/hClose pair isn't really closed until a garbage collection
 happens. All this is using GHC 6.10.2 on XP through Cygwin.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2924#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to