This repository has been archived by the owner. It is now read-only.

PHP7 support #12

Open
oligriffiths opened this Issue Oct 23, 2015 · 84 comments

Comments

Projects
None yet
@oligriffiths

oligriffiths commented Oct 23, 2015

Hi

Is there any plan for this?

Thanks

Oli

@hotrush

This comment has been minimized.

Show comment
Hide comment
@hotrush

hotrush Nov 19, 2015

+1 let us know, wait or migrate to something other

hotrush commented Nov 19, 2015

+1 let us know, wait or migrate to something other

@vojta

This comment has been minimized.

Show comment
Hide comment
@vojta

vojta commented Nov 27, 2015

Maybe this could help you: https://github.com/wcgallego/pecl-gearman/

@IvixLabs

This comment has been minimized.

Show comment
Hide comment
@IvixLabs

IvixLabs Dec 4, 2015

I got Segmentation fault: 11 with https://github.com/wcgallego/pecl-gearman/.
Project works fine on php 5.6 with gearman on Debian and Mac OS X.
Waiting support php 7.0.
+1

IvixLabs commented Dec 4, 2015

I got Segmentation fault: 11 with https://github.com/wcgallego/pecl-gearman/.
Project works fine on php 5.6 with gearman on Debian and Mac OS X.
Waiting support php 7.0.
+1

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Dec 4, 2015

Owner

I am not sure if that branch is completely up to date. Please see https://twitter.com/wcgallego/status/672248988163248128

cc @wcgallego

Owner

hjr3 commented Dec 4, 2015

I am not sure if that branch is completely up to date. Please see https://twitter.com/wcgallego/status/672248988163248128

cc @wcgallego

@jacobalberty

This comment has been minimized.

Show comment
Hide comment
@jacobalberty

jacobalberty Dec 6, 2015

@IvixLabs are you using an anonymous function or a named function in the code you're getting a Segmentation fault in?

jacobalberty commented Dec 6, 2015

@IvixLabs are you using an anonymous function or a named function in the code you're getting a Segmentation fault in?

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Dec 6, 2015

Collaborator

Hi @IvixLabs , can you give some details on the failure here? Code examples would great, and a core dump even better if you have one.

Collaborator

wcgallego commented Dec 6, 2015

Hi @IvixLabs , can you give some details on the failure here? Code examples would great, and a core dump even better if you have one.

@asterixcapri

This comment has been minimized.

Show comment
Hide comment
@asterixcapri

asterixcapri Dec 8, 2015

@wcgallego seems that the segmentation fault is caused by anonymous function with inherited variables:

<?php
$worker = new \GearmanWorker();
$worker->addServer("127.0.0.1", 4730);

$function_name = "Foo";

$worker->addFunction($function_name, function(\GearmanJob $job) use ($function_name) {
    echo $function_name."\n";
    return true;
});

while ($worker->work()) {
}
<?php

$client = new \GearmanClient();
$client->addServer("127.0.0.1", 4730);
$client->doBackground("Foo", "workload");

Removing use ($function_name) everything is fine.

asterixcapri commented Dec 8, 2015

@wcgallego seems that the segmentation fault is caused by anonymous function with inherited variables:

<?php
$worker = new \GearmanWorker();
$worker->addServer("127.0.0.1", 4730);

$function_name = "Foo";

$worker->addFunction($function_name, function(\GearmanJob $job) use ($function_name) {
    echo $function_name."\n";
    return true;
});

while ($worker->work()) {
}
<?php

$client = new \GearmanClient();
$client->addServer("127.0.0.1", 4730);
$client->doBackground("Foo", "workload");

Removing use ($function_name) everything is fine.

@jacobalberty

This comment has been minimized.

Show comment
Hide comment
@jacobalberty

jacobalberty Dec 8, 2015

@asterixcapri just to stir the pot a little more anonymous functions in general with the php 7 gearman are having issues even the demo for sending mail from http://gearman.org/examples/send-emails/ crashes on the json_decode line, using (un)serialize produces similar albeit not exactly the same, the workaround im using is to use named functions for now.

Edit: just to give credit where its due the information is from wcgallego

jacobalberty commented Dec 8, 2015

@asterixcapri just to stir the pot a little more anonymous functions in general with the php 7 gearman are having issues even the demo for sending mail from http://gearman.org/examples/send-emails/ crashes on the json_decode line, using (un)serialize produces similar albeit not exactly the same, the workaround im using is to use named functions for now.

Edit: just to give credit where its due the information is from wcgallego

@IvixLabs

This comment has been minimized.

Show comment
Hide comment
@IvixLabs

IvixLabs Dec 9, 2015

I use https://github.com/mmoreram/GearmanBundle for working with gearman i am not sure how implemented callback inside.

When will be time i try learn more.

IvixLabs commented Dec 9, 2015

I use https://github.com/mmoreram/GearmanBundle for working with gearman i am not sure how implemented callback inside.

When will be time i try learn more.

@IvixLabs

This comment has been minimized.

Show comment
Hide comment
@IvixLabs

IvixLabs Dec 9, 2015

I found follow code

    /**
     * Wrapper function handler for all registered functions
     * This allows us to do some nice logging when jobs are started/finished
     *
     * @see https://github.com/brianlmoon/GearmanManager/blob/ffc828dac2547aff76cb4962bb3fcc4f454ec8a2/GearmanPeclManager.php#L95-206
     *
     * @param \GearmanJob $job
     * @param mixed $context
     *
     * @return mixed
     */
    public function handleJob(\GearmanJob $job, $context)
    {
        var_dump('Step 1');
        var_dump(array_keys($context));
        $mehod = $context['job_method'];
        var_dump('Step 2');
        var_dump($context['job_method']);
        var_dump('Step 3');
        if (
            !is_array($context)
            || !array_key_exists('job_object_instance', $context)
            || !array_key_exists('job_method', $context)
        ) {
            throw new \InvalidArgumentException('$context shall be an array with job_object_instance and job_method key.');
        }

        $event = new GearmanWorkStartingEvent($context['jobs']);
        $this->eventDispatcher->dispatch(GearmanEvents::GEARMAN_WORK_STARTING, $event);


        $result = call_user_func_array(
            array($context['job_object_instance'], $context['job_method']),
            array($job, $context)
        );

        /**
         * Workaround for PECL bug #17114
         * http://pecl.php.net/bugs/bug.php?id=17114
         */
        $type = gettype($result);
        settype($result, $type);

        return $result;
    }

in output:

array(3) {
  [0] =>
  string(19) "job_object_instance"
  [1] =>
  string(10) "job_method"
  [2] =>
  string(4) "jobs"
}
Segmentation fault: 11

It means Segmentation fault: 11 on $mehod = $context['job_method'];

IvixLabs commented Dec 9, 2015

I found follow code

    /**
     * Wrapper function handler for all registered functions
     * This allows us to do some nice logging when jobs are started/finished
     *
     * @see https://github.com/brianlmoon/GearmanManager/blob/ffc828dac2547aff76cb4962bb3fcc4f454ec8a2/GearmanPeclManager.php#L95-206
     *
     * @param \GearmanJob $job
     * @param mixed $context
     *
     * @return mixed
     */
    public function handleJob(\GearmanJob $job, $context)
    {
        var_dump('Step 1');
        var_dump(array_keys($context));
        $mehod = $context['job_method'];
        var_dump('Step 2');
        var_dump($context['job_method']);
        var_dump('Step 3');
        if (
            !is_array($context)
            || !array_key_exists('job_object_instance', $context)
            || !array_key_exists('job_method', $context)
        ) {
            throw new \InvalidArgumentException('$context shall be an array with job_object_instance and job_method key.');
        }

        $event = new GearmanWorkStartingEvent($context['jobs']);
        $this->eventDispatcher->dispatch(GearmanEvents::GEARMAN_WORK_STARTING, $event);


        $result = call_user_func_array(
            array($context['job_object_instance'], $context['job_method']),
            array($job, $context)
        );

        /**
         * Workaround for PECL bug #17114
         * http://pecl.php.net/bugs/bug.php?id=17114
         */
        $type = gettype($result);
        settype($result, $type);

        return $result;
    }

in output:

array(3) {
  [0] =>
  string(19) "job_object_instance"
  [1] =>
  string(10) "job_method"
  [2] =>
  string(4) "jobs"
}
Segmentation fault: 11

It means Segmentation fault: 11 on $mehod = $context['job_method'];

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Dec 9, 2015

Collaborator

Hey All,

I just pushed a change out which should in theory fix this. Looks like I wasn't copying over some zvals correctly. They weren't out of scope yet, so they weren't being cleaned up, except I think the Closure was probably doing some clean up assuming there wasn't an added reference to it.

If you could run your own code against this to test and confirm, It'd be much appreciated. Code should be in my github repo here: https://github.com/wcgallego/pecl-gearman/

Collaborator

wcgallego commented Dec 9, 2015

Hey All,

I just pushed a change out which should in theory fix this. Looks like I wasn't copying over some zvals correctly. They weren't out of scope yet, so they weren't being cleaned up, except I think the Closure was probably doing some clean up assuming there wasn't an added reference to it.

If you could run your own code against this to test and confirm, It'd be much appreciated. Code should be in my github repo here: https://github.com/wcgallego/pecl-gearman/

@jacobalberty

This comment has been minimized.

Show comment
Hide comment
@jacobalberty

jacobalberty Dec 9, 2015

Fixed the issues I was having.

jacobalberty commented Dec 9, 2015

Fixed the issues I was having.

@asterixcapri

This comment has been minimized.

Show comment
Hide comment
@asterixcapri

asterixcapri Dec 9, 2015

The fix works for me! Good job! :)

asterixcapri commented Dec 9, 2015

The fix works for me! Good job! :)

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Dec 9, 2015

Collaborator

Thanks for the eyes and for the patience everyone! Happy to tackle more issues as they come in

Collaborator

wcgallego commented Dec 9, 2015

Thanks for the eyes and for the patience everyone! Happy to tackle more issues as they come in

@vincentdesmares

This comment has been minimized.

Show comment
Hide comment
@vincentdesmares

vincentdesmares Dec 10, 2015

Good work! I can't wait to move to 7.0.

vincentdesmares commented Dec 10, 2015

Good work! I can't wait to move to 7.0.

@IvixLabs

This comment has been minimized.

Show comment
Hide comment
@IvixLabs

IvixLabs Dec 10, 2015

I have same error is what i wrote above.
I develop on Mac OS X using brew maybe for me problem in other place there is my installation steps:
Maybe problem in make step have some warnings.

bash-3.2$ git clone https://github.com/wcgallego/pecl-gearman.git
Cloning into 'pecl-gearman'...
remote: Counting objects: 520, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 520 (delta 1), reused 0 (delta 0), pack-reused 514
Receiving objects: 100% (520/520), 395.85 KiB | 75.00 KiB/s, done.
Resolving deltas: 100% (323/323), done.
Checking connectivity... done.
bash-3.2$ cd ./pecl-gearman/
bash-3.2$ php -v
PHP 7.0.0 (cli) (built: Dec  2 2015 13:06:23) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.4.0RC2, Copyright (c) 2002-2015, by Derick Rethans
bash-3.2$ phpize 
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
bash-3.2$ ./configure 
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin15.0.0
checking host system type... x86_64-apple-darwin15.0.0
checking target system type... x86_64-apple-darwin15.0.0
checking for PHP prefix... /usr/local/Cellar/php70/7.0.0
checking for PHP includes... -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php70/7.0.0/lib/php/extensions/no-debug-non-zts-20151012
checking for PHP installed headers prefix... /usr/local/Cellar/php70/7.0.0/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable gearman support... yes, shared
found in /usr/local
checking for gearman_client_set_context in -lgearman... yes
checking for gearman_worker_set_server_option in -lgearman... yes
checking for gearman_job_error in -lgearman... yes
checking for gearman_client_unique_status in -lgearman... yes
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
bash-3.2$ make
/bin/sh /Users/ivix/app/pecl-gearman/libtool --mode=compile cc  -I. -I/Users/ivix/app/pecl-gearman -DPHP_ATOM_INC -I/Users/ivix/app/pecl-gearman/include -I/Users/ivix/app/pecl-gearman/main -I/Users/ivix/app/pecl-gearman -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2 -Wall   -c /Users/ivix/app/pecl-gearman/php_gearman.c -o php_gearman.lo 
mkdir .libs
 cc -I. -I/Users/ivix/app/pecl-gearman -DPHP_ATOM_INC -I/Users/ivix/app/pecl-gearman/include -I/Users/ivix/app/pecl-gearman/main -I/Users/ivix/app/pecl-gearman -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -Wall -c /Users/ivix/app/pecl-gearman/php_gearman.c  -fno-common -DPIC -o .libs/php_gearman.o
/Users/ivix/app/pecl-gearman/php_gearman.c:75:24: warning: unused variable 'arginfo_gearman_task_context' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_task_context, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:307:24: warning: unused variable 'arginfo_oo_gearman_client_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_options, 0, 0, 0)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:315:24: warning: unused variable 'arginfo_oo_gearman_client_set_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_set_options, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:324:24: warning: unused variable 'arginfo_oo_gearman_client_add_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_options, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:333:24: warning: unused variable 'arginfo_oo_gearman_client_remove_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_remove_options, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:537:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_low' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_low, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:552:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_background' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_background, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:567:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_high_background' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_high_background, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:582:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_low_background' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_low_background, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:589:24: warning: unused variable 'arginfo_gearman_client_add_task_status' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_client_add_task_status, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
10 warnings generated.
/bin/sh /Users/ivix/app/pecl-gearman/libtool --mode=link cc -DPHP_ATOM_INC -I/Users/ivix/app/pecl-gearman/include -I/Users/ivix/app/pecl-gearman/main -I/Users/ivix/app/pecl-gearman -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2 -Wall   -o gearman.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/ivix/app/pecl-gearman/modules  php_gearman.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/gearman.so -bundle  .libs/php_gearman.o  -L/usr/local/lib -lgearman  -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
dsymutil .libs/gearman.so || :
creating gearman.la
(cd .libs && rm -f gearman.la && ln -s ../gearman.la gearman.la)
/bin/sh /Users/ivix/app/pecl-gearman/libtool --mode=install cp ./gearman.la /Users/ivix/app/pecl-gearman/modules
cp ./.libs/gearman.so /Users/ivix/app/pecl-gearman/modules/gearman.so
cp ./.libs/gearman.lai /Users/ivix/app/pecl-gearman/modules/gearman.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Users/ivix/app/pecl-gearman/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

bash-3.2$ cp ./modules/gearman.so /usr/local/gearman/gearman.so 
bash-3.2$ php -i | grep gearman
/usr/local/etc/php/7.0/conf.d/ext-gearman.ini,
gearman
gearman support => enabled
libgearman version => 1.1.12
PWD => /Users/ivix/app/pecl-gearman
$_SERVER['PWD'] => /Users/ivix/app/pecl-gearman
bash-3.2$ cat /usr/local/etc/php/7.0/conf.d/ext-gearman.ini 
[gearman]
extension="/usr/local/php70-gearman/gearman.so"

IvixLabs commented Dec 10, 2015

I have same error is what i wrote above.
I develop on Mac OS X using brew maybe for me problem in other place there is my installation steps:
Maybe problem in make step have some warnings.

bash-3.2$ git clone https://github.com/wcgallego/pecl-gearman.git
Cloning into 'pecl-gearman'...
remote: Counting objects: 520, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 520 (delta 1), reused 0 (delta 0), pack-reused 514
Receiving objects: 100% (520/520), 395.85 KiB | 75.00 KiB/s, done.
Resolving deltas: 100% (323/323), done.
Checking connectivity... done.
bash-3.2$ cd ./pecl-gearman/
bash-3.2$ php -v
PHP 7.0.0 (cli) (built: Dec  2 2015 13:06:23) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.4.0RC2, Copyright (c) 2002-2015, by Derick Rethans
bash-3.2$ phpize 
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
bash-3.2$ ./configure 
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin15.0.0
checking host system type... x86_64-apple-darwin15.0.0
checking target system type... x86_64-apple-darwin15.0.0
checking for PHP prefix... /usr/local/Cellar/php70/7.0.0
checking for PHP includes... -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php70/7.0.0/lib/php/extensions/no-debug-non-zts-20151012
checking for PHP installed headers prefix... /usr/local/Cellar/php70/7.0.0/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable gearman support... yes, shared
found in /usr/local
checking for gearman_client_set_context in -lgearman... yes
checking for gearman_worker_set_server_option in -lgearman... yes
checking for gearman_job_error in -lgearman... yes
checking for gearman_client_unique_status in -lgearman... yes
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
bash-3.2$ make
/bin/sh /Users/ivix/app/pecl-gearman/libtool --mode=compile cc  -I. -I/Users/ivix/app/pecl-gearman -DPHP_ATOM_INC -I/Users/ivix/app/pecl-gearman/include -I/Users/ivix/app/pecl-gearman/main -I/Users/ivix/app/pecl-gearman -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2 -Wall   -c /Users/ivix/app/pecl-gearman/php_gearman.c -o php_gearman.lo 
mkdir .libs
 cc -I. -I/Users/ivix/app/pecl-gearman -DPHP_ATOM_INC -I/Users/ivix/app/pecl-gearman/include -I/Users/ivix/app/pecl-gearman/main -I/Users/ivix/app/pecl-gearman -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -Wall -c /Users/ivix/app/pecl-gearman/php_gearman.c  -fno-common -DPIC -o .libs/php_gearman.o
/Users/ivix/app/pecl-gearman/php_gearman.c:75:24: warning: unused variable 'arginfo_gearman_task_context' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_task_context, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:307:24: warning: unused variable 'arginfo_oo_gearman_client_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_options, 0, 0, 0)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:315:24: warning: unused variable 'arginfo_oo_gearman_client_set_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_set_options, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:324:24: warning: unused variable 'arginfo_oo_gearman_client_add_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_options, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:333:24: warning: unused variable 'arginfo_oo_gearman_client_remove_options' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_remove_options, 0, 0, 1)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:537:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_low' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_low, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:552:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_background' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_background, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:567:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_high_background' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_high_background, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:582:24: warning: unused variable 'arginfo_oo_gearman_client_add_task_low_background' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_task_low_background, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
/Users/ivix/app/pecl-gearman/php_gearman.c:589:24: warning: unused variable 'arginfo_gearman_client_add_task_status' [-Wunused-const-variable]
ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_client_add_task_status, 0, 0, 2)
                       ^
/usr/local/Cellar/php70/7.0.0/include/php/Zend/zend_API.h:118:38: note: expanded from macro 'ZEND_BEGIN_ARG_INFO_EX'
        static const zend_internal_arg_info name[] = { \
                                            ^
10 warnings generated.
/bin/sh /Users/ivix/app/pecl-gearman/libtool --mode=link cc -DPHP_ATOM_INC -I/Users/ivix/app/pecl-gearman/include -I/Users/ivix/app/pecl-gearman/main -I/Users/ivix/app/pecl-gearman -I/usr/local/Cellar/php70/7.0.0/include/php -I/usr/local/Cellar/php70/7.0.0/include/php/main -I/usr/local/Cellar/php70/7.0.0/include/php/TSRM -I/usr/local/Cellar/php70/7.0.0/include/php/Zend -I/usr/local/Cellar/php70/7.0.0/include/php/ext -I/usr/local/Cellar/php70/7.0.0/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2 -Wall   -o gearman.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/ivix/app/pecl-gearman/modules  php_gearman.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgearman
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/gearman.so -bundle  .libs/php_gearman.o  -L/usr/local/lib -lgearman  -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
dsymutil .libs/gearman.so || :
creating gearman.la
(cd .libs && rm -f gearman.la && ln -s ../gearman.la gearman.la)
/bin/sh /Users/ivix/app/pecl-gearman/libtool --mode=install cp ./gearman.la /Users/ivix/app/pecl-gearman/modules
cp ./.libs/gearman.so /Users/ivix/app/pecl-gearman/modules/gearman.so
cp ./.libs/gearman.lai /Users/ivix/app/pecl-gearman/modules/gearman.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Users/ivix/app/pecl-gearman/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

bash-3.2$ cp ./modules/gearman.so /usr/local/gearman/gearman.so 
bash-3.2$ php -i | grep gearman
/usr/local/etc/php/7.0/conf.d/ext-gearman.ini,
gearman
gearman support => enabled
libgearman version => 1.1.12
PWD => /Users/ivix/app/pecl-gearman
$_SERVER['PWD'] => /Users/ivix/app/pecl-gearman
bash-3.2$ cat /usr/local/etc/php/7.0/conf.d/ext-gearman.ini 
[gearman]
extension="/usr/local/php70-gearman/gearman.so"
@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Dec 12, 2015

Collaborator

Hi @IvixLabs,

I need to do some more clean up to get rid of those warnings, but they shouldn't be contributing to the segfault. Just to confirm, you're using the latest version from my repo from a few days ago, correct?

If you could distill down the code outside of the GearmanManager code, that would be helpful in speeding up finding where the problem lies. I'll keep looking at it from my end. Thanks!

Collaborator

wcgallego commented Dec 12, 2015

Hi @IvixLabs,

I need to do some more clean up to get rid of those warnings, but they shouldn't be contributing to the segfault. Just to confirm, you're using the latest version from my repo from a few days ago, correct?

If you could distill down the code outside of the GearmanManager code, that would be helpful in speeding up finding where the problem lies. I'll keep looking at it from my end. Thanks!

@IvixLabs

This comment has been minimized.

Show comment
Hide comment
@IvixLabs

IvixLabs Dec 14, 2015

I try reproduce seg fault with more simple code seem it works ok except one case and maybe it related to my problem.

test_worker.php

<?php

class JobHandler
{

    public function handleJob(GearmanJob $job)
    {
        $data = $job->workload();
        $this->logInfo($data);
        return 'success';
    }

    private function logInfo($message)
    {
        var_dump($message);
    }

}

class GearmanManager
{

    private $worker;

    /**
     * GearmanManager constructor.
     */
    public function __construct()
    {
        $this->worker = new GearmanWorker();
        $this->worker->addServer('127.0.0.1', 4730);
    }

    public function addJob($instance, $methodName)
    {
        $context = [
            'job_method' => $methodName,
            //'job_object_instance' => $instance
        ];

        $this->worker->addFunction("test_fun", array($this, 'handleJob'), $context);

        $this->worker->work();
    }

    public function handleJob(\GearmanJob $job, $context)
    {
        if (
            !is_array($context)
            || !array_key_exists('job_object_instance', $context)
            || !array_key_exists('job_method', $context)
        ) {
            var_dump('step2');
            throw new \InvalidArgumentException('$context shall be an array with job_object_instance and job_method key.');
        }

        $result = call_user_func_array(
            array($context['job_object_instance'], $context['job_method']),
            array($job, $context)
        );

        return $result;
    }
}


$jobHandler = new JobHandler();

$manager = new GearmanManager();
$manager->addJob($jobHandler, 'handleJob');

test_client.php

<?php

$client = new GearmanClient();
$client->addServer('127.0.0.1', 4730);

$result = $client->doNormal('test_fun', 'Hello');
var_dump($result);

output:

string(5) "step2"
Illegal instruction: 4

It means on place where it throws exception i have "Illegal instruction: 4".

But in my base code no exception.

Maybe problem in mac os x.
I will try learn more.

IvixLabs commented Dec 14, 2015

I try reproduce seg fault with more simple code seem it works ok except one case and maybe it related to my problem.

test_worker.php

<?php

class JobHandler
{

    public function handleJob(GearmanJob $job)
    {
        $data = $job->workload();
        $this->logInfo($data);
        return 'success';
    }

    private function logInfo($message)
    {
        var_dump($message);
    }

}

class GearmanManager
{

    private $worker;

    /**
     * GearmanManager constructor.
     */
    public function __construct()
    {
        $this->worker = new GearmanWorker();
        $this->worker->addServer('127.0.0.1', 4730);
    }

    public function addJob($instance, $methodName)
    {
        $context = [
            'job_method' => $methodName,
            //'job_object_instance' => $instance
        ];

        $this->worker->addFunction("test_fun", array($this, 'handleJob'), $context);

        $this->worker->work();
    }

    public function handleJob(\GearmanJob $job, $context)
    {
        if (
            !is_array($context)
            || !array_key_exists('job_object_instance', $context)
            || !array_key_exists('job_method', $context)
        ) {
            var_dump('step2');
            throw new \InvalidArgumentException('$context shall be an array with job_object_instance and job_method key.');
        }

        $result = call_user_func_array(
            array($context['job_object_instance'], $context['job_method']),
            array($job, $context)
        );

        return $result;
    }
}


$jobHandler = new JobHandler();

$manager = new GearmanManager();
$manager->addJob($jobHandler, 'handleJob');

test_client.php

<?php

$client = new GearmanClient();
$client->addServer('127.0.0.1', 4730);

$result = $client->doNormal('test_fun', 'Hello');
var_dump($result);

output:

string(5) "step2"
Illegal instruction: 4

It means on place where it throws exception i have "Illegal instruction: 4".

But in my base code no exception.

Maybe problem in mac os x.
I will try learn more.

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Jan 24, 2016

would be nice to have this 7.0 branch on the Pecl repos too!

acasademont commented Jan 24, 2016

would be nice to have this 7.0 branch on the Pecl repos too!

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Jan 24, 2016

Owner

@acasademont there is no actual release yet. when @wcgallego tags a release, we can put it up on PECL

Owner

hjr3 commented Jan 24, 2016

@acasademont there is no actual release yet. when @wcgallego tags a release, we can put it up on PECL

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Jan 24, 2016

@hjr3 what about a "beta" release on PECL? That would make it easier for people to test

acasademont commented Jan 24, 2016

@hjr3 what about a "beta" release on PECL? That would make it easier for people to test

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Jan 24, 2016

Owner

@acasademont good idea. i will make one tonight

Owner

hjr3 commented Jan 24, 2016

@acasademont good idea. i will make one tonight

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Jan 24, 2016

nice! btw, so far no problems at all with PHP7 and the extension :)

acasademont commented Jan 24, 2016

nice! btw, so far no problems at all with PHP7 and the extension :)

@vojta

This comment has been minimized.

Show comment
Hide comment
@vojta

vojta Jan 24, 2016

I've found an issue with GearmanJob::setCompleteCallback() - could you please try to reproduce it? wcgallego/pecl-gearman#3

I'm running Centos6, PHP 7.0.2

vojta commented Jan 24, 2016

I've found an issue with GearmanJob::setCompleteCallback() - could you please try to reproduce it? wcgallego/pecl-gearman#3

I'm running Centos6, PHP 7.0.2

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Jan 24, 2016

Collaborator

thanks, vojta, can you give some details about it?

Collaborator

wcgallego commented Jan 24, 2016

thanks, vojta, can you give some details about it?

@vojta

This comment has been minimized.

Show comment
Hide comment
@vojta

vojta Jan 25, 2016

Details are here: wcgallego/pecl-gearman#3

failCallback() is triggered instead of jobCallback()

vojta commented Jan 25, 2016

Details are here: wcgallego/pecl-gearman#3

failCallback() is triggered instead of jobCallback()

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Mar 9, 2016

someone with enough PHP extensions knowledge maybe can help @wcgallego? We're seeing lots of segfaults with the latest master, the one I fetched on January was working much better :(

acasademont commented Mar 9, 2016

someone with enough PHP extensions knowledge maybe can help @wcgallego? We're seeing lots of segfaults with the latest master, the one I fetched on January was working much better :(

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Mar 9, 2016

Collaborator

hey @acasademont, just to confirm, have you grabbed recent versions from my repo?

I was trying to sort out the seg fault about a week ago or so but wasn't able to reproduce. @vojta did comment on it I think a day or two ago, but I don't immediately have the bandwidth to look right now. If you have a test case you can paste, that would go a long way! Thanks.

Collaborator

wcgallego commented Mar 9, 2016

hey @acasademont, just to confirm, have you grabbed recent versions from my repo?

I was trying to sort out the seg fault about a week ago or so but wasn't able to reproduce. @vojta did comment on it I think a day or two ago, but I don't immediately have the bandwidth to look right now. If you have a test case you can paste, that would go a long way! Thanks.

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Mar 9, 2016

Yes, In my machine I had a version from January 24th, working fine, from yesterday's master it's not. It's a really big app, will be difficult to provide a simple test case...I will try though

acasademont commented Mar 9, 2016

Yes, In my machine I had a version from January 24th, working fine, from yesterday's master it's not. It's a really big app, will be difficult to provide a simple test case...I will try though

@oligriffiths

This comment has been minimized.

Show comment
Hide comment
@oligriffiths

oligriffiths Mar 15, 2016

Hey @acasademont. Just built your branch and tried to run the examples. It appears GearmanClient::do does not exist. Any ideas?

Fatal error: Uncaught Error: Call to undefined method GearmanClient::do() in /home/oli/pecl-gearman/examples/reverse_client.php:30

oligriffiths commented Mar 15, 2016

Hey @acasademont. Just built your branch and tried to run the examples. It appears GearmanClient::do does not exist. Any ideas?

Fatal error: Uncaught Error: Call to undefined method GearmanClient::do() in /home/oli/pecl-gearman/examples/reverse_client.php:30

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Mar 16, 2016

Owner

@oligriffiths The do method name is a reserved word in PHP. Before I released 1.0.0, I deprecated those method names. In master, those method names were removed: 2a20dcf

Per http://php.net/manual/en/gearmanclient.do.php the new method was moved to http://php.net/manual/en/gearmanclient.donormal.php

Owner

hjr3 commented Mar 16, 2016

@oligriffiths The do method name is a reserved word in PHP. Before I released 1.0.0, I deprecated those method names. In master, those method names were removed: 2a20dcf

Per http://php.net/manual/en/gearmanclient.do.php the new method was moved to http://php.net/manual/en/gearmanclient.donormal.php

@oligriffiths

This comment has been minimized.

Show comment
Hide comment
@oligriffiths

oligriffiths Mar 16, 2016

Gotcha.

Yeah I found if I updated the examples it all works as expected :)

Thanks

On 16 Mar 2016, at 12:18, Herman J. Radtke III notifications@github.com wrote:

@oligriffiths The do method name is a reserved word in PHP. Before I released 1.0.0, I deprecated those method names. In master, those method names were removed: 2a20dcf

Per http://php.net/manual/en/gearmanclient.do.php the new method was moved to http://php.net/manual/en/gearmanclient.donormal.php


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

oligriffiths commented Mar 16, 2016

Gotcha.

Yeah I found if I updated the examples it all works as expected :)

Thanks

On 16 Mar 2016, at 12:18, Herman J. Radtke III notifications@github.com wrote:

@oligriffiths The do method name is a reserved word in PHP. Before I released 1.0.0, I deprecated those method names. In master, those method names were removed: 2a20dcf

Per http://php.net/manual/en/gearmanclient.do.php the new method was moved to http://php.net/manual/en/gearmanclient.donormal.php


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Mar 16, 2016

Owner

@oligriffiths I totally missed that the Examples are using the deprecated methods. I will fix.

Owner

hjr3 commented Mar 16, 2016

@oligriffiths I totally missed that the Examples are using the deprecated methods. I will fix.

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Mar 16, 2016

Owner

I updated the basic example to use doNormal instead of do.

Owner

hjr3 commented Mar 16, 2016

I updated the basic example to use doNormal instead of do.

@oligriffiths

This comment has been minimized.

Show comment
Hide comment
@oligriffiths

oligriffiths Mar 18, 2016

Amazing, thanks Herman!

On 16 Mar 2016, at 18:55, Herman J. Radtke III notifications@github.com wrote:

I updated the basic example to use doNormal instead of do.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

oligriffiths commented Mar 18, 2016

Amazing, thanks Herman!

On 16 Mar 2016, at 18:55, Herman J. Radtke III notifications@github.com wrote:

I updated the basic example to use doNormal instead of do.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@sebastien-fauvel

This comment has been minimized.

Show comment
Hide comment
@sebastien-fauvel

sebastien-fauvel Mar 21, 2016

@wcgallego is it correct that your master branch on https://github.com/wcgallego/pecl-gearman is where most work is being done regarding this php7 upgrade? Have you already contacted the pecl team to make a beta release there? Is it kind of working already? Any updates are very appreciated!

sebastien-fauvel commented Mar 21, 2016

@wcgallego is it correct that your master branch on https://github.com/wcgallego/pecl-gearman is where most work is being done regarding this php7 upgrade? Have you already contacted the pecl team to make a beta release there? Is it kind of working already? Any updates are very appreciated!

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Mar 21, 2016

yes @sebastien-fauvel right now master seems to be working quite well, already using it in production with php7

acasademont commented Mar 21, 2016

yes @sebastien-fauvel right now master seems to be working quite well, already using it in production with php7

@sebastien-fauvel

This comment has been minimized.

Show comment
Hide comment
@sebastien-fauvel

sebastien-fauvel Mar 21, 2016

Thanks for the timely reply :) How do you install it in production without pecl? Just like this:

git clone https://github.com/wcgallego/pecl-gearman.git
cd pecl-gearman
${ROOT_DIR}/php7/bin/phpize -clean
./configure --with-php-config=${ROOT_DIR}/php7/bin/php-config
make install

then create ${ROOT_DIR}/etc/php7/conf.d/gearman.ini and restart php7? Or is there one more step beforehand to prepare things after cloning the repo?

sebastien-fauvel commented Mar 21, 2016

Thanks for the timely reply :) How do you install it in production without pecl? Just like this:

git clone https://github.com/wcgallego/pecl-gearman.git
cd pecl-gearman
${ROOT_DIR}/php7/bin/phpize -clean
./configure --with-php-config=${ROOT_DIR}/php7/bin/php-config
make install

then create ${ROOT_DIR}/etc/php7/conf.d/gearman.ini and restart php7? Or is there one more step beforehand to prepare things after cloning the repo?

@acasademont

This comment has been minimized.

Show comment
Hide comment
@acasademont

acasademont Mar 21, 2016

I think it's even more convenient without git at all. This is my script for debian jessie

wget https://github.com/wcgallego/pecl-gearman/archive/master.zip
unzip master.zip
cd pecl-gearman-master
phpize
./configure
make install
echo "extension=gearman.so" > /etc/php/mods-available/gearman.ini
phpenmod -v ALL -s ALL gearman
service php7.0-fpm restart

acasademont commented Mar 21, 2016

I think it's even more convenient without git at all. This is my script for debian jessie

wget https://github.com/wcgallego/pecl-gearman/archive/master.zip
unzip master.zip
cd pecl-gearman-master
phpize
./configure
make install
echo "extension=gearman.so" > /etc/php/mods-available/gearman.ini
phpenmod -v ALL -s ALL gearman
service php7.0-fpm restart
@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Mar 21, 2016

Collaborator

hey all,

I can cut a branch next week. I'd like to give it a few more days as we've only just had some annoying seg faults that were lingering squashed and I'd like to give a little more burn in time.

I'll be AFK on PTO until next week as well, so apologies but I won't be in communication range.

Collaborator

wcgallego commented Mar 21, 2016

hey all,

I can cut a branch next week. I'd like to give it a few more days as we've only just had some annoying seg faults that were lingering squashed and I'd like to give a little more burn in time.

I'll be AFK on PTO until next week as well, so apologies but I won't be in communication range.

@PunKeel

This comment has been minimized.

Show comment
Hide comment
@PunKeel

PunKeel May 4, 2016

👍 please

PunKeel commented May 4, 2016

👍 please

@dmitriivoitovich

This comment has been minimized.

Show comment
Hide comment
@dmitriivoitovich

dmitriivoitovich May 12, 2016

@wcgallego Hello! Can you please clarify why the interface of your GearmanClient is so different from the one described in official documentation? For example there are a bunch of methods that now require a client_object as the first argument (http://php.net/manual/en/gearmanclient.setoptions.php):

options
setOptions
addOptions
removeOptions
addTaskLow
addTaskBackground
addTaskHighBackground
addTaskLowBackground
setWarningCallback

Parameter #0 [ <required> $client_object ]

That's rather weird I think, and also generates a lot of troubles with already existing code.

dmitriivoitovich commented May 12, 2016

@wcgallego Hello! Can you please clarify why the interface of your GearmanClient is so different from the one described in official documentation? For example there are a bunch of methods that now require a client_object as the first argument (http://php.net/manual/en/gearmanclient.setoptions.php):

options
setOptions
addOptions
removeOptions
addTaskLow
addTaskBackground
addTaskHighBackground
addTaskLowBackground
setWarningCallback

Parameter #0 [ <required> $client_object ]

That's rather weird I think, and also generates a lot of troubles with already existing code.

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego May 12, 2016

Collaborator

@dmitriivoitovich This would be a better question set up as an issue on my branch of the code, so as to clarify threads and not pollute them with several problems.

The documentation hasn't always been the best on php.net for Gearman. Can you confirm the difference between PHP 5.x and PHP 7? Could've simply been a porting mistake.

Collaborator

wcgallego commented May 12, 2016

@dmitriivoitovich This would be a better question set up as an issue on my branch of the code, so as to clarify threads and not pollute them with several problems.

The documentation hasn't always been the best on php.net for Gearman. Can you confirm the difference between PHP 5.x and PHP 7? Could've simply been a porting mistake.

@dmitriivoitovich

This comment has been minimized.

Show comment
Hide comment
@dmitriivoitovich

dmitriivoitovich May 12, 2016

@wcgallego Thanks for your feedback! I've opened a new issue wcgallego/pecl-gearman#22
Please correct me if I did something wrong

dmitriivoitovich commented May 12, 2016

@wcgallego Thanks for your feedback! I've opened a new issue wcgallego/pecl-gearman#22
Please correct me if I did something wrong

@relaxnow

This comment has been minimized.

Show comment
Hide comment
@relaxnow

relaxnow Jul 22, 2016

Hi @wcgallego there still is no version on Pecl that supports PHP7, could you add it? Anything we users can do?

relaxnow commented Jul 22, 2016

Hi @wcgallego there still is no version on Pecl that supports PHP7, could you add it? Anything we users can do?

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Aug 13, 2016

Collaborator

Hey All,

As said in previous thread, sorry, life got in the way of code!

I've tagged 2.0.1 branch on github.com/wcgallego/pecl-gearman but I've never gotten any versions on Pecl proper, so the tango to do so is unknown to me. Happy to help get this up there! Also, thanks again for massive patience on this, it's really appreciated.

Collaborator

wcgallego commented Aug 13, 2016

Hey All,

As said in previous thread, sorry, life got in the way of code!

I've tagged 2.0.1 branch on github.com/wcgallego/pecl-gearman but I've never gotten any versions on Pecl proper, so the tango to do so is unknown to me. Happy to help get this up there! Also, thanks again for massive patience on this, it's really appreciated.

@sebastien-fauvel

This comment has been minimized.

Show comment
Hide comment
@sebastien-fauvel

sebastien-fauvel Aug 13, 2016

Maybe contact the maintainers? According to pecl, the project leads are:

James Luedke contact@jamesluedke.com
Herman Radtke hradtke@php.net

sebastien-fauvel commented Aug 13, 2016

Maybe contact the maintainers? According to pecl, the project leads are:

James Luedke contact@jamesluedke.com
Herman Radtke hradtke@php.net

@till

This comment has been minimized.

Show comment
Hide comment
@till

till Aug 13, 2016

@wcgallego did you send a PR somewhere?

till commented Aug 13, 2016

@wcgallego did you send a PR somewhere?

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Aug 13, 2016

Collaborator

I think this repo is about as official as it gets. Happy to merge in but I did contact hjr off thread

Collaborator

wcgallego commented Aug 13, 2016

I think this repo is about as official as it gets. Happy to merge in but I did contact hjr off thread

@till

This comment has been minimized.

Show comment
Hide comment
@till

till Aug 13, 2016

@wcgallego yeah, sorry. That was my the point. Can you send one to this repo so we can merge it? I can help with the pecl stuff if required. I can help track down @hjr3. :)


Sorted of related, maybe @hjr3 wants to add you as a contributor? ;)

till commented Aug 13, 2016

@wcgallego yeah, sorry. That was my the point. Can you send one to this repo so we can merge it? I can help with the pecl stuff if required. I can help track down @hjr3. :)


Sorted of related, maybe @hjr3 wants to add you as a contributor? ;)

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Aug 14, 2016

Owner

@wcgallego Sorry, I don't think I got the message. Happy to add you as a contributor.

@till thanks for helping 😄

I can create a PR right from master...wcgallego:2.0.1 if that sounds good to people too.

Owner

hjr3 commented Aug 14, 2016

@wcgallego Sorry, I don't think I got the message. Happy to add you as a contributor.

@till thanks for helping 😄

I can create a PR right from master...wcgallego:2.0.1 if that sounds good to people too.

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Aug 14, 2016

Collaborator

Sure, I can do the contributor thing if it's easiest. Thanks!

Collaborator

wcgallego commented Aug 14, 2016

Sure, I can do the contributor thing if it's easiest. Thanks!

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Aug 29, 2016

Owner

There is an open segfault issue that has a PHP 7 report. #15 (comment)

Has anyone else seen this?

Owner

hjr3 commented Aug 29, 2016

There is an open segfault issue that has a PHP 7 report. #15 (comment)

Has anyone else seen this?

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Aug 29, 2016

Collaborator

I have not, but it looks like the thread has closed. They also were not using the latest version, 2.0.1

@hjr3 - Were you planning on contributing more to the extension? We can certainly collaborate here, but most of the work has been on my branch and seems like has been the focus of PHP 7 dev

Collaborator

wcgallego commented Aug 29, 2016

I have not, but it looks like the thread has closed. They also were not using the latest version, 2.0.1

@hjr3 - Were you planning on contributing more to the extension? We can certainly collaborate here, but most of the work has been on my branch and seems like has been the focus of PHP 7 dev

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Aug 29, 2016

Owner

@wcgallego they closed it as I mentioned it here. Good call about not using the latest version.

I was supporting this extension through work, but we are not actively using gearman anymore. I have no problems if you want to make your repo this official pecl/gearman one going forward. I can update the README and other things if that helps as well.

Owner

hjr3 commented Aug 29, 2016

@wcgallego they closed it as I mentioned it here. Good call about not using the latest version.

I was supporting this extension through work, but we are not actively using gearman anymore. I have no problems if you want to make your repo this official pecl/gearman one going forward. I can update the README and other things if that helps as well.

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Aug 29, 2016

Collaborator

We're still actively using it over here and I hate making you middle man for these changes :\ And it seems lame that you've fallen into the "not it!" situation of being last to touch.

I'm happy to keep up maintenance of the extension for the time being

Collaborator

wcgallego commented Aug 29, 2016

We're still actively using it over here and I hate making you middle man for these changes :\ And it seems lame that you've fallen into the "not it!" situation of being last to touch.

I'm happy to keep up maintenance of the extension for the time being

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Aug 29, 2016

Owner

@wcgallego Ya, the PHP core team never setup official pecl repos 😒

Owner

hjr3 commented Aug 29, 2016

@wcgallego Ya, the PHP core team never setup official pecl repos 😒

@till

This comment has been minimized.

Show comment
Hide comment
@till

till Aug 29, 2016

@wcgallego @hjr3 maybe create a pecl-gearman org and put it there? That way it's not tied to anyone's account and you can add contributors, etc..

till commented Aug 29, 2016

@wcgallego @hjr3 maybe create a pecl-gearman org and put it there? That way it's not tied to anyone's account and you can add contributors, etc..

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Dec 7, 2016

Owner

@wcgallego picking up from gearman/gearmand#62 (comment) I have reached out to @Tyrael about getting a pecl-gearman repo at github.com/php

Owner

hjr3 commented Dec 7, 2016

@wcgallego picking up from gearman/gearmand#62 (comment) I have reached out to @Tyrael about getting a pecl-gearman repo at github.com/php

@Tyrael

This comment has been minimized.

Show comment
Hide comment
@Tyrael

Tyrael Dec 11, 2016

hi, should I create an empty repo on git.php.net(which will be mirrored to github.com/php) and you push whatever you want, or should I mirror this repository there?
is there anybody who will be a maintainer for this new repo and needs a php.net or pecl.php.net account or additional karma to be able to push to this new repository?
let me know and I will set up the repo there with the appropriate access/karma for you guys.

Tyrael commented Dec 11, 2016

hi, should I create an empty repo on git.php.net(which will be mirrored to github.com/php) and you push whatever you want, or should I mirror this repository there?
is there anybody who will be a maintainer for this new repo and needs a php.net or pecl.php.net account or additional karma to be able to push to this new repository?
let me know and I will set up the repo there with the appropriate access/karma for you guys.

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Dec 11, 2016

Owner

@wcgallego any preference? How do you want to handle bug reports, issues, patches, etc?

Owner

hjr3 commented Dec 11, 2016

@wcgallego any preference? How do you want to handle bug reports, issues, patches, etc?

@Tyrael

This comment has been minimized.

Show comment
Hide comment
@Tyrael

Tyrael Dec 12, 2016

I've just created the empty repo in the meantime, you can either tell me what to mirror there or you can do it for yourself.

Tyrael commented Dec 12, 2016

I've just created the empty repo in the meantime, you can either tell me what to mirror there or you can do it for yourself.

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Dec 22, 2016

Collaborator

hey all, sorry for delay. Being on call and a lack of sleep leaves little time for fun open source projects. Thanks for patience.

I can continue maintaining the project for sure. That said, rather than make it one person's project, I'd love to have it hosted apart from one of our personal github accounts. I've got a php.net account, but only have karma I believe for documentation, dunno if that's covering pushing to this repo.

What can I do to help? Thanks for getting this set up.

Collaborator

wcgallego commented Dec 22, 2016

hey all, sorry for delay. Being on call and a lack of sleep leaves little time for fun open source projects. Thanks for patience.

I can continue maintaining the project for sure. That said, rather than make it one person's project, I'd love to have it hosted apart from one of our personal github accounts. I've got a php.net account, but only have karma I believe for documentation, dunno if that's covering pushing to this repo.

What can I do to help? Thanks for getting this set up.

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Dec 22, 2016

Owner

@wcgallego It sounds like we can only mirror to the https://github.com/php/pecl-networking-gearman repo. We can make a pecl-gearman github org and have pecl-gearman/pecl-gearman by the central repository for PRs, issues, etc.

You need a pecl.php.net account to manage the package at https://pecl.php.net/package/gearman . We can handle that, but we need to get the above figured out prior to posting a new package.

Owner

hjr3 commented Dec 22, 2016

@wcgallego It sounds like we can only mirror to the https://github.com/php/pecl-networking-gearman repo. We can make a pecl-gearman github org and have pecl-gearman/pecl-gearman by the central repository for PRs, issues, etc.

You need a pecl.php.net account to manage the package at https://pecl.php.net/package/gearman . We can handle that, but we need to get the above figured out prior to posting a new package.

@Tyrael

This comment has been minimized.

Show comment
Hide comment
@Tyrael

Tyrael Dec 22, 2016

yeah, we only have mirrors under the php github organization, the primary repositories are on https://git.php.net/ and pushes are mirrored to the github mirrors.

Tyrael commented Dec 22, 2016

yeah, we only have mirrors under the php github organization, the primary repositories are on https://git.php.net/ and pushes are mirrored to the github mirrors.

@rwngallego

This comment has been minimized.

Show comment
Hide comment
@rwngallego

rwngallego Feb 2, 2017

How can we get the rpm package for the Centos PHP 7.1 version?

rwngallego commented Feb 2, 2017

How can we get the rpm package for the Centos PHP 7.1 version?

@vojta

This comment has been minimized.

Show comment
Hide comment
@vojta

vojta Feb 2, 2017

@rwngallego it's already in the Remi repo:

Available Packages
php71-php-pecl-gearman.x86_64 2.0.3-1.el6.remi remi

vojta commented Feb 2, 2017

@rwngallego it's already in the Remi repo:

Available Packages
php71-php-pecl-gearman.x86_64 2.0.3-1.el6.remi remi

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Jun 5, 2017

Owner

Maybe @pierrejoye and folks would allow us to move this into https://github.com/FriendsOfPHP ?

I also received an email today to get a new version into pecl too.

Owner

hjr3 commented Jun 5, 2017

Maybe @pierrejoye and folks would allow us to move this into https://github.com/FriendsOfPHP ?

I also received an email today to get a new version into pecl too.

@kwhat

This comment has been minimized.

Show comment
Hide comment
@kwhat

kwhat Jun 17, 2017

So the src for the remi rpm package is https://github.com/wcgallego/pecl-gearman can someone update this officially?

kwhat commented Jun 17, 2017

So the src for the remi rpm package is https://github.com/wcgallego/pecl-gearman can someone update this officially?

@pierrejoye

This comment has been minimized.

Show comment
Hide comment
@pierrejoye

pierrejoye Jun 17, 2017

pierrejoye commented Jun 17, 2017

@hjr3

This comment has been minimized.

Show comment
Hide comment
@hjr3

hjr3 Jun 17, 2017

Owner

@pierrejoye if you can create the repo and give myself and @wcgallego commit bit, then I will do the work to make that the official repo.

Owner

hjr3 commented Jun 17, 2017

@pierrejoye if you can create the repo and give myself and @wcgallego commit bit, then I will do the work to make that the official repo.

@pierrejoye

This comment has been minimized.

Show comment
Hide comment
@pierrejoye

pierrejoye Jun 19, 2017

pierrejoye commented Jun 19, 2017

@RossiRun

This comment has been minimized.

Show comment
Hide comment
@RossiRun

RossiRun Jun 27, 2017

i got a memory leak while i use php7.0.5 debug version and valgrind to check memory leak.
pecl-gearman-master/php_gearman.c(892) : Freeing 0x7F81E8C7A000 (687 bytes).
@rwngallego @wcgallego have you ever seen it ?
here is the detail
==24899== 687 bytes in 1 blocks are definitely lost in loss record 30 of 34
==24899== at 0x4C2817A: malloc (vg_replace_malloc.c:298)
==24899== by 0xA1934A: __zend_malloc (zend_alloc.c:2864)
==24899== by 0xA18584: _emalloc (zend_alloc.c:2457)
==24899== by 0xF789719: _php_malloc (php_gearman.c:892)
==24899== by 0xF9A5BFC: _client_do(gearman_client_st*, gearman_command_t, char const*, char const*, void const*, unsigned long, unsigned long*, gearman_return_t*) (client.cc:185)
==24899== by 0xF9A5DB7: gearman_client_do (client.cc:617)
==24899== by 0xF78CC48: gearman_client_do_work_handler (php_gearman_client.c:374)
==24899== by 0xF78CDCB: zif_gearman_client_do_normal (php_gearman_client.c:401)
==24899== by 0xAABF7F: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==24899== by 0xAAAD78: execute_ex (zend_vm_execute.h:417)
==24899== by 0xAAAEA2: zend_execute (zend_vm_execute.h:458)
==24899== by 0xA4DDDE: zend_execute_scripts (zend.c:1443)
==24899==
==24899== LEAK SUMMARY:
==24899== definitely lost: 687 bytes in 1 blocks
==24899== indirectly lost: 0 bytes in 0 blocks
==24899== possibly lost: 0 bytes in 0 blocks
==24899== still reachable: 18,121 bytes in 58 blocks
==24899== suppressed: 0 bytes in 0 blocks
==24899== Reachable blocks (those to which a pointer was found) are not shown.

RossiRun commented Jun 27, 2017

i got a memory leak while i use php7.0.5 debug version and valgrind to check memory leak.
pecl-gearman-master/php_gearman.c(892) : Freeing 0x7F81E8C7A000 (687 bytes).
@rwngallego @wcgallego have you ever seen it ?
here is the detail
==24899== 687 bytes in 1 blocks are definitely lost in loss record 30 of 34
==24899== at 0x4C2817A: malloc (vg_replace_malloc.c:298)
==24899== by 0xA1934A: __zend_malloc (zend_alloc.c:2864)
==24899== by 0xA18584: _emalloc (zend_alloc.c:2457)
==24899== by 0xF789719: _php_malloc (php_gearman.c:892)
==24899== by 0xF9A5BFC: _client_do(gearman_client_st*, gearman_command_t, char const*, char const*, void const*, unsigned long, unsigned long*, gearman_return_t*) (client.cc:185)
==24899== by 0xF9A5DB7: gearman_client_do (client.cc:617)
==24899== by 0xF78CC48: gearman_client_do_work_handler (php_gearman_client.c:374)
==24899== by 0xF78CDCB: zif_gearman_client_do_normal (php_gearman_client.c:401)
==24899== by 0xAABF7F: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==24899== by 0xAAAD78: execute_ex (zend_vm_execute.h:417)
==24899== by 0xAAAEA2: zend_execute (zend_vm_execute.h:458)
==24899== by 0xA4DDDE: zend_execute_scripts (zend.c:1443)
==24899==
==24899== LEAK SUMMARY:
==24899== definitely lost: 687 bytes in 1 blocks
==24899== indirectly lost: 0 bytes in 0 blocks
==24899== possibly lost: 0 bytes in 0 blocks
==24899== still reachable: 18,121 bytes in 58 blocks
==24899== suppressed: 0 bytes in 0 blocks
==24899== Reachable blocks (those to which a pointer was found) are not shown.

@wcgallego

This comment has been minimized.

Show comment
Hide comment
@wcgallego

wcgallego Jun 27, 2017

Collaborator

Hi @RossiRun, if you could, please create a new issue at https://github.com/wcgallego/pecl-gearman with the details above and the PHP code to replicate, so that we can narrow down issues

Collaborator

wcgallego commented Jun 27, 2017

Hi @RossiRun, if you could, please create a new issue at https://github.com/wcgallego/pecl-gearman with the details above and the PHP code to replicate, so that we can narrow down issues

@RossiRun

This comment has been minimized.

Show comment
Hide comment
@RossiRun

RossiRun Jun 27, 2017

@wcgallego hi I just create an issue at https://github.com/wcgallego/pecl-gearman , please check~

RossiRun commented Jun 27, 2017

@wcgallego hi I just create an issue at https://github.com/wcgallego/pecl-gearman , please check~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.