Subject: Re: uvm_fault
To: YAMAMOTO Takashi <>
From: None <>
List: current-users
Date: 01/30/2006 02:53:35
On Sun, 29 Jan 2006 17:01:59 +0900
YAMAMOTO Takashi <> wrote:

> > Hi, I have a script that sets up a chroot environment under /opt/sandbox by
> > calling 'mount_null' to
> > mount /bin, /sbin, /lib, /usr/bin, /usr/sbin, /usr/lib, etc
> > under /opt/sandbox. When some of the directories are exported via NFS and I
> > call this scripts on the server that exports those directories, I get a
> > kernel panic. This is on a pretty recent NetBSD-current.
> can you show me your scripts and /etc/{fstab,exports}?
> YAMAMOTO Takashi

$ cat /etc/fstab
/dev/wd0a / ffs rw,softdep 1 1
/dev/wd0b none swap sw 0 0
/dev/wd0e /var ffs rw,softdep 1 2
/dev/wd0f /opt ffs rw,softdep 1 2
kernfs /kern kernfs rw
procfs /proc procfs rw,noauto

tmpfs /tmp tmpfs rw
tmpfs /var/run tmpfs rw
procfs /emul/linux/proc procfs ro,linux
/dev/sd0h /zip msdos rw,noauto 0 0
/dev/cd0a /cdrom0 cd9660 ro,noauto 0 0
/dev/cd1a /cdrom1 cd9660 ro,noauto 0 0

$ cat /etc/exports
/opt/distfiles /opt/pkgsrc /opt/src /opt/xsrc -network

The scripts that trigger kernel panic are at
The scripts assume a certain directory structure:


This is how to repeat kernel panic:

Create top level /opt directory
Create /opt/distfiles containing sources for various packages
Create /opt/src containing NetBSD src directory
Create /opt/xsrc containing NetBSD xsrc directory
Create empty /opt/sandbox directory

Create /etc/exports as shown above, then add the following to /etc/rc.conf and
reboot, or manually export NFS directories: 


Unpack my scripts and use them:

cd /opt/sandbox
tar -zxvpf /path_to/scripts.tgz
cd /opt/sandbox/scripts
# Create mount points under /opt/sandbox
./chroot.mkdirs os=netbsd arch=i386
# Enter chroot, at this point kernel panics
./chroot.enter os=netbsd arch=i386