Home > PHP Framework > Swoole > body text

How to check swoole errors

Release: 2019-12-17 09:17:39
Original
2752 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

Use the f command in gdb to view the code segment

(gdb)f 1
(gdb)f 0
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template