[lxc-users] [lxc-devel] Segfault while running lxc-start whic

Anil Kumar linuxdeveloper7 at gmail.com
Mon Feb 24 12:22:19 UTC 2014


Hi Stéphane Graber,
I tried the link which you given sometime back. But issue was
persistent. So I left things there because I picked some other
activity.

Finally I moved back to lxc setup task, I could resolve the issue by
using mount command of busybox instead of android mount binary.

Here is the change which I have done in prepare.sh to resolve the issue.
=================================
if ! grep -q " $lxc/root/cgroup " /proc/mounts; then
    busybox mount -t cgroup -o $cgroups none $lxc/root/cgroup
fi


Next thing, I wanted to move my setup on android-4.4.2_r1 ASOP (Nexus
7). I picked latest binaries from
https://qa.linuxcontainers.org/master/1.0.0~rc4+master~20140220-1900/android-armel/
 and given a try but lxc-start failed as shown below. I would
appreciate if you can provide some inputs:

Thanks in advance.

==========
/run-lxc lxc-start -n ubuntu /bin/bash -l DEBUG
lxc-start: Could not find writable mount point for cgroup hierarchy 2
while trying to create cgroup.
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete /cgroup/
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/dev/cpuctl//apps/bg_non_interactive
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/dev/cpuctl//apps
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete /dev/cpuctl/
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/9999
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1023
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1021
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1012
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1017
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1013
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1019
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete
/acct//uid/1000
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete /acct//uid/0
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete /acct//uid
lxc-start: Device or resource busy - cgroup_rmdir: failed to delete /acct/
lxc-start: failed creating cgroups
lxc-start: failed to spawn 'ubuntu'


 # mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600,ptmxmode=000 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
none /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/sdhci-tegra.3/by-name/APP /system ext4
rw,seclabel,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/block/platform/sdhci-tegra.3/by-name/CAC /cache ext4
rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered
0 0
/dev/block/platform/sdhci-tegra.3/by-name/UDA /data ext4
rw,seclabel,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered
0 0
/dev/fuse /mnt/shell/emulated fuse
rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other
0 0
/dev/block/platform/sdhci-tegra.3/by-name/UDA /data/lxc/root ext4
rw,seclabel,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered
0 0
none /data/lxc/root/acct cgroup rw,relatime,cpuacct 0 0
/dev/block/platform/sdhci-tegra.3/by-name/UDA
/data/lxc/root/data/lxc/containers ext4
rw,seclabel,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered
0 0
/dev/block/platform/sdhci-tegra.3/by-name/UDA
/data/lxc/root/data/lxc/lxc ext4
rw,seclabel,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=ordered
0 0
tmpfs /data/lxc/root/dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
none /data/lxc/root/dev/cpuctl cgroup rw,relatime,cpu 0 0
devpts /data/lxc/root/dev/pts devpts
rw,seclabel,relatime,mode=600,ptmxmode=000 0 0
proc /data/lxc/root/proc proc rw,relatime 0 0
sysfs /data/lxc/root/sys sysfs rw,seclabel,relatime 0 0
/dev/block/platform/sdhci-tegra.3/by-name/APP /data/lxc/root/system
ext4 rw,seclabel,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
none /data/lxc/root/cgroup cgroup
rw,relatime,freezer,devices,debug,cpuset,clone_children 0 0




On Sat, Jan 25, 2014 at 4:25 AM, Stéphane Graber <stgraber at ubuntu.com> wrote:
> On Fri, Jan 24, 2014 at 03:04:51PM +0530, linux developer wrote:
>> Hello
>> I downloaded latest lxc (lxc version: 1.0.0.beta2) for android from
>> http://qa.linuxcontainers.org/master/current/android-armel/ and copied
>> files at /data of Nexus 7 Device ( ASOP 4.3 and Kernel 3.1.10). Also
>> added ubuntu rootfs under /data/lxc/containers
>>
>> When I started the container (./run-lxc lxc-start -n ubuntu) ,
>> segfault happened( as shown below).
>> I am not sure what went wrong. It will be great if you can provide some inputs.
>
> It's not very clear to me either. I just tried the current upstream
> build on my Android phone and it works fine here, no segfault.
>
> Can you try:
> https://qa.linuxcontainers.org/master/1.0.0~beta2+master~20140124-2230/android-armel/
>
> That's the one I just tested here on my Atrix.
>
>>
>>
>> $strace ./run-lxc lxc-start -n ubuntu
>> execve("./run-lxc", ["./run-lxc", "lxc-start", "-n", "ubuntu"], [/* 23
>> vars */]) = 0
>> mprotect(0x40186000, 4096, PROT_READ)   = 0
>> open("/dev/null", O_RDWR)               = 3
>> fcntl64(0, F_GETFL)                     = 0x20002 (flags O_RDWR)
>> fcntl64(1, F_GETFL)                     = 0x20002 (flags O_RDWR)
>> fcntl64(2, F_GETFL)                     = 0x20002 (flags O_RDWR)
>> close(3)                                = 0
>> gettid()                                = 2175
>> set_tls(0x40187efc, 0x40187efc, 0, 0xffffffbc, 0x40187ffc) = 0
>> sigaction(SIGILL, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL, 0x41e1d038) = 0
>> sigaction(SIGABRT, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL,
>> 0x41e1d038) = 0
>> sigaction(SIGBUS, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL, 0x41e1d038) = 0
>> sigaction(SIGFPE, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL, 0x41e1d038) = 0
>> sigaction(SIGSEGV, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL,
>> 0x41e1d038) = 0
>> sigaction(SIGSTKFLT, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL,
>> 0x41e1d038) = 0
>> sigaction(SIGPIPE, {0x40177a41, [], SA_RESTART|SA_SIGINFO}, NULL,
>> 0x41e1d038) = 0
>> mmap2(NULL, 4092, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0,
>> 0) = 0x400ab000
>> open("/vendor/lib/libc.so", O_RDONLY)   = -1 ENOENT (No such file or directory)
>> open("/system/lib/libc.so", O_RDONLY)   = 3
>> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"...,
>> 52) = 52
>> mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40149000
>> mmap2(NULL, 360448, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4023e000
>> mmap2(0x4023e000, 282284, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
>> 3, 0) = 0x4023e000
>> mmap2(0x40284000, 12952, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
>> 3, 0x45) = 0x40284000
>> mmap2(0x40288000, 57344, PROT_READ|PROT_WRITE,
>> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40288000
>> close(3)                                = 0
>> munmap(0x40149000, 4096)                = 0
>> mprotect(0x40284000, 8192, PROT_READ)   = 0
>> mprotect(0x400a4000, 4096, PROT_READ)   = 0
>> open("/dev/__properties__", O_RDONLY|O_NOFOLLOW) = 3
>> fstat64(3, {st_mode=S_IFREG|0644, st_size=49152, ...}) = 0
>> mmap2(NULL, 49152, PROT_READ, MAP_SHARED, 3, 0) = 0x400ac000
>> close(3)                                = 0
>> futex(0x402873b4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
>> mprotect(0x400ab000, 4092, PROT_READ|PROT_WRITE) = 0
>> mprotect(0x400ab000, 4092, PROT_READ|PROT_WRITE) = 0
>> mprotect(0x400ab000, 4092, PROT_READ|PROT_WRITE) = 0
>> mprotect(0x400ab000, 4092, PROT_READ|PROT_WRITE) = 0
>> mprotect(0x400ab000, 4092, PROT_READ|PROT_WRITE) = 0
>> clock_gettime(CLOCK_MONOTONIC, {1368, 48694362}) = 0
>> mprotect(0x400ab000, 4092, PROT_READ|PROT_WRITE) = 0
>> mprotect(0x400ab000, 4092, PROT_READ)   = 0
>> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
>> 0) = 0x400d2000
>> mprotect(0x400d2000, 4096, PROT_READ)   = 0
>> getpid()                                = 2175
>> geteuid32()                             = 0
>> getpgid(0)                              = 2174
>> getppid()                               = 2174
>> gettimeofday({1390555791, 867632}, NULL) = 0
>> brk(0)                                  = 0x412b2000
>> brk(0x412b2000)                         = 0x412b2000
>> brk(0x412b3000)                         = 0x412b3000
>> brk(0x412b4000)                         = 0x412b4000
>> sigaction(SIGINT, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGINT, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> sigaction(SIGQUIT, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGQUIT, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> sigaction(SIGTERM, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGTERM, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> sigaction(SIGHUP, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGHUP, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> brk(0x412b6000)                         = 0x412b6000
>> open("/dev/tty", O_RDWR)                = 3
>> fcntl64(3, F_DUPFD, 10)                 = 11
>> fcntl64(11, F_SETFD, FD_CLOEXEC)        = 0
>> close(3)                                = 0
>> ioctl(11, TIOCGWINSZ, {ws_row=0, ws_col=0, ws_xpixel=0, ws_ypixel=0}) = 0
>> brk(0x412b7000)                         = 0x412b7000
>> gettimeofday({1390555791, 878263}, NULL) = 0
>> gettimeofday({1390555791, 878558}, NULL) = 0
>> gettimeofday({1390555791, 879237}, NULL) = 0
>> brk(0x412b8000)                         = 0x412b8000
>> getcwd("/data/lxc", 4096)               = 10
>> getuid32()                              = 0
>> getgid32()                              = 0
>> getegid32()                             = 0
>> gettimeofday({1390555791, 882219}, NULL) = 0
>> open("./run-lxc", O_RDONLY)             = 3
>> fcntl64(3, F_DUPFD, 10)                 = 12
>> close(3)                                = 0
>> fcntl64(12, F_SETFD, FD_CLOEXEC)        = 0
>> fstat64(0, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
>> sigprocmask(SIG_SETMASK, [], NULL)      = 0
>> sigaction(SIGCHLD, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGCHLD, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> sigaction(SIGWINCH, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGWINCH, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> sigaction(SIGALRM, {SIG_IGN, , {SIG_DFL, , 0) = 0
>> sigaction(SIGALRM, {0x40090041, [], 0}, NULL, 0x41e1d038) = 0
>> brk(0x412b9000)                         = 0x412b9000
>> read(12, "#!/system/bin/sh\nexport PATH=$PA"..., 512) = 305
>> brk(0x412ba000)                         = 0x412ba000
>> chdir("/data/lxc/lxc")                  = 0
>> stat64("/sbin/sh", 0xbeffd620)          = -1 ENOENT (No such file or directory)
>> stat64("/vendor/bin/sh", 0xbeffd620)    = -1 ENOENT (No such file or directory)
>> stat64("/system/sbin/sh", 0xbeffd620)   = -1 ENOENT (No such file or directory)
>> stat64("/system/bin/sh", {st_mode=S_IFREG|0755, st_size=157488, ...}) = 0
>> access("/system/bin/sh", X_OK)          = 0
>> sigprocmask(SIG_BLOCK, [CHLD], [])      = 0
>> fork()                                  = 2176
>> sigsuspend([]Segmentation fault
>> link failed File exists
>> )                          = ? ERESTARTNOHAND (To be restarted)
>> --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2176, si_status=255,
>> si_utime=0, si_stime=2} (Child exited) ---
>> getrusage(RUSAGE_CHILDREN, {ru_utime={0, 0}, ru_stime={0, 0}, ...}) = 0
>> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 255}], WNOHANG|WSTOPPED,
>> NULL) = 2176
>> getrusage(RUSAGE_CHILDREN, {ru_utime={0, 0}, ru_stime={0, 10000}, ...}) = 0
>> wait4(-1, 0xbeffd2ac, WNOHANG|WSTOPPED, NULL) = -1 ECHILD (No child processes)
>> sigreturn()                             = ? (mask now [])
>> sigprocmask(SIG_SETMASK, [], NULL)      = 0
>> read(12, "", 512)                       = 0
>> close(12)                               = 0
>> sigprocmask(SIG_BLOCK, [CHLD], [])      = 0
>> sigprocmask(SIG_SETMASK, [], NULL)      = 0
>> fcntl64(3, F_GETFD)                     = -1 EBADF (Bad file number)
>> fcntl64(4, F_GETFD)                     = -1 EBADF (Bad file number)
>> fcntl64(5, F_GETFD)                     = -1 EBADF (Bad file number)
>> fcntl64(6, F_GETFD)                     = -1 EBADF (Bad file number)
>> fcntl64(7, F_GETFD)                     = -1 EBADF (Bad file number)
>> fcntl64(8, F_GETFD)                     = -1 EBADF (Bad file number)
>> fcntl64(9, F_GETFD)                     = 0
>> fcntl64(10, F_GETFD)                    = 0
>> fcntl64(11, F_GETFD)                    = 0x1 (flags FD_CLOEXEC)
>> close(11)                               = 0
>> fcntl64(12, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(13, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(14, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(15, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(16, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(17, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(18, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(19, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(20, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(21, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(22, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(23, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(24, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(25, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(26, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(27, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(28, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(29, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(30, F_GETFD)                    = -1 EBADF (Bad file number)
>> fcntl64(31, F_GETFD)                    = -1 EBADF (Bad file number)
>> close(2)                                = 0
>> close(1)                                = 0
>> close(0)                                = 0
>> mprotect(0x400d2000, 4096, PROT_READ|PROT_WRITE) = 0
>> mprotect(0x400d2000, 4096, PROT_READ)   = 0
>> close(0)                                = -1 EBADF (Bad file number)
>> close(1)                                = -1 EBADF (Bad file number)
>> close(2)                                = -1 EBADF (Bad file number)
>> futex(0x40288be8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
>> munmap(0x400d2000, 4096)                = 0
>> exit_group(255)                         = ?
>>
>>
>>
>>
>> FYI,
>> $cd /data/lxc
>> $ ls
>> containers
>> lxc
>> root
>> run-lxc
>>
>> $ cd containers
>> $ls
>> ubuntu
>>
>> $busybox uname -a
>> Linux localhost 3.1.10-gfd8d03e-dirty #9 SMP PREEMPT Thu Jan 23
>> 19:32:01 IST 2014 armv7l GNU/Linux
>> _______________________________________________
>> lxc-devel mailing list
>> lxc-devel at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-devel
>
> --
> Stéphane Graber
> Ubuntu developer
> http://www.ubuntu.com
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list