Re: can't build rust -- out of swap space

From: Trond Endrestøl <trond.endrestol_at_ximalas.info>
Date: Tue, 3 Mar 2020 10:42:21 +0100 (CET)
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.
Received on Tue Mar 03 2020 - 08:42:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:23 UTC