qemu-user-static for sparc32plus : bash: fork: Invalid argument

Bug #1054831 reported by Erik de Castro Lopo
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

On Debian x86-64 host system I setup a sparc chroot using:

host $ mkdir sparc
host $ sudo debootstrap --arch=sparc --foreign wheezy sparc http://ftp.au.debian.org/debian
host $ sudo cp ~/Git/qemu/sparc32plus-linux-user/qemu-sparc32plus sparc/usr/bin/qemu-sparc32plus-static
host $ LANG=C sudo chroot sparc/ /usr/bin/qemu-sparc32plus-static /bin/bash

When I then run the second stage of debootstrap I get:

target $ /debootstrap/debootstrap --second-stage
bash: fork: Invalid argument

The above procedures works perfectly for armhf.

This is with current git HEAD (commit 93b6599734f81328ee3d608f57667742cafeea72).

Revision history for this message
Dillon Amburgey (dillona) wrote :

This is due to QEMU sparc32plus-linux-user not being compiled with NPTL support.

Revision history for this message
Erik de Castro Lopo (erikd) wrote : Re: [Bug 1054831] Re: qemu-user-static for sparc32plus : bash: fork: Invalid argument

Dillon Amburgey wrote:

> This is due to QEMU sparc32plus-linux-user not being compiled with NPTL
> support.

I just check, and NPTL is enabled. I also did this on the binary I
compiled:

    $ strings /usr/bin/qemu-sparc32plus-static | grep nptl
    ../nptl/sysdeps/pthread/createthread.c
    ../nptl/pthread_mutex_lock.c
    nptl-init.c
    ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c

which suggests that it has been compiled with NPTL.

Revision history for this message
Dillon Amburgey (dillona) wrote :

What I mean is that QEMU isn't compiled with guest support for NPTL on every architecture.

If you look in the configure script around line 3900, you'll see some architectures have target_nptl="yes" while others (including sparc) do not.

Unfortunately it looks like the code isn't complete for sparc support, so it isn't a simple matter of enabling it in the configure script.

The reason you get "bash: fork: Invalid argument" is because glibc makes a call to clone() with NPTL arguments that aren't supported.

Revision history for this message
Peter Maydell (pmaydell) wrote :

This bug should be fixed by a combination of:
 * the enable-NPTL-everywhere patchset: http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg02614.html
 * a fix for pipe() on sparc: http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg01072.html
which I hope will make it into QEMU 1.6.

Revision history for this message
Peter Maydell (pmaydell) wrote :

This was fixed years ago...

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.