From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SNcWOKweAmHsFwEAgWs5BA (envelope-from ) for ; Thu, 29 Jul 2021 05:21:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MA/TM6weAmHzNwAA1q6Kng (envelope-from ) for ; Thu, 29 Jul 2021 03:21:16 +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 5EF2B12CF3 for ; Thu, 29 Jul 2021 05:21:16 +0200 (CEST) Received: from localhost ([::1]:58504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8wbj-0003LB-1o for larch@yhetil.org; Wed, 28 Jul 2021 23:21:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8wbW-0003L3-8x for bug-guix@gnu.org; Wed, 28 Jul 2021 23:21:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8wbW-0001n6-0H for bug-guix@gnu.org; Wed, 28 Jul 2021 23:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m8wbV-0002rV-TP for bug-guix@gnu.org; Wed, 28 Jul 2021 23:21:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#49439: grafts cause =?UTF-8?Q?=E2=80=9Cguix_?= =?UTF-8?Q?environment=E2=80=9D?= to get killed with OOM Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 29 Jul 2021 03:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49439 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 49439-submit@debbugs.gnu.org id=B49439.162752884310956 (code B ref 49439); Thu, 29 Jul 2021 03:21:01 +0000 Received: (at 49439) by debbugs.gnu.org; 29 Jul 2021 03:20:43 +0000 Received: from localhost ([127.0.0.1]:56166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8wbD-0002qe-6r for submit@debbugs.gnu.org; Wed, 28 Jul 2021 23:20:43 -0400 Received: from out1.migadu.com ([91.121.223.63]:37277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8wbA-0002qS-Pq for 49439@debbugs.gnu.org; Wed, 28 Jul 2021 23:20:42 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1627528839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+qtAJKm0St2Sdm/YsDnnmt2nfD5A5LMO2wQLOM1JIxc=; b=YVoUgApOhuIV6CLXZvMUtp8NycZ96BC8cqttoWrs4h4dQiBztHiK1SGjJXntj+yt42KjaM 5tj/sT+CNA66IBo2kxzpykZQlwoSkCKmNLLVUSUUh9QuNqrrSKv+Hgw+Geknc88fo8t2vI 7uJ0tG0Rx2HB8cElt4XkflV2vuQ6vis= From: Sarah Morgensen References: <87sg0rse1n.fsf@elephly.net> <86tuklr5g6.fsf@mgsn.dev> <87y29r3enb.fsf@gnu.org> <867dhbpbyt.fsf@mgsn.dev> <87k0la3ghk.fsf@gnu.org> <87wnpa14fx.fsf@gnu.org> Date: Wed, 28 Jul 2021 20:20:36 -0700 In-Reply-To: <87wnpa14fx.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 29 Jul 2021 00:03:46 +0200") Message-ID: <861r7hpzzv.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: iskarian@mgsn.dev 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: , Cc: Ricardo Wurmus , 49439@debbugs.gnu.org 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=1627528876; 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: content-transfer-encoding:content-transfer-encoding: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:dkim-signature; bh=+qtAJKm0St2Sdm/YsDnnmt2nfD5A5LMO2wQLOM1JIxc=; b=Tn5mbMLgfShsc9WsIM6OgJjSA5S6Ec2znmmP2UTlF1ULZVu0dS8bdrSXKWOV3PguNSRX0h dJ9Wdze4dVhtXjzOWM/1BPPWlbMLqNhA/INRYVy6ej46mBxzQNXz3A/bXEkH9ky3jFF0qW lxEQjTU5KT65k4i+a6+uoizmoMa7OoI/K6aPrLHaBxQfhwPManNKoe0BBynudkb9+aGDx+ 47cN2M2jrWuZstL5WXlwFuXb8gCngXCqsoBjIFA6URZCxXyhGaX7CrmZw2BN+fg73JOOfM fR1dEztNJSkZJtzNS/bWV3HpqYDN1tUiU3W0No+8jODVMqblTTllH/pIVqrK1A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627528876; a=rsa-sha256; cv=none; b=XMg5xcqtWPzR5xu6Omf80ACJl6+QmuGtBaIr2gRHQhE/OJi1Gh/IuaheSUquETCRdA52QY CLjRI0+hKV1zqubina4DUG5hO6Nfv/g8PmVjDMTzguTLLgy2duWd39GTEfkz0mNK8EPi/z gUa5vb3YjOnCDRZ+/UyDx3mT2PsgaZpW6rNRiShW8bzPXz8hfqBqNrgaNUf4Uw1uEd8p67 mIoTZn94o3X9i7HAb9jm1EV+qTGsBs0WuhA89/JKMoi2Y5/h+qqAYdP+EZPGGbnpmmFlxX 3OM60493oMCwFhkZ1+aoXKdgICV4a9RRYt8i6sHFH1rkA/AobNhjWTCwC+4jEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=YVoUgApO; 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: 0.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=YVoUgApO; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=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: 5EF2B12CF3 X-Spam-Score: 0.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: Vt6q6C24y/n+ Hi, Ludovic Court=C3=A8s writes: > Hi, > > Ludovic Court=C3=A8s skribis: > >> Thinking about it, the grafts code depends on what=E2=80=99s in the stor= e: when >> nothing is in the store, it bounces to the =E2=80=9Cbuild handler=E2=80= =9D, 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 > =E2=80=98build-accumulator=E2=80=99 build handler. Here, the graph of = =E2=80=98pigx-scrnaseq=E2=80=99 > has many nodes, and many of them depend on, say, =E2=80=98r-rlang=E2=80= =99. Thus, when > =E2=80=98r-rlang=E2=80=99 is not in the store, the grafting code keeps as= king for it by > calling =E2=80=98build-derivations=E2=80=99, which aborts to the build ha= ndler; the > build handler saves the .drv file name and the continuation and keeps > going. But since the next package also depends on =E2=80=98r-langr=E2=80= =99, we abort > again to the build handler, and so on. > > The end result is a very long list of nodes, probably of > this order in this case: > > $ guix graph -t reverse-package r-rlang |grep 'label =3D "'|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=E2=80=A6 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=E2=80=99. > > PS: Did you know =E2=80=98pigx-scrnaseq=E2=80=99 has twice as many nodes = as > =E2=80=98libreoffice=E2=80=99? > > $ guix graph -t bag pigx-scrnaseq |grep 'label =3D "'|wc -l > 1359 > $ guix graph -t bag libreoffice |grep 'label =3D "'|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