public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: maliubiao <maliubiao@gmail.com>, systemtap@sourceware.org
Subject: Re: report a segment fault bug of systemtap
Date: Mon, 13 Jan 2014 10:49:00 -0000	[thread overview]
Message-ID: <1389610159.23835.46.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: <y0mob3iqtja.fsf@fche.csb>

On Sat, 2014-01-11 at 13:10 -0500, Frank Ch. Eigler wrote:
> It seems like incomplete DWARF data can result in elfutils passing
> NULL char*'s to the stap translator, which the latter is not always
> prepared to tolerate.  We encountered this same problem here yesterday
> and committed a patch.

I quickly looked at the patch and I do think elfutils is allowed to
return NULL indeed. And you should guard against it.

dwarf_decl_file () will return NULL when there is no DW_AT_decl_file
attribute, if the value is zero (which indicates no source information
was recorded by the compiler) or if the .debug_line section isn't
valid/doesn't contain the indicated source file.

dwarf_diename () will return NULL when no DW_AT_name attribute can be
found (which isn't guaranteed to be produced by the compiler in all
cases). Or if the DW_AT_name is wrongly encoded (isn't a string).

In particular for CUs a DW_TAG_compile_unit often does have a name (the
primary source the compiler used), but a DW_TAG_partial_unit often
doesn't have one (since there it might be unclear whether there even is
a primary source file in that case).

Cheers,

Mark

      reply	other threads:[~2014-01-13 10:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28 11:52 maliubiao
2013-12-28 12:22 ` maliubiao
2014-01-11 18:10 ` Frank Ch. Eigler
2014-01-13 10:49   ` Mark Wielaard [this message]

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=1389610159.23835.46.camel@bordewijk.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=fche@redhat.com \
    --cc=maliubiao@gmail.com \
    --cc=systemtap@sourceware.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).