This is an archive of the discontinued LLVM Phabricator instance.

Allow nested CrashRecoveryContexts.
ClosedPublic

Authored by thakis on Aug 5 2015, 10:35 AM.

Details

Reviewers
thakis
akyrtzi
Summary

libclang uses a CrashRecoveryContext, and building a module does too. If a module gets built through libclang, nested CrashRecoveryContexts are used. They work fine with threads as things are stored in ThreadLocal variables, but in LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the same globals.

To fix, keep active CrashRecoveryContextImpls in a list and have the global point to the innermost one, and do something similar for tlIsRecoveringFromCrash.

Necessary (but not sufficient) for PR11974 and PR20325

Diff Detail

Event Timeline

thakis updated this revision to Diff 31369.Aug 5 2015, 10:35 AM
thakis retitled this revision from to Allow nested CrashRecoveryContexts..
thakis updated this object.
thakis added a reviewer: akyrtzi.
thakis added a subscriber: llvm-commits.

akyrtzi: Ping. (I'm asking you for review because your r184380 from two years ago is the most recent related change in this area.)

akyrtzi edited edge metadata.Aug 6 2015, 11:53 AM
akyrtzi added a subscriber: akyrtzi.

LGTM.

thakis accepted this revision.Aug 6 2015, 12:22 PM
thakis added a reviewer: thakis.

r244251, thanks!

This revision is now accepted and ready to land.Aug 6 2015, 12:22 PM
thakis closed this revision.Aug 6 2015, 12:22 PM