From: marko@kevac.org
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: Using libdw to get symbol names inside signal handler
Date: Fri, 01 Apr 2016 14:41:11 +0000 [thread overview]
Message-ID: <CA+RAKy6qpEcf_07JYKxvp5O5GVf3dk_AZSLy31WMsUX-MNtP=w@mail.gmail.com> (raw)
In-Reply-To: 1459517668.8147.148.camel@redhat.com
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
On Fri, Apr 1, 2016 at 4:34 PM Mark Wielaard <mjw@redhat.com> wrote:
>
> It does have documentation, but it is indeed not as full as we would
> like. Please take a look at libdw.h and libdwfl.h
>
For someone who is familiar with ELF innards maybe, but for someone who
just wants backtrace and symbol names not so much :-)
> If you really need an in-process unwinder then I would recommend you
> take a look at the libbacktrace from the GCC project:
> https://gcc.gnu.org/viewcvs/gcc/trunk/libbacktrace/
I really do. Not only for logging after segmentation fault, but also for
watchdog feature: print stack trace if program stuck somewhere and could
not rewind SIGALRM timeout in time.
I have found standalone fork of libbacktrace (
https://github.com/ErwanLegrand/libbacktrace
<https://github.com/ErwanLegrand/libbacktrace_>) and will try it. Thank
you.
> If you just want to get a good backtrace when you get a SIGSEGV or other
> fatal signal it makes sense to just call eu-stack -P TID on yourself.
> fork and exec are signal safe. And then you don't have to try to deal
> with a possibly corrupt program.
>
It would be fine for SIGSEGV case, but not for watchdog (SIGALRM) case.
Thanks again for rapid answer!
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1963 bytes --]
next reply other threads:[~2016-04-01 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 14:41 marko [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-01 13:34 Mark Wielaard
2016-04-01 11:38 marko
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='CA+RAKy6qpEcf_07JYKxvp5O5GVf3dk_AZSLy31WMsUX-MNtP=w@mail.gmail.com' \
--to=marko@kevac.org \
--cc=elfutils-devel@lists.fedorahosted.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.
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).