Package: qemu-user-static
Version: 1.7.0+dfsg-9
Severity: normal

Dear Maintainer,

while trying to set up a foreign chroot for sparc, loosely based in
the instructions found for armel[0], I encountered a hang while
starting second stage.

How to repeat:

# mkdir /tmp/dest
# debootstrap --variant=buildd --include=fakeroot,build-essential \
  --arch=sparc --foreign sid /tmp/dest http://ftp.de.debian.org/debian
# cp -p /usr/bin/qemu-sparc32plus-static /tmp/dest/usr/bin/
# chroot /tmp/dest ./debootstrap/debootstrap --second-stage
qemu: Unsupported syscall: 210

... then debootstrap hangs while eating 100% CPU. Running strace on
that process shows

    mprotect(0x4002c000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
    rt_sigreturn(0)                         = 0
    mprotect(0x4002c000, 8192, PROT_READ|PROT_EXEC) = 0
    wait4(-1, 0x7fff94e844b0, 0, NULL)      = -1 ECHILD (No child processes)
    --- SIGSEGV (Segmentation fault) @ 0 (0) ---
    mprotect(0x4002c000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
    rt_sigreturn(0)                         = 0
    mprotect(0x4002c000, 8192, PROT_READ|PROT_EXEC) = 0
    wait4(-1, 0x7fff94e844b0, 0, NULL)      = -1 ECHILD (No child processes)

in an endless loop.

That can be reduced to the execution of the 'cat' when using dash, in
other words:

This one fails:
    chroot /tmp/dest/ /bin/sh -c 'cat /etc/debian_version'

This one succeeds:
    chroot /tmp/dest/ /bin/bash -c 'cat /etc/debian_version'

FWIW, changing the default shell to /bin/bash only delays the trouble,
running from inside the sparc chroot:

# umount /proc/
Segmentation fault

Second stage of debootstrap does this at some later point.

Last-minute amendments:

- About binfmt-support below, installing it doesn't change a bit.
- Same problem with /usr/bin/qemu-sparc32plus-static taken from
  qemu-user-static_2.0.0+dfsg-3

    Christoph

[0] http://www.hellion.org.uk/blog/posts/foreign-chroots-with-schroot-and-qemu/

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.10.36 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

qemu-user-static depends on no packages.

Versions of packages qemu-user-static recommends:
pn  binfmt-support  <none>

Versions of packages qemu-user-static suggests:
pn  sudo  <none>

-- no debconf information

Attachment: signature.asc
Description: Digital signature

Reply via email to