Bug 227609 - Compiling world from sources fails: out of swap space
Summary: Compiling world from sources fails: out of swap space
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
: 231123 (view as bug list)
Depends on:
Reported: 2018-04-18 13:57 UTC by tschweikle
Modified: 2018-09-03 20:24 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description tschweikle 2018-04-18 13:57:15 UTC

Comment 1 tschweikle 2018-04-18 14:08:44 UTC
checking out sources, then configuring, then compiling tools, then world.
Compiling wold fails with out of swap space. In some rare cases compiling world succeeds, but then compiling kernel fails. I never got both: world an kernel.

Swap is 8GiByte, RAM is 4GiByte.

FreeBSD fbsd12.bfs.de 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r330841: Wed Mar 14 09:29:53 CET 2018     root@fbsd12.bfs.de:/usr/obj/usr/src/amd64.amd64/sys/FBSD12  amd64

Last world and kernel compile succeeded was Wed Mar 14 09:29:53 CET 2018
svn release r330841

Later tries ended all with out of swap space:
Root mount waiting for: usbus1 usbus0
ugen0.2: <VMware VMware Virtual USB Mouse> at usbus0
ugen0.3: <vendor 0x0e0f VMware Virtual USB Hub> at usbus0
uhub2 on uhub1
uhub2: <VMware Virtual USB Hub> on usbus0
Root mount waiting for: usbus1 usbus0
uhub0: 6 ports with 6 removable, self powered
uhub2: 7 ports with 7 removable, self powered
VMware memory control driver initialized
intsmb0: <Intel PIIX4 SMBUS Interface> port 0x1040-0x104f at device 7.3 on pci0
intsmb0: intr SMI disabled revision 0
smbus0: <System Management Bus> on intsmb0
uhid0 on uhub1
uhid0: <VMware> on usbus0
uhid1 on uhub1
uhid1: <VMware> on usbus0
pid 88103 (cc), uid 0, was killed: out of swap space
pid 85453 (make), uid 0, was killed: out of swap space
pid 2650 (ld.lld), uid 0, was killed: out of swap space

source tree is on svn release:
Comment 2 Mark Millard 2018-04-19 01:49:18 UTC
Given the exchanges on the lists about such, you are likely to be asked about the
configuration: Is ZFS involved? Just UFS?

Most of the reports are tied to ZFS-involved contexts. There have been some where ZFS was not involved but UFS was. (-r331879 may have largely taken care of no-ZFS contexts.)

There may be more context/environment information requested as well.

The reported problems are not limited to buildworld buildkernel sorts of activity,
but definitely include examples of such activity.
Comment 3 tschweikle 2018-04-20 11:09:44 UTC
Two systems, one zfs, one ufs, same problem

- 4GiB RAM, 8GiB Swap

# zfs get all zroot
NAME   PROPERTY              VALUE                  SOURCE
zroot  type                  filesystem             -
zroot  creation              Fri Oct 10 16:32 2014  -
zroot  used                  14.8G                  -
zroot  available             25.7G                  -
zroot  referenced            919M                   -
zroot  compressratio         1.15x                  -
zroot  mounted               yes                    -
zroot  quota                 none                   default
zroot  reservation           none                   default
zroot  recordsize            128K                   default
zroot  mountpoint            legacy                 local
zroot  sharenfs              off                    default
zroot  checksum              fletcher4              local
zroot  compression           off                    default
zroot  atime                 on                     default
zroot  devices               on                     default
zroot  exec                  on                     default
zroot  setuid                on                     default
zroot  readonly              off                    default
zroot  jailed                off                    default
zroot  snapdir               hidden                 default
zroot  aclmode               discard                default
zroot  aclinherit            restricted             default
zroot  canmount              on                     default
zroot  xattr                 off                    temporary
zroot  copies                1                      default
zroot  version               5                      -
zroot  utf8only              off                    -
zroot  normalization         none                   -
zroot  casesensitivity       sensitive              -
zroot  vscan                 off                    default
zroot  nbmand                off                    default
zroot  sharesmb              off                    default
zroot  refquota              none                   default
zroot  refreservation        none                   default
zroot  primarycache          all                    default
zroot  secondarycache        all                    default
zroot  usedbysnapshots       0                      -
zroot  usedbydataset         919M                   -
zroot  usedbychildren        13.9G                  -
zroot  usedbyrefreservation  0                      -
zroot  logbias               latency                default
zroot  dedup                 off                    default
zroot  mlslabel                                     -
zroot  sync                  standard               default
zroot  refcompressratio      1.00x                  -
zroot  written               919M                   -
zroot  logicalused           14.7G                  -
zroot  logicalreferenced     905M                   -
zroot  volmode               default                default
zroot  filesystem_limit      none                   default
zroot  snapshot_limit        none                   default
zroot  filesystem_count      none                   default
zroot  snapshot_count        none                   default
zroot  redundant_metadata    all                    default

#zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
zroot                      14.8G  25.7G   919M  legacy
zroot/home                  192K  25.7G    96K  /home
zroot/home/sct-muc           96K  25.7G    96K  /home/sct-muc
zroot/tmp                   188M  25.7G   188M  /tmp
zroot/usr                  10.1G  25.7G  3.88G  /usr
zroot/usr/ports            3.59G  25.7G  2.76G  /usr/ports
zroot/usr/ports/distfiles   853M  25.7G   853M  /usr/ports/distfiles
zroot/usr/ports/packages     96K  25.7G    96K  /usr/ports/packages
zroot/usr/src              2.66G  25.7G  2.66G  /usr/src
zroot/var                  3.52G  25.7G  3.09G  /var
zroot/var/crash             194M  25.7G   194M  /var/crash
zroot/var/db                241M  25.7G   196M  /var/db
zroot/var/db/pkg           45.0M  25.7G  45.0M  /var/db/pkg
zroot/var/empty              96K  25.7G    96K  /var/empty
zroot/var/log              8.85M  25.7G  8.85M  /var/log
zroot/var/mail              120K  25.7G   120K  /var/mail
zroot/var/run               184K  25.7G   184K  /var/run
zroot/var/tmp               172K  25.7G   172K  /var/tmp

#zpool status
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: scrub canceled on Fri Apr 20 12:54:12 2018

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          da0p3     ONLINE       0     0     0

errors: No known data errors

# zpool list
zroot  41.8G  14.8G  27.0G         -    53%    35%  1.00x  ONLINE  -

# swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/gpt/swap0    8388608        0  8388608     0%

- 2GiB RAM, 8GiB Swap
Comment 4 Mark Millard 2018-04-21 00:59:10 UTC
(In reply to tschweikle from comment #3)

It is interesting that you have examples of both contexts.

For the UFS context, if you can somehow get to -r331879 or later (or at least test with such a version), you might get past the problem for that context.
Comment 5 Mark Millard 2018-04-29 20:41:04 UTC
(In reply to tschweikle from comment #1)

Some characteristics of the environment
not mentioned are:

How many processors/cores/threads?
What sort of value for -j<?> for the buildworld/buildkernel.

For reference (but only a partial result so far):

I currently have a smaller aarch64 context building world
and kernel (4 core Pine64+ 2GiB, -j4, UFS, Swap 3584M).
Before this I updated to -r333079. The -r333079 was a jump
from materials from around the beginning of the year and was
done via a cross build. I then used poudriere-devel and pkg
to update ports (1 builder but allowing all 4 cores to be
used in a builder). It survived the somewhat over 29 hr
build of the 101 involved ports, 14.5 hr or so being for
devel/llvm60 . So far it is 10 hr or so into the -j4
buildworld and shows no problems yet, but it will be some
time before it is done if it finishes okay. I'll report.

(I use a 128 GiB emmc on an adapter instead of using a
normal usdcard.)
Comment 6 Mark Millard 2018-04-30 13:06:06 UTC
(In reply to Mark Millard from comment #5)

The Pine64+ 2GiB finished the buildworld buildkernel in
a little under 19.5 hr.
Comment 7 Mark Millard 2018-08-12 17:24:47 UTC
(In reply to Mark Millard from comment #6)

As of updating to -r337400 the Pine64+ 2GB no
longer will boot from the e.MMC on the microsd
adapter card. (I switched to tracking fully
modern dts use, u-boot, etc.)

So I tried a build via a USB SSD as the root
file system and swap partition. As reported in:


it failed with an OOM kill.

This should have avoided I/O latency problems being
involved. (That message is part of a long on-going
thread tied to OOM kills, most of the reports involving
large I/O latencies being involved.)

I can not change the "Affects Only Me status.
Comment 8 Mark Millard 2018-08-12 17:52:17 UTC
(In reply to Mark Millard from comment #7)

Other bugzilla's are: 230402 230454.
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2018-08-13 01:24:07 UTC
(In reply to Mark Millard from comment #7)

I've changed the "affects only me" status but honestly twiddling that knob doesn't really do anything.
Comment 10 matthias.freitag 2018-09-03 20:24:15 UTC
*** Bug 231123 has been marked as a duplicate of this bug. ***