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_http_server开启ssl经常core dump #1121

Closed
alexmango opened this issue Mar 7, 2017 · 5 comments
Closed

swoole_http_server开启ssl经常core dump #1121

alexmango opened this issue Mar 7, 2017 · 5 comments
Labels

Comments

@alexmango
Copy link

服务端开启ssl,运行一段时间以后php就会core dump(一般一天内最少发生一次)。

Swoole版本:1.9.6
php版本:5.4.15
openssl版本:1.0.2k
gdb堆栈信息如下:
#0 freelist_extract (for_read=, sz=34120, ctx=) at s3_both.c:619
#1 0x00007fcda5b904fc in ssl3_setup_read_buffer (s=0x311e820) at s3_both.c:682
#2 0x00007fcda5b90679 in ssl3_setup_buffers (s=0x311e820) at s3_both.c:735
#3 0x00007fcda5b92055 in ssl23_get_client_hello (s=0x311e820) at s23_srvr.c:265
#4 0x00007fcda5b92613 in ssl23_accept (s=0x311e820) at s23_srvr.c:209
#5 0x00007fcda1dce83f in swSSL_verify (conn=0x27600000087, allow_self_signed=135) at /data/build/swoole-src-1.9.6/src/protocol/SSL.c:308
#6 0x00007fcda1dbc30d in swReactorThread_onWrite (reactor=0x7fcd9b529498, ev=0x5400000002) at /data/build/swoole-src-1.9.6/src/network/ReactorThread.c:955
#7 0x00007fcda1dab6b9 in swPipeBase_getFd (p=0x1, isWriteFd=-1) at /data/build/swoole-src-1.9.6/src/pipe/PipeBase.c:81
#8 0x00007fcda1dbd9e0 in swReactorProcess_create (serv=0x5400000000) at /data/build/swoole-src-1.9.6/src/network/ReactorProcess.c:44
#9 0x00007fcda340ee9a in start_thread () from /data/services/php-5.4.15/lib/libpthread.so.0
#10 0x00007fcda393438d in clone () from /data/services/php-5.4.15/lib/libc.so.6
#11 0x0000000000000000 in ?? ()

@matyhtf
Copy link
Member

matyhtf commented Mar 9, 2017

先用 ldd swoole.so 确认一下连接的ssl.so是哪个,你这里不像openssl

@alexmango
Copy link
Author

确定是 openssl ,这个问题百分百重现的, swoole 运行一段时间以后就会 coredump

@matyhtf
Copy link
Member

matyhtf commented Mar 30, 2017

从core信息中无法判断问题所在,产生crash的地方是在openssl中,还需要进一步分析

@matyhtf matyhtf added the bug label Mar 30, 2017
@matyhtf
Copy link
Member

matyhtf commented Mar 30, 2017

请编译一个 gcc -O0 版本的swoole,然后重现crash,通过gdb执行下列命令

f 5
p *conn
p *conn->ssl

matyhtf added a commit that referenced this issue Nov 22, 2017
@matyhtf
Copy link
Member

matyhtf commented Nov 22, 2017

可能是由于线程安全问题导致。最新版本已尝试进行了修复,请重现验证。

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

No branches or pull requests

2 participants