Skip to content

Commit 0cd8ce7

Browse files
authored
Default to full gdb backtraces (#21)
Receiving a dump of local variables often reduces the number of requests for more information in bug reports and speeds up triage. The downsides (i.e. more output, slightly higher risk of exposing sensitive information, and hypothetical lack of support in very old gdb) are not significant enough to preserve the old "less info" default. AFAICT, gdb supports `backtrace full` since 1998 commit 65b07dd (at least). Since 2019, gdb prefers `backtrace -full` to `backtrace full`, but we are not upgrading yet to accommodate older/more environments. Other debuggers may not support "full", but our instructions are already gdb-specific, and most folks folks can adapt them as needed. Also do not distract the reader with an out-of-scope explanation on how gdb commands may be abbreviated (e.g., "bt" instead of "backtrace").
1 parent 639e0e8 commit 0cd8ce7

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

docs/SquidFaq/BugReporting.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ checks. If one of those checks fail, Squid calls abort() to generate a
3333
core dump.
3434

3535
If you have a core dump file, then use gdb to extract a stack trace from
36-
the core using a "bt full" command (if supported) or a "backtrace"
37-
command (can be typed as "bt" and is always supported, but gives less
38-
information):
36+
the core using a `backtrace full` command (if supported) or a `backtrace`
37+
command (always supported, but gives less information):
3938

4039
% gdb /usr/local/squid/sbin/squid core
41-
gdb> backtrace
40+
gdb> backtrace full
4241

4342
Many people report that Squid doesn't leave a coredump anywhere. This
4443
may be due to one of the following reasons:
@@ -67,7 +66,7 @@ may be due to one of the following reasons:
6766
Core was generated by `(squid) -D'.
6867
Program terminated with signal 6, Aborted.
6968

70-
(gdb) bt
69+
(gdb) backtrace full
7170
#0 0x006ad7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
7271
#1 0x006ed7a5 in raise () from /lib/tls/libc.so.6
7372
#2 0x006ef209 in abort () from /lib/tls/libc.so.6
@@ -163,7 +162,7 @@ Once you have located the core dump file, use a debugger such as *dbx*
163162
or *gdb* to generate a stack trace:
164163

165164
% gdb /usr/local/squid/sbin/squid core
166-
gdb> backtrace
165+
gdb> backtrace full
167166

168167
If possible, you might keep the coredump file around for a day or two.
169168
It is often helpful if we can ask you to send additional debugger
@@ -225,7 +224,7 @@ handle SIGSEGV stop
225224
handle SIGABRT stop
226225
run -NYCX
227226
[wait for crash]
228-
backtrace
227+
backtrace full
229228
quit
230229
```
231230

@@ -248,7 +247,7 @@ handle SIGKILL pass
248247
handle SIGSEGV stop
249248
handle SIGABRT stop
250249
run -NYCd3
251-
backtrace
250+
backtrace full
252251
quit
253252
EOF
254253
while sleep 2; do
@@ -283,7 +282,7 @@ handle SIGABRT stop
283282
284283
attach [worker PID]
285284
[wait for crash]
286-
backtrace
285+
backtrace full
287286
detach
288287
quit
289288
```
@@ -296,11 +295,10 @@ stuck in a busy loop, and/or you want to know what your Squid is doing
296295

297296
1. To dump the current stack using gdb:
298297
```
299-
sudo gdb -n -batch -ex backtrace -pid <PID>
298+
sudo gdb -n -batch -ex 'backtrace full' -pid <PID>
300299
```
301300
You may not need/want the `-n` (i.e. do not load gdb initialization
302-
files) option. Using `'backtrace full'` instead of `backtrace` will
303-
give even more info but might be a tad slower.
301+
files) option.
304302
1. To dump the current stack using pstack(1):
305303
```
306304
sudo pstack <PID>

0 commit comments

Comments
 (0)