From: vijay nag <vijunag@gmail.com>
To: "Кукушкин Павел Геннадьевич" <kukp@1c.ru>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Minimal core dump mapping set
Date: Fri, 22 Apr 2016 05:25:00 -0000 [thread overview]
Message-ID: <CAKhyrx8xV5ESt1-xVvVafnRLL-pQw92eByHuyVeuu9gT2eUmZw@mail.gmail.com> (raw)
In-Reply-To: <dc359f2a-ac3f-4619-b4f7-1e515af60989@sourceware.org>
On Wed, Apr 20, 2016 at 10:29 PM, Кукушкин Павел Геннадьевич <kukp@1c.ru> wrote:
> Dear developers,
>
> I want to generate core dump file by application itself. Of course it supposed to be compatible with gdb. When I store all anonymous mappings to the file I get no problems. I can see stacks and heaps and so forth. But I want to store only stacks without heap. So I decided to skip anonymous mappings. Here I get in trouble. Gdb can't open that kind of core. I noticed that storing last 4 anonymous mappings (I mean in proc maps list) solves the problem. But how can I be sure that and if the particular mapping is vital for gdb. And what do those mappings keep.
>
> Thank you for answer,
> Pavel Kukushkin,
> kukp@1c.ru
>
>
>
If you are looking for only stacktrace, you don't have to bother about
including anonymous mappings of your task. You simply have to dump the
stack pages from the current stack-top ($esp or $rsp) till the stack
bottom(stack bottom can be the first variable in the main function) in
your signal handler if stack pages aren't corrupted(Use madvise or
msync to know the sanity of a page). Along with stack pages, you'll
need register contents especially ($eip/$rip) for stack crawling. With
this data, you can teach GDB to load the stack trace from your core by
writing a BFD backend.
next prev parent reply other threads:[~2016-04-22 5:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 17:00 Кукушкин Павел Геннадьевич
2016-04-22 5:25 ` vijay nag [this message]
2016-04-27 18:39 ` Antoine Tremblay
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKhyrx8xV5ESt1-xVvVafnRLL-pQw92eByHuyVeuu9gT2eUmZw@mail.gmail.com \
--to=vijunag@gmail.com \
--cc=gdb@sourceware.org \
--cc=kukp@1c.ru \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox