public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
Date: Mon,  2 Nov 2015 23:37:13 +0000 (UTC)	[thread overview]
Message-ID: <1446507318.d9454b5d1c5a22855e7c22f30644ba7c8980f923.mjo@gentoo> (raw)

commit:     d9454b5d1c5a22855e7c22f30644ba7c8980f923
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  2 23:00:20 2015 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Nov  2 23:35:18 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9454b5d

dev-lang/php: revbump php-5.6.15 to fix a segfault.

The segfault issue was reported in bug #564690 by Zoltán
Halassy. There is an upstream fix that we've added as a patch. The
problem/fix have both been confirmed.

Since this requires a revbump, the sys-libs/db dependency has been
fixed along with it according to bug #521222. It still remains to
address that issue for the php-7.x series.

Gentoo-Bug: 521222
Gentoo-Bug: 564690

Package-Manager: portage-2.2.20.1

 .../php/files/fix-5.6.15-fpm-const-crash.patch     | 59 ++++++++++++++++++++++
 .../{php-5.6.15.ebuild => php-5.6.15-r1.ebuild}    | 23 ++++++++-
 2 files changed, 80 insertions(+), 2 deletions(-)

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
new file mode 100644
index 0000000..29876a9
--- /dev/null
+++ b/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch
@@ -0,0 +1,59 @@
+From 37ed0dafe47fb1053aee7822113bacc1f213337a Mon Sep 17 00:00:00 2001
+From: Xinchen Hui <laruence@gmail.com>
+Date: Mon, 2 Nov 2015 10:47:02 +0800
+Subject: [PATCH] Fixed bug #70828 (php-fpm 5.6 with opcache crashes when
+ referencing a non-existent constant)
+
+---
+ NEWS                     |  2 ++
+ Zend/tests/bug70828.phpt | 24 ++++++++++++++++++++++++
+ Zend/zend_compile.c      |  2 +-
+ 3 files changed, 27 insertions(+), 1 deletion(-)
+ create mode 100644 Zend/tests/bug70828.phpt
+
+diff --git a/Zend/tests/bug70828.phpt b/Zend/tests/bug70828.phpt
+new file mode 100644
+index 0000000..dd285b5
+--- /dev/null
++++ b/Zend/tests/bug70828.phpt
+@@ -0,0 +1,24 @@
++--TEST--
++Bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant)
++--FILE--
++<?php
++
++namespace test {
++	use const nonexistent;
++
++	class test {
++		static function run(){
++			var_dump(nonexistent);
++			existent;
++		}
++	}
++}
++
++namespace {
++	define("test\\existent", "bug!", 1);
++	test\test::run();
++}
++?>
++--EXPECTF--
++Notice: Use of undefined constant nonexistent - assumed 'nonexistent' in /home/huixinchen/opensource/php-5.6/Zend/tests/bug70828.php on line 8
++string(11) "nonexistent"
+diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
+index 5ff1b04..fca4e2a 100644
+--- a/Zend/zend_compile.c
++++ b/Zend/zend_compile.c
+@@ -5804,7 +5804,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
+ 				opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 0 TSRMLS_CC);
+ 			} else {
+ 				opline->extended_value = IS_CONSTANT_UNQUALIFIED;
+-				if (CG(current_namespace)) {
++				if (check_namespace && CG(current_namespace)) {
+ 					opline->extended_value |= IS_CONSTANT_IN_NAMESPACE;
+ 					opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 1 TSRMLS_CC);
+ 				} else {
+-- 
+2.1.4
+

diff --git a/dev-lang/php/php-5.6.15.ebuild b/dev-lang/php/php-5.6.15-r1.ebuild
similarity index 96%
rename from dev-lang/php/php-5.6.15.ebuild
rename to dev-lang/php/php-5.6.15-r1.ebuild
index c6cc5ca..c64fd9d 100644
--- a/dev-lang/php/php-5.6.15.ebuild
+++ b/dev-lang/php/php-5.6.15-r1.ebuild
@@ -79,8 +79,23 @@ DEPEND="
 	>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
 	>=dev-libs/libpcre-8.32[unicode]
 	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
-		<www-servers/apache-2.4[threads=] ) )
-	berkdb? ( =sys-libs/db-4* )
+		<www-servers/apache-2.4[threads=] ) )"
+
+# This wacky berkdb dependency really means "any 4.x or 5.x version of
+# sys-libs/db". The ./configure flag is called --with-db4, but this is a
+# misnomer since db5 also works (bug #521222). We really want to say
+# "any 4.x or 5.x slot", but that's not possible. The safest thing to
+# do is list all 4.x and 5.x slots in order of preference.
+DEPEND="${DEPEND}
+	berkdb? ( || ( sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5
+					sys-libs/db:4.4
+					sys-libs/db:4.3
+					sys-libs/db:4.2 ) )
 	bzip2? ( app-arch/bzip2 )
 	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
 	cjk? ( !gd? (
@@ -308,6 +323,10 @@ src_prepare() {
 			|| die "Failed to fix heimdal crypt library reference"
 	fi
 
+	# Fix a const crash in php-fpm, bug #564690.
+	# Only applies to php-5.6.15 and should be fixed in 5.6.16.
+	epatch "${FILESDIR}/fix-5.6.15-fpm-const-crash.patch"
+
 	#Add user patches #357637
 	epatch_user
 


             reply	other threads:[~2015-11-02 23:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 23:37 Michael Orlitzky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-09-30 15:07 [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/ Michael Orlitzky
2018-04-27  2:21 Brian Evans
2018-04-30  0:16 Aaron Bauman
2018-05-04 21:03 Brian Evans
2018-12-06 23:20 Thomas Deutschmann
2018-12-07  0:41 Thomas Deutschmann
2018-12-07  1:16 Thomas Deutschmann
2019-02-06 18:26 Thomas Deutschmann
2019-02-11 14:21 Brian Evans
2020-12-03 20:48 Thomas Deutschmann
2020-12-23  0:39 Thomas Deutschmann
2021-02-25 19:23 Brian Evans
2021-03-25 15:56 Brian Evans
2022-04-05 19:03 Brian Evans
2023-01-05 21:30 Brian Evans
2023-05-05 13:18 Brian Evans
2024-02-18 23:54 Michael Orlitzky
2024-03-04 17:00 Michael Orlitzky
2024-04-09 13:51 Michael Orlitzky
2024-07-10 14:50 Michael Orlitzky

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=1446507318.d9454b5d1c5a22855e7c22f30644ba7c8980f923.mjo@gentoo \
    --to=mjo@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