From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3C41E13835B for ; Sat, 2 Jan 2021 01:23:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A4F4E083E; Sat, 2 Jan 2021 01:23:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 42D51E083E for ; Sat, 2 Jan 2021 01:23:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 46B95340EF4 for ; Sat, 2 Jan 2021 01:23:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 61E1048C for ; Sat, 2 Jan 2021 01:23:03 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1609550553.68426bc06c976362ef7cc51e57a676535e7e310e.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtnetwork/files/, dev-qt/qtnetwork/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-qt/qtnetwork/files/qtnetwork-5.15.2-QNetworkAccessManager-memleak.patch dev-qt/qtnetwork/qtnetwork-5.15.2-r1.ebuild X-VCS-Directories: dev-qt/qtnetwork/ dev-qt/qtnetwork/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 68426bc06c976362ef7cc51e57a676535e7e310e X-VCS-Branch: master Date: Sat, 2 Jan 2021 01:23:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bc197165-92cd-4417-ab8d-45e6b2cbf6dc X-Archives-Hash: effc54438f0a53dc85cb7f74a7050931 commit: 68426bc06c976362ef7cc51e57a676535e7e310e Author: Andreas Sturmlechner gentoo org> AuthorDate: Fri Jan 1 16:56:08 2021 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Jan 2 01:22:33 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68426bc0 dev-qt/qtnetwork: Fix memleak in QNetworkAccessManager See also: https://bugreports.qt.io/browse/QTBUG-88063 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner gentoo.org> ...work-5.15.2-QNetworkAccessManager-memleak.patch | 41 +++++++++++ dev-qt/qtnetwork/qtnetwork-5.15.2-r1.ebuild | 80 ++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/dev-qt/qtnetwork/files/qtnetwork-5.15.2-QNetworkAccessManager-memleak.patch b/dev-qt/qtnetwork/files/qtnetwork-5.15.2-QNetworkAccessManager-memleak.patch new file mode 100644 index 00000000000..be2c1f6e1a0 --- /dev/null +++ b/dev-qt/qtnetwork/files/qtnetwork-5.15.2-QNetworkAccessManager-memleak.patch @@ -0,0 +1,41 @@ +From 0807f16eb407eaf8a5b34b67602d0a97778d945d Mon Sep 17 00:00:00 2001 +From: =?utf8?q?M=C3=A5rten=20Nordheim?= +Date: Fri, 6 Nov 2020 12:51:42 +0100 +Subject: [PATCH] QNAM: Work around QObject finicky orphan cleanup details + +Details described in a comment. + +Task-number: QTBUG-88063 +Change-Id: I763ecfedf518de97615e04a8eaae0fe1fd784f52 +Reviewed-by: Timur Pocheptsov +(cherry picked from commit 1c6d6cbb62c5e93cbcad2d740c3b0ed01095618c) +Reviewed-by: Qt Cherry-pick Bot +--- + src/network/access/qnetworkreplyhttpimpl.cpp | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp +index 21916f53f15..727c1a0316d 100644 +--- a/src/network/access/qnetworkreplyhttpimpl.cpp ++++ b/src/network/access/qnetworkreplyhttpimpl.cpp +@@ -808,7 +808,17 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq + + // For the synchronous HTTP, this is the normal way the delegate gets deleted + // For the asynchronous HTTP this is a safety measure, the delegate deletes itself when HTTP is finished +- QObject::connect(thread, SIGNAL(finished()), delegate, SLOT(deleteLater())); ++ QMetaObject::Connection threadFinishedConnection = ++ QObject::connect(thread, SIGNAL(finished()), delegate, SLOT(deleteLater())); ++ ++ // QTBUG-88063: When 'delegate' is deleted the connection will be added to 'thread''s orphaned ++ // connections list. This orphaned list will be cleaned up next time 'thread' emits a signal, ++ // unfortunately that's the finished signal. It leads to a soft-leak so we do this to disconnect ++ // it on deletion so that it cleans up the orphan immediately. ++ QObject::connect(delegate, &QObject::destroyed, delegate, [threadFinishedConnection]() { ++ if (bool(threadFinishedConnection)) ++ QObject::disconnect(threadFinishedConnection); ++ }); + + // Set the properties it needs + delegate->httpRequest = httpRequest; +-- +2.16.3 diff --git a/dev-qt/qtnetwork/qtnetwork-5.15.2-r1.ebuild b/dev-qt/qtnetwork/qtnetwork-5.15.2-r1.ebuild new file mode 100644 index 00000000000..9d366649d1c --- /dev/null +++ b/dev-qt/qtnetwork/qtnetwork-5.15.2-r1.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +QT5_MODULE="qtbase" +inherit qt5-build + +DESCRIPTION="Network abstraction library for the Qt5 framework" + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +fi + +IUSE="bindist connman gssapi libressl libproxy networkmanager sctp +ssl" + +DEPEND=" + ~dev-qt/qtcore-${PV}:5= + sys-libs/zlib:= + connman? ( ~dev-qt/qtdbus-${PV} ) + gssapi? ( virtual/krb5 ) + libproxy? ( net-libs/libproxy ) + networkmanager? ( ~dev-qt/qtdbus-${PV} ) + sctp? ( kernel_linux? ( net-misc/lksctp-tools ) ) + ssl? ( + !libressl? ( >=dev-libs/openssl-1.1.1:0=[bindist=] ) + libressl? ( dev-libs/libressl:0= ) + ) +" +RDEPEND="${DEPEND} + connman? ( net-misc/connman ) + networkmanager? ( net-misc/networkmanager ) +" + +QT5_TARGET_SUBDIRS=( + src/network + src/plugins/bearer/generic +) + +QT5_GENTOO_CONFIG=( + libproxy:libproxy: + ssl::SSL + ssl::OPENSSL + ssl:openssl-linked:LINKED_OPENSSL +) + +QT5_GENTOO_PRIVATE_CONFIG=( + :network +) + +PATCHES=( + "${FILESDIR}"/${P}-QNetworkAccessManager-memleak.patch # QTBUG-88063 + "${FILESDIR}"/${PN}-5.15.2-libressl.patch # Bug 562050, not upstreamable +) + +pkg_setup() { + use connman && QT5_TARGET_SUBDIRS+=(src/plugins/bearer/connman) + use networkmanager && QT5_TARGET_SUBDIRS+=(src/plugins/bearer/networkmanager) +} + +src_configure() { + local myconf=( + $(usex connman -dbus-linked '') + $(usex gssapi -feature-gssapi -no-feature-gssapi) + $(qt_use libproxy) + $(usex networkmanager -dbus-linked '') + $(qt_use sctp) + $(usex ssl -openssl-linked '') + ) + qt5-build_src_configure +} + +src_install() { + qt5-build_src_install + # workaround for bug 652650 + if use ssl; then + sed -e "/^#define QT_LINKED_OPENSSL/s/$/ true/" \ + -i "${D}${QT5_HEADERDIR}"/Gentoo/${PN}-qconfig.h || die + fi +}