|  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
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
44 - 38 = ?
Subscribe to this entry?

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

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 ("" and 4730) @ 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.


Add a Patch

Pull Requests

Add a Pull Request


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("", 4730);

 [2017-10-24 23:27 UTC]
-Status: Open +Status: Suspended
 [2017-10-24 23:27 UTC]
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: Sun May 26 19:01:30 2024 UTC