This is an archive of the discontinued LLVM Phabricator instance.

[ORC] Avoid Race in Assertions
AcceptedPublic

Authored by pree-jackie on Jun 15 2019, 7:34 AM.

Details

Reviewers
lhames
dblaikie
Summary

Prevents when two threads execute the assertions and two threads passed the check before any one is acquiring the SessionLock.

Diff Detail

Event Timeline

pree-jackie created this revision.Jun 15 2019, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2019, 7:34 AM

Does the original bug show up with TSan on any existing/checked in tests, or could TSan catch it in some new test that isn't checked in yet/should be checked in?

pree-jackie added a comment.EditedJun 17 2019, 9:12 PM

I think it's more of an race condition than a data race. I will write a test case and check whether TSan can catch it. But the idea here is createJITDylib and getJITdylibByName must be executed by the same thread,

lhames accepted this revision.Jul 9 2019, 11:16 AM

Tentatively LGTM. Was this is generating a TSan error, or a crash? I would expect this to pass TSan, so writing a test case is probably not practical.

This revision is now accepted and ready to land.Jul 9 2019, 11:16 AM