forked from qt-creator/qt-creator
Clang: Disable printing stack traces by default
Printing the stack strace in the event of a crash is very useful, but in the worst case it can also result in a deadlock, without any trace being printed, rendering the clangbackend completely useless. For example, if a thread allocates memory (lock) and another thread crashes right then, clang's stack trace printer is invoked, which (unfortunately) also tries to allocate memory (deadlock). This was observed with QTCREATORBUG-21559. The stack trace printer should be fixed in clang. Until then, disable printing stack traces by default and allow to enable when explicitly requested (QTC_CLANG_ENABLE_STACKTRACES=1). Task-number: QTCREATORBUG-21559 Change-Id: I418cea7f3d70bc8a9cae333b3858228650307c6e Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -80,6 +80,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const QString connection = processArguments(application);
|
const QString connection = processArguments(application);
|
||||||
|
|
||||||
|
// Printing the stack strace might dead lock as clang's stack printer allocates memory.
|
||||||
|
if (qEnvironmentVariableIntValue("QTC_CLANG_ENABLE_STACKTRACES"))
|
||||||
clang_enableStackTraces();
|
clang_enableStackTraces();
|
||||||
|
|
||||||
ClangCodeModelServer clangCodeModelServer;
|
ClangCodeModelServer clangCodeModelServer;
|
||||||
|
|||||||
Reference in New Issue
Block a user