From 76682c27b5c0f6b1b8e256e704aae2d15138823e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 25 Apr 2013 12:33:51 +0200 Subject: php-pecl-apcu: upstream patch to fix a segfault when used from cli --- apcu-git.patch | 38 ++++++++++++++++++++++++++++++++++++++ php-pecl-apcu-dev.spec | 13 +++++++++++-- php-pecl-apcu.spec | 13 +++++++++++-- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 apcu-git.patch diff --git a/apcu-git.patch b/apcu-git.patch new file mode 100644 index 0000000..9f6e922 --- /dev/null +++ b/apcu-git.patch @@ -0,0 +1,38 @@ +From d192f6081164ba5ec5b05dce8e5c0b50b5d7b35d Mon Sep 17 00:00:00 2001 +From: krakjoe +Date: Thu, 28 Mar 2013 20:27:16 +0000 +Subject: [PATCH] forcefully align frequent structs (gcc >= 3.1), in testing + (windows anyone?) stop crash in cli when cache is disabled by configuration + and some userland functions are executed + +--- + apc.h | 5 ++++- + apc_cache.c | 4 ++-- + apc_cache_api.h | 12 +++++++----- + php_apc.c | 3 +-- + 4 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/php_apc.c b/php_apc.c +index 9849580..6dc0184 100644 +--- a/php_apc.c ++++ b/php_apc.c +@@ -499,7 +499,7 @@ static void apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclu + return; + } + +- if (!key) { ++ if (!key || !APCG(enabled)) { + /* cannot work without key */ + RETURN_FALSE; + } +@@ -941,7 +941,6 @@ void *apc_erealloc_wrapper(void *ptr, size_t size) { + HashTable *h_vars; + apc_bd_t *bd; + +- + if (!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC); + RETURN_FALSE; +-- +1.8.1.6 + diff --git a/php-pecl-apcu-dev.spec b/php-pecl-apcu-dev.spec index 5c82008..ae6aa64 100644 --- a/php-pecl-apcu-dev.spec +++ b/php-pecl-apcu-dev.spec @@ -3,12 +3,14 @@ Name: php-pecl-apcu Summary: APC User Cache Version: 4.0.0 -Release: 1%{?dist}.1 +Release: 2%{?dist}.1 Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz Source1: %{pecl_name}.ini Source2: %{pecl_name}-panel.conf Source3: %{pecl_name}.conf.php +Patch0: %{pecl_name}-git.patch + License: PHP Group: Development/Languages URL: http://pecl.php.net/package/APCu @@ -87,12 +89,16 @@ configuration, available on http://localhost/apcu-panel/ %setup -qc mv %{pecl_name}-%{version} NTS +cd NTS +%patch0 -p1 -b .fromgit + # Sanity check, really often broken -extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_apc.h) +extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. exit 1 fi +cd .. # duplicate for ZTS build cp -pr NTS ZTS @@ -192,6 +198,9 @@ rm -rf %{buildroot} %changelog +* Thu Apr 25 2013 Remi Collet - 4.0.0-2 +- fix segfault when used from command line + * Wed Mar 27 2013 Remi Collet - 4.0.0-1 - first pecl release - rename from php-apcu to php-pecl-apcu diff --git a/php-pecl-apcu.spec b/php-pecl-apcu.spec index 7cb8d62..bc39141 100644 --- a/php-pecl-apcu.spec +++ b/php-pecl-apcu.spec @@ -6,12 +6,14 @@ Name: php-pecl-apcu Summary: APC User Cache Version: 4.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz Source1: %{pecl_name}.ini Source2: %{pecl_name}-panel.conf Source3: %{pecl_name}.conf.php +Patch0: %{pecl_name}-git.patch + License: PHP Group: Development/Languages URL: http://pecl.php.net/package/APCu @@ -87,12 +89,16 @@ configuration, available on http://localhost/apcu-panel/ %setup -qc mv %{pecl_name}-%{version} NTS +cd NTS +%patch0 -p1 -b .fromgit + # Sanity check, really often broken -extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_apc.h) +extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. exit 1 fi +cd .. %if %{with_zts} # duplicate for ZTS build @@ -197,6 +203,9 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Thu Apr 25 2013 Remi Collet - 4.0.0-2 +- fix segfault when used from command line + * Wed Mar 27 2013 Remi Collet - 4.0.0-1 - first pecl release - rename from php-apcu to php-pecl-apcu -- cgit