From: Sarah Morgensen <iskarian@mgsn.dev>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Ricardo Wurmus <rekado@elephly.net>, 49439@debbugs.gnu.org
Subject: bug#49439: grafts cause “guix environment” to get killed with OOM
Date: Wed, 28 Jul 2021 20:20:36 -0700 [thread overview]
Message-ID: <861r7hpzzv.fsf@mgsn.dev> (raw)
In-Reply-To: <87wnpa14fx.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 29 Jul 2021 00:03:46 +0200")
Hi,
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> Thinking about it, the grafts code depends on what’s in the store: when
>> nothing is in the store, it bounces to the “build handler”, which
>> accumulates the list of missing store items, until it starts building
>> them.
>
> So I can reproduce the problem Ricardo and you initially reported by
> running:
>
> ./pre-inst-env guix environment pigx-scrnaseq --search-paths
>
> after removing some of the ungrafted store items with:
>
> guix gc -D $(guix build r-rlang --no-grafts) \
> $(guix gc --references $(guix build pigx-scrnaseq --no-grafts))
Same here. I'm glad we were able to pinpoint this!
>
> The seemingly endless CPU usage and unbound memory use comes from the
> ‘build-accumulator’ build handler. Here, the graph of ‘pigx-scrnaseq’
> has many nodes, and many of them depend on, say, ‘r-rlang’. Thus, when
> ‘r-rlang’ is not in the store, the grafting code keeps asking for it by
> calling ‘build-derivations’, which aborts to the build handler; the
> build handler saves the .drv file name and the continuation and keeps
> going. But since the next package also depends on ‘r-langr’, we abort
> again to the build handler, and so on.
>
> The end result is a very long list of <unresolved> nodes, probably of
> this order in this case:
>
> $ guix graph -t reverse-package r-rlang |grep 'label = "'|wc -l
> 594
>
> Presumably, the captured continuations occupy quite a bit of memory,
> hence the quick growth.
>
> I suppose one solution is to fire suspended builds when the build
> handler sees a build request for a given derivation for the second time.
> It needs more thought and testing…
I wonder if instead it's possible to reduce the memory taken by the
continuations? As someone who has absolutely no experience with the
build/derivation system, it seems like all we *should* need to save is
the derivation file name.
>
> Ludo’.
>
> PS: Did you know ‘pigx-scrnaseq’ has twice as many nodes as
> ‘libreoffice’?
>
> $ guix graph -t bag pigx-scrnaseq |grep 'label = "'|wc -l
> 1359
> $ guix graph -t bag libreoffice |grep 'label = "'|wc -l
> 699
>
> That makes it a great example to study and fix scalability issues!
For those interested, I've compiled a list of the top 60
highest-dependency packages, as reported by package-closure:
pigx 1630
nextcloud-client 1539
akregator 1486
kmail 1484
korganizer 1481
kdepim-runtime 1480
kincidenceeditor 1478
keventviews 1477
kmailcommon 1476
kcalendarsupport 1475
kmessagelib 1474
knotes 1472
kaddressbook 1469
libksieve 1467
kdepim-apps-libs 1465
libgravatar 1463
kpimcommon 1462
akonadi-calendar 1453
pigx-bsseq 1448
elisa 1446
kaffeine 1432
kdenlive 1431
kmailtransport 1431
dolphin-plugins 1426
k3b 1424
libkgapi 1422
dolphin 1421
kopete 1403
pigx-sars-cov2-ww 1401
krdc 1398
baloo-widgets 1397
baloo 1396
pigx-chipseq 1396
krfb 1389
ffmpegthumbs 1388
kget 1382
kmplayer 1381
kdelibs4support 1375
pigx-scrnaseq 1342
kdevelop 1340
kmailimporter 1326
libkdepim 1325
pigx-rnaseq 1324
labplot 1316
smb4k 1315
kleopatra 1311
kalarmcal 1311
choqok 1311
okular 1310
ktnef 1310
ktorrent 1310
kate 1308
akonadi-search 1308
kcalutils 1307
yakuake 1306
khelpcenter 1305
libksysguard 1305
kdeconnect 1304
konsole 1304
libkleo 1304
There seem to be a lot of kde packages in there, so perhaps this issue
isn't as rare as we might otherwise expect?
--
Sarah
next prev parent reply other threads:[~2021-07-29 3:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 14:38 bug#49439: grafts cause “guix environment” to get killed with OOM Ricardo Wurmus
2021-07-23 4:59 ` Sarah Morgensen
2021-07-27 14:52 ` Julien Lepiller
2021-07-27 16:28 ` Ludovic Courtès
2021-07-27 23:35 ` Sarah Morgensen
2021-07-28 10:00 ` Ludovic Courtès
2021-07-28 22:03 ` Ludovic Courtès
2021-07-29 3:20 ` Sarah Morgensen [this message]
2021-08-09 21:26 ` Ludovic Courtès
2021-08-10 15:36 ` Ludovic Courtès
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=861r7hpzzv.fsf@mgsn.dev \
--to=iskarian@mgsn.dev \
--cc=49439@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=rekado@elephly.net \
/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.