1

I've been trying to create a LXC container (lxc create) but at the end I get these messages:

W: Failure trying to run: chroot /var/cache/lxc/debian/wheezy_armhf.partial mount -t proc proc /proc
W: See /var/cache/lxc/debian/wheezy_armhf.partial/debootstrap/debootstrap.log for details
Failed to download the rootfs, aborting.
Failed to download base system
failed to install system
failed to execute template 'debian'
aborted

I tried to run chroot /var/cache/lxc/debian/wheezy_armhf.partial to see what would happen and I get a "Segmentation fault" message.

An strace to the previous chroot command, shows the following:

execve("/usr/sbin/chroot", ["chroot", "/var/cache/lxc/debian/wheezy_arm"...], [/* 16 vars */]) = 0
brk(0)                                  = 0x1e000
uname({sys="Linux", node="raspberrypi", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f6c000
access("/etc/ld.so.preload", R_OK)      = 0
open("/etc/ld.so.preload", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=44, ...}) = 0
mmap2(NULL, 44, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0xb6f6b000
close(3)                                = 0
open("/usr/lib/arm-linux-gnueabihf/libcofi_rpi.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\270\4\0\0004\0\0\0"..., 512) = 512
lseek(3, 7276, SEEK_SET)                = 7276
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080
lseek(3, 7001, SEEK_SET)                = 7001
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=10170, ...}) = 0
mmap2(NULL, 39740, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f3f000
mprotect(0xb6f41000, 28672, PROT_NONE)  = 0
mmap2(0xb6f48000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb6f48000
close(3)                                = 0
munmap(0xb6f6b000, 44)                  = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42208, ...}) = 0
mmap2(NULL, 42208, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f34000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", 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`\364\0\0004\0\0\0"..., 512) = 512
lseek(3, 130212, SEEK_SET)              = 130212
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160
lseek(3, 129880, SEEK_SET)              = 129880
read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 51) = 51
fstat64(3, {st_mode=S_IFREG|0644, st_size=131372, ...}) = 0
mmap2(NULL, 162704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f0c000
mprotect(0xb6f2c000, 28672, PROT_NONE)  = 0
mmap2(0xb6f33000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f) = 0xb6f33000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", 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\214y\1\0004\0\0\0"..., 512) = 512
lseek(3, 1194784, SEEK_SET)             = 1194784
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1360) = 1360
lseek(3, 1194348, SEEK_SET)             = 1194348
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1196144, ...}) = 0
mmap2(NULL, 1238312, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6ddd000
mprotect(0xb6eff000, 28672, PROT_NONE)  = 0
mmap2(0xb6f06000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x121) = 0xb6f06000
mmap2(0xb6f09000, 9512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f09000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f6b000
set_tls(0xb6f6b4c0, 0xb6f6bb98, 0xb6f6f048, 0xb6f6b4c0, 0xb6f6f048) = 0
mprotect(0xb6f06000, 8192, PROT_READ)   = 0
mprotect(0x16000, 4096, PROT_READ)      = 0
mprotect(0xb6f6e000, 4096, PROT_READ)   = 0
munmap(0xb6f34000, 42208)               = 0
brk(0)                                  = 0x1e000
brk(0x3f000)                            = 0x3f000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1534656, ...}) = 0
mmap2(NULL, 1534656, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6c66000
close(3)                                = 0
chroot("/var/cache/lxc/debian/wheezy_armhf.partial") = 0
chdir("/")                              = 0
execve("/bin/bash", ["/bin/bash", "-i"], [/* 16 vars */]) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

Anyone knows what might be causing this problem?

PS: debootstrap log file here.

  • Did you "See /var/cache/lxc/debian/wheezy_armhf.partial/debootstrap/debootstrap.log for details" / What is in the log ? – Panther Dec 13 '13 at 21:00
  • Yes, I did. But couldn't find any clue there :s I added a link to the file above. – bulkmoustache Dec 13 '13 at 22:11
  • Yuck, no not much there at all. Unless there is something obviously wrong in your config file or you are out of space on the hard drive, my best advice is for you to file a bug report. – Panther Dec 13 '13 at 22:50
  • I'm deplying this on an ARM architecture... I also tried on x86 and it works fine. I don't know if this helps... – bulkmoustache Dec 13 '13 at 23:19
  • It's not chroot that's segfaulting, but bash. Running mount probably segfaulted for the same reason. What hardware are you running this on (specifically, what exact ARM core)? What Linux architecture are you running outside the chroot (uname -imopr), and what arguments are you passing to debootstrap? – Gilles Dec 14 '13 at 0:04
1

I had a similar issue attempting a debootstrap for a Raspberry Pi as well. In fact, I found your posting while searching for a solution to my issue. I finally solved my issue and figured I'd add some notes here for others searching...

I can confirm what was previously mentioned in this thread, the shell was crashing with a segfault in the debootstrap created image, any shell actually -- bash, dash, etc, it didn't seem to matter. It first crashed on me while doing the debootstrap at the point it attempted to do the /proc mount in the chroot it was creating so it could finish the build (the same as you encountered).

Since I wasn't sure if it was the chroot itself, the mount call debootstrap was trying to do, or the shell trying to run and since the debootstrap target I was creating was identical to the currently running image on my Rasberry Pi, I tried to run the shell executables in the debootstrap image by hand to manually confirm it. And sure enough, it was the shells.

My solution was to switch the archive or repository that the debootstrap was sourcing from. Somehow, my original debootstrap was sourcing from debian.org rather than raspbian.org. I didn't dig much deeper, so I'm not exactly sure what was different about the two repositories, particularly for something as simple as the shells, as both were for the armhf architecture, but when I wiped the one sourced from debian.org and explicitly gave debootstrap the URL to the Raspbian archive, it worked perfectly.

So my suggestion is try a different repository for debootstrap. The archive I used that worked for me is: http://archive.raspbian.org/raspbian/

  • MIRROR=http://archive.raspbian.org/raspbian/ lxc-create -n mycontainer1 -t debian did it for me – Daniel Alder Apr 3 '15 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.