From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YFbbLMzhaGOodAAAbAwnHQ (envelope-from ) for ; Mon, 07 Nov 2022 11:45:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kJr+K8zhaGPrLQEAG6o9tA (envelope-from ) for ; Mon, 07 Nov 2022 11:45:32 +0100 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 E95159D41 for ; Mon, 7 Nov 2022 11:45:30 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orzcs-0002zo-8F; Mon, 07 Nov 2022 05:45:16 -0500 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 1orzck-0002xW-Ht for bug-guix@gnu.org; Mon, 07 Nov 2022 05:45:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1orzck-0001Ie-9C for bug-guix@gnu.org; Mon, 07 Nov 2022 05:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1orzck-0001x7-4g for bug-guix@gnu.org; Mon, 07 Nov 2022 05:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#58631: [Shepherd] Indefinite heap growth (memory leak) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 07 Nov 2022 10:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58631 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 58631@debbugs.gnu.org Received: via spool by 58631-submit@debbugs.gnu.org id=B58631.16678178517432 (code B ref 58631); Mon, 07 Nov 2022 10:45:02 +0000 Received: (at 58631) by debbugs.gnu.org; 7 Nov 2022 10:44:11 +0000 Received: from localhost ([127.0.0.1]:33435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orzbv-0001vn-4D for submit@debbugs.gnu.org; Mon, 07 Nov 2022 05:44:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orzbu-0001vc-5w for 58631@debbugs.gnu.org; Mon, 07 Nov 2022 05:44:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orzbo-0001DD-Ux for 58631@debbugs.gnu.org; Mon, 07 Nov 2022 05:44:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=I7zbSXYjvO0qlG9lPoE8iXB908PMGIRV09FwZho53jE=; b=V28dSn24+mQLc5RWpk39 nwfuf3p9ywQoWF6coN3wNoqHHo4H0ka1anHY2oTYDYSF/jvq23sZ6vgFmM1JiS57mf0CeDhCcp4rP +N6ipDQmUmrmiX7zzyJ6fxaiZSWUjEkOrFFwO3gn2ifY1GgUN3rvtNZisMIHt/A4EaokXtQcWtFJa Bw9EnDEQa5bEUOK4HF9AaX2dfu8apZM00i9QPkcNyfA1iOg47tbWxxglthp7NKz6zMFmfSoLgcfNt KHBU1eW86RKb4kCruc5RKB4hGo65zsWRWMAToY/RMZ7AGPwBCi1dq5g+W78C6IfP9Utoc4qZ4C6jU LvLjcW8gssSFLw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orzbl-0004rM-Pw for 58631@debbugs.gnu.org; Mon, 07 Nov 2022 05:44:03 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87pmeohute.fsf@gnu.org> <87sfjjhjcd.fsf@gnu.org> <87a65qhmh3.fsf@gnu.org> <87ilkb4n5l.fsf_-_@gnu.org> <87r0yrymlm.fsf@gnu.org> <87mt9dzm3q.fsf@gnu.org> <87edufg0st.fsf@gnu.org> Date: Mon, 07 Nov 2022 11:43:59 +0100 In-Reply-To: <87edufg0st.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 06 Nov 2022 23:45:06 +0100") Message-ID: <87sfivujrk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667817932; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=I7zbSXYjvO0qlG9lPoE8iXB908PMGIRV09FwZho53jE=; b=lVGLtKtLo/fZzcCAks4yVEFes+Fv4aQrG+lPXqzhZKMzjaUS08yfw9NP+xsHGD7yVkvVdc Ot3DCstYb7c5XehGif/Z5cLT6IWG7iY5DuM9tL2T9JLRx8HjVZGnQX0+L4QUMrgqtjqk47 LXahhbwrDVTty3BtMcWYOTaq2A38+FSsNaejyu2+EVQy/Yp883rzMrn9Wf9Ls63z85mq5r ipSHseFJksFoeeJRiMhinGXb3UgSWn2ZxOiqvw+yoVPHrFGUjSDVd4iLvwvhGVppklfJWG EKrVBWPv9T+O4h43U/wlFpmMUxqW3KM5FJrNsu7UlpW5IQYDqHWCed5xOqLffQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667817932; a=rsa-sha256; cv=none; b=MFHMmyRto4wucd6Qj7tTIP1KfRexdsSHjfitxprI6W5rh4+DdeGU2yMZz6n4KBIrTRGdRZ zcD3lAUqvSKTi/A1ihwscVVuw2m1QsCoZn2mXAafjX51UPk9PPIdj5HvxTWPtxNqX0xPPX zOjRNeeZBLulbEIbhXIlTtxN82t/KdmBFVBHhJjnWJ87m0DuPnJPcHr7GXZFvrVmCZWRrG +XmTrT86Vy9rkboidSTE2IyxZLyQP1sC5ZVxqIyGEh+Ng7W7zE28b3tDwRFraURQUsaW9J bFLllnPmxlvHjzpQAVhtAN7Pbomv3jMmL96ueJFA902LozalBwVdeZgX7YVM/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=V28dSn24; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -5.00 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=V28dSn24; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: E95159D41 X-Spam-Score: -5.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: MlgSeKsF9bR8 Ludovic Court=C3=A8s skribis: > Ludovic Court=C3=A8s skribis: > >> Ludovic Court=C3=A8s skribis: >> >>> The attached Fibers program illustrates the problem: heap grows even >>> though it=E2=80=99s not supposed to. >> >> The saga continues at . > > =E2=80=A6 and then at , which appears = to have > a happy end: these Guix commits deploy the fix: > > 072fd1124a gnu: shepherd@0.9: Use 'guile-3.0-latest' to address memory = leak. > 7138ba34fa gnu: guile@3.0.8: Add patch to address continuation memory l= eak. > > In my testing it fixes the problem. It=E2=80=99s now deployed it on > bayfront.guix.gnu.org and we=E2=80=99ll deploy to berlin.guix.gnu.org lat= er on > and see how it goes in the coming days. Turns out it=E2=80=99s neither the end nor happy! On bayfront, shepherd is apparently still leaking: --8<---------------cut here---------------start------------->8--- ludo@bayfront ~$ date && sudo herd eval root '(gc-stats)' Sun Nov 6 11:50:48 PM CET 2022 Password: Evaluating user expression (gc-stats). ((gc-time-taken . 2193894749) (heap-size . 16404480) (heap-free-size . 5505= 024) (heap-total-allocated . 119183424) (heap-allocated-since-gc . 4071216)= (protected-objects . 0) (gc-times . 21)) ludo@bayfront ~$ date && sudo herd eval root '(gc-stats)' Mon Nov 7 09:45:35 AM CET 2022 Password: Evaluating user expression (gc-stats). ((gc-time-taken . 741717175797) (heap-size . 47304704) (heap-free-size . 10= 625024) (heap-total-allocated . 17295529056) (heap-allocated-since-gc . 102= 37808) (protected-objects . 0) (gc-times . 1700)) ludo@bayfront ~$ date && sudo herd eval root '(gc-stats)' Mon Nov 7 11:18:05 AM CET 2022 Password: Evaluating user expression (gc-stats). ((gc-time-taken . 1090097976826) (heap-size . 55693312) (heap-free-size . 5= 206016) (heap-total-allocated . 23190066736) (heap-allocated-since-gc . 189= 95744) (protected-objects . 0) (gc-times . 1996)) --8<---------------cut here---------------end--------------->8--- There seems to be an unusually high number of =E2=80=9Cprogram=E2=80=9D obj= ects in the heap: --8<---------------cut here---------------start------------->8--- ludo@bayfront ~$ sudo herd eval root '(begin (load "/home/ludo/heap-profile= r.scm") (profile-heap))' Password: Evaluating user expression (begin (load "/home/ludo/heap-profiler.scm") (#)= ). % type self avg obj size 48.0 program 1188240 32.1 21.8 pair 539904 16.0 7.4 bytevector 184368 784.5 5.6 vector 138373 7.1 4.6 struct 113328 85.8 3.5 unknown 86912 39.8 2.0 stringbuf 50144 60.5 1.3 symbol 33152 32.9 0.6 string 13728 34.1 0.5 smob 12656 39.9 0.5 variable 12432 22.6 0.4 frame 10720 34.6 0.4 pointer 10256 32.5 0.4 weak-vector 9968 32.8 0.4 bitvector 9936 34.4 0.4 hash-table 9840 34.5 0.3 weak-table 7504 34.0 0.3 vm-continuation 6976 31.7 0.3 heap-number 6848 35.3 0.2 atomic-box 5488 36.1 0.2 port 5248 36.4 0.2 dynamic-state 3760 30.1 0.1 fluid 3664 70.5 0.1 syntax 3312 48.0 0.1 keyword 2016 40.3 0.1 weak-set 1872 48.0 0.1 array 1776 48.0 0.1 partial-continuation 1760 39.1 0.0 primitive 528 16.0 0.0 foreign-program 448 44.8 0.0 continuation 336 48.0 0.0 primitive-generic 176 35.2 sampled heap: 2.36098 MiB (heap size: 53.11328 MiB) --8<---------------cut here---------------end--------------->8--- (Note that =E2=80=98partial-continuation=E2=80=99, which are programs with = the SCM_F_PROGRAM_IS_PARTIAL_CONTINUATION flag, are counted separately. So here we really talking about programs with flags =3D=3D 0.) Ludo=E2=80=99.