summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-07-31 12:06:50 +0000
committerPavel Labath <pavel@labath.sk>2019-07-31 12:06:50 +0000
commita9d58436af83eeeca376a0686bb13fc43d3f8ece (patch)
tree40ad8cc63ef8c89f655cb51ee861558bf6a5d228 /lldb/packages/Python/lldbsuite/test
parent5f616901f579062aabe32fee165eacd36de82e8b (diff)
downloadbcm5719-llvm-a9d58436af83eeeca376a0686bb13fc43d3f8ece.tar.gz
bcm5719-llvm-a9d58436af83eeeca376a0686bb13fc43d3f8ece.zip
Fix issues with inferior stdout coming out of order
Summary: We've had a bug where two pieces of code, executing on two threads were attempting to write inferior output simultaneously. The first one was in Debugger::HandleProcessEvent, which handled the cases where stdout was coming while the process was running. The second was in CommandInterpreter::IOHandlerInputComplete, which was ensuring that any output is printed before the command which caused process to run terminates. Both of these things make sense, but the fact they were implemented as two independent functions without any synchronization meant that race conditions could occur (e.g. both threads call process->GetSTDOUT, get two chunks of data, but then end up calling stream->Write in opposite order). This was most apparent in situations where a process quickly writes a bunch of output and then exits (as all our register tests do). This patch adds a mutex to ensure that stdout forwarding happens atomically. It also refactors a code somewhat in order to reduce code duplication. Reviewers: clayborg, jingham Subscribers: jfb, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D65152 llvm-svn: 367418
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud