Hi all,
these questions pops up all the time, how to get a stack traces etc.
from a crashing ATS installation. So, here are some quick tips .
First, it's important to have a properly built ATS version for debugging
to be efficient. The "best" option is to build ATS with something like this:
#! /bin/sh
#
# Created by configure
"./configure" \
"--enable-static-libts" \
"--enable-debug" \
"$@"
Next, Linux can be finicky when it comes to generating core files, so
I'd recommend the following sysctl configs:
kernel.core_uses_pid = 1
kernel.core_pattern = /tmp/core
This tells the kernel to dump the core file into /tmp, with a name like
core.12345. Also, you might need to increase the resource limits on the
size of the core file that can be generated. This can be done with e.g.
"ulimit -c unlimited", or adding something like this to
/etc/security/limits.conf:
root - core unlimited
We might still not be able to get a core file with all this said and
done, so in that case, you might have to attach gdb directly to the
running traffic_server process. You can do that with e.g.
% sudo gdb /usr/local/bin/traffic_server 12345
Where 12345 is the pid of the running traffic_server process. Once you
have entered the command above, make sure to type the "cont" command to
have gdb continue executing traffic_server. Assuming you instead got a
core file (lets hope), then instead you would run
% sudo gdb /usr/local/bin/traffic_server /tmp/core.12345
Now with either a core file, or a crasher inside gdb directly, you need
to submit useful information to us. The best starting point is to get
some stack traces, so inside gdb type:
(gdb) set pagination 0
(gdb) bt
...
(gdb) thread apply all bt
This is now useful information, particularly if you compiled ATS like
mentioned above. Attach this to a bug in Jira, together with information
from you environment. Useful information includes:
* Version of ATS (this is absolutely necessary to do any debugging).
More importantly, you should run the latest released version
(development releases preferably).
* Linux version / platform
* Any configuration changes you have made
* Any information about what causes the crash, i.e. if you know of a
particular request that triggers it, or anything else that would
help reproducing the problem, please include it.
* Anything else you can possibly think would be useful to help debug
the problem, including promises of beer.
I'm sure I've missed plenty of details here, so feel free to add to this.
Thanks,
-- leif