This is an archive of the discontinued LLVM Phabricator instance.

Add a mutex to the ThreadPlanStackMap to prevent it getting corrupted
ClosedPublic

Authored by jingham on Apr 19 2022, 11:40 AM.

Details

Summary

We were seeing very occasional crashes that looked like corrupted ThreadPlans. This happens when we go to destroy a process which is running, and the attempt to interrupt the process fails so we proceed to tear down the process anyway, but in the middle of doing that the stop event comes in and we crash trying to handle it. We fixed that by protecting the ThreadPlanStack with a mutex so that either the tear down would win, and the event would get discarded, or the event would get handled, and then we would continue with the teardown.

After that change was promulgated we didn't see any more of these crashes but last week I got one crash report that can only be explained by corruption of the ThreadPlanStackMap - which I hadn't added a mutex to. It looks like we need one there as well.

Diff Detail

Event Timeline

jingham created this revision.Apr 19 2022, 11:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 11:40 AM
jingham requested review of this revision.Apr 19 2022, 11:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 11:40 AM
JDevlieghere accepted this revision.Apr 19 2022, 7:26 PM

Jim and I discussed this offline last week. LGTM.

This revision is now accepted and ready to land.Apr 19 2022, 7:26 PM
This revision was automatically updated to reflect the committed changes.