summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Levine <plevine457@gmail.com>2019-08-20 01:56:41 -0400
committerJoonas Niilola <juippis@gentoo.org>2019-08-21 08:06:55 +0300
commitaa4cea02ac7bb486979ce96d29b0dc6c76491184 (patch)
tree11273ebaecbff8c777435444a6e732af00bf39d6 /dev-cpp
parentdev-ruby/rouge: add 3.9.0 (diff)
downloadgentoo-aa4cea02ac7bb486979ce96d29b0dc6c76491184.tar.gz
gentoo-aa4cea02ac7bb486979ce96d29b0dc6c76491184.tar.bz2
gentoo-aa4cea02ac7bb486979ce96d29b0dc6c76491184.zip
dev-cpp/gtest: Fix test failure on sparc64
sparc64 exhibits the same usersandbox stack overflow bug and its stack can apparently grow upwards in memory. Revert back to allocating 10 pages of mapped memory for the offending call to clone(). Bug: https://bugs.gentoo.org/692464 Reported-by: Rolf Eike Beer <gentoo-bug@opensource.sf-tec.de> Package-Manager: Portage-2.3.71, Repoman-2.3.17 Signed-off-by: Peter Levine <plevine457@gmail.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-cpp')
-rw-r--r--dev-cpp/gtest/files/gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch15
-rwxr-xr-xdev-cpp/gtest/files/gtest-1.9.0_pre20190607-increase-clone-stack-size.patch13
-rw-r--r--dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild2
-rw-r--r--dev-cpp/gtest/gtest-9999.ebuild2
4 files changed, 15 insertions, 17 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
deleted file mode 100644
index 9a840aa5876..00000000000
--- a/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-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-1.9.0_pre20190607-increase-clone-stack-size.patch b/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-increase-clone-stack-size.patch
new file mode 100755
index 00000000000..38d515a48dd
--- /dev/null
+++ b/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-increase-clone-stack-size.patch
@@ -0,0 +1,13 @@
+Bug: https://bugs.gentoo.org/692464
+
+--- a/googletest/src/gtest-death-test.cc
++++ b/googletest/src/gtest-death-test.cc
+@@ -1070,7 +1070,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()* 10);
+ // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
+ void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_PRIVATE, -1, 0);
diff --git a/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild b/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild
index 923d9a16c22..d79d6b7dd58 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}-1.9.0_pre20190607-add-mmap-stack-flag.patch
+ "${FILESDIR}"/${PN}-1.9.0_pre20190607-increase-clone-stack-size.patch
)
pkg_setup() {
diff --git a/dev-cpp/gtest/gtest-9999.ebuild b/dev-cpp/gtest/gtest-9999.ebuild
index bd677dc0bd1..02ca3c039b1 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}-1.9.0_pre20190607-add-mmap-stack-flag.patch
+ "${FILESDIR}"/${PN}-1.9.0_pre20190607-increase-clone-stack-size.patch
)
pkg_setup() {