From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30820: Chunked store references in compiled code break grafting (again) Date: Mon, 19 Mar 2018 23:34:38 +0100 Message-ID: <87370vg0e9.fsf@gnu.org> References: <87o9jq7j7r.fsf@gnu.org> <87muz3dgy1.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey3Mv-0006Cz-Bl for bug-guix@gnu.org; Mon, 19 Mar 2018 18:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey3Ms-0000C2-4f for bug-guix@gnu.org; Mon, 19 Mar 2018 18:35:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:34430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey3Ms-0000BZ-0M for bug-guix@gnu.org; Mon, 19 Mar 2018 18:35:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87muz3dgy1.fsf@netris.org> (Mark H. Weaver's message of "Mon, 19 Mar 2018 15:05:26 -0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Mark H Weaver Cc: 30820@debbugs.gnu.org Hi Mark, Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> The recently added glibc grafts triggered issues that, in the end, show >> the return of (=E2=80=9CStore references in = 8-byte >> chunks in compiled code=E2=80=9D). > > I think that we should generalize our reference scanning and grafting > code to support store references broken into pieces, as long as each > piece containing part of the hash is at least 8 bytes long. > > Here's my preliminary proposal: > > (1) The reference scanner should recognize any 8-byte substring of a > hash as a valid reference to that hash. > > (2) To enable reliable grafting of chunked references, we should impose > the following new restrictions: (a) the store prefix must be at > least 6 bytes, (b) grafting can change only the hash, not the > readable part of the store name, and (c) the readable part of the > store name must be at least 6 bytes. > > (3) The grafter should recognize and replace any 8-byte subsequence of > the absolute store file name. I=E2=80=99m quite reluctant because it would add complexity, it will probab= ly slow things down, and yet it may not handle all the cases, as Danny suggests. Mind you, the GCC patches are not perfect either, but they=E2=80=99re relat= ively easy to deal with (well, so far at least). In theory we would need similar patches for LLVM and maybe a couple other native compilers, though, which is obviously a downside, although we haven=E2=80=99t had any problems so far. WDYT? Ludo=E2=80=99.