一模一样的代码在php5下是正常的,在php7下运行某一段代码时会莫名其妙自动重启。
环境:
php: 7.0.10
swoole: 1.9.1
系统: CentOS release 6.7
[2016-12-19 14:24:15 $19737.0]WARNINGswManager_check_exit_status: worker#0 abnormal exit, status=0, signal=11
[2016-12-19 14:25:44 *19944.0]WARNINGswSignalfd_onSignal: signal[13] callback is null.
运行
gdb -p worker进程pid
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x00000000007e0fbb in zval_delref_p (zval_ptr=0x7efd2280ce98) at /root/php-7.0.10/Zend/zend_types.h:827
827/root/php-7.0.10/Zend/zend_types.h: No such file or directory.
in /root/php-7.0.10/Zend/zend_types.h
(gdb)
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
"/root/php-7.0.10/"这个目录是php7的软件包路径,编译安装完成之后就被删掉了,是因为这个原因???
运行
strace -f -p worker进程pid
poll([{fd=6, events=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1 ([{fd=6, revents=POLLIN}])
recvfrom(6, "$-1\r\n", 8192, 0, NULL, NULL) = 5
poll([{fd=6, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
write(1, "[14:24:15] chefang ==> AAGID30FF"..., 57) = 57
sendto(8, "\2\0\0\0!\0\0\0\0S\0\0AAGID30FFDC053353313"..., 45, 0, NULL, 0) = 45
write(1, "[14:24:15] ch result ===> 1\n", 28) = 28
poll([{fd=11, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
sendto(11, "*3\r\n$4\r\nHDEL\r\n$9\r\nis_walert\r\n$24"..., 60, 0, NULL, 0) = 60
poll([{fd=11, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 1 ([{fd=11, revents=POLLIN}])
recvfrom(11, ":", 1, MSG_PEEK, NULL, NULL) = 1
poll([{fd=11, events=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1 ([{fd=11, revents=POLLIN}])
recvfrom(11, ":1\r\n", 8192, 0, NULL, NULL) = 4
poll([{fd=11, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
sendto(11, "*3\r\n$4\r\nHDEL\r\n$6\r\nwalert\r\n$24\r\n3"..., 57, 0, NULL, 0) = 57
poll([{fd=11, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 1 ([{fd=11, revents=POLLIN}])
recvfrom(11, ":", 1, MSG_PEEK, NULL, NULL) = 1
poll([{fd=11, events=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1 ([{fd=11, revents=POLLIN}])
recvfrom(11, ":0\r\n", 8192, 0, NULL, NULL) = 4
poll([{fd=11, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
sendto(11, "*2\r\n$3\r\nDEL\r\n$31\r\nweb_cf_30FFDC0"..., 51, 0, NULL, 0) = 51
poll([{fd=11, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 1 ([{fd=11, revents=POLLIN}])
recvfrom(11, ":", 1, MSG_PEEK, NULL, NULL) = 1
poll([{fd=11, events=POLLIN|POLLERR|POLLHUP}], 1, -1) = 1 ([{fd=11, revents=POLLIN}])
recvfrom(11, ":0\r\n", 8192, 0, NULL, NULL) = 4
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffff00000006} ---
+++ killed by SIGSEGV +++