Clang: Disable crash recovery in libclang

...because

 1. We already run in a separate process.
 2. It's not entirely clear in which state we end up after a crash,
    except for:
 3. A "crashed" translation unit won't be freed, even when calling
    clang_disposeTranslationUnit().

This avoids undefined behavior within clangbackend and accumulated
leaking memory in the long run. On the other side, crashes within
libclang will crash clangbackend now, too.

Change-Id: I0789c52db08ace2f7e181e3b7bdfc9f595f75e8d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-02-02 15:18:40 +01:00
parent 89d6a36bc6
commit fdd695c35c
2 changed files with 1 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ ClangCodeModelConnectionClient::ClangCodeModelConnectionClient(
Utils::Environment environment;
environment.set(QStringLiteral("LIBCLANG_NOTHREADS"), QString());
environment.set(QStringLiteral("LIBCLANG_DISABLE_CRASH_RECOVERY"), QString());
m_processCreator.setEnvironment(environment);
stdErrPrefixer().setPrefix("clangbackend.stderr: ");

View File

@@ -82,7 +82,6 @@ int main(int argc, char *argv[])
const QString connection = processArguments(application);
clang_toggleCrashRecovery(true);
clang_enableStackTraces();
ClangCodeModelServer clangCodeModelServer;