public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: Dodji Seketeli <dodji@seketeli.org>
Cc: Thomas Schwinge <thomas@codesourcery.com>,
	 Giuliano Procida via Libabigail <libabigail@sourceware.org>,
	Mark Wielaard <mark@klomp.org>
Subject: Re: 'src/abg-dwarf-reader.cc:compare_dies_string_attribute_value' optimization
Date: Tue, 12 Apr 2022 16:20:51 +0100	[thread overview]
Message-ID: <CAGvU0HmzdaK2SuNh3GOtKyG+V9DBYTNcxnVxU2GuJ+JrXR=8BQ@mail.gmail.com> (raw)
In-Reply-To: <877d7vhcmv.fsf@seketeli.org>

I started looking at this today but I've run out of time. I'll be able to
take another look in about a week.

Checks fail (various types are renumbered in XML output) starting at
commit 57b1c714.

I haven't tried this on kernel or framework libraries yet, but I know there
are plenty of typedefs in both.

Regards,
Giuliano

On Mon, 11 Apr 2022 at 16:18, Dodji Seketeli <dodji@seketeli.org> wrote:

> Hello Thomas and Giuliano,
>
> [...]
>
>
> Thomas Schwinge <thomas@codesourcery.com> a écrit:
>
> [...]
>
> >> OK.  Then:
> >>
> >>     (gdb) print l_attr.valp && r_attr.valp
> >>     $8 = true
> >>     (gdb) print *l_attr.valp == *r_attr.valp
> >>     $9 = true
> >>
> >> This now does 'return true;'!
> >>
> >> Given 'unsigned char *valp', what this only checks is that one byte at
> >> 'l_attr.valp' equals one byte at 'r_attr.valp' -- which evidently isn't
> >> sufficient to demonstrate that 'l_attr' and 'r_attr' do match.
> Therefore
> >> it seems that this optimization is not correct?
> >>
>
> Giuliano Procida <gprocida@google.com> a écrit:
>
> > Looks like you've found one bug. It has compared addresses and moved on
> to
> > test data.
> >
> > It could do strcmp at this point, assuming these things are
> null-terminated
> > strings, which is the case for DW_FORM_strp but is not for other things.
> >
> > But there is another bug. I've instrumented the code and found cases (in
> > the test suite) where the fast path returns false, but the slow path
> > returns true. Both sides are DW_FORM_strx1. The data are not strings but
> > indexes and that the same string appears at different indexes.
>
> I agree.  This is a bug.
>
> I tried to fix and indeed, hell did break lose as I realized there were
> several other issues across the pipeline (including several issues that
> I have long wanted to address) that needed so that this one fits in
> correctly.
>
> I came up with a patch set that lies in the branch 'fix-dwarf-str-cmp',
> at
>
> https://sourceware.org/git/?p=libabigail.git;a=shortlog;h=refs/heads/fix-dwarf-str-cmp
> .
>
> The tip of that patch set addresses this issue specifically:
>
> https://sourceware.org/git/?p=libabigail.git;a=commit;h=3d277a9cc05873cf4aeb97273d585e0b07af917d
> .
>
> But for that fix to be applied, we need the whole patch set that fixes
> several other issues left and right.
>
> Giuliano & Thomas, could you please test that branch on your specific
> environments?  If it works OK, then I can consider posting the patch-set
> properly to the list.  If it doesn't, at least I'd wouldn't have broken
> the world without notice ;-)
>
> Thanks.
>
> --
>                 Dodji
>

  reply	other threads:[~2022-04-12 15:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 22:39 Thomas Schwinge
2022-01-31 14:38 ` Thomas Schwinge
2022-01-31 15:56   ` Giuliano Procida
2022-04-11 15:18     ` Dodji Seketeli
2022-04-12 15:20       ` Giuliano Procida [this message]
2022-04-12 16:16         ` Dodji Seketeli
2022-04-13  2:19           ` Ben Woodard
2022-04-13 18:00             ` Ben Woodard
2022-04-14  9:14             ` Dodji Seketeli
2022-04-18 16:42               ` Ben Woodard
2022-06-20 16:12 ` Dodji Seketeli
2022-06-22  8:09   ` Ben Woodard

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='CAGvU0HmzdaK2SuNh3GOtKyG+V9DBYTNcxnVxU2GuJ+JrXR=8BQ@mail.gmail.com' \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=libabigail@sourceware.org \
    --cc=mark@klomp.org \
    --cc=thomas@codesourcery.com \
    /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).