1 |
commit: d9454b5d1c5a22855e7c22f30644ba7c8980f923 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 2 23:00:20 2015 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 2 23:35:18 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9454b5d |
7 |
|
8 |
dev-lang/php: revbump php-5.6.15 to fix a segfault. |
9 |
|
10 |
The segfault issue was reported in bug #564690 by Zoltán |
11 |
Halassy. There is an upstream fix that we've added as a patch. The |
12 |
problem/fix have both been confirmed. |
13 |
|
14 |
Since this requires a revbump, the sys-libs/db dependency has been |
15 |
fixed along with it according to bug #521222. It still remains to |
16 |
address that issue for the php-7.x series. |
17 |
|
18 |
Gentoo-Bug: 521222 |
19 |
Gentoo-Bug: 564690 |
20 |
|
21 |
Package-Manager: portage-2.2.20.1 |
22 |
|
23 |
.../php/files/fix-5.6.15-fpm-const-crash.patch | 59 ++++++++++++++++++++++ |
24 |
.../{php-5.6.15.ebuild => php-5.6.15-r1.ebuild} | 23 ++++++++- |
25 |
2 files changed, 80 insertions(+), 2 deletions(-) |
26 |
|
27 |
diff --git a/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch b/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch |
28 |
new file mode 100644 |
29 |
index 0000000..29876a9 |
30 |
--- /dev/null |
31 |
+++ b/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch |
32 |
@@ -0,0 +1,59 @@ |
33 |
+From 37ed0dafe47fb1053aee7822113bacc1f213337a Mon Sep 17 00:00:00 2001 |
34 |
+From: Xinchen Hui <laruence@×××××.com> |
35 |
+Date: Mon, 2 Nov 2015 10:47:02 +0800 |
36 |
+Subject: [PATCH] Fixed bug #70828 (php-fpm 5.6 with opcache crashes when |
37 |
+ referencing a non-existent constant) |
38 |
+ |
39 |
+--- |
40 |
+ NEWS | 2 ++ |
41 |
+ Zend/tests/bug70828.phpt | 24 ++++++++++++++++++++++++ |
42 |
+ Zend/zend_compile.c | 2 +- |
43 |
+ 3 files changed, 27 insertions(+), 1 deletion(-) |
44 |
+ create mode 100644 Zend/tests/bug70828.phpt |
45 |
+ |
46 |
+diff --git a/Zend/tests/bug70828.phpt b/Zend/tests/bug70828.phpt |
47 |
+new file mode 100644 |
48 |
+index 0000000..dd285b5 |
49 |
+--- /dev/null |
50 |
++++ b/Zend/tests/bug70828.phpt |
51 |
+@@ -0,0 +1,24 @@ |
52 |
++--TEST-- |
53 |
++Bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant) |
54 |
++--FILE-- |
55 |
++<?php |
56 |
++ |
57 |
++namespace test { |
58 |
++ use const nonexistent; |
59 |
++ |
60 |
++ class test { |
61 |
++ static function run(){ |
62 |
++ var_dump(nonexistent); |
63 |
++ existent; |
64 |
++ } |
65 |
++ } |
66 |
++} |
67 |
++ |
68 |
++namespace { |
69 |
++ define("test\\existent", "bug!", 1); |
70 |
++ test\test::run(); |
71 |
++} |
72 |
++?> |
73 |
++--EXPECTF-- |
74 |
++Notice: Use of undefined constant nonexistent - assumed 'nonexistent' in /home/huixinchen/opensource/php-5.6/Zend/tests/bug70828.php on line 8 |
75 |
++string(11) "nonexistent" |
76 |
+diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c |
77 |
+index 5ff1b04..fca4e2a 100644 |
78 |
+--- a/Zend/zend_compile.c |
79 |
++++ b/Zend/zend_compile.c |
80 |
+@@ -5804,7 +5804,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con |
81 |
+ opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 0 TSRMLS_CC); |
82 |
+ } else { |
83 |
+ opline->extended_value = IS_CONSTANT_UNQUALIFIED; |
84 |
+- if (CG(current_namespace)) { |
85 |
++ if (check_namespace && CG(current_namespace)) { |
86 |
+ opline->extended_value |= IS_CONSTANT_IN_NAMESPACE; |
87 |
+ opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 1 TSRMLS_CC); |
88 |
+ } else { |
89 |
+-- |
90 |
+2.1.4 |
91 |
+ |
92 |
|
93 |
diff --git a/dev-lang/php/php-5.6.15.ebuild b/dev-lang/php/php-5.6.15-r1.ebuild |
94 |
similarity index 96% |
95 |
rename from dev-lang/php/php-5.6.15.ebuild |
96 |
rename to dev-lang/php/php-5.6.15-r1.ebuild |
97 |
index c6cc5ca..c64fd9d 100644 |
98 |
--- a/dev-lang/php/php-5.6.15.ebuild |
99 |
+++ b/dev-lang/php/php-5.6.15-r1.ebuild |
100 |
@@ -79,8 +79,23 @@ DEPEND=" |
101 |
>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?] |
102 |
>=dev-libs/libpcre-8.32[unicode] |
103 |
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
104 |
- <www-servers/apache-2.4[threads=] ) ) |
105 |
- berkdb? ( =sys-libs/db-4* ) |
106 |
+ <www-servers/apache-2.4[threads=] ) )" |
107 |
+ |
108 |
+# This wacky berkdb dependency really means "any 4.x or 5.x version of |
109 |
+# sys-libs/db". The ./configure flag is called --with-db4, but this is a |
110 |
+# misnomer since db5 also works (bug #521222). We really want to say |
111 |
+# "any 4.x or 5.x slot", but that's not possible. The safest thing to |
112 |
+# do is list all 4.x and 5.x slots in order of preference. |
113 |
+DEPEND="${DEPEND} |
114 |
+ berkdb? ( || ( sys-libs/db:5.3 |
115 |
+ sys-libs/db:5.1 |
116 |
+ sys-libs/db:4.8 |
117 |
+ sys-libs/db:4.7 |
118 |
+ sys-libs/db:4.6 |
119 |
+ sys-libs/db:4.5 |
120 |
+ sys-libs/db:4.4 |
121 |
+ sys-libs/db:4.3 |
122 |
+ sys-libs/db:4.2 ) ) |
123 |
bzip2? ( app-arch/bzip2 ) |
124 |
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
125 |
cjk? ( !gd? ( |
126 |
@@ -308,6 +323,10 @@ src_prepare() { |
127 |
|| die "Failed to fix heimdal crypt library reference" |
128 |
fi |
129 |
|
130 |
+ # Fix a const crash in php-fpm, bug #564690. |
131 |
+ # Only applies to php-5.6.15 and should be fixed in 5.6.16. |
132 |
+ epatch "${FILESDIR}/fix-5.6.15-fpm-const-crash.patch" |
133 |
+ |
134 |
#Add user patches #357637 |
135 |
epatch_user |