From owner-svn-ports-head@freebsd.org Tue Apr 14 16:29:54 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 228992C4421; Tue, 14 Apr 2020 16:29:54 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 491rYY74yvz4QfR; Tue, 14 Apr 2020 16:29:53 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE77A8378; Tue, 14 Apr 2020 16:29:53 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03EGTr2P003293; Tue, 14 Apr 2020 16:29:53 GMT (envelope-from tcberner@FreeBSD.org) Received: (from tcberner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03EGTr14003289; Tue, 14 Apr 2020 16:29:53 GMT (envelope-from tcberner@FreeBSD.org) Message-Id: <202004141629.03EGTr14003289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tcberner set sender to tcberner@FreeBSD.org using -f From: "Tobias C. Berner" Date: Tue, 14 Apr 2020 16:29:53 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r531705 - in head/devel/qt5-core: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tcberner X-SVN-Commit-Paths: in head/devel/qt5-core: . files X-SVN-Commit-Revision: 531705 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2020 16:29:54 -0000 Author: tcberner Date: Tue Apr 14 16:29:53 2020 New Revision: 531705 URL: https://svnweb.freebsd.org/changeset/ports/531705 Log: devel/qt5-core: add upstream patch to fix grpahics/krita at runtime Qt5-5.14.2 introduced a regression which lead to krita deadlocking on start. [1] https://bugreports.qt.io/browse/QTBUG-83207 [2] https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=276fa8383a7535765be7182883ef4aade17ce013 Added: head/devel/qt5-core/files/patch-git_276fa83 (contents, props changed) Modified: head/devel/qt5-core/Makefile Modified: head/devel/qt5-core/Makefile ============================================================================== --- head/devel/qt5-core/Makefile Tue Apr 14 16:29:42 2020 (r531704) +++ head/devel/qt5-core/Makefile Tue Apr 14 16:29:53 2020 (r531705) @@ -2,6 +2,7 @@ PORTNAME= core DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- Added: head/devel/qt5-core/files/patch-git_276fa83 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/qt5-core/files/patch-git_276fa83 Tue Apr 14 16:29:53 2020 (r531705) @@ -0,0 +1,109 @@ +From 276fa8383a7535765be7182883ef4aade17ce013 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Thu, 2 Apr 2020 12:08:41 -0300 +Subject: QLibrary: fix deadlock caused by fix to QTBUG-39642 + +Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around +the entire load_sys(). We had reasoed that deadlocks would only occur if +the object creation in instance() recursed into its own instance(), +which was already a bug. But we had forgotten that dlopen()/ +LoadLibrary() executes initialization code from the module being loaded, +which could cause a recursion back into the same QPluginLoader or +QLibrary object. This recursion is benign because the module *is* loaded +and dlopen()/LoadLibrary() returns the same handle. + +[ChangeLog][QtCore][QLibrary and QPluginLoader] Fixed a deadlock that +would happen if the plugin or library being loaded has load-time +initialization code (C++ global variables) that recursed back into the +same QLibrary or QPluginLoader object. + +PS: QLibraryPrivate::loadPlugin() updates pluginState outside a mutex +lock, so pluginState should be made an atomic variable. Once that is +done, we'll only need locking the mutex to update errorString (no +locking before loading). + +Fixes: QTBUG-83207 +Task-number: QTBUG-39642 +Change-Id: Ibdc95e9af7bd456a94ecfffd160209304e5ab2eb +Reviewed-by: Volker Hilsheimer +Reviewed-by: David Faure +--- + src/corelib/plugin/qlibrary.cpp | 2 -- + src/corelib/plugin/qlibrary_unix.cpp | 4 ++++ + src/corelib/plugin/qlibrary_win.cpp | 3 +++ + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp +index ddb053c26f..be9d92b204 100644 +--- src/corelib/plugin/qlibrary.cpp ++++ src/corelib/plugin/qlibrary.cpp +@@ -576,9 +576,7 @@ bool QLibraryPrivate::load() + + Q_TRACE(QLibraryPrivate_load_entry, fileName); + +- mutex.lock(); + bool ret = load_sys(); +- mutex.unlock(); + if (qt_debug_component()) { + if (ret) { + qDebug() << "loaded library" << fileName; +diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp +index 017aa97b66..a5c72f81d9 100644 +--- src/corelib/plugin/qlibrary_unix.cpp ++++ src/corelib/plugin/qlibrary_unix.cpp +@@ -123,6 +123,7 @@ QStringList QLibraryPrivate::prefixes_sys() + + bool QLibraryPrivate::load_sys() + { ++ QMutexLocker locker(&mutex); + QString attempt; + QFileSystemEntry fsEntry(fileName); + +@@ -213,6 +214,7 @@ bool QLibraryPrivate::load_sys() + } + #endif + ++ locker.unlock(); + bool retry = true; + Handle hnd = nullptr; + for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) { +@@ -273,6 +275,8 @@ bool QLibraryPrivate::load_sys() + } + } + #endif ++ ++ locker.relock(); + if (!hnd) { + errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror()); + } +diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp +index 000bf76276..ef58724be8 100644 +--- src/corelib/plugin/qlibrary_win.cpp ++++ src/corelib/plugin/qlibrary_win.cpp +@@ -78,6 +78,7 @@ bool QLibraryPrivate::load_sys() + // fileName + // + // NB If it's a plugin we do not ever try the ".dll" extension ++ QMutexLocker locker(&mutex); + QStringList attempts; + + if (pluginState != IsAPlugin) +@@ -95,6 +96,7 @@ bool QLibraryPrivate::load_sys() + attempts.prepend(QDir::rootPath() + fileName); + #endif + ++ locker.unlock(); + Handle hnd = nullptr; + for (const QString &attempt : qAsConst(attempts)) { + #ifndef Q_OS_WINRT +@@ -115,6 +117,7 @@ bool QLibraryPrivate::load_sys() + #ifndef Q_OS_WINRT + SetErrorMode(oldmode); + #endif ++ locker.relock(); + if (!hnd) { + errorString = QLibrary::tr("Cannot load library %1: %2").arg( + QDir::toNativeSeparators(fileName), qt_error_string()); +-- +cgit v1.2.1 +