I build a linux container from scratch and wanna start it.
First, I use chroot to test like run "chroot rootfs/ /init", it starts correctly.
However, when i try to use "lxc-start -n mycontainer", one of its process has segfault problem and dmesg shows “[973.829549] servicemanager[1634]: segfault at 0 ip 40001094 sp bff23920 error 4 in servicemanager[40000000+3000]”
Even I try "lxc-start -n mycontainer -- /bin/sh" (just start sh instead of the whole init process), and it shows "[ 333.572917] sh[1715]: segfault at 90 ip b76d9a80 sp bff4cb24 error 4 in libc.so[b767a000+99000]", still a segfault problem.
I checked the lxc-start log and the container setup part is fine, no error.
Then I go through the lxc sourcecode, find it uses pivot_root instead of chroot. Could this be the problem? Or something else like namespace ,cgroup couses the segfault here?