php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58769 Fails to build with ZTS enabled
Submitted: 2009-07-21 08:49 UTC Modified: 2009-07-22 04:46 UTC
From: thomas at koch dot ro Assigned: jluedke (profile)
Status: Closed Package: gearman (PECL)
PHP Version: 5.3.0RC4 OS: Debian Lenny
Private report: No CVE-ID: None
 [2009-07-21 08:49 UTC] thomas at koch dot ro
Description:
------------
some function miss either a 
	TSRMLS_FETCH();
line at the beginning
or don't provide a TSRMLS_CC macro when calling zend_is_callable. See the diff below.

(Why oh why did you move away from launchpad and a distributed version control system...)



Reproduce code:
---------------
diff --git a/ext/gearman/php_gearman.c b/ext/gearman/php_gearman.c
index 24e7f7f..9918495 100644
--- a/ext/gearman/php_gearman.c
+++ b/ext/gearman/php_gearman.c
@@ -1019,6 +1019,8 @@ void _php_free(void *ptr, void *arg) {

 void _php_task_free(gearman_task_st *task, void *fn_arg) {
        gearman_task_obj *obj= (gearman_task_obj *)fn_arg;
+       TSRMLS_FETCH();
+
        if (obj->flags & GEARMAN_TASK_OBJ_DEAD) {
                GEARMAN_ZVAL_DONE(obj->zdata)
                GEARMAN_ZVAL_DONE(obj->zworkload)
@@ -2554,6 +2556,7 @@ static gearman_return_t _php_task_cb_fn(gearman_task_obj *task,
        gearman_task_obj *new_obj;
        zend_fcall_info fci;
        zend_fcall_info_cache fcic= empty_fcall_info_cache;
+       TSRMLS_FETCH();

        MAKE_STD_ZVAL(ztask)
        if (task->flags & GEARMAN_TASK_OBJ_DEAD) {
@@ -2705,7 +2708,7 @@ PHP_FUNCTION(gearman_client_set_workload_fn) {
                                 &zworkload_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zworkload_fn, 0, &callable)) {
+       if (! zend_is_callable(zworkload_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                "function %s is not callable", callable);
                efree(callable);
@@ -2735,7 +2738,7 @@ PHP_FUNCTION(gearman_client_set_created_fn) {
                                 &zcreated_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zcreated_fn, 0, &callable)) {
+       if (! zend_is_callable(zcreated_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -2765,7 +2768,7 @@ PHP_FUNCTION(gearman_client_set_data_fn) {
                                 &zdata_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zdata_fn, 0, &callable)) {
+       if (! zend_is_callable(zdata_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -2796,7 +2799,7 @@ PHP_FUNCTION(gearman_client_set_warning_fn) {
                                 &zwarning_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zwarning_fn, 0, &callable)) {
+       if (! zend_is_callable(zwarning_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -2827,7 +2830,7 @@ PHP_FUNCTION(gearman_client_set_status_fn) {
                                 &zstatus_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zstatus_fn, 0, &callable)) {
+       if (! zend_is_callable(zstatus_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -2858,7 +2861,7 @@ PHP_FUNCTION(gearman_client_set_complete_fn) {
                                 &zcomplete_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zcomplete_fn, 0, &callable)) {
+       if (! zend_is_callable(zcomplete_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -2889,7 +2892,7 @@ PHP_FUNCTION(gearman_client_set_exception_fn) {
                                 &zexception_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zexception_fn, 0, &callable)) {
+       if (! zend_is_callable(zexception_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -2920,7 +2923,7 @@ PHP_FUNCTION(gearman_client_set_fail_fn) {
                                 &zfail_fn)

        /* check that the function is callable */
-       if (! zend_is_callable(zfail_fn, 0, &callable)) {
+       if (! zend_is_callable(zfail_fn, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);
@@ -3290,6 +3293,7 @@ static void *_php_worker_function_callback(gearman_job_st *job, void *fn_arg,
        zval *zret_ptr= NULL;
        zend_fcall_info fci;
        zend_fcall_info_cache fcic= empty_fcall_info_cache;
+       TSRMLS_FETCH();

        /* first create our job object that will be passed to the callback */
        MAKE_STD_ZVAL(zjob);
@@ -3370,7 +3374,7 @@ PHP_FUNCTION(gearman_worker_add_function) {
                                 &zname, &zcall, &zdata, &timeout)

        /* check that the function can be called */
-       if (!zend_is_callable(zcall, 0, &callable)) {
+       if (!zend_is_callable(zcall, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING,
                                                 "function %s is not callable", callable);
                efree(callable);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-21 12:22 UTC] contact at jamesluedke dot com
Thanks for the patch. I will check it in tonight.

-jluedke
 [2009-07-22 04:46 UTC] contact at jamesluedke dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

zend api change.Updated will be in next release.

-jluedke
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC