Join 4,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5
If you have seen segment falt errors of your Open Swoole application, please follow the following steps to generate a call stack report.
To see the call stack related to Open Swoole, you have to add --enable-debug
when compiling OpenSwoole.
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
bt
f 1
f 0
rm -rf /tmp/core.*
ulimit -c unlimited
echo '1' > /proc/sys/kernel/core_pipe_limit
echo '1' > /proc/sys/kernel/core_uses_pid
echo '/tmp/core'> /proc/sys/kernel/core_pattern
sudo mkdir /cores
sudo chown root:admin /cores
sudo chmod 1775 /cores
sudo chmod o+w /cores
ulimit -c unlimited