<div dir="ltr"><div><div><div>I'm writing a client application that uses libclang and
uses it to parse documents on multiple threads. I've been debugging a
memory corruption bug and traced it to the CrashRecoveryContext
destructor deleting other thread's Parser objects out from under it.<br><br></div><div>Looking
at the CrashRecoveryContext code it appears no effort is made to make
this thread safe, specifically it heavily relies on static members which
is how pointers are making their way across threads.<br></div><div><br></div>There are two questions here:<br></div>1) Is libclang intended to be thread safe? (I.e. would a patch be accepted to fix this or is this behavior by design)<br><br></div>2)
Generally "recovering" from unknown crashes is considered to be bad
practice, is there a recommended way to prevent use of the crash
recovery mechanism?</div>