Asynchronous exception bugs in readProcess and readProcessWithExitCode
As explained on the libraries list, I fixed two asynchronous exception bugs in readProcess and
readProcessWithExitCode:
- If an asynchronous exception was thrown to the thread executing
readProcess/readProcessWithExitCodesomewhere aftercreateProcesswas 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?
- If an asynchronous exception was thrown to the stdout/stderr-read-thread it did not execute the
putMVaranymore resulting in a dead-lock whentakeMVarwas 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.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.2.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/process |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |