Crash when calling exceptions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman |
Fix Released
|
High
|
Brian Aker |
Bug Description
# pecl list
Installed packages, channel pecl.php.net:
=======
Package Version State
gearman 1.0.3 stable
# php -i | grep -i gearman
gearman
gearman support => enabled
libgearman version => 0.33
core 'core' of 23192: /opt/local/bin/php /opt/local/
----------------- lwp# 1 / thread# 1 -------
fffffd7fff20036a _lwp_kill () + a
fffffd7fff18a7b1 raise () + 19
fffffd7fff15fee1 abort () + d9
fffffd7feff4c6f5 sigsegv_handler () + 125
fffffd7fff1f73b6 __sighndlr () + 6
fffffd7fff1ea09c call_user_handler () + 2a4
fffffd7fff1ea2c3 sigacthandler (6, 0, fffffd7fffdf9c70) + db
--- called from signal handler with signal 6 (SIGABRT) ---
fffffd7fff20036a _lwp_kill () + a
fffffd7fff18a7b1 raise () + 19
fffffd7fff15fe65 abort () + 5d
fffffd7fefea54ea ???????? ()
fffffd7fefea8acf _Z22gearman_
fffffd7fefeaad8d gearman_
fffffd7fefece3d3 zif_gearman_
000000000074c66a zend_do_
000000000070e043 execute () + 1c3
fffffd7feff4114b nr__execute () + 52b
00000000006ec969 zend_execute_
000000000069a41b php_execute_script () + 15b
000000000077f0d6 main () + 1566
00000000004c6f7c _start () + 6c
----------------- lwp# 2 / thread# 2 -------
fffffd7fff1ff4da __nanosleep () + a
fffffd7feff5017a nr__harvest_thread () + 4a
fffffd7fff1f7024 _thrp_setup () + bc
fffffd7fff1f72f0 _lwp_start ()
Here is a sanitized version of the code involved:
#!/opt/
<?php
$CONFIG=array();
$pid=getmypid();
echo "Starting\n";
$gmworker= new GearmanWorker();
$gmworker-
$gmworker-
$gmworker-
$gmclient=new GearmanClient();
$gmclient-
$mysqli=new mysqli(
if ($mysqli-
die("MySQL Connection Error: ".$mysqli-
}
print "Waiting for job...\n";
while($
{
if ($gmworker-
{
echo "return_code: " . $gmworker-
break;
}
}
function jobFunction($job)
{
global $gmclient;
global $pid;
global $CONFIG;
global $mysqli;
$sqlh=
$workload=
$appname=
$currentJobs=
$nextJobs=array();
$object = new ObjectClass();
echo $pid.": Received job: " . $job->handle() . "\n";
try{
$param = array(
'field' => 'VALUE',
'field2' => $currentJobs );
$results = $object->api('/', 'POST', $param);
if(isset(
foreach($results as $result){
switch(
case 200:
$
$
if(
print "Upserted ".$sqlh-
}
print "Storing Details ".print_
$
'field1' =>'value1',
'field2' => 'value2'
);
break;
default:
echo "Error: ".$result[
break;
}
}
}
else{
error_log("Bad Results: ".print_
}
}
catch(
error_log( "ERROR on ".$e);
echo $pid.": Failed job: ". $job->handle() . "ERROR on ".$e."\n";
return(-1);
}
$job_handle = $gmclient-
if ($gmclient-
error_log("Bad return code");
}
else {
echo "Dispatched Chunk of ".count(
}
echo $pid.": Finished job: " . $job->handle() . "\n";
}
?>
description: | updated |
summary: |
- core dump using PHP-Gearman 1.0.3 and gearmand 0.33 + core dump using PHP-Gearman 1.0.3 and gearmand 0.33 calling exceptions |
Changed in gearmand: | |
status: | Incomplete → Fix Committed |
milestone: | none → 1.1.9 |
Changed in gearmand: | |
status: | Fix Committed → Fix Released |
Caused by this code in pecl/gearman:
php_gearman.c: worker_ set_server_ option( &(obj-> worker) , "exceptions", (sizeof( "exceptions" ) - 1))) {
GEARMAN_ EXCEPTION( "Failed to set exception option", 0);
if (! gearman_
}