Race condition in applications assuming IO stops after process death
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PlainBox (Toolkit) |
Fix Released
|
High
|
Zygmunt Krynicki |
Bug Description
The extcmd interface has, among others, the following two methods:
- on_line()
- on_end()
It seems natural to think that on_line() cannot occur after on_exit(). Applications making this assumption can break as that assumption is not true. If the communication pipe leaks from the started process to a third process that survives its parent's death (such as many daemons and "background" software) and the venerable process doesn't close its stdout/stderr streams then we can indeed see on_line() being called after on_exit().
To guard against this and let apps see "simplified" versions of reality. Extcmd should optionally defer on_end() and on_abnormal_end() after we're certain that no more on_line() events will occur.
Related branches
- Sylvain Pineau (community): Approve
-
Diff: 117 lines (+38/-12)2 files modifiedplainbox/plainbox/vendor/extcmd/glibc.py (+29/-12)
plainbox/plainbox/vendor/glibc.py (+9/-0)
Changed in plainbox: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Zygmunt Krynicki (zkrynicki) |
milestone: | none → 0.18 |
Changed in plainbox: | |
status: | In Progress → Fix Committed |
Changed in plainbox: | |
status: | Fix Committed → Fix Released |