Skip to content

non deterministic exception from withCreateProcess on Windows: "terminateProcess: permission denied (Permission denied)" #110

Closed
@sternmull

Description

@sternmull

On Windows the following program

module Main where
import System.Process
import System.IO

main :: IO ()
main = test 1

test i = do
  print i
  withCreateProcess ((shell "echo x") {std_out = CreatePipe}) $ \ _ (Just out) _ p -> do
    hGetChar out -- hGetLine and hGetContents have the same effect. But the problem disappears when this line is removed!
    return ()
  test $ i + 1

leads to output like this:

1
2
3
4
5
6
7
mytest.EXE: terminateProcess: permission denied (Permission denied)

Sometime it happens earlier sometimes it happens later. But as far i can tell it always happens pretty soon. I can not reproduce it on linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions