It seems clang doesn't particularily like a source file being changed behind its back while it is reparsing. Read the file in and pass it as an CXUnsavedFile in order to avoid crashing