diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-02-02 18:08:18 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-02-02 18:08:18 +0200 |
commit | 05de1bc398178decc6a46c0b4a0da3975339cc89 (patch) | |
tree | 4abbb508c161df30d8a4ab709847d2814a5f95e2 | |
parent | Merge pull request #1649 (diff) | |
parent | Added instructions for getting stack traces with gdb (diff) | |
download | monero-05de1bc398178decc6a46c0b4a0da3975339cc89.tar.xz |
Merge pull request #1614
7b6a9e91 Added instructions for getting stack traces with gdb (NanoAkron)
-rw-r--r-- | README.md | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -385,6 +385,50 @@ If you want to help out, see CONTRIBUTING for a set of guidelines. This section contains general instructions for debugging failed installs or problems encountered with Monero. First ensure you are running the latest version built from the github repo. +## Obtaining Stack Traces and Core Dumps on Unix Systems + +We generally use the tool `gdb` (GNU debugger) to provide stack trace functionality, and `ulimit` to provide core dumps in builds which crash or segfault. + +* To use gdb in order to obtain a stack trace for a build that has stalled: + +Run the build. + +Once it stalls, enter the following command: + +``` +gdb /path/to/monerod `pidof monerod` +``` + +Type `thread apply all bt` within gdb in order to obtain the stack trace + +* If however the core dumps or segfaults: + +Enter `ulimit -c unlimited` on the command line to enable unlimited filesizes for core dumps + +Run the build. + +When it terminates with an output along the lines of "Segmentation fault (core dumped)", there should be a core dump file in the same directory as monerod. + +You can now analyse this core dump with `gdb` as follows: + +`gdb /path/to/monerod /path/to/dumpfile` + +Print the stack trace with `bt` + +* To run monero within gdb: + +Type `gdb /path/to/monerod` + +Pass command-line options with `--args` followed by the relevant arguments + +Type `run` to run monerod + +## Analysing Memory Corruption + +We use the tool `valgrind` for this. + +Run with `valgrind /path/to/monerod`. It will be slow. + ## LMDB Instructions for debugging suspected blockchain corruption as per @HYC |