[Pkg-uml-pkgs] Bug#410154: checking /dev/shm inside a chroot

Mattia Dongili malattia at linux.it
Thu Feb 8 19:37:26 CET 2007


Hello!

On Thu, Feb 08, 2007 at 04:09:57PM +0000, bdb at forbidden.co.uk wrote:
> Actually, theres already code in uml thats trying to do this. It works

Yep, I was going to reply to your previous mail with such a statement :)

> by parsing /proc/mounts, which is rather misleading inside a chroot?  This
> could arguably be called a kernel bug with chroot....
> 
> So it breaks precsisely if /dev/shm is mounted outside the chroot, and not mounted inside.
> 
> Its not obvious the kernel really provides a better way.
> 
> Perhaps statvfs on /dev and /dev/shm and checking if the fsid is different???
> (Tries to run tests...)
> 
> But wait a minute.... I had the outside's /dev bind-mounted inside the chroot.
> That was already a tmpfs, belonging to udev.
> 
> Whats the difference between the udev tmpfs and the separate one normally on
> /dev/shm?
> 
> ....
> 
> Aha!! Its the free space setting. The udev tmpfs is mounted with a very small
> maximum size. That explains how uml was able to run for a short while
> before crashing.
> 
> So perhaps the /dev/shm check should actually be one that checks the free space.
> 
> Ok, I guess the bug should be that one doesn't get a good warning message
> when a mmap fails because of size limits on /dev/shm.

I don't think it's that obvious. The mmap actually succeed, the real
problem is the filesystem becomes full after some (in your case short)
time.
See also http://user-mode-linux.sourceforge.net/new/problems.html#sigbus

-- 
mattia
:wq!




More information about the Pkg-uml-pkgs mailing list