From eae438c6359801a78bf4b1967f590772acb8b930 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 29 May 2015 17:29:18 +0200 Subject: php-pecl-xdebug: add upstream patch to fix crash when another extension call call_user_function() during RINIT (e.g. phk) --- php-pecl-xdebug.spec | 71 ++++++++++++++++++++++++++++++++++++---------------- xdebug-pr178.patch | 22 ++++++++++++++++ 2 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 xdebug-pr178.patch diff --git a/php-pecl-xdebug.spec b/php-pecl-xdebug.spec index 8bc0900..d6e46c6 100644 --- a/php-pecl-xdebug.spec +++ b/php-pecl-xdebug.spec @@ -17,11 +17,11 @@ %{!?__pecl: %global __pecl %{_bindir}/pecl} %{!?__php: %global __php %{_bindir}/php} -%global pecl_name xdebug -%global with_zts 0%{?__ztsphp:1} -#global commit b1ce1e3ecc95c2e24d2df73cffce7e501df53215 -#global gitver %(c=%{commit}; echo ${c:0:7}) -#global prever dev +%global pecl_name xdebug +%global with_zts 0%{?__ztsphp:1} +%global gh_commit 5c8c76b1d69a0395130fe9b23ad18f767a94e798 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global with_tests %{?_with_tests:1}%{!?_with_tests:0} # XDebug should be loaded after opcache %if "%{php_version}" < "5.6" @@ -33,12 +33,8 @@ Name: %{?scl_prefix}php-pecl-xdebug Summary: PECL package for debugging PHP scripts Version: 2.3.2 -Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} -%if 0%{?gitver:1} -Source0: https://github.com/%{pecl_name}/%{pecl_name}/archive/%{commit}/%{pecl_name}-%{version}-%{gitver}.tar.gz -%else -Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -%endif +Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Source0: https://github.com/%{pecl_name}/%{pecl_name}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz # https://github.com/xdebug/xdebug/pull/172 # https://bugzilla.redhat.com/1214111 @@ -47,6 +43,9 @@ Patch0: %{pecl_name}-pr172.patch Patch1: %{pecl_name}-pr176.patch # https://github.com/xdebug/xdebug/pull/167 Patch2: %{pecl_name}-pr167.patch +# https://github.com/xdebug/xdebug/pull/178 +Patch3: %{pecl_name}-pr178.patch + # The Xdebug License, version 1.01 # (Based on "The PHP License", version 3.0) @@ -59,6 +58,9 @@ BuildRequires: %{?scl_prefix}php-pear > 1.9.1 BuildRequires: %{?scl_prefix}php-devel > 5.4 BuildRequires: libedit-devel BuildRequires: libtool +%if %{with_tests} +BuildRequires: php-soap +%endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} @@ -115,18 +117,14 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -%if 0%{?gitver:1} -sed -e '/release/s/2.2.1/%{version}%{?prever}/' \ - %{pecl_name}-%{commit}/package.xml >package.xml -mv %{pecl_name}-%{commit} NTS -%else -mv %{pecl_name}-%{version}%{?prever} NTS -%endif +mv %{pecl_name}-%{gh_commit} NTS +mv NTS/package.xml . cd NTS %patch2 -p1 -b .pr167 %patch0 -p1 -b .pr172 %patch1 -p1 -b .pr176 +%patch3 -p1 -b .pr178 # Check extension version ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h) @@ -154,9 +152,7 @@ make %{?_smp_mflags} # Build debugclient pushd debugclient # buildconf required for aarch64 support -%if 0%{?rhel} != 5 ./buildconf -%endif %configure --with-libedit make %{?_smp_mflags} popd @@ -216,7 +212,9 @@ EOF # Documentation for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +do + [ -f NTS/contrib/$i ] && j=contrib/$i || j=$i + install -Dpm 644 NTS/$j %{buildroot}%{pecl_docdir}/%{pecl_name}/$j done @@ -234,6 +232,31 @@ done --modules | grep Xdebug %endif +%if %{with_tests} +cd NTS +# ignore kwown failed tests +rm tests/bug00623.phpt +rm tests/bug00687.phpt +rm tests/bug00778.phpt +rm tests/bug00806.phpt +rm tests/bug00840.phpt +rm tests/bug00886.phpt +rm tests/bug00913.phpt +rm tests/bug01059.phpt +rm tests/bug01104.phpt +rm tests/dbgp-context-get.phpt +rm tests/dbgp-property-get-constants.phpt + +: Upstream test suite NTS extension +TEST_PHP_EXECUTABLE=%{_bindir}/php \ +TEST_PHP_ARGS="-n -d extension=soap.so -d zend_extension=$PWD/modules/%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{__php} -n run-tests.php --show-diff +%else +: Test suite disabled +%endif + # when pear installed alone, after us %triggerin -- %{?scl_prefix}php-pear @@ -274,6 +297,12 @@ rm -rf %{buildroot} %changelog +* Fri May 29 2015 Remi Collet - 2.3.2-5 +- sources from github, with test suite +- run test suite when build using "--with tests" option +- add upstream patch to fix crash when another extension calls + call_user_function() during RINIT (e.g. phk) + * Fri May 29 2015 Remi Collet - 2.3.2-4 - add patch for exception code change (for phpunit) diff --git a/xdebug-pr178.patch b/xdebug-pr178.patch new file mode 100644 index 0000000..237ade0 --- /dev/null +++ b/xdebug-pr178.patch @@ -0,0 +1,22 @@ +From 1958b346aea595a67d15978f9a38d413c4147e8e Mon Sep 17 00:00:00 2001 +From: Derick Rethans +Date: Fri, 29 May 2015 13:20:53 +0100 +Subject: [PATCH] Fixed issue #1151: Crash when another extension calls + call_user_function() during RINIT + +--- + xdebug_stack.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xdebug_stack.c b/xdebug_stack.c +index 2c7d94e..4be99d2 100644 +--- a/xdebug_stack.c ++++ b/xdebug_stack.c +@@ -993,6 +993,7 @@ function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_a + /* Call user function locations */ + if ( + !tmp->filename && ++ XG(stack) && + XDEBUG_LLIST_TAIL(XG(stack)) && + XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack))) && + ((function_stack_entry*) XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack))))->filename -- cgit