all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bengt Richter <bokr@bokr.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 53696@debbugs.gnu.org, Ekaitz Zarraga <ekaitz@elenq.tech>
Subject: bug#53696: Integer overflow on Guix GC size calculation
Date: Wed, 2 Feb 2022 13:04:41 +0100	[thread overview]
Message-ID: <20220202120441.GA2665@LionPure> (raw)
In-Reply-To: <f0a7920cbd0c80894a305e535031f1e1bb4403e2.camel@telenet.be>

Hi Maxime, Ekaitz, et al,

On +2022-02-02 11:05:31 +0100, Maxime Devos wrote:
> Ekaitz Zarraga schreef op di 01-02-2022 om 14:06 [+0000]:
> > [17592186042897 MiB] deleting '/gnu/store/wbz6vkiz7cq8c531xvb31lxm28nz332i-ghc-8.10.7'
> 
> For comparison, this is about 16 exbibyte.
> According to <https://en.wikipedia.org/wiki/Byte#Multiple-byte_units>,
> that's more than the global monthly Internet traffic in 2004.
> 
> According to <https://what-if.xkcd.com/31/>, 16 exbibyte would be about
> 17 million solid-state disks.  Even though this ignores deduplication,
> this seems rather expensive. 
> 
> My guess is that the size of a store item was misrecorded somewhere.
> 
> Greetings,
> Maxime.

s/misrecorded/mis-defined-in-record/ ?
Wild guessing follows:

--8<---------------cut here---------------start------------->8---
$ guile --no-auto-compile -c '(use-modules (ice-9 format))(format #t "~20x\n~20x\n~20d\n" (* 17592186042897 (expt 2 20)) #xa1100000 #xa1100000)';
    ffffffffa1100000
            a1100000
          2702180352
--8<---------------cut here---------------end--------------->8---

It looks to me like a 32-bit unsigned int should have been turned to 64-bit unsigned long or bigint
but somehow got cast/interpreted as signed, becoming signed 64-bit long,
which then in turn was seen by the print as 64-bit unsigned long.

I don't know, but if records are being used, perhaps some slot integer-widening logic
might be involved? Or a mis-defined int slot that should have been long to accomodate
big > 31-bit  positive integers?

Just guessing wildly -- I think I saw something about records and defining their fields
as fixed C ints or longs.

-- 
Regards,
Bengt Richter




  reply	other threads:[~2022-02-02 12:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 14:06 bug#53696: Integer overflow on Guix GC size calculation Ekaitz Zarraga
2022-02-01 21:20 ` Liliana Marie Prikler
2022-02-01 21:54   ` Ekaitz Zarraga
2022-02-02 19:45     ` Liliana Marie Prikler
2022-02-02 19:51       ` Ekaitz Zarraga
2022-02-02 20:04         ` Liliana Marie Prikler
2022-02-02 10:05 ` Maxime Devos
2022-02-02 12:04   ` Bengt Richter [this message]
2022-02-02 22:46     ` Bengt Richter
2022-02-08 10:01     ` Ludovic Courtès
2022-02-08 10:52       ` Ekaitz Zarraga
2022-02-10 20:25         ` Ludovic Courtès
2022-02-10 20:27           ` Ekaitz Zarraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220202120441.GA2665@LionPure \
    --to=bokr@bokr.com \
    --cc=53696@debbugs.gnu.org \
    --cc=ekaitz@elenq.tech \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.