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_client 异步方式onError报错,导致work进程Core #570

Closed
badxpgy opened this issue Mar 15, 2016 · 9 comments
Closed

swoole_client 异步方式onError报错,导致work进程Core #570

badxpgy opened this issue Mar 15, 2016 · 9 comments

Comments

@badxpgy
Copy link

badxpgy commented Mar 15, 2016

(gdb) bt
#0 swClient_onError (reactor=0x1600ef08, event=0x7fff47aba530) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/Client.c:609
#1 0x00002b6272a3f38a in swReactorEpoll_wait (reactor=0x1600ef08, timeo=) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/reactor/ReactorEpoll.c:287
#2 0x00002b6272a49051 in swReactorProcess_loop (pool=, worker=0x2b6273103760) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/ReactorProcess.c:371
#3 0x00002b6272a455e7 in swProcessPool_spawn (worker=0x2b6273103760) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/ProcessPool.c:234
#4 0x00002b6272a45ac9 in swProcessPool_start (pool=0x2b6273103240) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/ProcessPool.c:106
#5 0x00002b6272a4938c in swReactorProcess_start (serv=) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/ReactorProcess.c:162
#6 0x00002b6272a41db2 in swServer_start (serv=0x1600e970) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/Server.c:625
#7 0x00002b6272a1fefe in zim_swoole_server_start (execute_data=, return_value=0x2b626e2130b0) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/swoole_server.c:1772
#8 0x000000000089fbe7 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x2b626e213030) at /tools/php-7.0.2/Zend/zend_vm_execute.h:842
#9 0x00000000008681e0 in execute_ex (ex=) at /tools/php-7.0.2/Zend/zend_vm_execute.h:417
#10 0x00000000008baaab in zend_execute (op_array=0x2b626e27e0e0, return_value=) at /tools/php-7.0.2/Zend/zend_vm_execute.h:458
#11 0x0000000000827063 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /tools/php-7.0.2/Zend/zend.c:1427
#12 0x00000000007c8910 in php_execute_script (primary_file=0x7fff47abdcf0) at /tools/php-7.0.2/main/main.c:2471
#13 0x00000000008bf139 in do_cli (argc=3, argv=0x15e2edb0) at /tools/php-7.0.2/sapi/cli/php_cli.c:974
#14 0x00000000008bf89a in main (argc=3, argv=0x15e2edb0) at /tools/php-7.0.2/sapi/cli/php_cli.c:1345

(gdb) f 0
#0 swClient_onError (reactor=0x1600ef08, event=0x7fff47aba530) at /data/wwwroot/mfproxy/swoole-src-swoole-1.8.3-alpha/src/network/Client.c:609

609 if (cli->onError)
(gdb)

以上core情况,只要并发高的情况下进行压力测试,多测几次必现。

cmsproxy.zip

swoole版本 1.8.3-alpha

@matyhtf
Copy link
Member

matyhtf commented Mar 15, 2016

请使用master分支的代码,这是因为合并 pull request #556 时,贡献者提交了一行错误代码导致的,最新的代码中已经revert

@matyhtf matyhtf closed this as completed Mar 15, 2016
@badxpgy
Copy link
Author

badxpgy commented Mar 15, 2016

@matyhtf 用最新的代码测了一下,现在又换另一种错误了,

#0 swReactorThread_onRead (reactor=0x1ef5df08, event=) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/ReactorThread.c:803
#1 0x00002b3f3023f30e in swReactorEpoll_wait (reactor=0x1ef5df08, timeo=) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/reactor/ReactorEpoll.c:263
#2 0x00002b3f302490f1 in swReactorProcess_loop (pool=, worker=0x2b3f30903760) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/ReactorProcess.c:371
#3 0x00002b3f30245687 in swProcessPool_spawn (worker=0x2b3f30903760) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/ProcessPool.c:234
#4 0x00002b3f30245b69 in swProcessPool_start (pool=0x2b3f30903240) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/ProcessPool.c:106
#5 0x00002b3f3024942c in swReactorProcess_start (serv=) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/ReactorProcess.c:162
#6 0x00002b3f30241ea2 in swServer_start (serv=0x1ef5d970) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/Server.c:625
#7 0x00002b3f3021ff0e in zim_swoole_server_start (execute_data=, return_value=0x2b3f2ba130b0) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/swoole_server.c:1773
#8 0x000000000089fbe7 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x2b3f2ba13030) at /tools/php-7.0.2/Zend/zend_vm_execute.h:842
#9 0x00000000008681e0 in execute_ex (ex=) at /tools/php-7.0.2/Zend/zend_vm_execute.h:417
#10 0x00000000008baaab in zend_execute (op_array=0x2b3f2ba7e0e0, return_value=) at /tools/php-7.0.2/Zend/zend_vm_execute.h:458
#11 0x0000000000827063 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /tools/php-7.0.2/Zend/zend.c:1427
#12 0x00000000007c8910 in php_execute_script (primary_file=0x7fff89836bd0) at /tools/php-7.0.2/main/main.c:2471
#13 0x00000000008bf139 in do_cli (argc=3, argv=0x1ed7ddb0) at /tools/php-7.0.2/sapi/cli/php_cli.c:974
#14 0x00000000008bf89a in main (argc=3, argv=0x1ed7ddb0) at /tools/php-7.0.2/sapi/cli/php_cli.c:1345
(gdb) f 0
#0 swReactorThread_onRead (reactor=0x1ef5df08, event=) at /data/wwwroot/mfproxy/mfproxy/swoole-src-master/src/network/ReactorThread.c:803
803 return port->onRead(reactor, port, event);
(gdb)

@matyhtf matyhtf reopened this Mar 15, 2016
@matyhtf
Copy link
Member

matyhtf commented Mar 15, 2016

SWOOLE_BASE模式的BUG,已修复。

@badxpgy
Copy link
Author

badxpgy commented Mar 16, 2016

@matyhtf
我用master 分支下载下来,重新测试了一下,这个问题还是存在。

@matyhtf
Copy link
Member

matyhtf commented Mar 16, 2016

是否make clean过,我用你的代码测试无问题。

@badxpgy
Copy link
Author

badxpgy commented Mar 16, 2016

@matyhtf
我刚刚从master分支下载全新安装,重新测了一下,还是有问题,测多几次就会重现,
用SWOOLE_PROCESS 模式就不会重现,

@matyhtf matyhtf reopened this Mar 16, 2016
@matyhtf
Copy link
Member

matyhtf commented Mar 16, 2016

再抓一下core信息,看看还是onError这里报吗

@matyhtf
Copy link
Member

matyhtf commented Mar 16, 2016

测试发现是BASE模式下心跳线程把swoole_client的底层回调函数篡改了,已修复。

@badxpgy
Copy link
Author

badxpgy commented Mar 17, 2016

@matyhtf
下了最新代码,测试了很多次,现在不会重现了。

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

No branches or pull requests

2 participants