From owner-freebsd-current@freebsd.org Tue Mar 3 09:42:45 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2E5F269A7E for ; Tue, 3 Mar 2020 09:42:45 +0000 (UTC) (envelope-from trond.endrestol@ximalas.info) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 48WsW84cGSz4C5r for ; Tue, 3 Mar 2020 09:42:44 +0000 (UTC) (envelope-from trond.endrestol@ximalas.info) Received: by mailman.nyi.freebsd.org (Postfix) id 65947269A7D; Tue, 3 Mar 2020 09:42:44 +0000 (UTC) Delivered-To: current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6537A269A7C for ; Tue, 3 Mar 2020 09:42:44 +0000 (UTC) (envelope-from trond.endrestol@ximalas.info) Received: from enterprise.ximalas.info (enterprise.ximalas.info [IPv6:2001:700:1100:1::8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ximalas.info", Issuer "Hostmaster ximalas.info" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48WsW4738Zz4ByB for ; Tue, 3 Mar 2020 09:42:40 +0000 (UTC) (envelope-from trond.endrestol@ximalas.info) Received: from enterprise.ximalas.info (Ximalas@localhost [127.0.0.1]) by enterprise.ximalas.info (8.15.2/8.15.2) with ESMTPS id 0239gLbP021523 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 3 Mar 2020 10:42:22 +0100 (CET) (envelope-from trond.endrestol@ximalas.info) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ximalas.info; s=default; t=1583228542; bh=0oq4K1lRjIt1F5Q5Fhj59gDm0MH+oeubSGlg9jcooZI=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=HOodxuAEh4s8aJkm1N93Tt4RyKoG4SEHYfrcp19CTTQwHpX8OsxndPHaVdoM12yyD WSKW0nzZdv04+PpmRZN7u6ihCzz+rWXV5XJ8gvoRDps6GdnHT4BXWVkf4bLX8uS8cX 40699YmjTxLOw2cW3h8VB+vwp5b1k51rEEiGTio4x9L5z5YkRCBRVfQ9POieykzcRW 2cspEZHn/GbQaEC4YBh0qdwbboY6mvJr6/ejuuGeS8xiuMyAJCqKL20RE4dXijQG4/ alLK9/kr/y1LVE3/RMNoz8K0aacWUALAhDpAQBcHrWzj7fyBjX5bCiToG6zMExPKHe Fov3tQ43uagxA== Received: from localhost (trond@localhost) by enterprise.ximalas.info (8.15.2/8.15.2/Submit) with ESMTP id 0239gLgm021520; Tue, 3 Mar 2020 10:42:21 +0100 (CET) (envelope-from trond.endrestol@ximalas.info) X-Authentication-Warning: enterprise.ximalas.info: trond owned process doing -bs Date: Tue, 3 Mar 2020 10:42:21 +0100 (CET) From: =?UTF-8?Q?Trond_Endrest=C3=B8l?= Sender: Trond.Endrestol@ximalas.info To: Yuri Pankov cc: current@freebsd.org Subject: Re: can't build rust -- out of swap space In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (BSF 395 2020-01-19) OpenPGP: url=http://ximalas.info/about/tronds-openpgp-public-key MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on enterprise.ximalas.info X-Rspamd-Queue-Id: 48WsW4738Zz4ByB X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ximalas.info header.s=default header.b=HOodxuAE; dmarc=pass (policy=none) header.from=ximalas.info; spf=pass (mx1.freebsd.org: domain of trond.endrestol@ximalas.info designates 2001:700:1100:1::8 as permitted sender) smtp.mailfrom=trond.endrestol@ximalas.info X-Spamd-Result: default: False [-5.07 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[ximalas.info:s=default]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ximalas.info:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[ximalas.info,none]; FREEMAIL_TO(0.00)[fastmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:224, ipnet:2001:700::/32, country:NO]; IP_SCORE(-2.07)[ip: (-8.18), ipnet: 2001:700::/32(-1.39), asn: 224(-0.76), country: NO(-0.01)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2020 09:42:45 -0000 On Tue, 3 Mar 2020 11:49+0300, Yuri Pankov wrote: > With recent pkg fallout, I'm trying to build rust myself first time ever (as > far as I can remember), and it's failing running out of swap on the following > step: > > Building stage0 std artifacts (x86_64-unknown-freebsd -> > x86_64-unknown-freebsd) > running: > "/usr/ports/lang/rust/work/rustc-1.41.1-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" > "build" "-Zconfig-profile" "--target" "x86_64-unknown-freebsd" > "-Zbinary-dep-depinfo" "-j" "1" "-v" "--release" "--frozen" "--features" > "panic-unwind backtrace compiler-builtins-c" "--manifest-path" > "/usr/ports/lang/rust/work/rustc-1.41.1-src/src/libtest/Cargo.toml" > "--message-format" "json-render-diagnostics" > ^C^C^C > Build completed unsuccessfully in 0:00:55 > > Here I pressed ^C as the build actually continues despite several rustdoc, > python, and other processes being killed. > > swap_pager: out of swap space > swp_pager_getswapspace(20): failed > swap_pager: out of swap space > swp_pager_getswapspace(11): failed > > The system has 32G of RAM and 2GB swap partition (as advised by zfs-auto > installation option), top shows about 28G of memory free at that moment, so > I'm wondering why the swap is being used, and if 2G should be enough to build > rust. > > Tried building both as root and user, DISABLE_MAKE_JOBS has no effect. > > Any hints? It's good to see that it's not only me. I suspect choice of hardware might play a role. My laptop's a Lenovo E590 with 32 GiB of memory and 16 GiB of swap space, running fairly recent -CURRENT, booted via UEFI. Activating the laptop's kernel dump partition as a secondary swap device, adding another 16 GiB of swap space, had no positive effect. In my case, I've noticed rustdoc being run as "rustdoc --crate-type proc-macro --help", and this process grows to a virtual size of 10T, grabbing all the memory and swap that it can find. My laptop even locked up on one such occasion. On Sunday, I switched to lang/rust-nightly and I managed to also build bat, exa and hexyl. I was not that lucky with firefox and ripgrep, they both caused rustc to crash in the same fashion. I've tried building lang/rust on a couple of VMs running the latest -CURRENT, only to have these builds succeed. I even added the contents of /var/db/ports from my laptop, and the build still succeeded. Building lang/rust on stable/12 is successful atm. Maybe it's a combination of hardware and changes to the FreeBSD VM subsystem. -- Trond.