Bug 27259

Summary: md causes hang with make world
Product: Base System Reporter: sec <sec>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-STABLE   
Hardware: Any   
OS: Any   

Description sec 2001-05-11 00:10:01 UTC
I configured a malloc disk, mounted it as /mnt (see above), symlinked
/usr/obj there, and started a make world. After 10-20 Minutes the
buildworld hangs, and no access to the memory disk is possible. Not even
killing processes.

top displays the situation as follows:

last pid: 53061;  load averages:  0.00,  0.13,  0.36    up 1+13:01:37 22:36:30
32 processes:  2 running, 30 sleeping
CPU states:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
Mem: 26M Active, 411M Inact, 195M Wired, 36K Cache, 112M Buf, 372M Free
Swap: 1024M Total, 1024M Free

  PID USERNAME PRI NICE  SIZE    RES STATE    TIME   WCPU    CPU COMMAND
47780 root      10   5  7548K  7236K wait     0:01  0.00%  0.00% make
  155 daemon     2   0   896K   476K sbwait   0:01  0.00%  0.00% rwhod
  180 root       2   0  2184K  1216K select   0:00  0.00%  0.00% sshd
  173 root      10   0   976K   596K nanslp   0:00  0.00%  0.00% cron
  145 root       2   0   936K   568K select   0:00  0.00%  0.00% syslogd
  274 root      28   0  2308K  1516K RUN      0:00  0.00%  0.00% sshd
88844 root      28   0  1908K  1216K RUN      0:00  0.00%  0.00% top
 3644 root      18   0  1588K  1188K pause    0:00  0.00%  0.00% zsh
  176 root      18   0  2524K  1472K pause    0:00  0.00%  0.00% sendmail
88573 root      10   5  1224K   912K wait     0:00  0.00%  0.00% make
19270 root      10   5  1224K   908K wait     0:00  0.00%  0.00% make
  276 root      18   0  1324K   844K pause    0:00  0.00%  0.00% csh
88562 root      10   5  1056K   744K wait     0:00  0.00%  0.00% make
37688 root      10   5  1080K   768K wait     0:00  0.00%  0.00% make
  275 sec       10   0   632K    68K wait     0:00  0.00%  0.00% sh
  171 root       2   0  1060K   740K select   0:00  0.00%  0.00% inetd
37689 root      10   5   632K   492K wait     0:00  0.00%  0.00% sh
53051 root      10   5   312K   200K wait     0:00  0.00%  0.00% cc
53054 root      -6   5   752K   544K biowr    0:00  0.00%  0.00% as
  150 daemon     2   0   952K   580K select   0:00  0.00%  0.00% portmap
34314 root      10   5   628K   484K wait     0:00  0.00%  0.00% sh
53050 root      10   5   632K   488K wait     0:00  0.00%  0.00% sh
19269 root      10   5   632K   488K wait     0:00  0.00%  0.00% sh
88572 root      10   5   628K   484K wait     0:00  0.00%  0.00% sh

I then tried "ktrace -p 47780". Nothing in kdump.out

kill 47780

top shows:
47780 root     -14   5  7548K  7236K inode    0:01  0.00%  0.00% make

kdump then gives:
 47780 make     PSIG  SIGTERM caught handler=0x804ae64 mask=0x0 code=0x0
 47780 make     RET   wait4 RESTART
 47780 make     CALL  lstat(0x86cb420,0xbfbfe6dc)
 47780 make     NAMI  "uthread_writev.o"

kill -9 doesn't help either. top then says:
47780 root     -14   0  7548K  7236K inode    0:01  0.00%  0.00% make

mount and df display info correctly:

foo# mount
/dev/da0s1a on / (ufs, local)
/dev/da0s1f on /usr (ufs, local, soft-updates)
/dev/da0s1e on /var (ufs, local)
procfs on /proc (procfs, local)
/dev/md0c on /mnt (ufs, local)
foo# df
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/da0s1a     99183    35948    55301    39%    /
/dev/da0s1f  50254651   522826 45711453     1%    /usr
/dev/da0s1e    254063      790   232948     0%    /var
procfs              4        4        0   100%    /proc
/dev/md0c      387607    95076   261523    27%    /mnt
Comment 1 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-05-23 20:32:02 UTC
State Changed
From-To: open->closed

The md driver uses non-swappable ram for storage.  You have simply 
RAM-starved your system to death.