From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: bug#32895: file progress reporter crashes on small files Date: Thu, 04 Oct 2018 05:58:20 -0400 Message-ID: <87y3behw3n.fsf@netris.org> References: 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]:39193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g80PR-0000Hw-37 for bug-guix@gnu.org; Thu, 04 Oct 2018 05:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g80PN-0002Ae-Ro for bug-guix@gnu.org; Thu, 04 Oct 2018 05:59:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g80PN-0002AW-Ne for bug-guix@gnu.org; Thu, 04 Oct 2018 05:59:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g80PN-0002bF-Lx for bug-guix@gnu.org; Thu, 04 Oct 2018 05:59:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: (Ricardo Wurmus's message of "Mon, 1 Oct 2018 16:16:31 +0200") 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: Ricardo Wurmus Cc: 32895@debbugs.gnu.org Hi Ricardo, Ricardo Wurmus writes: > Downloading small files (such as cabal revisions) sometimes fails with a > backtrace like this: > > Starting download of /gnu/store/plr3hf9gjdcg2qhi3x4k2wjm8zajqibc-ghc-cryp= tohash-md5-0.11.100.1-2.cabal > From https://hackage.haskell.org/package/cryptohash-md5-0.11.100.1/revisi= on/2.cabal... > downloading from https://hackage.haskell.org/package/cryptohash-md5-0.11.= 100.1/revision/2.cabal... > Backtrace: 7.6MiB/s 0= 0:00 | 3KiB transferred > In ice-9/boot-9.scm: > 829:9 19 (catch _ _ # =C3=A2=C2=A6) > 829:9 18 (catch _ _ # =C3=A2=C2=A6) > In guix/scripts/build.scm: > 749:24 17 (_) > In ice-9/boot-9.scm: > 829:9 16 (catch _ _ # =C3=A2=C2=A6) > In guix/ui.scm: > 409:6 15 (_) > In guix/scripts/build.scm: > 675:5 14 (_) > In srfi/srfi-1.scm: > 679:15 13 (append-map _ _ . _) > 592:17 12 (map1 (#)) > In guix/scripts/build.scm: > 680:31 11 (_ _) > In guix/packages.scm: > 881:14 10 (cache! # # =C3=A2=C2=A6) > In unknown file: > 9 (_ # # #) > In guix/grafts.scm: > 303:4 8 (graft-derivation # # =C3=A2=C2=A6) > 181:4 7 (references-oracle # #) > 190:20 6 (_ _ _) > In guix/store.scm: > 1087:15 5 (_ # _ _) > 661:13 4 (process-stderr _ _) > In unknown file: > 3 (display "@ download-progress /gnu/store/plr3hf9gjdcg2=C3=A2= =C2=A6" =C3=A2=C2=A6) > In guix/status.scm: > 457:13 2 (write! _ _ 186) > 421:6 1 (_ (download-progress "/gnu/store/plr3hf9gjdcg2qhi3=C3=A2=C2= =A6" =C3=A2=C2=A6) =C3=A2=C2=A6) > In guix/progress.scm: > 214:25 0 (display-download-progress "2.cabal" #f #:start-time _ # =C3= =A2=C2=A6) > > guix/progress.scm:214:25: In procedure display-download-progress: > In procedure /: Wrong type argument in position 1: #f I'm hitting this same bug repeatedly while trying to build 'idris'. Previous to this build attempt, I did not have any GHC-related packages on my system, so this build involves downloading and building many GHC-related packages. In this scenario, the bug is quite easy to trigger. > This happens because =E2=80=9Ctransferred=E2=80=9D in the =E2=80=9Celse= =E2=80=9D branch of (@ (guix > progress) display-download-progress) is #f instead of a number. This > could be the result of running string->number on an invalid string in > =E2=80=9Cprint-build-event=E2=80=9D. Indeed, the string in the 'transferred' slot of the event is actually "#f". Here's the entire event, i.e. the first argument passed to 'print-build-event': (download-progress "/gnu/store/k0z5nlg4gi02zx64l49aail3nb8zzi7x-ghc-vector-= 0.12.0.1-3.cabal" "https://hackage.haskell.org/package/vector-0.12.0.1/revi= sion/3.cabal" "-" "#f") So far, I've traced it back to the underlying download derivation. Here are the contents of the raw build log as found in /var/log/guix/drvs/, /var/log/guix/drvs/c2/9v4wx8k3gzg2lryyn1v6ki1hc7wcll-ghc-vector-0.12.0.1-3.= cabal.drv.bz2: --8<---------------cut here---------------start------------->8--- Starting download of /gnu/store/k0z5nlg4gi02zx64l49aail3nb8zzi7x-ghc-vector= -0.12.0.1-3.cabal >From https://hackage.haskell.org/package/vector-0.12.0.1/revision/3.cabal... @ download-started /gnu/store/k0z5nlg4gi02zx64l49aail3nb8zzi7x-ghc-vector-0= .12.0.1-3.cabal https://hackage.haskell.org/package/vector-0.12.0.1/revisio= n/3.cabal - @ download-progress /gnu/store/k0z5nlg4gi02zx64l49aail3nb8zzi7x-ghc-vector-= 0.12.0.1-3.cabal https://hackage.haskell.org/package/vector-0.12.0.1/revisi= on/3.cabal - 7073 @ download-progress /gnu/store/k0z5nlg4gi02zx64l49aail3nb8zzi7x-ghc-vector-= 0.12.0.1-3.cabal https://hackage.haskell.org/package/vector-0.12.0.1/revisi= on/3.cabal - #f @ download-succeeded /gnu/store/k0z5nlg4gi02zx64l49aail3nb8zzi7x-ghc-vector= -0.12.0.1-3.cabal https://hackage.haskell.org/package/vector-0.12.0.1/revis= ion/3.cabal 7073 --8<---------------cut here---------------end--------------->8--- Notice that the last field of the final 'download-progress' line is "#f" instead of a number. To be continued... Mark