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 A67311382C5 for ; Thu, 17 Jun 2021 12:47:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8C9EEE0822; Thu, 17 Jun 2021 12:47:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 69264E0822 for ; Thu, 17 Jun 2021 12:47:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 5358634090F for ; Thu, 17 Jun 2021 12:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AB26D78A for ; Thu, 17 Jun 2021 12:47:29 +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: <1623934037.39c12693d5372029f54a3b853179bf4c7fada1c3.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/mdds/, dev-util/mdds/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/mdds/files/mdds-1.7.0-rtree_test.patch dev-util/mdds/mdds-1.7.0.ebuild X-VCS-Directories: dev-util/mdds/ dev-util/mdds/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 39c12693d5372029f54a3b853179bf4c7fada1c3 X-VCS-Branch: master Date: Thu, 17 Jun 2021 12:47:29 +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: 41af624d-28a7-4c22-9318-1c329c0bc945 X-Archives-Hash: 435ec9a7c96ee0dfd34117005e212814 commit: 39c12693d5372029f54a3b853179bf4c7fada1c3 Author: Andreas Sturmlechner gentoo org> AuthorDate: Thu Jun 17 12:45:37 2021 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Thu Jun 17 12:47:17 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39c12693 dev-util/mdds: Fix rtree_test See also: https://gitlab.com/mdds/mdds/-/issues/66 Upstream commit 7ab81002fe127d16602b85b391c1d1b0422a9afd Thanks-to: Paul Mulders gmail.com> Closes: https://bugs.gentoo.org/775056 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner gentoo.org> dev-util/mdds/files/mdds-1.7.0-rtree_test.patch | 52 +++++++++++++++++++++++++ dev-util/mdds/mdds-1.7.0.ebuild | 3 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/dev-util/mdds/files/mdds-1.7.0-rtree_test.patch b/dev-util/mdds/files/mdds-1.7.0-rtree_test.patch new file mode 100644 index 00000000000..391f8979891 --- /dev/null +++ b/dev-util/mdds/files/mdds-1.7.0-rtree_test.patch @@ -0,0 +1,52 @@ +From 7ab81002fe127d16602b85b391c1d1b0422a9afd Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Mon, 14 Jun 2021 22:52:14 -0400 +Subject: [PATCH] std::deque::erase invalidates all elements if the erased + element ... + +... is not the first or the last element. My previous assumption ( +that only the elements that occur after the erased element become +invalid) was in fact wrong. + +This should resolve #66. +--- + include/mdds/rtree_def.inl | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/include/mdds/rtree_def.inl b/include/mdds/rtree_def.inl +index ed0e9be..84f0673 100644 +--- a/include/mdds/rtree_def.inl ++++ b/include/mdds/rtree_def.inl +@@ -836,17 +836,20 @@ bool rtree<_Key,_Value,_Trait>::directory_node::erase(const node_store* ns) + if (it == children.end()) + return false; + +- it = children.erase(it); ++ // NB: std::deque::erase invalidates all elements when the erased element ++ // is somwhere in the middle. But if the erased element is either the ++ // first or the last element, only the erased element becomes invalidated. + +- // All nodes that occur after the erased node have their memory addresses +- // shifted. ++ std::size_t pos = std::distance(children.begin(), it); ++ bool all_valid = pos == 0 || pos == children.size() - 1; + +- std::for_each(it, children.end(), +- [](node_store& this_ns) +- { +- this_ns.valid_pointer = false; +- } +- ); ++ it = children.erase(it); ++ ++ if (!all_valid) ++ { ++ for (node_store& ns : children) ++ ns.valid_pointer = false; ++ } + + return true; + } +-- +GitLab + diff --git a/dev-util/mdds/mdds-1.7.0.ebuild b/dev-util/mdds/mdds-1.7.0.ebuild index 6bd8e95ff76..62a57426b64 100644 --- a/dev-util/mdds/mdds-1.7.0.ebuild +++ b/dev-util/mdds/mdds-1.7.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -33,6 +33,7 @@ RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}/${PN}-1.5.0-buildsystem.patch" "${FILESDIR}/${P}-bashism.patch" # bug 723094 + "${FILESDIR}/${P}-rtree_test.patch" # bug 775056 ) pkg_pretend() {