public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: cannot skip augment string handling
Date: Sat, 13 Aug 2022 23:28:08 +0200	[thread overview]
Message-ID: <YvgXaNY5FLwqLoxi@wildebeest.org> (raw)
In-Reply-To: <CAP3s5k8EfHWcne4YG=rEThAqhi=7DAkM3VC7hWawkSohnJoAZg@mail.gmail.com>

Hi Ulrich,

On Tue, Aug 09, 2022 at 08:01:43PM +0200, Ulrich Drepper via Elfutils-devel wrote:
> He dwarf_next_cfi function has some clever code which skips over the
> processing of the augmentation string content if the first character is 'z'
> (for sized augmentation).  This would be OK if it wouldn't be for the fact
> that the augment processing loop produces additional information, namely,
> it fills in the fde_augmentation_data_size fields.  That information isn't
> available elsewhere.
> 
> In addition, the loop over the augment string is incorrect because the
> interpretation of the P, L, and R entries depends on 'z' being present.  in
> the absence of 'z', when the loop would be executed in the current version,
> the interpretation of those entries is not the same.
> 
> In the patch below I've removed the shortcut and fixed the handling of the
> P, L, and R entries.  I've also added an additional test checking that the
> entries of the augmentation string don't guide the code to consume more
> data then is indicated in the 'z' data.

Looks good. Thanks for catching this. Please do add a Signed-off-by
line next time. See the CONTRIBUTING file.

I was wondering why this hasn't caused an issue before. But it looks
like internally when we use the result of dwarf_next_cfi in cie.c and
fde.c we always call __libdw_intern_cie or intern_new_cie which
recalculates the fde_augmentation_data_size by reading the
augmentation string and data again.

Thanks,

Mark

      reply	other threads:[~2022-08-13 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 18:01 Ulrich Drepper
2022-08-13 21:28 ` 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=YvgXaNY5FLwqLoxi@wildebeest.org \
    --to=mark@klomp.org \
    --cc=drepper@redhat.com \
    --cc=elfutils-devel@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).