Debug Coredump of Swoole

If you have seen segment falt errors of your Swoole application, please follow the following steps to generate a call stack report.

To see the call stack related to Swoole, you have to add --enable-debug when compiling Swoole.

1. Install gdb and enable coredump

ulimit -c unlimited

2. Run your application and generate core-dump file

Depends on your OS, the core dump file may be located at different folders: /tmp or /cores.

3. View the info in the core-dump file:

gdb php core 

gdb php /tmp/core.xxxx

4. View the call stack

f 1
f 0