# NanoBSD "swap_pager: Indefinite wait buffer" error



## zennybsd (Mar 7, 2012)

Trying to compile NanoBSD with F*ree*BSD9-STABLE and when I run the nanobsd.sh script, compilation halts indefintely with an error:


```
swap_pager: indefinite wait buffer: bufobj: 0, blkno: 66396, size: 4096
```

I have assigned a GB of swap (ada0p3) of which only 1% is used, and also a GB of physical RAM to FBSD9. 


```
# swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p3       1048540    12368  1036172     1%
```

*Smartctl* gives the folowing summary:


```
# /usr/local/sbin/smartctl -a /dev/ada0
smartctl 5.42 2011-10-20 r3458 [FreeBSD 9.0-RELEASE amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, [url]http://smartmontools.sourceforge.net[/url]

=== START OF INFORMATION SECTION ===
Device Model:     QEMU HARDDISK
Serial Number:    QM00001
Firmware Version: 0.12.3
User Capacity:    21,474,836,480 bytes [21.4 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   5
ATA Standard is:  ATA/ATAPI-5 published, ANSI NCITS 340-2000
Local Time is:    Wed Mar  7 20:49:25 2012 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82)	Offline data collection activity
					was completed without error.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		(  288) seconds.
Offline data collection
capabilities: 			 (0x19) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					No Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					No General Purpose Logging support.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (  54) minutes.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x0003   100   100   006    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0003   100   100   070    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0002   100   100   020    Old_age   Always       -       0
  5 Reallocated_Sector_Ct   0x0003   100   100   054    Pre-fail  Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


Device does not support Selective Self Tests/Logging
```

I am running FBSD9-amd64 under qemu-kvm

Hint to overcome this problem appreciated. Thanks!


----------



## zennybsd (Mar 8, 2012)

Once again, I tried to run nanobsd.sh after rebooting, but failed. The last lines of the nanobsd compilation log (/usr/obj/nanobsd.FREESERVER//_.bw) looks like:


```
===> lib/libwrap (all)
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/hosts_access.c: In function 'host_match':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/hosts_access.c:309: warning: implicit declaration of function 'yp_get_default_domain'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/hosts_access.c:310: warning: implicit declaration of function 'innetgr'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/hosts_access.c:316: warning: passing argument 2 of 'hostfile_match' from incompatible pointer type
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'banners_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:233: warning: implicit declaration of function 'write'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'group_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:262: warning: implicit declaration of function 'setgid'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'user_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:284: warning: implicit declaration of function 'setuid'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'nice_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:366: warning: implicit declaration of function 'nice'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'twist_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:390: warning: implicit declaration of function 'close'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'banners_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:233: warning: implicit declaration of function 'write'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'group_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:262: warning: implicit declaration of function 'setgid'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'user_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:284: warning: implicit declaration of function 'setuid'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'nice_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:366: warning: implicit declaration of function 'nice'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'twist_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:390: warning: implicit declaration of function 'close'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:390: warning: implicit declaration of function 'dup'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:397: warning: implicit declaration of function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:397: warning: incompatible implicit declaration of built-in function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'setenv_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:437: warning: implicit declaration of function 'setenv'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:390: warning: implicit declaration of function 'dup'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:397: warning: implicit declaration of function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:397: warning: incompatible implicit declaration of built-in function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c: In function 'setenv_option':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/options.c:437: warning: implicit declaration of function 'setenv'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/percent_x.c: In function 'percent_x':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/percent_x.c:78: warning: implicit declaration of function 'sleep'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/percent_x.c: In function 'percent_x':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/percent_x.c:78: warning: implicit declaration of function 'sleep'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c: In function 'fsocket':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c:60: warning: implicit declaration of function 'close'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c: In function 'rfc931':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c:140: warning: implicit declaration of function 'alarm'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c: In function 'fsocket':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c:60: warning: implicit declaration of function 'close'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c: In function 'rfc931':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/rfc931.c:140: warning: implicit declaration of function 'alarm'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c: In function 'shell_cmd':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:47: warning: implicit declaration of function 'fork'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:55: warning: implicit declaration of function 'wait'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c: In function 'do_child':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:78: warning: implicit declaration of function 'close'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:79: warning: implicit declaration of function 'open'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:81: warning: implicit declaration of function 'dup'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:84: warning: implicit declaration of function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:84: warning: incompatible implicit declaration of built-in function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:91: warning: implicit declaration of function '_exit'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:91: warning: incompatible implicit declaration of built-in function '_exit'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c: In function 'shell_cmd':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:47: warning: implicit declaration of function 'fork'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:55: warning: implicit declaration of function 'wait'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c: In function 'do_child':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:78: warning: implicit declaration of function 'close'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:79: warning: implicit declaration of function 'open'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:81: warning: implicit declaration of function 'dup'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:84: warning: implicit declaration of function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:84: warning: incompatible implicit declaration of built-in function 'execl'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:91: warning: implicit declaration of function '_exit'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/shell_cmd.c:91: warning: incompatible implicit declaration of built-in function '_exit'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/update.c: In function 'request_init':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/update.c:110: warning: implicit declaration of function 'getpid'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/update.c: In function 'request_init':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/update.c:110: warning: implicit declaration of function 'getpid'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/workarounds.c: In function 'yp_get_default_domain':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/workarounds.c:210: warning: implicit declaration of function 'getdomainname'
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/workarounds.c: In function 'yp_get_default_domain':
/usr/src/lib/libwrap/../../contrib/tcp_wrappers/workarounds.c:210: warning: implicit declaration of function 'getdomainname'
===> lib/liby (all)
===> lib/libz (all)
===> lib/bind (all)
===> lib/bind/isc (all)
===> lib/bind/isccc (all)
===> lib/bind/dns (all)
===> lib/bind/isccfg (all)
===> lib/bind/bind9 (all)
===> lib/bind/lwres (all)
===> lib/clang (all)
===> lib/clang/libclanganalysis (all)
===> lib/clang/libclangarcmigrate (all)
{standard input}: Assembler messages:
{standard input}:35548: Warning: end of file not at end of a line; newline inserted
{standard input}:36435: Error: unrecognized symbol type ""
c++: Internal error: Killed: 9 (program cc1plus)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
```

The last few lines of the dmesg looks like:


```
Mar  7 22:09:37 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 137834, size: 12288
Mar  7 22:09:48 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 184672, size: 36864
Mar  7 22:13:34 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 5637, size: 4096
Mar  7 22:31:52 freenano kernel: swap_pager: out of swap space
Mar  7 22:31:55 freenano kernel: swap_pager_getswapspace(2): failed
Mar  7 22:31:55 freenano kernel: pid 57843 (cc1plus), uid 0, was killed: out of swap space
```

How much of memory and swap is required to compile? Could anyone tell me is it a bug or did I do something wrong? Thanks!


----------



## zennybsd (Mar 8, 2012)

*compilations are not working third time, too!*

I tried again by increasing physical RAM to 1.5G and swap to 1G, still nanobsd.sh is showing errors while compiling.


```
# swapinfo -h
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p3       1048540      11M       1G     1%
```

Complete bw log is at http://pastebin.com/U3CuR5ND. whereas some last lines of buildworld reads surprising me that it seems to have been using clang, but asks to submit bugs to gcc developers! How can I choose specifically either clang or gcc for compilation without getting messy errors?


```
===> lib/clang/libclangparse (all)
===> lib/clang/libclangrewrite (all)
===> lib/clang/libclangsema (all)
{standard input}: Assembler messages:
{standard input}:11467: Warning: end of file not at end of a line; newline inserted
c++: Internal error: Killed: 9 (program cc1plus)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
```

The dmesg output is at http://pastebin.com/j6bChbLT, however the last few lines are relevant to the build process:


```
Mar  8 05:48:20 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 140272, size: 8192
Mar  8 05:48:47 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 14458, size: 24576
Mar  8 05:50:28 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 14458, size: 24576
Mar  8 05:50:44 freenano last message repeated 3 times
Mar  8 05:54:36 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 128166, size: 8192
Mar  8 05:54:36 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 140275, size: 4096
Mar  8 05:54:36 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 113567, size: 4096
Mar  8 05:54:36 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 112387, size: 8192
Mar  8 05:54:36 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 12807, size: 4096
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 90932, size: 4096
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 128166, size: 8192
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 140275, size: 4096
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 113567, size: 4096
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 112387, size: 8192
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 12807, size: 4096
Mar  8 05:55:15 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 90932, size: 4096
Mar  8 06:01:56 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 55357, size: 4096
Mar  8 06:01:56 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 102733, size: 4096
Mar  8 06:01:56 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 114486, size: 8192
Mar  8 06:01:56 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 121744, size: 4096
Mar  8 06:02:16 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 119162, size: 4096
Mar  8 06:02:16 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 145967, size: 16384
Mar  8 06:06:18 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 42288, size: 32768
Mar  8 06:06:18 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 114471, size: 4096
Mar  8 06:06:18 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 162302, size: 4096
Mar  8 06:06:18 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 119068, size: 12288
Mar  8 06:06:18 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 121748, size: 8192
Mar  8 06:06:18 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 219, size: 4096
Mar  8 06:08:54 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 55926, size: 4096
Mar  8 06:08:54 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 150744, size: 28672
Mar  8 06:09:51 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 163151, size: 4096
Mar  8 06:09:51 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 150301, size: 12288
Mar  8 06:24:13 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 159992, size: 4096
Mar  8 06:24:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 18581, size: 4096
Mar  8 06:24:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 124807, size: 36864
Mar  8 06:24:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 168191, size: 4096
Mar  8 06:24:24 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 90525, size: 8192
Mar  8 06:31:24 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 48908, size: 16384
Mar  8 06:31:24 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 58070, size: 8192
Mar  8 06:31:24 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 136240, size: 4096
Mar  8 06:31:39 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 169822, size: 4096
Mar  8 07:01:49 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 12768, size: 24576
Mar  8 07:01:49 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 187072, size: 16384
Mar  8 07:01:49 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 156319, size: 4096
Mar  8 07:01:49 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 177047, size: 4096
Mar  8 07:02:11 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 187072, size: 16384
Mar  8 07:02:11 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 156319, size: 4096
Mar  8 07:02:11 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 177047, size: 4096
Mar  8 07:02:11 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 12768, size: 24576
Mar  8 07:04:59 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 81486, size: 4096
Mar  8 07:04:59 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 130062, size: 4096
Mar  8 07:04:59 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 166344, size: 8192
Mar  8 07:04:59 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 89575, size: 12288
Mar  8 07:08:32 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 132327, size: 8192
Mar  8 07:08:32 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 83983, size: 4096
Mar  8 07:08:32 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 165342, size: 4096
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 127650, size: 4096
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 168019, size: 20480
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 22331, size: 4096
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 165339, size: 12288
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 167953, size: 4096
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 89139, size: 12288
Mar  8 07:09:14 freenano kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 168032, size: 12288
Mar  8 08:28:17 freenano kernel: swap_pager: out of swap space
Mar  8 08:28:18 freenano kernel: swap_pager_getswapspace(1): failed
Mar  8 08:28:18 freenano kernel: pid 79888 (cc1plus), uid 0, was killed: out of swap space
```

Any inputs to overcome this?


----------



## adam2104 (Mar 8, 2012)

Not sure I can help but I've also been building nanobsd images usi g FreeBSD9 and it has been working without any trouble. My build machine is a FreeBSD9 install under VMware Fusion 4 with 120gigs of disk and 2048megs of ram.


----------



## zennybsd (Mar 8, 2012)

@adam2104: Thanks Could you share your configs for compilation? It will help me because I was compiling from the same script that I used to create with FreeBSD 8.3.

In the meantime, what I did was I created a qcow2 chunk of 4G and mounted as swap:


```
# swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p3       1048540     6220  1042320     1%
/dev/ada1         4194304     6272  4188032     0%
Total             5242844    12492  5230352     0%
```

Could not believe that fbsd9 is so memory-hungry!

Then the compilation seemed to have gone well, but stopped with the error again.

Please find the compilation logs:

http://pastebin.com/F3NkPckY (Part One)
http://pastebin.com/PJ6aXB7W (Part Two)

Thanks!


----------



## adam2104 (Mar 8, 2012)

Sure Zenny. Again, I'm building for an alix 2D13 embedded board. This is my first try at nanobsd, but things seem to be working well for me.

alix.conf:

```
NANO_NAME=alix
NANO_KERNEL=alix.kernel
NANO_ARCH="i386"

# build options
NANO_PMAKE="make -j 4"

# disk info - using 1gig size
NANO_MEDIASIZE=1953125
NANO_HEADS=16
NANO_SECTS=63

# options
NANO_RAM_ETCSIZE=16384

CONF_INSTALL='
WITHOUT_MAKE=YES
WITHOUT_TOOLCHAIN=YES
'

CONF_WORLD=' 
NO_MODULES=YES
WITHOUT_ACPI=YES
WITHOUT_BIND_MTREE=YES
WITHOUT_BIND_NAMED=YES
WITHOUT_CALENDAR=YES
WITHOUT_DICT=YES
WITHOUT_FREEBSD_UPDATE=YES
WITHOUT_GAMES=YES
WITHOUT_IPFILTER=YES
WITHOUT_IPFW=YES
WITHOUT_IPX=YES
WITHOUT_KERBEROS=YES
WITHOUT_LOCALES=YES
WITHOUT_LPR=YES
WITHOUT_NDIS=YES
WITHOUT_NETGRAPH=YES
WITHOUT_NLS=YES
WITHOUT_NLS_CATALOGS=YES
WITHOUT_PAM_SUPPORT=YES
WITHOUT_RESCUE=YES
WITHOUT_SHAREDOCS=YES
WITHOUT_SYSCONS=YES
WITHOUT_ZFS=YES
'

# do some loader configs
cust_loader() (
	touch ${NANO_WORLDDIR}/boot/loader.conf
	echo "beastie_disable=\"YES\"" >> ${NANO_WORLDDIR}/boot/loader.conf
	echo "autoboot_delay=\"5\"" >> ${NANO_WORLDDIR}/boot/loader.conf
)
customize_cmd cust_loader

# We only have a serial port for console
cust_settermtype () (
	# set vt100 term type on console
	sed -i "" -e /tty[du]0/s/dialup/vt100/ ${NANO_WORLDDIR}/etc/ttys
)
customize_cmd cust_comconsole
customize_cmd cust_settermtype

# Install files in /usr/src/tools/tools/nanobsd/Files
customize_cmd cust_install_files

# allow root to login to ssh
customize_cmd cust_allow_ssh_root

# Install packages in /usr/src/tools/tools/nanobsd/Pkg
customize_cmd cust_pkg
```

alix.kernel

```
# kernel for alix 2d13

cpu 		I586_CPU
ident 		ALIX
options 	CPU_GEODE

# geode specifics
device 		crypto
device 		cryptodev
device 		glxsb

# qos support
options 	ALTQ
options 	ALTQ_HFSC
options 	HZ=1000
options 	DEVICE_POLLING
device		pf
device		pflog
device		pfsync

# ipsec
device		enc
options 	IPSEC
options		IPSEC_NAT_T

# main config
options 	SCHED_ULE
options 	PREEMPTION
options 	INET
options 	INET6
options 	FFS
options 	SOFTUPDATES
options 	UFS_ACL
options 	UFS_DIRHASH
options 	MSDOSFS
options 	CD9660
options 	PROCFS
options 	PSEUDOFS
options 	GEOM_PART_GPT
options 	GEOM_LABEL
options 	COMPAT_FREEBSD7
options 	SCSI_DELAY=5000
options 	SYSVSHM
options 	SYSVMSG
options 	SYSVSEM
options 	_KPOSIX_PRIORITY_SCHEDULING
options 	PRINTF_BUFR_SIZE=128

# Basic bus support
device		apic
device		pci

# ATA devices
device		ata
device		atadisk
options 	ATA_STATIC_ID

# SCSI peripherals needed for USB mass storage devices
device		scbus
device		da

# Console support
device		uart

# alix NIC drivers
device		miibus
device		vr

# Wireless NIC cards
device		wlan
options 	IEEE80211_DEBUG
options 	IEEE80211_AMPDU_AGE
options 	IEEE80211_SUPPORT_MESH
device		wlan_wep
device		wlan_ccmp
device		wlan_tkip
device		wlan_acl
device		wlan_amrr
device		ath
device		ath_hal
options 	AH_SUPPORT_AR5416
device		ath_rate_sample

# Pseudo devices.
device		loop
device		random
device		ether
device		vlan
device		tun
device		pty
device		md
device		gif
device		stf
device		gre
device		firmware
device		if_bridge
device		bpf

# USB support
device		ohci
device		ehci
device		usb
device		umass
```

I build it using this CLI:

```
sh nanobsd.sh -c alix.conf
```


----------



## zennybsd (Mar 8, 2012)

Thanks for sharing. My configs were very well working with FreeBSD 8.3. Is there any other way of building nanobsd besides using nanobsd.sh script in cli? I guess not.


----------



## zennybsd (Mar 10, 2012)

*Update*

Hi:

I reinstalled FreeBSD9-STABLE again on a new qcow2 image. Installed everything including src and ports during installation except games.

But when it comes to compiling NanoBSD, it halts at:


```
/usr/src/gnu/usr.bin/sort/../../../contrib/gnu-sort/lib/quotearg.c: In function 'quotearg_n_options':
/usr/src/gnu/usr.bin/sort/../../../contrib/gnu-sort/lib/quotearg.c:585: warning: comparison is always false due to limited range of data type
===> gnu/usr.bin/texinfo (all)
===> gnu/usr.bin/texinfo/libtxi (all)
===> gnu/usr.bin/texinfo/makeinfo (all)
===> gnu/usr.bin/texinfo/info (all)
===> gnu/usr.bin/texinfo/infokey (all)
===> gnu/usr.bin/texinfo/install-info (all)
===> gnu/usr.bin/texinfo/texindex (all)
===> gnu/usr.bin/texinfo/doc (all)
1 error
*** Error code 2
1 error
*** Error code 2
1 error
```

I can easily build NanoBSD image with the same configurations in FreeBSD-8.3 STABLE, but it does not compile with FreeBSD9-STABLE, but pops up the above error as well as the detailed log I posted at (public document, no login required):

https://docs.google.com/open?id=0B5PA_hdlux-AUW83MGI2R3NRQ3l2Nm1qeFNvbUM3dw

Any inputs shall be appreciated! Thanks!


----------



## adam2104 (Mar 10, 2012)

Do you have another machine you can try to compile on? Your build seems to fail at different points each time. Perhaps you have a hardware issue that is causing trouble when building FreeBSD9.


----------



## zennybsd (Mar 12, 2012)

*Tried on Real HW with the same error*

Tried on a new hardware with a fresh installation of FreeBSD9-RELEASE. Anyway the compilation dies at the same point with the same error (so it does not seem it is related with whether it is compiled under a qemu-kvm or in real hardware). 

Any hints appreciated. 

My configurations are:

freeserver.conf is at http://pastebin.com/q8YauEcd

FREESERVER is at http://pastebin.com/4YC1Xu11

Build log is at https://docs.google.com/open?id=0B5PA_hdlux-AN012OW5MSnVSNEMwM0NpTGw4UmwwUQ


----------



## adam2104 (Mar 12, 2012)

Another question, can you do just a basic nanobsd build at all?

[cmd=]sh nanobsd.sh[/cmd]

If that works there is likely something wrong with your freeserver.conf file that is prevent compilation. You could then add them back one at a time to see which one is causing the problem.


----------



## rigo (Mar 13, 2012)

Hello,

I am not sure about the cause of your problem, but the following message rang a bell for me:



			
				zennybsd said:
			
		

> [...]
> But when it comes to compiling NanoBSD, it halts at:
> 
> 
> ...



I saw messages like these when I tried cross-compilation between 32-bit and 64-bit. I suggest you to check that your host system is 64-bit, and that nanobsd is not using a 32-bit compiler, or trying to use 32-bit libraries.


----------



## zennybsd (Mar 13, 2012)

*Mine is amd64 host*

rigo: Thanks for the pointer, but mine is a amd64 bit host building amd64 nanobsd.


```
#uname -a
FreeBSD free.dev 9.0-STABLE FreeBSD 9.0-STABLE #3 r231386: Fri Feb 10 19:46:46 PST 2012     root@build9x64.pcbsd.org:/usr/obj/storage/fbsd-sources/9-stable/sys/GENERIC  amd64
```

I installed freebsd from pcbsd DVD.

So this problem has nothing to do with my compilation.

In addition, I tried by specifying two things in my conf file:

```
NANO_PMAKE="make -s"
```
 (removed -j 6 at the end)

```
WITHOUT_CLANG=true
```

And still a no go, but the compilation ended at:


```
wpa.o: In function `wpa_sm_rx_eapol':
wpa.c:(.text+0x2d2e): undefined reference to `rc4_skip'
wpa.c:(.text+0x31c8): undefined reference to `rc4_skip'
wpa_supplicant.o: In function `wpa_supplicant_init':
wpa_supplicant.c:(.text+0x1f83): undefined reference to `eap_register_methods'
*** Error code 1

Stop in /usr/src/usr.sbin/wpa/wpa_supplicant.
*** Error code 1

Stop in /usr/src/usr.sbin/wpa.
*** Error code 1

Stop in /usr/src/usr.sbin.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
```

Whining me all around! ;-(


----------



## rigo (Mar 13, 2012)

zennybsd said:
			
		

> rigo: Thanks for the pointer, but mine is a amd64 bit host building amd64 nanobsd.



Ok.



> In addition, I tried by specifying two things in my conf file:
> 
> ```
> NANO_PMAKE="make -s"
> ...



I believe that that setting was in fact quite crucial for understanding what is wrong!

If we go back to see your full build log (from the Google docs link you posted), we can find the same messages there, interspersed with other build messages. This explains that the problem was actually wpa_supplicant not building, even though the last messages in that build log are about other files.

The relevant error messages are probably:

```
aes-cbc.o: In function `aes_128_cbc_decrypt':
aes-cbc.c:(.text+0x1b): undefined reference to `aes_decrypt_init'
aes-cbc.c:(.text+0x72): undefined reference to `aes_decrypt'
aes-cbc.c:(.text+0xaf): undefined reference to `aes_decrypt_deinit'
aes-cbc.o: In function `aes_128_cbc_encrypt':
aes-cbc.c:(.text+0xeb): undefined reference to `aes_encrypt_init'
aes-cbc.c:(.text+0x13e): undefined reference to `aes_encrypt'
aes-cbc.c:(.text+0x165): undefined reference to `aes_encrypt_deinit'
aes-ctr.o: In function `aes_128_ctr_encrypt':
aes-ctr.c:(.text+0x1d): undefined reference to `aes_encrypt_init'
aes-ctr.c:(.text+0x63): undefined reference to `aes_encrypt'
aes-ctr.c:(.text+0xbb): undefined reference to `aes_encrypt_deinit'

...etc...
```

Maybe you should review your build settings, with respect to cryptography.

Hope this helps.


----------



## adam2104 (Mar 13, 2012)

I had problems building nanobsd9 when I had this line also:


```
WITHOUT_WPA_SUPPLICANT_EAPOL=true
```

This matches what you're seeing. Remove that line and try again.


----------



## zennybsd (Mar 14, 2012)

Thanks adam2104 for the pointer. The build got completed after the following:


1) removed all source and ports, and csup/portsnap them again
2) In the src.conf file, I figured out that disabling WPA_SUPPLICANT (
	
	



```
#WITHOUT_WPA_SUPPLICANT=true
```
) is preventing the build world.
3) In the kernel file, I have to change from 
	
	



```
COMPAT_IA32
```
 to 
	
	



```
COMPAT_FREEBSD32
```
 (the former is obsoleted in FreeBSD9-RELEASE) to complete the build kernel.

Just could not understand why FreeBSD9-RELEASE fails to build without wpa_supplicant. For the machine that I am working I really don't need that!


----------

