summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface
diff options
context:
space:
mode:
authorjeffreytan81 <jeffreytan@meta.com>2024-08-15 09:57:01 -0700
committerGitHub <noreply@github.com>2024-08-15 09:57:01 -0700
commit54154f9f06e08b7ab3c7294352601ca4c6e5e160 (patch)
tree589d27b1e7a960d4ffd2b05fbcf5471c21277232 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface
parente61776a0edce86ef01efaa708f43476c58173cae (diff)
Fix single thread stepping timeout race condition (#104195)
This PR fixes a potential race condition in https://github.com/llvm/llvm-project/pull/90930. This race can happen because the original code set `m_info->m_isAlive = true` **after** the timer thread is created. So if there is a context switch happens and timer thread checks `m_info->m_isAlive` before main thread got a chance to run `m_info->m_isAlive = true`, the timer thread may treat `ThreadPlanSingleThreadTimeout` as not alive and simply exit resulting in async interrupt never being sent to resume all threads (deadlock). The PR fixes the race by initializing all states **before** worker timer thread creates. Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface')
0 files changed, 0 insertions, 0 deletions