php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74861 GEARMAN_INVALID_ARGUMENT When adding server or function to GearmanWorker class.
Submitted: 2017-07-06 00:04 UTC Modified: 2017-10-24 23:27 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: alex at 1stleg dot com Assigned:
Status: Suspended Package: gearman (PECL)
PHP Version: 5.6.30 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alex at 1stleg dot com
New email:
PHP Version: OS:

 

 [2017-07-06 00:04 UTC] alex at 1stleg dot com
Description:
------------
Hi,

I am compiling pecl-gearman 1.1.2 against gearmand 1.1.16 and I am running into a very strange issue.  Everything appears to be compiling and working except for a couple of functions on GearmanWorker class.  

PHP Warning:  GearmanWorker::addServers(): (null) in ...

PHP Warning:  GearmanWorker::addFunction(): Unable to add function to Gearman Worker: (null) GEARMAN_INVALID_ARGUMENT in ...

This appears to be a problem when talking from the PHP extension to libgearman. The php extension is definitely getting called with the correct values ("127.0.0.1" and 4730) @ https://github.com/hjr3/pecl-gearman/blob/gearman-1.0/php_gearman.c#L3311 but obj->ret == GEARMAN_INVALID_ARGUMENT when I debug.  The only way that should happen is that &(obj->worker) == NULL on libgearman's end, but &(obj->worker) definitely looks like a pointer from the PHP extension end. I am not sure whats happening...

I have also tested the same gearmand libgearman version against 2.x (hjr3/pecl-gearman) and I am having the same problem.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-06 01:36 UTC] alex at 1stleg dot com
Ok, under normal circumstances this works fine.  It seems to soil the pants only if the GearmanWorker class is a member variable of a class that extends Stackable!  I.E. `
```
class MyWorker extends Stackable {
    /** @var GearmanWorker $gearman */
    protected $gearman;

    public function __construct()
    {
        $this->gearman = new GearmanWorker();

        // Poops pants here.
        $this->gearman->addServer("127.0.0.1", 4730);
    }

    ...
}
```
 [2017-10-24 23:27 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-10-24 23:27 UTC] kalle@php.net
The gearman package have not had a release since 2013 and no development since, its safe to say that this package is no longer maintained, if development picks back up then this report should be re-opened
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC