#3231: Permission denied error with runProcess/openFile
--------------------------+-------------------------------------------------
Reporter: NeilMitchell | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.10.2
Severity: normal | Resolution:
Keywords: | Testcase:
Os: Windows | Architecture: Unknown/Multiple
--------------------------+-------------------------------------------------
Comment (by duncan):
Replying to [comment:3 NeilMitchell]:
> This version works fine if the {{{system}}} call is removed. That call
shouldn't have any difference to the usage of any handles. It seems that
system calls mess with handles and resources in painful ways. This is now
almost certainly the same underlying cause as the problems I reported in
bug #2924.
Presumably it is the system call that is crucial. Delaying by one second
in Haskell code presumably works ok?
If so, my guess is that it's related to the open file handles being
inherited by the child process and then the use of the handle in the child
conflicts with attempts to remove or re-open the same file in the parent.
Of course we wait for the child process to terminate so in principle this
should not be a problem, the handles used in the child process should now
be closed. However I have a strong suspicion that Windows is using delayed
deallocation/unlocking of handles when a process terminates.
I've seen behaviour in cabal-install where we wait for a program to
terminate, which had an open file in the directory we're about to delete,
and when we try to remove the file we often get a permission error.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3231#comment:5>
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