chroot segfault

1

Estou tentando criar um contêiner LXC (lxc create), mas no final recebo essas mensagens:

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

Eu tentei executar chroot /var/cache/lxc/debian/wheezy_armhf.partial para ver o que aconteceria e recebo uma mensagem de "Falha de segmentação".

Um strace para o comando chroot anterior mostra o seguinte:

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, "7ELF
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
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, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%0%pre%%pre%04%pre%%pre%%pre%"..., 512) = 512
lseek(3, 7276, SEEK_SET)                = 7276
read(3, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 1080) = 1080
lseek(3, 7001, SEEK_SET)                = 7001
read(3, "A.%pre%%pre%%pre%aeabi%pre%$%pre%%pre%%pre%%pre%56%pre%\t\n"..., 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, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%'4%pre%%pre%04%pre%%pre%%pre%"..., 512) = 512
lseek(3, 130212, SEEK_SET)              = 130212
read(3, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 1160) = 1160
lseek(3, 129880, SEEK_SET)              = 129880
read(3, "A2%pre%%pre%%pre%aeabi%pre%(%pre%%pre%%pre%%pre%56%pre%\t\n"..., 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, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%4y%pre%04%pre%%pre%%pre%"..., 512) = 512
lseek(3, 1194784, SEEK_SET)             = 1194784
read(3, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 1360) = 1360
lseek(3, 1194348, SEEK_SET)             = 1194348
read(3, "A.%pre%%pre%%pre%aeabi%pre%$%pre%%pre%%pre%%pre%56%pre%\t\n"..., 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
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%0%pre%%pre%04%pre%%pre%%pre%"..., 512) = 512 lseek(3, 7276, SEEK_SET) = 7276 read(3, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 1080) = 1080 lseek(3, 7001, SEEK_SET) = 7001 read(3, "A.%pre%%pre%%pre%aeabi%pre%$%pre%%pre%%pre%%pre%56%pre%\t\n"..., 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, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%'4%pre%%pre%04%pre%%pre%%pre%"..., 512) = 512 lseek(3, 130212, SEEK_SET) = 130212 read(3, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 1160) = 1160 lseek(3, 129880, SEEK_SET) = 129880 read(3, "A2%pre%%pre%%pre%aeabi%pre%(%pre%%pre%%pre%%pre%56%pre%\t\n"..., 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, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%4y%pre%04%pre%%pre%%pre%"..., 512) = 512 lseek(3, 1194784, SEEK_SET) = 1194784 read(3, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 1360) = 1360 lseek(3, 1194348, SEEK_SET) = 1194348 read(3, "A.%pre%%pre%%pre%aeabi%pre%$%pre%%pre%%pre%%pre%56%pre%\t\n"..., 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

Alguém sabe o que pode estar causando esse problema?

PS: arquivo de log do debootstrap aqui .

    
por bulkmoustache 13.12.2013 / 20:51

1 resposta

1

Eu tive um problema semelhante ao tentar um debootstrap para um Raspberry Pi também. Na verdade, encontrei sua postagem enquanto procurava uma solução para meu problema. Eu finalmente resolvi meu problema e pensei em adicionar algumas anotações aqui para outras pessoas pesquisarem ...

Eu posso confirmar o que foi mencionado anteriormente neste tópico, o shell estava travando com um segfault na imagem criada pelo debootstrap, qualquer shell na verdade - bash, dash, etc, não parecia importar. Primeiro ele caiu em mim enquanto fazia o debootstrap no ponto em que tentou fazer a montagem / proc no chroot que estava criando para que pudesse terminar a compilação (a mesma que você encontrou).

Desde que eu não tinha certeza se era o próprio chroot, a chamada de montagem que o debootstrap estava tentando fazer, ou o shell tentando rodar e já que o destino do debootstrap que eu estava criando era idêntico à imagem atualmente em execução no meu Rasberry Pi Eu tentei executar manualmente os executáveis do shell na imagem do debootstrap para confirmar manualmente. E com certeza, foram as conchas.

Minha solução foi mudar o repositório ou repositório que o debootstrap estava obtendo. De alguma forma, o meu debootstrap original foi obtido do debian.org em vez de raspbian.org. Eu não fui muito fundo, então não sei exatamente o que havia de diferente nos dois repositórios, particularmente para algo tão simples quanto os shells, já que ambos eram para a arquitetura armhf, mas quando eu limpei o que vinha do debian. org e explicitamente deu ao debootstrap a URL para o arquivo Raspbian, funcionou perfeitamente.

Então minha sugestão é tentar um repositório diferente para o debootstrap. O arquivo que usei e que funcionou para mim é: link

    
por 03.10.2014 / 05:34