<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[[提交缺陷]Swoole2.X版本提供PHP原生协程支持实践，Http请求部分的$httpclient-setDefer();该行出现段错误的可能是Bug提交示例。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Swoole专题研究]]></category>
<pubDate>Thu, 22 Jun 2017 15:51:49 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：研究一下这个Swoole2.X（V2.0.8）的协程,于是试了一下Tcp/Mysql/Redis/Http(在一个以Http形式下，协程了：TcpServer配置、Redis配置、Mysql配置、Http，最后的接口返回时间以里面最长的那个为准，也就是一般是Mysql耗时最长，它就是最长的接口返回时间了。)一起上,Swoole顾问觉得要想性能高还得加上RPC，再就是在一些数据的Pack和Unpack性能上予以加强，以争取每个请求都非常快非常高效，一请求发现出现了段错误，最新版本出现小小的问题属于正常性况，关键是如何反馈问题，看了一下Swoole的Wiki是如何提Bug的连接，于是就试着提一个Bug吧，给其它用Swoole万一出现Coredump的兄弟们作一个示范，进行提Bug的和捕获相关的Coredump的输出，参考Swoole的Wiki，地址：https://wiki.swoole.com/wiki/page/10.html。<br/><br/>一、假如在你的项目中出现段错误，怎么办？重新编译打包Swoole的源码并打成RPm包，打开debug,参数是： --enable-debug ，如下：<br/>swoole-php71-2.0.7.el7.x86_64.spec 打包./configure部分：<br/>#./configure --with-php-config=%&#123;php_bin&#125;/php-config --enable-coroutine --enable-async-redis<br/>./configure --with-php-config=%&#123;php_bin&#125;/php-config --enable-coroutine --enable-async-redis --enable-debug <br/><br/>二、Mysql部分做测试，加上用户权限，那个Tcp就用Swoole的示例打开9501端口，官网上有很简单的TcpServer样例（略），Mysql部分如下：<br/>Mysql服务器上@101.200.*.135：<br/>#mysql<br/>Welcome to the MySQL monitor.&nbsp;&nbsp;Commands end with ; or &#92;g.<br/>Your MySQL connection id is 93109<br/>Server version: 8.0.0-dmr-log Source distribution<br/><br/>mysql&gt; grant all privileges on test.* to swooleUser@10.51.*.34 identified by &quot;test123&quot;;<br/>Query OK, 0 rows affected, 1 warning (0.04 sec)<br/><br/>mysql&gt; flush privileges;&nbsp;&nbsp;&nbsp;&nbsp;<br/>Query OK, 0 rows affected (0.01 sec)<br/><br/>@测试机器@123.57.*.183<br/>#rpm -ql mysql-client-8.0.0-170523211353.el7.centos.x86_64<br/>/usr/local/mysql/bin/mysql<br/>#/usr/local/mysql/bin/mysql -h10.44.*.177 -uswooleUser -p<br/>Enter password: <br/>mysql&gt; show databases;<br/>+--------------------+<br/>&#124; Database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;<br/>+--------------------+<br/>&#124; information_schema &#124;<br/>&#124; test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;<br/>+--------------------+<br/>2 rows in set (0.00 sec)<br/><br/><br/><br/>三、根据TcpServer配置、Redis配置、Mysql配置、Http(试着访问百度的Http页面)，一般来讲都是Mysql慢，所以，它才是重点，代码如下：<br/>coroutinemysql.php<br/><br/>&lt;?php<br/>$server = new Swoole&#92;Http&#92;Server(&quot;123.57.*.183&quot;, 9507, SWOOLE_BASE);<br/>$server-&gt;set([<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#039;worker_num&#039; =&gt; 1,<br/>]);<br/><br/>$server-&gt;on(&#039;Request&#039;, function ($request, $response) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;$tcpclient = new Swoole&#92;Coroutine&#92;Client(SWOOLE_SOCK_TCP);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$tcpclient-&gt;connect(&#039;127.0.0.1&#039;, 9501,0.5);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$tcpclient-&gt;send(&quot;hello world&#92;n&quot;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;$redis = new Swoole&#92;Coroutine&#92;Redis();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$redis-&gt;connect(&#039;123.57.*.183&#039;, 6379);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$redis-&gt;setDefer();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$redis-&gt;get(&#039;key&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;$mysql = new Swoole&#92;Coroutine&#92;MySQL();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$ret = $mysql-&gt;connect([<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#039;host&#039; =&gt; &#039;10.44.*.177&#039;,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#039;port&#039; =&gt; 3306,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#039;user&#039; =&gt; &#039;swooleUser&#039;,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#039;password&#039; =&gt; &#039;test123&#039;,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#039;database&#039; =&gt; &#039;test&#039;,<br/>&nbsp;&nbsp;&nbsp;&nbsp;]);<br/>&nbsp;&nbsp;&nbsp;&nbsp;if ($ret == false) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response-&gt;end(&quot;MySQL connect fail!&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;$mysql-&gt;setDefer();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$mysql-&gt;query(&#039;select sleep(1)&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;$httpclient = new Swoole&#92;Coroutine&#92;Http&#92;Client(&#039;123.125.114.144&#039;, 80);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$httpclient-&gt;setHeaders([&#039;Host&#039; =&gt; &quot;baidu.com&quot;]);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$httpclient-&gt;set([ &#039;timeout&#039; =&gt; 1]);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$httpclient-&gt;setDefer();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$httpclient-&gt;get(&#039;/&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;$tcp_res&nbsp;&nbsp;= $tcpclient-&gt;recv();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$redis_res = $redis-&gt;recv();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$mysql_res = $mysql-&gt;recv();<br/>&nbsp;&nbsp;&nbsp;&nbsp;$http_res&nbsp;&nbsp;= $httpclient-&gt;recv();<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;$response-&gt;end(&#039;Test End&#039;);<br/>&#125;);<br/>$server-&gt;start();<br/><br/><br/><br/><br/>四、按Swoole官方的Wiki教程，设置一下吐核，From: https://wiki.swoole.com/wiki/page/10.html ：<br/>#ulimit -c unlimited<br/><br/>五、启动对外提供的Http协议的9507端口访问进来后的多种协议并发的协程服务，如下：<br/>#php&nbsp;&nbsp;coroutinemysql.php<br/><br/><br/>六、访问Http时再触发一下协程： <br/>触发一下：http://123.57.*.183:9507/<br/><br/>七、生成了段错误的Coredump文件，如下：<br/>#php&nbsp;&nbsp;coroutinemysql.php <br/>段错误(吐核)<br/><br/>#ls *core*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>core.8494<br/><br/><br/>八、用GDB去跟进其堆栈，BT显示调用层级定位出现问题所在位置：<br/>#gdb php /tmp/core.8494<br/>(gdb) bt<br/>#0&nbsp;&nbsp;0x00007f146b33e9a5 in http_client_coro_send_http_request (zobject=0x7f147248d190)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/swoole_http_client_coro.c:501<br/>#1&nbsp;&nbsp;0x00007f146b383c93 in swClient_onWrite (reactor=&lt;optimized out&gt;, event=0x7ffd0c185a10)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/src/network/Client.c:1109<br/>#2&nbsp;&nbsp;0x00007f146b37d63c in swReactorEpoll_wait (reactor=0x1dfc338, timeo=&lt;optimized out&gt;)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/src/reactor/ReactorEpoll.c:270<br/>#3&nbsp;&nbsp;0x00007f146b389de9 in swReactorProcess_loop (pool=&lt;optimized out&gt;, <br/>&nbsp;&nbsp;&nbsp;&nbsp;worker=worker@entry=0x7ffd0c185ae0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/src/network/ReactorProcess.c:379<br/>#4&nbsp;&nbsp;0x00007f146b38a727 in swReactorProcess_start (serv=serv@entry=0x1dc7cf0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/src/network/ReactorProcess.c:112<br/>#5&nbsp;&nbsp;0x00007f146b381538 in swServer_start (serv=serv@entry=0x1dc7cf0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/src/network/Server.c:696<br/>#6&nbsp;&nbsp;0x00007f146b333730 in zim_swoole_http_server_start (execute_data=0x7f14724130a0, <br/>&nbsp;&nbsp;&nbsp;&nbsp;return_value=0x7ffd0c185cb0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/swoole_http_server.c:1567<br/>#7&nbsp;&nbsp;0x00000000008ad0c6 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER ()<br/>#8&nbsp;&nbsp;0x000000000085bd3b in execute_ex ()<br/>#9&nbsp;&nbsp;0x00000000008aee24 in zend_execute ()<br/>#10 0x0000000000816fc4 in zend_execute_scripts ()<br/>#11 0x00000000007b8520 in php_execute_script ()<br/>#12 0x00000000008b0fbf in do_cli ()<br/>#13 0x000000000043d450 in main ()<br/><br/>(gdb)f 1<br/>#1&nbsp;&nbsp;0x00007f146b383c93 in swClient_onWrite (reactor=&lt;optimized out&gt;, event=0x7ffd0c185a10)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/src/network/Client.c:1109<br/>1109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cli-&gt;onConnect(cli);<br/><br/>(gdb)f 0<br/>#0&nbsp;&nbsp;0x00007f146b33e9a5 in http_client_coro_send_http_request (zobject=0x7f147248d190)<br/>&nbsp;&nbsp;&nbsp;&nbsp;at /home/test/rpmbuild/BUILD/swoole-src-2.0.7-stable/swoole_http_client_coro.c:501<br/>501&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!http-&gt;cli &#124;&#124; !http-&gt;cli-&gt;socket )<br/><br/>九、用valgrind大体排查一下是否有内存溢出等：<br/>[root@测试服务器:/tmp]<br/>#USE_ZEND_ALLOC=0 valgrind php coroutinemysql.php <br/>==12833== Memcheck, a memory error detector<br/>==12833== Copyright (C) 2002-2015, and GNU GPL&#039;d, by Julian Seward et al.<br/>==12833== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info<br/>==12833== Command: php coroutinemysql.php<br/>==12833== <br/><br/>==12833== Invalid read of size 8<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;at 0x121249A5: http_client_coro_send_http_request (swoole_http_client_coro.c:501)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x12169C92: swClient_onWrite (Client.c:1109)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x1216363B: swReactorEpoll_wait (ReactorEpoll.c:270)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x1216FDE8: swReactorProcess_loop (ReactorProcess.c:379)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x12170726: swReactorProcess_start (ReactorProcess.c:112)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x12167537: swServer_start (Server.c:696)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x1211972F: zim_swoole_http_server_start (swoole_http_server.c:1567)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x8AD0C5: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x85BD3A: execute_ex (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x8AEE23: zend_execute (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x816FC3: zend_execute_scripts (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x7B851F: php_execute_script (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;Address 0x100000188 is not stack&#039;d, malloc&#039;d or (recently) free&#039;d<br/>==12833== <br/>==12833== <br/>==12833== Process terminating with default action of signal 11 (SIGSEGV): dumping core<br/>==12833==&nbsp;&nbsp;Access not within mapped region at address 0x100000188<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;at 0x121249A5: http_client_coro_send_http_request (swoole_http_client_coro.c:501)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x12169C92: swClient_onWrite (Client.c:1109)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x1216363B: swReactorEpoll_wait (ReactorEpoll.c:270)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x1216FDE8: swReactorProcess_loop (ReactorProcess.c:379)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x12170726: swReactorProcess_start (ReactorProcess.c:112)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x12167537: swServer_start (Server.c:696)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x1211972F: zim_swoole_http_server_start (swoole_http_server.c:1567)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x8AD0C5: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x85BD3A: execute_ex (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x8AEE23: zend_execute (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x816FC3: zend_execute_scripts (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;by 0x7B851F: php_execute_script (in /usr/local/php/bin/php)<br/>==12833==&nbsp;&nbsp;If you believe this happened as a result of a stack<br/>==12833==&nbsp;&nbsp;overflow in your program&#039;s main thread (unlikely but<br/>==12833==&nbsp;&nbsp;possible), you can try to increase the size of the<br/>==12833==&nbsp;&nbsp;main thread stack using the --main-stacksize= flag.<br/>==12833==&nbsp;&nbsp;The main thread stack size used in this run was 8388608.<br/>==12833== <br/>==12833== HEAP SUMMARY:<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp; in use at exit: 22,357,752 bytes in 22,711 blocks<br/>==12833==&nbsp;&nbsp; total heap usage: 29,852 allocs, 7,141 frees, 23,257,973 bytes allocated<br/>==12833== <br/>==12833== LEAK SUMMARY:<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;definitely lost: 64 bytes in 2 blocks<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;indirectly lost: 4,096 bytes in 2 blocks<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;possibly lost: 1,813,286 bytes in 18,399 blocks<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;still reachable: 20,540,306 bytes in 4,308 blocks<br/>==12833==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; suppressed: 0 bytes in 0 blocks<br/>==12833== Rerun with --leak-check=full to see details of leaked memory<br/>==12833== <br/>==12833== For counts of detected and suppressed errors, rerun with: -v<br/>==12833== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)<br/>段错误<br/><br/><br/>十、在PHP代码上加加减减，定位一下PHP这个协程是哪个协议出现问题，经定位发现是发起http这块的协程可能有问题，如下：<br/>再细节一点：<br/>#php coroutinemysql.php <br/>段错误(吐核)<br/>这一行引起的：$httpclient-&gt;setDefer();&nbsp;&nbsp;&nbsp;&nbsp; #setDefer函数的Wiki地址：https://wiki.swoole.com/wiki/page/607.html<br/><br/>$httpclient = new Swoole&#92;Coroutine&#92;Http&#92;Client(&#039;123.125.114.144&#039;, 80);<br/>$httpclient-&gt;setHeaders([&#039;Host&#039; =&gt; &quot;baidu.com&quot;]);<br/>$httpclient-&gt;set([ &#039;timeout&#039; =&gt; 3]);<br/>$httpclient-&gt;setDefer();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#注释这一行，就会报下面的警告，不会Coredump，如下：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>$httpclient-&gt;get(&#039;/&#039;);<br/><br/>#php coroutinemysql.php&nbsp;&nbsp; #浏览器访问一下：http://123.57.*.183:9507/<br/>PHP Warning:&nbsp;&nbsp;Swoole&#92;Coroutine&#92;Http&#92;Client::recv(): you should not use recv without defer&nbsp;&nbsp;in /tmp/coroutinemysql.php on line 40<br/>PHP Warning:&nbsp;&nbsp;Swoole&#92;Coroutine&#92;Http&#92;Client::recv(): you should not use recv without defer&nbsp;&nbsp;in /tmp/coroutinemysql.php on line 40<br/><br/>在服务器上CURL形式访问一下百度，没毛病：<br/>curl -i -H&quot;Host:baidu.com&quot; http://123.125.114.144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>HTTP/1.1 200 OK&nbsp;&nbsp; <br/>&lt;html&gt;<br/>&lt;meta http-equiv=refresh content=0;url=http://www.baidu.com/&gt;<br/>&lt;/html&gt;<br/><br/><br/>十一、提交出现Coredump以及和环境相关的问题给Swoole的CoreTeam研发小组的兄弟：<br/>请将上面的得到的信息，连同机器信息，包括php -v gcc -v uname -a 提交到Github Issues页面或者发送邮件到 team@swoole.com。<br/>若确定是Swoole的问题，开发组会快速解决问题。<br/>其它涉及到编译器和PHP版本、系统环境：<br/>#php -v<br/>PHP 7.1.5 (cli) (built: May 23 2017 10:35:57) ( NTS )<br/>Copyright (c) 1997-2017 The PHP Group<br/>Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies<br/>&nbsp;&nbsp;&nbsp;&nbsp;with Zend OPcache v7.1.5, Copyright (c) 1999-2017, by Zend Technologies<br/><br/>#gcc -v <br/>使用内建 specs。<br/>COLLECT_GCC=gcc<br/>COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper<br/>目标：x86_64-redhat-linux<br/>配置为：../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux<br/>线程模型：posix<br/>gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) <br/><br/><br/>#uname -a<br/>Linux 测试服务器 4.11.2-1.el7.elrepo.x86_64 #1 SMP Sun May 21 19:31:34 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux<br/><br/><br/>#php --ri swoole<br/><br/>swoole<br/><br/>swoole support =&gt; enabled<br/>Version =&gt; 2.0.8<br/>Author =&gt; tianfeng.han[email: mikan.tenny@gmail.com]<br/>epoll =&gt; enabled<br/>eventfd =&gt; enabled<br/>timerfd =&gt; enabled<br/>signalfd =&gt; enabled<br/>cpu affinity =&gt; enabled<br/>spinlock =&gt; enabled<br/>rwlock =&gt; enabled<br/>async redis client =&gt; enabled<br/>async http/websocket client =&gt; enabled<br/>Linux Native AIO =&gt; enabled<br/>pcre =&gt; enabled<br/>zlib =&gt; enabled<br/>mutex_timedlock =&gt; enabled<br/>pthread_barrier =&gt; enabled<br/><br/>Directive =&gt; Local Value =&gt; Master Value<br/>swoole.aio_thread_num =&gt; 2 =&gt; 2<br/>swoole.display_errors =&gt; On =&gt; On<br/>swoole.use_namespace =&gt; On =&gt; On<br/>swoole.fast_serialize =&gt; 1 =&gt; 1<br/>swoole.unixsock_buffer_size =&gt; 8388608 =&gt; 8388608<br/><br/><br/>EOF
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [提交缺陷]Swoole2.X版本提供PHP原生协程支持实践，Http请求部分的$httpclient-setDefer();该行出现段错误的可能是Bug提交示例。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>