From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 69C253858D3C; Tue, 3 Jan 2023 16:57:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69C253858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672765053; bh=XBH4gN3siqWAjBGGPcguSrcmU7U7sZ5k3EZvHAZi3f8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MNYRLyLyDj0+rYYn9KfHWJ5kubgm+gl9j4aILlhoOtlhYLSwBGA1Ug8r4SVm7fpr1 6Lb04oos7NslowRFn77qBLdZE50qgqZCy7i9v/N2z9Tf4N2SxB4bmhdhqkiQ6Nq8AU IQ8W/qjl2yT2LHB63ODO2WPig5PYWzwbjSrIQnkA= From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug remote/28489] Allow caching of remote objfiles Date: Tue, 03 Jan 2023 16:57:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: remote X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28489 --- Comment #5 from Simon Marchi --- (In reply to Tom Tromey from comment #4) > (In reply to Simon Marchi from comment #2) >=20 > > 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 w= here > > there would be a clash. >=20 > 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, f= or the index-cache). On my system, the build-ids are generated using the sha1 method, for instan= ce: $ file /bin/ls /bin/ls: ... BuildID[sha1]=3D588ca812c340997ca8660ce0e15ee31a542568ad ... 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 s= ha1 to create collisions, but then it's a producer problem, if they want to avo= id that they should move to a newer hashing algorithm. Same thing if the producer fails to consider some important bits of executa= bles 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 thin= k we should try to protect against that, otherwise we will always work in a pessimistic fashion and won't be able to optimize anything. --=20 You are receiving this mail because: You are on the CC list for the bug.=