1 |
commit: aa4cea02ac7bb486979ce96d29b0dc6c76491184 |
2 |
Author: Peter Levine <plevine457 <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Aug 20 05:56:41 2019 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 21 05:06:55 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa4cea02 |
7 |
|
8 |
dev-cpp/gtest: Fix test failure on sparc64 |
9 |
|
10 |
sparc64 exhibits the same usersandbox stack overflow bug and its stack can |
11 |
apparently grow upwards in memory. Revert back to allocating 10 pages of |
12 |
mapped memory for the offending call to clone(). |
13 |
|
14 |
Bug: https://bugs.gentoo.org/692464 |
15 |
Reported-by: Rolf Eike Beer <gentoo-bug <AT> opensource.sf-tec.de> |
16 |
Package-Manager: Portage-2.3.71, Repoman-2.3.17 |
17 |
Signed-off-by: Peter Levine <plevine457 <AT> gmail.com> |
18 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
19 |
|
20 |
.../gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch | 15 --------------- |
21 |
...test-1.9.0_pre20190607-increase-clone-stack-size.patch | 13 +++++++++++++ |
22 |
dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild | 2 +- |
23 |
dev-cpp/gtest/gtest-9999.ebuild | 2 +- |
24 |
4 files changed, 15 insertions(+), 17 deletions(-) |
25 |
|
26 |
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 |
27 |
deleted file mode 100644 |
28 |
index 9a840aa5876..00000000000 |
29 |
--- a/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-add-mmap-stack-flag.patch |
30 |
+++ /dev/null |
31 |
@@ -1,15 +0,0 @@ |
32 |
-Bug: https://bugs.gentoo.org/688162 |
33 |
-Upstream PR: https://github.com/google/googletest/pull/2276 |
34 |
- |
35 |
---- a/googletest/src/gtest-death-test.cc |
36 |
-+++ b/googletest/src/gtest-death-test.cc |
37 |
-@@ -1357,6 +1357,9 @@ static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) { |
38 |
- const auto stack_size = static_cast<size_t>(getpagesize()); |
39 |
- // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead. |
40 |
- void* const stack = mmap(nullptr, stack_size, PROT_READ | PROT_WRITE, |
41 |
-+# if GTEST_OS_LINUX |
42 |
-+ (stack_grows_down ? MAP_GROWSDOWN : 0) | // Needed for stack auto-resizing |
43 |
-+# endif |
44 |
- MAP_ANON | MAP_PRIVATE, -1, 0); |
45 |
- GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED); |
46 |
- |
47 |
|
48 |
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 |
49 |
new file mode 100755 |
50 |
index 00000000000..38d515a48dd |
51 |
--- /dev/null |
52 |
+++ b/dev-cpp/gtest/files/gtest-1.9.0_pre20190607-increase-clone-stack-size.patch |
53 |
@@ -0,0 +1,13 @@ |
54 |
+Bug: https://bugs.gentoo.org/692464 |
55 |
+ |
56 |
+--- a/googletest/src/gtest-death-test.cc |
57 |
++++ b/googletest/src/gtest-death-test.cc |
58 |
+@@ -1070,7 +1070,7 @@ |
59 |
+ |
60 |
+ if (!use_fork) { |
61 |
+ static const bool stack_grows_down = StackGrowsDown(); |
62 |
+- const auto stack_size = static_cast<size_t>(getpagesize()); |
63 |
++ const auto stack_size = static_cast<size_t>(getpagesize()* 10); |
64 |
+ // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead. |
65 |
+ void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE, |
66 |
+ MAP_ANON | MAP_PRIVATE, -1, 0); |
67 |
|
68 |
diff --git a/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild b/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild |
69 |
index 923d9a16c22..d79d6b7dd58 100644 |
70 |
--- a/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild |
71 |
+++ b/dev-cpp/gtest/gtest-1.9.0_pre20190607.ebuild |
72 |
@@ -35,7 +35,7 @@ DEPEND="test? ( ${PYTHON_DEPS} )" |
73 |
RDEPEND="!dev-cpp/gmock" |
74 |
|
75 |
PATCHES=( |
76 |
- "${FILESDIR}"/${PN}-1.9.0_pre20190607-add-mmap-stack-flag.patch |
77 |
+ "${FILESDIR}"/${PN}-1.9.0_pre20190607-increase-clone-stack-size.patch |
78 |
) |
79 |
|
80 |
pkg_setup() { |
81 |
|
82 |
diff --git a/dev-cpp/gtest/gtest-9999.ebuild b/dev-cpp/gtest/gtest-9999.ebuild |
83 |
index bd677dc0bd1..02ca3c039b1 100644 |
84 |
--- a/dev-cpp/gtest/gtest-9999.ebuild |
85 |
+++ b/dev-cpp/gtest/gtest-9999.ebuild |
86 |
@@ -33,7 +33,7 @@ DEPEND="test? ( ${PYTHON_DEPS} )" |
87 |
RDEPEND="!dev-cpp/gmock" |
88 |
|
89 |
PATCHES=( |
90 |
- "${FILESDIR}"/${PN}-1.9.0_pre20190607-add-mmap-stack-flag.patch |
91 |
+ "${FILESDIR}"/${PN}-1.9.0_pre20190607-increase-clone-stack-size.patch |
92 |
) |
93 |
|
94 |
pkg_setup() { |