Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swoole\Coroutine\Redis BUG #2879

Closed
shh12580 opened this issue Oct 10, 2019 · 2 comments
Closed

Swoole\Coroutine\Redis BUG #2879

shh12580 opened this issue Oct 10, 2019 · 2 comments

Comments

@shh12580
Copy link

shh12580 commented Oct 10, 2019

Please answer these questions before submitting your issue. Thanks!

Linux Centos

  1. What did you do? If possible, provide a simple script for reproducing the error.

封装了一个ABCRedis类,类内部调用Swoole\Coroutine\Redis ,调用方式
call_user_func_array(array($this->handle, $fun), $arguments);
其中$this->handle = new \Swoole\Coroutine\Redis(['timeout'=> $this->_timeout]);

调用封装的$abcRedis->set("a","test");第一次调用正常,调用第二次$abcRedis->set("a","test");导致work异常退出

core dump信息:
#1 0x00007f3d097a2e99 in swoole_redis_coro_resume (data=0x7f3d10478360) at swoole-src-4.2.1/swoole_redis_coro.c:3814
#2 0x00007f3d0951f66a in __redisRunCallback (reply=0x1c8dd50, cb=0x7ffe2f3aa960, ac=0x1c8dbf0) at async.c:269
#3 redisProcessCallbacks (ac=0x1c8dbf0) at async.c:469
#4 0x00007f3d097cb567 in swoole_redis_coro_onRead (reactor=, event=) at swoole-src-4.2.1/swoole_redis_coro.c:4119
#5 0x00007f3d097ec1c9 in swReactorEpoll_wait (reactor=0x1c7bae0, timeo=) at swoole-src-4.2.1/src/reactor/epoll.c:258
#6 0x00007f3d097ffe9e in swWorker_loop (factory=factory@entry=0x1c2b590, worker_id=worker_id@entry=0) at swoole-src-4.2.1/src/network/worker.c:798
#7 0x00007f3d097fcd56 in swManager_spawn_worker (factory=0x1c2b590, worker_id=0) at swoole-src-4.2.1/src/network/manager.c:499
#8 0x00007f3d097fd426 in swManager_start (factory=factory@entry=0x1c2b590) at swoole-src-4.2.1/src/network/manager.c:146
#9 0x00007f3d097e89b2 in swFactoryProcess_start (factory=0x1c2b590) at swoole-src-4.2.1/src/factory/process.c:87
#10 0x00007f3d097f061b in swServer_start (serv=serv@entry=0x1c2b100) at swoole-src-4.2.1/src/network/server.c:769
#11 0x00007f3d0977f25d in zim_swoole_http_server_start (execute_data=0x7f3d10414670, return_value=0x7ffe2f3aac30) at swoole-src-4.2.1/swoole_http_server.c:1649
#12 0x000000000092d310 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x7f3d104144a0) at /php-7.1.9/Zend/zend_vm_execute.h:970
#13 0x000000000090bdd8 in execute_ex (ex=) at /php-7.1.9/Zend/zend_vm_execute.h:432
#14 0x0000000000957920 in zend_execute (op_array=0x7f3d10483000, return_value=) at /php-7.1.9/Zend/zend_vm_execute.h:474
#15 0x00000000008b04c3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /php-7.1.9/Zend/zend.c:1480
#16 0x000000000084ff90 in php_execute_script (primary_file=0x7ffe2f3ae110) at /php-7.1.9/main/main.c:2552
#17 0x000000000095ac8a in do_cli (argc=3, argv=0x18c9bb0) at /php-7.1.9/sapi/cli/php_cli.c:993
#18 0x000000000095b48a in main (argc=3, argv=0x18c9bb0) at /php-7.1.9/sapi/cli/php_cli.c:1381

  1. What did you expect to see?

能成功多次调用set

  1. What did you see instead?

通过call_user_func_array调用Swoole\Coroutine\Redis实例,调用第二次会导致work异常退出

  1. What version of Swoole are you using (show your php --ri swoole)?

Swoole 4.2.1

  1. What is your machine environment used (including version of kernel & php & gcc) ?

PHP 7.1.9
gcc version 4.8.5 20150623

@twose
Copy link
Member

twose commented Oct 10, 2019

@shh12580 首先感谢您的BUG反馈, 我是无情的自动回复机器人,请您快速确认以下几点来帮助我们定位您的问题:

  1. 如你是手动升级编译的而不是首次编译, 确保你在编译前运行make clean清理了上次编译的内容

  2. 如你使用的是Linux系统, 使用以下命令运行你的程序, 以能够复现BUG的方式操作你的程序, 并在程序运行一定时间后, 将位于/tmp目录的valgrind.log日志内容贴在此issue中

USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php xxx.php
  1. 如你使用的是macOS系统,将无法使用valgrind, 请提供能够复现问题BUG的PHP代码

  2. 若以上需求都无法满足,请您在此表明, 我们将快速接入人工处理

@twose
Copy link
Member

twose commented Oct 11, 2019

版本太低了 4.2是已废弃(不再维护)的版本
请使用最新版重新测试以后再反馈 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants