Merge pull request #6607 from Icinga/feature/docs-dev-gdb-running-process

Enhance development docs with GDB backtrace and thread list
This commit is contained in:
Michael Friedrich 2018-09-12 12:40:17 +02:00 committed by GitHub
commit 0ef6084d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -175,7 +175,20 @@ make sure to attach as much detail as possible.
If Icinga 2 is still running, generate a full backtrace from the running
process and store it into a new file (e.g. for debugging dead locks):
# gdb -p $(pidof icinga2) -batch -ex "thread apply all bt full" -ex "detach" -ex "q" > gdb_bt.log
Icinga 2 runs with 2 processes, therefore generate two backtrace logs
and add them to the GitHub issue.
```
for pid in $(pidof icinga2); do gdb -p $pid -batch -ex "thread apply all bt full" -ex "detach" -ex "q" > gdb_bt_${pid}_`date +%s`.log; done
```
### GDB Thread List from Running Process <a id="development-debug-gdb-thread-list-running"></a>
Instead of a full backtrace, you sometimes just need a list of running threads.
```
for pid in $(pidof icinga2); do gdb -p $pid -batch -ex "info threads" -ex "detach" -ex "q" > gdb_threads_${pid}_`date +%s`.log; done
```
### GDB Backtrace Stepping <a id="development-debug-gdb-backtrace-stepping"></a>