public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/gtest/files/, dev-cpp/gtest/
Date: Mon, 17 Jun 2019 06:25:21 +0000 (UTC)	[thread overview]
Message-ID: <1560752705.fac747ad8938ce04897dfe1d188260f42ce8b6cb.mgorny@gentoo> (raw)

commit:     fac747ad8938ce04897dfe1d188260f42ce8b6cb
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Sun Jun 16 23:55:31 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 06:25:05 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fac747ad

dev-cpp/gtest: Fix segfault in googletest-death-test

Fixes call to mmap to include MAP_GROWSDOWN flag for
stack auto-resizing.

Reported-by: tka <tka <AT> kamph.org>
Tested-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail.com>
Closes: https://bugs.gentoo.org/688162
Closes: https://github.com/gentoo/gentoo/pull/12271
Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch     | 15 +++++++++++++++
 .../files/gtest-9999-increase-clone-stack-size.patch      | 14 --------------
 dev-cpp/gtest/gtest-1.7.0-r1.ebuild                       |  2 +-
 dev-cpp/gtest/gtest-1.8.0-r1.ebuild                       |  2 +-
 dev-cpp/gtest/gtest-1.8.0.ebuild                          |  2 +-
 dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild              |  2 +-
 dev-cpp/gtest/gtest-9999.ebuild                           |  2 +-
 7 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch b/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch
new file mode 100644
index 00000000000..9a840aa5876
--- /dev/null
+++ b/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch
@@ -0,0 +1,15 @@
+Bug: https://bugs.gentoo.org/688162
+Upstream PR: https://github.com/google/googletest/pull/2276
+
+--- a/googletest/src/gtest-death-test.cc
++++ b/googletest/src/gtest-death-test.cc
+@@ -1357,6 +1357,9 @@ static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
+     const auto stack_size = static_cast<size_t>(getpagesize());
+     // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
+     void* const stack = mmap(nullptr, stack_size, PROT_READ | PROT_WRITE,
++#    if GTEST_OS_LINUX
++                             (stack_grows_down ? MAP_GROWSDOWN : 0) | // Needed for stack auto-resizing
++#    endif
+                              MAP_ANON | MAP_PRIVATE, -1, 0);
+     GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
+ 

diff --git a/dev-cpp/gtest/files/gtest-9999-increase-clone-stack-size.patch b/dev-cpp/gtest/files/gtest-9999-increase-clone-stack-size.patch
deleted file mode 100644
index 5e4dc47f704..00000000000
--- a/dev-cpp/gtest/files/gtest-9999-increase-clone-stack-size.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Bug: https://bugs.gentoo.org/629620
-Upstream PR: https://github.com/google/googletest/pull/2276
-
---- a/googletest/src/gtest-death-test.cc
-+++ b/googletest/src/gtest-death-test.cc
-@@ -1354,7 +1354,7 @@
-
-   if (!use_fork) {
-     static const bool stack_grows_down = StackGrowsDown();
--    const auto stack_size = static_cast<size_t>(getpagesize());
-+    const auto stack_size = static_cast<size_t>(getpagesize() * 8);
-     // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
-     void* const stack = mmap(nullptr, stack_size, PROT_READ | PROT_WRITE,
-                              MAP_ANON | MAP_PRIVATE, -1, 0);

diff --git a/dev-cpp/gtest/gtest-1.7.0-r1.ebuild b/dev-cpp/gtest/gtest-1.7.0-r1.ebuild
index f1185b2db0c..360809f62e7 100644
--- a/dev-cpp/gtest/gtest-1.7.0-r1.ebuild
+++ b/dev-cpp/gtest/gtest-1.7.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"

diff --git a/dev-cpp/gtest/gtest-1.8.0-r1.ebuild b/dev-cpp/gtest/gtest-1.8.0-r1.ebuild
index 18d837c58fc..0e0934020cd 100644
--- a/dev-cpp/gtest/gtest-1.8.0-r1.ebuild
+++ b/dev-cpp/gtest/gtest-1.8.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6

diff --git a/dev-cpp/gtest/gtest-1.8.0.ebuild b/dev-cpp/gtest/gtest-1.8.0.ebuild
index a2fc61eb5c4..da82dca28b2 100644
--- a/dev-cpp/gtest/gtest-1.8.0.ebuild
+++ b/dev-cpp/gtest/gtest-1.8.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6

diff --git a/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild b/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild
index 1ff88fb723f..9fc545d7fd8 100644
--- a/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild
+++ b/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild
@@ -35,7 +35,7 @@ DEPEND="test? ( ${PYTHON_DEPS} )"
 RDEPEND="!dev-cpp/gmock"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-9999-increase-clone-stack-size.patch
+	"${FILESDIR}"/${PN}-1.9.0_pre20190607-add-mmap-stack-flag.patch
 )
 
 pkg_setup() {

diff --git a/dev-cpp/gtest/gtest-9999.ebuild b/dev-cpp/gtest/gtest-9999.ebuild
index 685acf50cd6..bd677dc0bd1 100644
--- a/dev-cpp/gtest/gtest-9999.ebuild
+++ b/dev-cpp/gtest/gtest-9999.ebuild
@@ -33,7 +33,7 @@ DEPEND="test? ( ${PYTHON_DEPS} )"
 RDEPEND="!dev-cpp/gmock"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-9999-increase-clone-stack-size.patch
+	"${FILESDIR}"/${PN}-1.9.0_pre20190607-add-mmap-stack-flag.patch
 )
 
 pkg_setup() {


             reply	other threads:[~2019-06-17  6:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17  6:25 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-14  7:16 [gentoo-commits] repo/gentoo:master commit in: dev-cpp/gtest/files/, dev-cpp/gtest/ Florian Schmaus
2023-09-04 10:08 David Seifert
2020-07-19 10:43 Joonas Niilola
2019-08-21  5:07 Joonas Niilola
2018-01-09 16:12 Mike Gilbert
2018-01-09 16:12 Mike Gilbert
2017-08-29 20:30 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560752705.fac747ad8938ce04897dfe1d188260f42ce8b6cb.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox