Skip to content

use mongodb with swoole together will occurs error #213

@ixqbar

Description

@ixqbar

i use swoole (https://github.com/swoole/swoole-src) , mongodb together, test code like

<?php

$server = new swoole_server('127.0.0.1', 9501);
$server->set(array(
    'worker_num' => 1,
    'task_worker_num' => 2,
    'log_file'   => './swoole.log'
));

$server->on('workerStart', function($serv, $worker_id){
    echo 'worker start :' . $worker_id . ',pid :' . getmypid() . PHP_EOL;
});

$server->on('task', function($serv, $task_id, int $from_id, string $data){
    echo 'on task  :' . $task_id . ',pid :' . getmypid() . PHP_EOL;
});

$server->on('finish', function($serv, $task_id, string $data){
    echo 'on finish  :' . $task_id . ',pid :' . getmypid() . PHP_EOL;
});

$server->on('receive', function ($serv, $fd, $from_id, $data) {
    $serv->reload(true);
});

$server->start();

where server receive any data, i will set server to reload, but occurs

[Mon Feb  1 17:12:39 2016]  Script:  '/Users/xingqiba/Desktop/haha.php'
---------------------------------------
/Users/xingqiba/data/softs/mongodb-1.1.2/php_phongo.c(2248) : Block 0x7fe95255a040 status:
Beginning:      Freed (magic=0x00000000, expected=0x99954317)
    Start:  Overflown (magic=0x00000035 instead of 0x4060D864)
            At least 4 bytes overflown
worker start :1,pid :71250
[Mon Feb  1 17:12:39 2016]  Script:  '/Users/xingqiba/Desktop/haha.php'
---------------------------------------
/Users/xingqiba/data/softs/mongodb-1.1.2/php_phongo.c(2248) : Block 0x7fe95255a040 status:
Beginning:      Freed (magic=0x00000000, expected=0x99954317)
    Start:  Overflown (magic=0x00000035 instead of 0x4060D864)
            At least 4 bytes overflown

if i don't use mongodb in php.ini, it's ok!

help

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions