From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Oct 17 05:50:01 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A1EA845 for ; Wed, 17 Oct 2012 05:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id D64B98FC17 for ; Wed, 17 Oct 2012 05:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9H5o0k6050570 for ; Wed, 17 Oct 2012 05:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9H5o081050569; Wed, 17 Oct 2012 05:50:00 GMT (envelope-from gnats) Resent-Date: Wed, 17 Oct 2012 05:50:00 GMT Resent-Message-Id: <201210170550.q9H5o081050569@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Valery Komarov Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F3ED69A for ; Wed, 17 Oct 2012 05:41:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 3900D8FC0C for ; Wed, 17 Oct 2012 05:41:20 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9H5fKC6059959 for ; Wed, 17 Oct 2012 05:41:20 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9H5fJNA059958; Wed, 17 Oct 2012 05:41:19 GMT (envelope-from nobody) Message-Id: <201210170541.q9H5fJNA059958@red.freebsd.org> Date: Wed, 17 Oct 2012 05:41:19 GMT From: Valery Komarov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/172808: [UPDATE] devel/php5-thrift X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 05:50:01 -0000 >Number: 172808 >Category: ports >Synopsis: [UPDATE] devel/php5-thrift >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Oct 17 05:50:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Valery Komarov >Release: FreeBSD 9-STABLE amd64 >Organization: >Environment: >Description: Upgrade to version 0.9.0 Ports devel/thrift, devel/fb30, devel/php5-thrift, devel/node-thrift, devel/rubygem-thrift.txt must be commited together >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruN /usr/ports/devel/php5-thrift/files/patch-php_thrift_protocol.cpp php5-thrift/files/patch-php_thrift_protocol.cpp --- /usr/ports/devel/php5-thrift/files/patch-php_thrift_protocol.cpp 2012-06-09 18:22:30.000000000 +0400 +++ php5-thrift/files/patch-php_thrift_protocol.cpp 1970-01-01 03:00:00.000000000 +0300 @@ -1,170 +0,0 @@ ---- ./php_thrift_protocol.cpp.orig 2011-11-26 23:00:43.000000000 +0400 -+++ ./php_thrift_protocol.cpp 2012-06-06 09:40:16.000000000 +0400 -@@ -57,6 +57,10 @@ - #error Unknown __BYTE_ORDER - #endif - -+#ifndef Z_ADDREF_P -+#define Z_ADDREF_P ZVAL_ADDREF -+#endif -+ - enum TType { - T_STOP = 0, - T_VOID = 1, -@@ -92,7 +96,7 @@ - #include "zend_exceptions.h" - #include "php_thrift_protocol.h" - --static function_entry thrift_protocol_functions[] = { -+static zend_function_entry thrift_protocol_functions[] = { - PHP_FE(thrift_protocol_write_binary, NULL) - PHP_FE(thrift_protocol_read_binary, NULL) - {NULL, NULL, NULL} -@@ -764,6 +768,7 @@ - } - - void binary_serialize(int8_t thrift_typeID, PHPOutputTransport& transport, zval** value, HashTable* fieldspec) { -+ Z_ADDREF_P(*value); - // At this point the typeID (and field num, if applicable) should've already been written to the output so all we need to do is write the payload. - switch (thrift_typeID) { - case T_STOP: -@@ -781,29 +786,51 @@ - binary_serialize_spec(*value, transport, Z_ARRVAL_P(spec)); - } return; - case T_BOOL: -- if (Z_TYPE_PP(value) != IS_BOOL) convert_to_boolean(*value); -+ if (Z_TYPE_PP(value) != IS_BOOL) { -+ SEPARATE_ZVAL(value); -+ convert_to_boolean(*value); -+ } - transport.writeI8(Z_BVAL_PP(value) ? 1 : 0); -+ zval_ptr_dtor(value); - return; - case T_BYTE: -- if (Z_TYPE_PP(value) != IS_LONG) convert_to_long(*value); -+ if (Z_TYPE_PP(value) != IS_LONG) { -+ SEPARATE_ZVAL(value); -+ convert_to_long(*value); -+ } - transport.writeI8(Z_LVAL_PP(value)); -+ zval_ptr_dtor(value); - return; - case T_I16: -- if (Z_TYPE_PP(value) != IS_LONG) convert_to_long(*value); -+ if (Z_TYPE_PP(value) != IS_LONG) { -+ SEPARATE_ZVAL(value); -+ convert_to_long(*value); -+ } - transport.writeI16(Z_LVAL_PP(value)); -+ zval_ptr_dtor(value); - return; - case T_I32: -- if (Z_TYPE_PP(value) != IS_LONG) convert_to_long(*value); -+ if (Z_TYPE_PP(value) != IS_LONG) { -+ SEPARATE_ZVAL(value); -+ convert_to_long(*value); -+ } - transport.writeI32(Z_LVAL_PP(value)); -+ zval_ptr_dtor(value); - return; - case T_I64: - case T_U64: { - int64_t l_data; - #if defined(_LP64) || defined(_WIN64) -- if (Z_TYPE_PP(value) != IS_LONG) convert_to_long(*value); -+ if (Z_TYPE_PP(value) != IS_LONG) { -+ SEPARATE_ZVAL(value); -+ convert_to_long(*value); -+ } - l_data = Z_LVAL_PP(value); - #else -- if (Z_TYPE_PP(value) != IS_DOUBLE) convert_to_double(*value); -+ if (Z_TYPE_PP(value) != IS_DOUBLE) { -+ SEPARATE_ZVAL(value); -+ convert_to_double(*value); -+ } - l_data = (int64_t)Z_DVAL_PP(value); - #endif - transport.writeI64(l_data); -@@ -813,20 +840,32 @@ - int64_t c; - double d; - } a; -- if (Z_TYPE_PP(value) != IS_DOUBLE) convert_to_double(*value); -+ if (Z_TYPE_PP(value) != IS_DOUBLE) { -+ SEPARATE_ZVAL(value); -+ convert_to_double(*value); -+ } - a.d = Z_DVAL_PP(value); - transport.writeI64(a.c); -+ zval_ptr_dtor(value); - } return; - //case T_UTF7: - case T_UTF8: - case T_UTF16: - case T_STRING: -- if (Z_TYPE_PP(value) != IS_STRING) convert_to_string(*value); -+ if (Z_TYPE_PP(value) != IS_STRING) { -+ SEPARATE_ZVAL(value); -+ convert_to_string(*value); -+ } - transport.writeString(Z_STRVAL_PP(value), Z_STRLEN_PP(value)); -+ zval_ptr_dtor(value); - return; - case T_MAP: { -- if (Z_TYPE_PP(value) != IS_ARRAY) convert_to_array(*value); - if (Z_TYPE_PP(value) != IS_ARRAY) { -+ SEPARATE_ZVAL(value); -+ convert_to_array(*value); -+ } -+ if (Z_TYPE_PP(value) != IS_ARRAY) { -+ zval_ptr_dtor(value); - throw_tprotocolexception("Attempt to send an incompatible type as an array (T_MAP)", INVALID_DATA); - } - HashTable* ht = Z_ARRVAL_PP(value); -@@ -850,10 +889,15 @@ - binary_serialize_hashtable_key(keytype, transport, ht, key_ptr); - binary_serialize(valtype, transport, val_ptr, valspec); - } -+ zval_ptr_dtor(value); - } return; - case T_LIST: { -- if (Z_TYPE_PP(value) != IS_ARRAY) convert_to_array(*value); - if (Z_TYPE_PP(value) != IS_ARRAY) { -+ SEPARATE_ZVAL(value); -+ convert_to_array(*value); -+ } -+ if (Z_TYPE_PP(value) != IS_ARRAY) { -+ zval_ptr_dtor(value); - throw_tprotocolexception("Attempt to send an incompatible type as an array (T_LIST)", INVALID_DATA); - } - HashTable* ht = Z_ARRVAL_PP(value); -@@ -872,10 +916,15 @@ - for (zend_hash_internal_pointer_reset_ex(ht, &key_ptr); zend_hash_get_current_data_ex(ht, (void**)&val_ptr, &key_ptr) == SUCCESS; zend_hash_move_forward_ex(ht, &key_ptr)) { - binary_serialize(valtype, transport, val_ptr, valspec); - } -+ zval_ptr_dtor(value); - } return; - case T_SET: { -- if (Z_TYPE_PP(value) != IS_ARRAY) convert_to_array(*value); - if (Z_TYPE_PP(value) != IS_ARRAY) { -+ SEPARATE_ZVAL(value); -+ convert_to_array(*value); -+ } -+ if (Z_TYPE_PP(value) != IS_ARRAY) { -+ zval_ptr_dtor(value); - throw_tprotocolexception("Attempt to send an incompatible type as an array (T_SET)", INVALID_DATA); - } - HashTable* ht = Z_ARRVAL_PP(value); -@@ -891,8 +940,11 @@ - for (zend_hash_internal_pointer_reset_ex(ht, &key_ptr); zend_hash_get_current_data_ex(ht, (void**)&val_ptr, &key_ptr) == SUCCESS; zend_hash_move_forward_ex(ht, &key_ptr)) { - binary_serialize_hashtable_key(keytype, transport, ht, key_ptr); - } -+ zval_ptr_dtor(value); - } return; - }; -+ -+ zval_ptr_dtor(value); - char errbuf[128]; - sprintf(errbuf, "Unknown thrift typeID %d", thrift_typeID); - throw_tprotocolexception(errbuf, INVALID_DATA); >Release-Note: >Audit-Trail: >Unformatted: