aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/Platform.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2021-05-05 11:34:07 -0700
committerJim Ingham <jingham@apple.com>2021-05-06 14:11:42 -0700
commit72ba78c29e923cb6e5d89eb5ea8180bf723188be (patch)
tree082e785ed4ba5988c9c9d03de596f67a186ec5de /llvm/lib/TextAPI/Platform.cpp
parentd21e1b79ff7d40bca537c30da706e31e48483f21 (diff)
downloadllvm-72ba78c29e923cb6e5d89eb5ea8180bf723188be.zip
llvm-72ba78c29e923cb6e5d89eb5ea8180bf723188be.tar.gz
llvm-72ba78c29e923cb6e5d89eb5ea8180bf723188be.tar.bz2
When SendContinuePacketAndWaitForResponse returns eStateInvalid, don't fetch more packets.
This looks like just an oversight in the AsyncThread function. It gets a result of eStateInvalid, and then marks the process as exited, but doesn't set "done" to true, so we go to fetch another event. That is not safe, since you don't know when that extra packet is going to arrive. If it arrives while you are tearing down the process, the internal-state-thread might try to handle it when the process in not in a good state. Rather than put more effort into checking all the shutdown paths to make sure this extra packet doesn't cause problems, just don't fetch it. We weren't going to do anything useful with it anyway. The main part of the patch is setting "done = true" when we get the eStateInvalid. I also added a check at the beginning of the while(done) loop to prevent another error from getting us to fetch packets for an exited process. I added a test case to ensure that if an Interrupt fails, we call the process exited. I can't test exactly the error I'm fixing, there's no good way to know that the stop reply for the failed interrupt wasn't fetched. But at least this asserts that the overall behavior is correct. Differential Revision: https://reviews.llvm.org/D101933
Diffstat (limited to 'llvm/lib/TextAPI/Platform.cpp')
0 files changed, 0 insertions, 0 deletions