public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug remote/28489] Allow caching of remote objfiles
Date: Tue, 03 Jan 2023 16:57:32 +0000	[thread overview]
Message-ID: <bug-28489-4717-G7PBLvc4WQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28489-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28489

--- Comment #5 from Simon Marchi <simark at simark dot ca> ---
(In reply to Tom Tromey from comment #4)
> (In reply to Simon Marchi from comment #2)
> 
> > Isn't the concept of build-id that we can assume they are always unique, for
> > all practical intents?  I don't understand what situation you imagine where
> > there would be a clash.
> 
> Just bad luck.  I wonder if there's ever been a clash.
> Shrug, maybe we don't have to worry about it.  That would make
> things simpler.

I think that many things in the stack use that assumption.  The concept of
build-id would not be very useful if we couldn't assume they are unique, it
means we couldn't use the build-id as the key for anything (for instance, for
the index-cache).

On my system, the build-ids are generated using the sha1 method, for instance:

$ file /bin/ls
/bin/ls: ... BuildID[sha1]=588ca812c340997ca8660ce0e15ee31a542568ad ...

So accidental collisions are not going to happen, for practical intents and
purposes. People will of course point out that there are known attacks on sha1
to create collisions, but then it's a producer problem, if they want to avoid
that they should move to a newer hashing algorithm.

Same thing if the producer fails to consider some important bits of executables
when generating the build-id, resulting in two different binaries having the
same build-id, then it's a producer bug that should be fixed.  I don't think we
should try to protect against that, otherwise we will always work in a
pessimistic fashion and won't be able to optimize anything.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-01-03 16:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 15:24 [Bug remote/28489] New: " tromey at sourceware dot org
2023-01-02 19:30 ` [Bug remote/28489] " tromey at sourceware dot org
2023-01-03  2:56 ` simark at simark dot ca
2023-01-03  4:09 ` daniel at mariadb dot org
2023-01-03  9:57 ` mark at klomp dot org
2023-01-03 16:45 ` tromey at sourceware dot org
2023-01-03 16:57 ` simark at simark dot ca [this message]
2023-01-03 17:55 ` mark at klomp dot org
2023-01-04  1:39 ` tromey at sourceware dot org
2023-01-04  2:58 ` fche at redhat dot com
2023-01-04  4:07 ` tromey at sourceware dot org
2023-01-04  4:13 ` simark at simark dot ca
2023-01-04 17:11 ` simark at simark dot ca
2023-08-23 19:18 ` tromey at sourceware dot org
2023-08-23 19:26 ` fche at redhat dot com
2023-08-23 19:30 ` tromey at sourceware dot org
2023-08-24 17:40 ` tromey at sourceware dot org
2023-08-24 19:41 ` tromey at sourceware dot org

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=bug-28489-4717-G7PBLvc4WQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).