aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2021-10-04 15:31:30 +0200
committerEike Ziller <eike.ziller@qt.io>2021-10-04 13:39:14 +0000
commitab16f2984b6661ea172d345b0ecc9a7ce33bf40c (patch)
treeb25f920e11330d605879a3828097213698687fee
parentb07e29eb79a3f2637a9b7aaca4dce566b4ace51b (diff)
Work around QRegularExpression crashes on macOS with Rosetta
Looks like the regular expression jitting is not reentrant when running under Rosetta for some reason. It was crashing when loading bigger subdir .pro files which regular expressions in it, like qtcreator.pro. Disable JIT if we run under Rosetta. Task-number: QTBUG-97085 Change-Id: Icbab1ca8f62afa9cc86045983e84087a7694b5ad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/app/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index d3946584e3..c7270b3dec 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -492,6 +492,11 @@ int main(int argc, char **argv)
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
}
+ if (Utils::HostOsInfo::isRunningUnderRosetta()) {
+ // work around QTBUG-97085: QRegularExpression jitting is not reentrant under Rosetta
+ qputenv("QT_ENABLE_REGEXP_JIT", "0");
+ }
+
Utils::TemporaryDirectory::setMasterTemporaryDirectory(QDir::tempPath() + "/" + Core::Constants::IDE_CASED_ID + "-XXXXXX");
#ifdef Q_OS_MACOS