File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -74,3 +74,29 @@ start debugging, just like you would with any other program:
74
74
``` bash
75
75
gdb src/test/test_bitcoin
76
76
```
77
+
78
+ #### Segmentation faults
79
+
80
+ If you hit a segmentation fault during a test run, you can diagnose where the fault
81
+ is happening by running ` gdb ./src/test/test_bitcoin ` and then using the ` bt ` command
82
+ within gdb.
83
+
84
+ Another tool that can be used to resolve segmentation faults is
85
+ [ valgrind] ( https://valgrind.org/ ) .
86
+
87
+ If for whatever reason you want to produce a core dump file for this fault, you can do
88
+ that as well. By default, the boost test runner will intercept system errors and not
89
+ produce a core file. To bypass this, add ` --catch_system_errors=no ` to the
90
+ ` test_bitcoin ` arguments and ensure that your ulimits are set properly (e.g. `ulimit -c
91
+ unlimited`).
92
+
93
+ Running the tests and hitting a segmentation fault should now produce a file called ` core `
94
+ (on Linux platforms, the file name will likely depend on the contents of
95
+ ` /proc/sys/kernel/core_pattern ` ).
96
+
97
+ You can then explore the core dump using
98
+ ``` bash
99
+ gdb src/test/test_bitcoin core
100
+
101
+ (gbd) bt # produce a backtrace for where a segfault occurred
102
+ ```
You can’t perform that action at this time.
0 commit comments