From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id oInlDmROP2bMbgAAe85BDQ:P1 (envelope-from ) for ; Sat, 11 May 2024 12:54:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oInlDmROP2bMbgAAe85BDQ (envelope-from ) for ; Sat, 11 May 2024 12:54:28 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elephly.net header.s=zoho header.b=gvw3mk8u; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=2; s=key1; d=yhetil.org; t=1715424868; a=rsa-sha256; cv=fail; b=CFX7Ax9G7h/n8xiEjM4F0oBFSDB2ohEv0sZu5omFCNsa0YdnQkDTNE+cE9+FdZABXHjcPH FNZW/yl0jVeFOzDlEffVBVCcuLW7WIm37/u6HcXliPkaDwEwh/IGewbeD8PHB6NRecNf1V hSkt47pQCWV8uH90kI97bN1hom2xlXUKMm0SxdLalR5LRcyPD/Mq/+SvmTUQNVCNuVodb/ UQ0rRXe8AZ0U5PDjQMKVRDpfIW9Q9xAKNEbvmVhr6PoKgJtBj997k4rWbGGc+m8gqzJvUn JtlQMG73FPEXmXdeIoYYnEQS5CNFFuol/1H08szwsg8LapSqXYT9GHRGgHP/qA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elephly.net header.s=zoho header.b=gvw3mk8u; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715424868; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=t9J9EHFuaKrYrMFPWsIYaTbSQKBJj55dZTfJaFBTTUk=; b=QZQbfgXLdlz+efXkZqVQh/bZ4gbh9b3V9vZH3qwdlF8yRUogNZdTYAzBYINhy4EcLcNvFX 7qMr/MvYEC8c1qydeDXiGWD/UIcvHRdqNyXphy+M8yT2pKHKiY2RBDNaoBN+CcAqHktBWs 93TnKShJMnZvAnQ5gFTry5ospv5bcyEwYEssGCoEgPINoPOC9db8mR37CidMAVJ81rEMuo v5B+rI9sUXeIMZzwDf/dW83H51EX1N7207gTM43q/6t5xcQ6VphTfv3Zs/rAkFo1Zi0qOr PAhj7bU6qG9UL490+M+AcfvH9g3Ke3ELFEoyhpUAkWMkzv3j0FuZgblK6gOglw== 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 4C2C567503 for ; Sat, 11 May 2024 12:54:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5kMg-0004u2-7L; Sat, 11 May 2024 06:54:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5kMd-0004tk-Q9 for bug-guix@gnu.org; Sat, 11 May 2024 06:54:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5kMc-0002Wr-SB; Sat, 11 May 2024 06:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5kMc-0002Sp-1e; Sat, 11 May 2024 06:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#70877: guix-daemon fails to copy 4+GB file to store Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, bug-guix@gnu.org Resent-Date: Sat, 11 May 2024 10:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70877 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 70877@debbugs.gnu.org Cc: ludo@gnu.org X-Debbugs-Original-To: bug-guix@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17154247899460 (code B ref -1); Sat, 11 May 2024 10:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 May 2024 10:53:09 +0000 Received: from localhost ([127.0.0.1]:47688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5kLk-0002SW-Hu for submit@debbugs.gnu.org; Sat, 11 May 2024 06:53:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:42620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5kLi-0002SQ-6i for submit@debbugs.gnu.org; Sat, 11 May 2024 06:53:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5kLi-0004jv-Go for bug-guix@gnu.org; Sat, 11 May 2024 06:53:06 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5kLg-0002SY-Gn for bug-guix@gnu.org; Sat, 11 May 2024 06:53:06 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1715424779; cv=none; d=zohomail.com; s=zohoarc; b=j04xfDC+Am47I5gycTn6agPY1Oa0wSWfVwsKoTZYZCx7hhf9bcmOCjsVmF9Eh7vtE2n1lcufrB8G6V96PZZPS8yUkqs1F/HrcZP/OUYpoSHa/GM5OR1uqcqoYw0+xpqmAhu1QMLBUik5sO3usNJZvClfiMMRJ5yGA6kLtmFhbRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715424779; h=Content-Type:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=t9J9EHFuaKrYrMFPWsIYaTbSQKBJj55dZTfJaFBTTUk=; b=HaqO77xNk6t0bOJU7977dkeiUHrUCUy4lQUU7jG25Qwybfzd5Tq45M0vmHOa5cXkFvGSOFYeErQ08lzOa6lik+TQ+N7DksMVE43hqD82ZMAjba/ihN4cxcILxTAq8w9ArVrXzanhOtw93PvBiKUlcvpwlwAJyN6PUJdCMcJHDtM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1715424779; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=t9J9EHFuaKrYrMFPWsIYaTbSQKBJj55dZTfJaFBTTUk=; b=gvw3mk8unx/8yp05/IUlDrRh+hJ+c6HRjmoK0GxdQhP1VW8ecBVQsJQKYi4yx1xB Y5L9Mo2zSuUbwG7QbKTHVhZICjtdEJn/5+Tv6MzjtdyfcWsFuO+HZBHzCuqrOLk4IIK 0ttw+TLbGF7me8fNj/z841rGuQvtLuH43A7J6Mc4= Received: by mx.zohomail.com with SMTPS id 1715424777121760.7577937280839; Sat, 11 May 2024 03:52:57 -0700 (PDT) From: Ricardo Wurmus User-Agent: mu4e 1.12.4; emacs 29.3 Date: Sat, 11 May 2024 12:52:53 +0200 Message-ID: <87msowpqm2.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-ZohoMailClient: External X-Zoho-Virus-Status: 1 Received-SPF: pass client-ip=136.143.188.51; envelope-from=rekado@elephly.net; helo=sender4-of-o51.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 4C2C567503 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -1.58 X-Spam-Score: -1.58 X-TUID: 1yJGHd2jG0FL --=-=-= Content-Type: text/plain The guix-daemon's libutil/util.cc uses copy_file_range to copy a downloaded file into the store. copy_file_range fails on files larger than 4GB with an error like this: guix build: error: short write in copy_file_range `15' to `16': No such file or directory The man page for copy_file_range says that it could return EFBIG when the range exceeds the maximum range. The daemon code does not check any limits and will attempt to copy the whole file. I believe our code ought to check the value of st.size and fall back to a boring copy if it exceeds some "reasonable" value. This is where copy_file_range is used: https://git.savannah.gnu.org/cgit/guix.git/tree/nix/libutil/util.cc#n382 Here is a little reproducer: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=bug.scm (use-modules (guix download) (guix packages) (guix build-system trivial)) (package (name "chungus") (version "1") (source (origin (method url-fetch) (uri "http://localhost:1111/chungus") (sha256 (base32 "0nx67d4ls2nfwcfdmg81vf240z6lpwpdqypssr1wzn3hyz4szci4")))) (build-system trivial-build-system) (home-page "") (synopsis "") (description "") (license #f)) --=-=-= Content-Type: text/plain --8<---------------cut here---------------start------------->8--- # generate a big file dd bs=1M count=4096 if=/dev/zero of=/tmp/chungus # serve it guix shell woof -- woof -i 127.0.0.1 -p 1111 -c 1 /tmp/chungus # build the source derivation guix build --no-grafts -Sf bug.scm # observe the error # guix build: error: short write in copy_file_range `15' to `16': No such file or directory --8<---------------cut here---------------end--------------->8--- -- Ricardo --=-=-=--