cmogstored dev/user discussion/issues/patches/etc
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Arkadi Colson <arkadi@smartbit.be>
Cc: cmogstored-public@bogomips.org
Subject: Re: Heavy load
Date: Thu, 12 Dec 2019 07:59:37 +0000	[thread overview]
Message-ID: <20191212075937.GA2881@dcvr> (raw)
In-Reply-To: <b72de298-f271-2033-7cfe-b7ba5c2aaa4f@smartbit.be>

Arkadi Colson <arkadi@smartbit.be> wrote:
> Hi
> 
> We are running cmogstored version 1.7.1 compiled and running on Debian 
> stretch. How do I catch backtrace and debugging symbols?

OK, on Linux, you need to make sure core file size is big
enough to hold the entire core dump.  I normally just use
"unlimited" since I have more free disk space than RAM.

Via init scripts, use "ulimit -c unlimited" in the shell
script before spawning cmogstored (from the same shell
process).

With systemd, it's the "LimitCORE=" property (see systemd.exec
manpage).

You can check "Max core file size" in the
"/proc/$PID_OF_CMOGSTORED/limits" file once cmogstored is running
to verify.

AFAIK, core dumps go to the working directory of the process by
default.  For daemonized processes like cmogstored might try to
write to "/" (and fail due to lack of permissions).

I've used the following to get all my core dumps in
/var/tmp/core.$CRASHED_PID:

	echo /var/tmp/core >/proc/sys/kernel/core_pattern
	echo 1 >/proc/sys/kernel/core_uses_pid

But modern kernels have more options for piping core dumps
to processes and such...

cmogstored builds by default with '-ggdb3' in the CFLAGS, which
is the most verbose debug info.  Some installers strip the debug
info, unfortunately.  Running "file /path/to/cmogstored" will
tell you if there's debug_info and if it's stripped
(probably easiest to install the unstripped one)

Once you have a core dump from a crashed process, you can run
gdb against it with an unstripped binary to get lots of info.

  gdb /path/to/cmogstored /var/tmp/core.$CRASHED_PID

And then you can type "bt" to get a backtrace.
You can also use "t 1", "t 2", etc to switch between
threads and get the backtrace of other threads and a
host of other commands.

I'm not an expert in using gdb, as I can usually figure
everything out from just the backtrace.

Hopefully that's enough to get you the info I need to
fix the problem.  But there's a lot of info out there
on debugging C programs on there (and I'm tired atm and
about to pass out).

  reply	other threads:[~2019-12-12  7:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 13:54 Heavy load Arkadi Colson
2019-12-11 17:06 ` Eric Wong
2019-12-12  7:30   ` Arkadi Colson
2019-12-12  7:59     ` Eric Wong [this message]
2019-12-12 19:16     ` Eric Wong
2019-12-17  7:40       ` Arkadi Colson
2019-12-17  8:43         ` Eric Wong
2019-12-17  8:57           ` Arkadi Colson
2019-12-17 19:42             ` Eric Wong
2019-12-18  7:56               ` Arkadi Colson
2019-12-18 17:58                 ` Eric Wong
2020-01-06  9:46                   ` Arkadi Colson
2020-01-08  3:35                     ` Eric Wong
2020-01-08  9:40                       ` Arkadi Colson
2020-01-30  0:35                         ` Eric Wong
2020-03-03 15:46                           ` Arkadi Colson
2019-12-17  7:41       ` Arkadi Colson
2019-12-17  8:31         ` Eric Wong
2019-12-17  8:43           ` Arkadi Colson
2019-12-17  8:50             ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/cmogstored/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191212075937.GA2881@dcvr \
    --to=e@80x24.org \
    --cc=arkadi@smartbit.be \
    --cc=cmogstored-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/cmogstored.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).