Home  >  Article  >  PHP Framework  >  How to check swoole errors

How to check swoole errors

尚
Original
2019-12-17 09:17:392676browse

How to check swoole errors

When a segmentation fault occurs when using swoole, please report it to the development team in time. You can use the gdb tool to get a copy of bt information. To use gdb tracking, you need to add the --enable-debug parameter when compiling swoole.

If gdb is not convenient, you can also provide a demo program that can be stably reproduced.

Open core dump

ulimit -c unlimited

Use gdb to view core dump information. The core file is generally in the current directory. If the operating system has processed it and placed the core dump file in another directory, please replace it with the corresponding path

gdb php core 
gdb php /tmp/core.4596

Enter bt under gdb to view the call stack information

(gdb)bt
Program terminated with signal 11, Segmentation fault.
#0  0x00007f1cdbe205e0 in swServer_onTimer (reactor=<value optimized out>, event=...)  
    at /usr/local/php/swoole-swoole-1.5.9b/src/network/Server.c:92
92                              serv->onTimer(serv, timer_node->interval);
Missing separate debuginfos, use: debuginfo-install php-cli-5.3.3-22.el6.x86_64

Use the f command in gdb to view the code segment

(gdb)f 1
(gdb)f 0

If there is no function call stack information, it may be that the debug information has been removed during compilation. Please manually modify the Makefile in the swoole source directory and modify CFLAGS to

CFLAGS = -Wall -pthread -g -O0

Recommended learning: swoole video tutorial

The above is the detailed content of How to check swoole errors. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Why is Swoole fast?Next article:Why is Swoole fast?