id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
5766	Asynchronous exception bugs in readProcess and readProcessWithExitCode	basvandijk		"As [http://www.haskell.org/pipermail/libraries/2012-January/017406.html explained] on the libraries list, I fixed two asynchronous exception bugs in `readProcess` and
`readProcessWithExitCode`:

1) If an asynchronous exception was thrown to the thread executing `readProcess`/`readProcessWithExitCode` somewhere after `createProcess` was executed, the standard handles would not be closed anymore resulting in a ""handle leak"" so to speak.

This is fixed by catching exceptions in the IO processing code and
closing the standard handles when an exception occurs. Additionally, I also terminate the process and wait for its termination. Does the
latter make sense?

2) If an asynchronous exception was thrown to the stdout/stderr-read-thread it did not execute the `putMVar` anymore resulting in a dead-lock when `takeMVar` was executed.

This is fixed by properly catching exception in the read-thread and
propagating them to the parent thread which will then handle them as
described above."	bug	closed	normal	7.6.1	libraries/process	7.2.2	fixed			Unknown/Multiple	Unknown/Multiple	None/Unknown	Unknown				
