-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Description
Users commonly experience problems with their servers hanging, usually because of bad plugin code.
The best way to identify the cause of this problem is using gdb on Linux platforms. However, the process to do this is currently quite cumbersome:
- Use the
debugging-symbols
binaries provided $ sudo gdb -p $(cat server.lock)
- this attaches to the server process(gdb) source path/to/php/.gdbinit
- load PHP's.gdbinit
(attached to binary releases, look forZ-PHP-8.3-gdbinit
or similar).(gdb) zbacktrace
- generates a PHP backtrace for the main thread
Optionally:
(gdb) bt
- generates a native backtrace for the main thread (usually not needed)(gdb) info threads
- gives a list of running threads(gdb) thread <thread number>
and then repeat steps 4 and 5 to generate backtraces for other threads
as well as a bunch of other finer details.
These steps can be repeated at intervals to see if there's a common theme on where the server is stuck.
It would be beneficial to users if this process could be reduced to a simple bash script like dump-server-stacks.sh
, which, when run, would dump the stack traces of all currently active threads into the console without the confusing bullshit in the mix.
DaisukeDaisuke, TheNewHEROBRINEX and Bqleine
Metadata
Metadata
Assignees
Labels
No labels