From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ma/fN1iEdmDyhAAAgWs5BA (envelope-from ) for ; Wed, 14 Apr 2021 07:57:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QGfIMFiEdmDkeQAA1q6Kng (envelope-from ) for ; Wed, 14 Apr 2021 05:57:44 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9FFD127C95 for ; Wed, 14 Apr 2021 07:57:43 +0200 (CEST) Received: from localhost ([::1]:36584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWYWz-0007b9-Em for larch@yhetil.org; Wed, 14 Apr 2021 01:57:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWYWM-000779-4f for bug-guix@gnu.org; Wed, 14 Apr 2021 01:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWYWL-00031F-Ta for bug-guix@gnu.org; Wed, 14 Apr 2021 01:57:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWYWL-00020V-TD for bug-guix@gnu.org; Wed, 14 Apr 2021 01:57:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47064: [racket-users] bytevector-uncompress: internal error uncompressing Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 14 Apr 2021 05:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47064 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Philip McGrath , Jack Hill , 47064@debbugs.gnu.org Received: via spool by 47064-submit@debbugs.gnu.org id=B47064.16183798077691 (code B ref 47064); Wed, 14 Apr 2021 05:57:01 +0000 Received: (at 47064) by debbugs.gnu.org; 14 Apr 2021 05:56:47 +0000 Received: from localhost ([127.0.0.1]:33180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWYW6-0001zx-PK for submit@debbugs.gnu.org; Wed, 14 Apr 2021 01:56:47 -0400 Received: from world.peace.net ([64.112.178.59]:36928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWYW4-0001zh-H8 for 47064@debbugs.gnu.org; Wed, 14 Apr 2021 01:56:45 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWYVy-0003gz-03; Wed, 14 Apr 2021 01:56:38 -0400 From: Mark H Weaver In-Reply-To: <53940c03-4f40-3954-0cb4-3d4ae01c39a2@philipmcgrath.com> References: <07f46e79-4fdb-49ab-63bd-2c106db077d1@philipmcgrath.com> <79c97b4c-defb-3966-dc50-a79fa8f5c053@philipmcgrath.com> <53940c03-4f40-3954-0cb4-3d4ae01c39a2@philipmcgrath.com> Date: Wed, 14 Apr 2021 01:54:54 -0400 Message-ID: <87o8ehquk6.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618379864; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=TXNzFflV+GIBtf3ZX2mL6Si+BQCn3UhCc++FyIR7dvw=; b=gX0UzeObp1Y6l+rkEFOMleStks0grT3vzhcn9CTnt6tgGoyEUNmCElWG+m6QQX0BCQPeLq fr2PceIaUXWvxvqPmsCiYlwt9Lg1r2PLNmUYkxRTm/TY24WTyFiDx4cBsv5GHkvo2t8kSZ jI7gsuZFLmlZYUq5ANnU5dGEmeFcuABGW59ONAWNLSV47SV3zOCTKKpVXoEJ4R5A6DdLUF jTjzqFCrhKsiQ9MZtL4EPHr09pIbC4UAU6qOzTDXmEboX8ngE6DuTOt31Fad7Ag7btC1z6 8GnQSagLu/9LxuxGBDSgIocOdt2q15dnU5MO0VBeKwctHNegEQ7he/+YfLWS8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618379864; a=rsa-sha256; cv=none; b=oj3S1agyMpqUqQoB0Yx4pfFiRXZb+1bZZe+d4gbcc7HbRoIULWs0ezVF0aVSTgLKU9XtXE BjIZk8lCRl98ft+lfJ+8J423WCap8ObCLsOdcKmMYP8nWWrG+mlp9H/vNl0aF7oQHXwAHQ 6je7y8/9zWpxri0iSyTMgvAwCdG6IBzMhfnDCEuNvLiLoHKgbE29262NfGutn/FmBTID+A vyHBftU7ngXH40S0Zmutl5EAUWfge5Hlc2seNynqYeN3FRlpMgtZIWb1wask4MMe4G8Cut jZGX1EoGCwGIjU3nnWm5z6xozCbX0hw9Wl1LFD395A6yCPyVn8JMsDXfg0H06w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 9FFD127C95 X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: wP94E4C2HQGT Hi Philip, [removed 'racket-users' from the recipient list] Philip McGrath writes: > My guess is that Racket CS is compressing string literals in compiled > code. Currently, Guix patches Racket source files to include the > absolute paths to foreign libraries in the store as string literals. > There are a bunch of grafts for GTK and such: if I'm right, Guix somehow > mangles the compiled code while attempting to apply the grafts. I think I know what happened here. Recall that the grafting code performs a set of substitutions, replacing store item names (i.e. file names in /gnu/store) with replacement store items of the same length, with rules like: "fx3979c88s9yxdbchyf36qryawgzpwb5-libx11-1.6.10" => "rwkqxykm91a75w9afhb41saj0dmf30hw-libx11-1.6.12". The grafting code currently only checks the first 33 bytes, consisting of the nix-base32 hash and the "-". It *assumes* that the remainder of the associated store item name immediately follows, and blindly writes the replacement string over whatever is there. In this case, I suspect that within a *.zo file, a Guix store item name was split into pieces, with the hash and "-" together in one piece but split somewhere between the "-" and the last byte of the store item. This results in corruption of the bytes following that piece. I've recently observed the splitting of store item names in *.zo files (see ), but in that case the "-" was separated from the hash, and as a result the reference was _invisible_ to the grafter. For the record, when I originally wrote this fast(er) grafting code (commit 5a1add373ab427a3b336981d857252e703a9f8d1), by design it only rewrote the hashes, and so naturally it had the following desirable property: it never overwrote any byte without first checking it against an expected value. Later, starting in commit 57bdd79e485801ccf405ca7389bd099809fe5d67, the grafting code was modified to allow rewriting the entire store item name (notably including the version number). Unfortunately, although the set of overwritten bytes was extended past the "-", the set of bytes *checked* was left unchanged, and thus the aforementioned desirable property was lost. I think we ought to restore that property. I'm already working on some other changed to the grafting code (supporting UTF-16 and UTF-32 encoded references), so I'll try to find the time to fix this problem as well. Regards, Mark