[Lldb-commits] [PATCH] D135516: [lldb] [MainLoopPosix] Fix crash upon adding lots of pending callbacks
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 14 09:01:54 PDT 2022
mgorny added inline comments.
================
Comment at: lldb/source/Host/posix/MainLoopPosix.cpp:408
assert(bytes_written == 1);
+ m_trigger_done = true;
}
----------------
labath wrote:
> I /think/ this is not right. The other thread can wake up as soon as the Write call is done, and can proceed to clear the `done` flag before we are able to set it. If we set it afterwards, then we we suppress all subsequent writes, and the callbacks would never run. If we set the flag before we make the Write call, then it should be ok -- though the flag should probably have a different name then.
I think you are correct. Will update that soonish.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135516/new/
https://reviews.llvm.org/D135516
More information about the lldb-commits
mailing list