qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1052857] [NEW] qemu-user compiled static for ppc fails
@ 2012-09-19 10:51 Erik de Castro Lopo
  2013-01-01  6:56 ` [Qemu-devel] [Bug 1052857] " Samuel Seay
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Erik de Castro Lopo @ 2012-09-19 10:51 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

On debian I used debootstrap to set up a powerpc chroot. If I then copy
in a statically linked qemu-user ppc binary it will work for some
commands in the chroot and fail for others. Steps to reproduce:

host$ mkdir powerpc
host$ sudo debootstrap --arch=powerpc --foreign wheezy powerpc http://ftp.debian.org/debian
host$ sudo cp /usr/bin/qemu-ppc-static powerpc/usr/bin/
host$  LANG=C sudo chroot powerpc /usr/bin/qemu-ppc-static /bin/bash
I have no name!@guest:/# pwd
/
I have no name!@guest:/# cd home/
I have no name!@guest:/home# ls
qemu-ppc-static: /tmp/buildd/qemu-1.1.2+dfsg/linux-user/signal.c:4341: setup_frame: Assertion `({ unsigned long __guest = (unsigned long)(ka->_sa_handler) - guest_base; (__guest < (1ul << 32)) && (!reserved_va || (__guest < reserved_va)); })' failed.

I have also built this from the git HEAD sources (hash
6b80f7db8a7f84d21e46d01e30c8497733bb23a0) and I get the same result.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1052857

Title:
  qemu-user compiled static for ppc fails

Status in QEMU:
  New

Bug description:
  On debian I used debootstrap to set up a powerpc chroot. If I then
  copy in a statically linked qemu-user ppc binary it will work for some
  commands in the chroot and fail for others. Steps to reproduce:

  host$ mkdir powerpc
  host$ sudo debootstrap --arch=powerpc --foreign wheezy powerpc http://ftp.debian.org/debian
  host$ sudo cp /usr/bin/qemu-ppc-static powerpc/usr/bin/
  host$  LANG=C sudo chroot powerpc /usr/bin/qemu-ppc-static /bin/bash
  I have no name!@guest:/# pwd
  /
  I have no name!@guest:/# cd home/
  I have no name!@guest:/home# ls
  qemu-ppc-static: /tmp/buildd/qemu-1.1.2+dfsg/linux-user/signal.c:4341: setup_frame: Assertion `({ unsigned long __guest = (unsigned long)(ka->_sa_handler) - guest_base; (__guest < (1ul << 32)) && (!reserved_va || (__guest < reserved_va)); })' failed.

  I have also built this from the git HEAD sources (hash
  6b80f7db8a7f84d21e46d01e30c8497733bb23a0) and I get the same result.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1052857/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails
  2012-09-19 10:51 [Qemu-devel] [Bug 1052857] [NEW] qemu-user compiled static for ppc fails Erik de Castro Lopo
@ 2013-01-01  6:56 ` Samuel Seay
  2013-01-02  0:10   ` Peter Maydell
  2013-01-01 17:08 ` [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails on 64bit hosts Samuel Seay
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Samuel Seay @ 2013-01-01  6:56 UTC (permalink / raw)
  To: qemu-devel

I ran into this issue also and did a bit of investigating. This is only
an issue when ran on a 64bit host. The actual problem line is

err |= __put_user(h2g(ka->_sa_handler), &sc->handler);

inside of linux_user/signal.c. What I am unsure of is when the h2g()
macro, the cause of the assert, is valid to be used. In this case, under
64bit, GUEST_BASE has a value (32bit it is 0) but ka->_sa_handler has a
low value. Assuming that the low value is a direct result of being a
guest address and not a host address then the h2g() shouldn't be called.

I removed the macro from that line which kept the assert from appearing
but qemu still died after running 'ls'. I am attempting to fix this bug
but I have limited understanding of qemu itself so no promises of me
doing a fix, let alone a proper fix.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1052857

Title:
  qemu-user compiled static for ppc fails

Status in QEMU:
  New

Bug description:
  On debian I used debootstrap to set up a powerpc chroot. If I then
  copy in a statically linked qemu-user ppc binary it will work for some
  commands in the chroot and fail for others. Steps to reproduce:

  host$ mkdir powerpc
  host$ sudo debootstrap --arch=powerpc --foreign wheezy powerpc http://ftp.debian.org/debian
  host$ sudo cp /usr/bin/qemu-ppc-static powerpc/usr/bin/
  host$  LANG=C sudo chroot powerpc /usr/bin/qemu-ppc-static /bin/bash
  I have no name!@guest:/# pwd
  /
  I have no name!@guest:/# cd home/
  I have no name!@guest:/home# ls
  qemu-ppc-static: /tmp/buildd/qemu-1.1.2+dfsg/linux-user/signal.c:4341: setup_frame: Assertion `({ unsigned long __guest = (unsigned long)(ka->_sa_handler) - guest_base; (__guest < (1ul << 32)) && (!reserved_va || (__guest < reserved_va)); })' failed.

  I have also built this from the git HEAD sources (hash
  6b80f7db8a7f84d21e46d01e30c8497733bb23a0) and I get the same result.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1052857/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails on 64bit hosts
  2012-09-19 10:51 [Qemu-devel] [Bug 1052857] [NEW] qemu-user compiled static for ppc fails Erik de Castro Lopo
  2013-01-01  6:56 ` [Qemu-devel] [Bug 1052857] " Samuel Seay
@ 2013-01-01 17:08 ` Samuel Seay
  2013-01-02  5:08 ` Samuel Seay
  2016-05-23 20:04 ` thh
  3 siblings, 0 replies; 6+ messages in thread
From: Samuel Seay @ 2013-01-01 17:08 UTC (permalink / raw)
  To: qemu-devel

** Summary changed:

- qemu-user compiled static for ppc fails
+ qemu-user compiled static for ppc fails on 64bit hosts

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1052857

Title:
  qemu-user compiled static for ppc fails on 64bit hosts

Status in QEMU:
  New

Bug description:
  On debian I used debootstrap to set up a powerpc chroot. If I then
  copy in a statically linked qemu-user ppc binary it will work for some
  commands in the chroot and fail for others. Steps to reproduce:

  host$ mkdir powerpc
  host$ sudo debootstrap --arch=powerpc --foreign wheezy powerpc http://ftp.debian.org/debian
  host$ sudo cp /usr/bin/qemu-ppc-static powerpc/usr/bin/
  host$  LANG=C sudo chroot powerpc /usr/bin/qemu-ppc-static /bin/bash
  I have no name!@guest:/# pwd
  /
  I have no name!@guest:/# cd home/
  I have no name!@guest:/home# ls
  qemu-ppc-static: /tmp/buildd/qemu-1.1.2+dfsg/linux-user/signal.c:4341: setup_frame: Assertion `({ unsigned long __guest = (unsigned long)(ka->_sa_handler) - guest_base; (__guest < (1ul << 32)) && (!reserved_va || (__guest < reserved_va)); })' failed.

  I have also built this from the git HEAD sources (hash
  6b80f7db8a7f84d21e46d01e30c8497733bb23a0) and I get the same result.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1052857/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails
  2013-01-01  6:56 ` [Qemu-devel] [Bug 1052857] " Samuel Seay
@ 2013-01-02  0:10   ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2013-01-02  0:10 UTC (permalink / raw)
  To: Bug 1052857; +Cc: qemu-devel, Alexander Graf

On 1 January 2013 06:56, Samuel Seay <lightningth@gmail.com> wrote:
> I ran into this issue also and did a bit of investigating. This is only
> an issue when ran on a 64bit host. The actual problem line is
>
> err |= __put_user(h2g(ka->_sa_handler), &sc->handler);
>
> inside of linux_user/signal.c. What I am unsure of is when the h2g()
> macro, the cause of the assert, is valid to be used.

Strongly suspect that (PPC-specific) code is just busted -- no other guest
architecture's signal handling code does an h2g on ka->_sa_handler,
because it's a guest address already.

cc'ing our PPC maintainer :-)

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails on 64bit hosts
  2012-09-19 10:51 [Qemu-devel] [Bug 1052857] [NEW] qemu-user compiled static for ppc fails Erik de Castro Lopo
  2013-01-01  6:56 ` [Qemu-devel] [Bug 1052857] " Samuel Seay
  2013-01-01 17:08 ` [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails on 64bit hosts Samuel Seay
@ 2013-01-02  5:08 ` Samuel Seay
  2016-05-23 20:04 ` thh
  3 siblings, 0 replies; 6+ messages in thread
From: Samuel Seay @ 2013-01-02  5:08 UTC (permalink / raw)
  To: qemu-devel

I just submitted a patch to the dev mailing list. Just in case there is
an issue with the submitted patch, or if Erik wants it sooner, I
attached the patch I submitted.

** Patch added: "0001-Change-to-correct-PowerPC-on-64bit-host.patch"
   https://bugs.launchpad.net/qemu/+bug/1052857/+attachment/3472367/+files/0001-Change-to-correct-PowerPC-on-64bit-host.patch

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1052857

Title:
  qemu-user compiled static for ppc fails on 64bit hosts

Status in QEMU:
  New

Bug description:
  On debian I used debootstrap to set up a powerpc chroot. If I then
  copy in a statically linked qemu-user ppc binary it will work for some
  commands in the chroot and fail for others. Steps to reproduce:

  host$ mkdir powerpc
  host$ sudo debootstrap --arch=powerpc --foreign wheezy powerpc http://ftp.debian.org/debian
  host$ sudo cp /usr/bin/qemu-ppc-static powerpc/usr/bin/
  host$  LANG=C sudo chroot powerpc /usr/bin/qemu-ppc-static /bin/bash
  I have no name!@guest:/# pwd
  /
  I have no name!@guest:/# cd home/
  I have no name!@guest:/home# ls
  qemu-ppc-static: /tmp/buildd/qemu-1.1.2+dfsg/linux-user/signal.c:4341: setup_frame: Assertion `({ unsigned long __guest = (unsigned long)(ka->_sa_handler) - guest_base; (__guest < (1ul << 32)) && (!reserved_va || (__guest < reserved_va)); })' failed.

  I have also built this from the git HEAD sources (hash
  6b80f7db8a7f84d21e46d01e30c8497733bb23a0) and I get the same result.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1052857/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails on 64bit hosts
  2012-09-19 10:51 [Qemu-devel] [Bug 1052857] [NEW] qemu-user compiled static for ppc fails Erik de Castro Lopo
                   ` (2 preceding siblings ...)
  2013-01-02  5:08 ` Samuel Seay
@ 2016-05-23 20:04 ` thh
  3 siblings, 0 replies; 6+ messages in thread
From: thh @ 2016-05-23 20:04 UTC (permalink / raw)
  To: qemu-devel

As far as I can see, the fix has been included here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=beb526b12134a6b674
... so closing this ticket now.

** Changed in: qemu
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1052857

Title:
  qemu-user compiled static for ppc fails on 64bit hosts

Status in QEMU:
  Fix Released

Bug description:
  On debian I used debootstrap to set up a powerpc chroot. If I then
  copy in a statically linked qemu-user ppc binary it will work for some
  commands in the chroot and fail for others. Steps to reproduce:

  host$ mkdir powerpc
  host$ sudo debootstrap --arch=powerpc --foreign wheezy powerpc http://ftp.debian.org/debian
  host$ sudo cp /usr/bin/qemu-ppc-static powerpc/usr/bin/
  host$  LANG=C sudo chroot powerpc /usr/bin/qemu-ppc-static /bin/bash
  I have no name!@guest:/# pwd
  /
  I have no name!@guest:/# cd home/
  I have no name!@guest:/home# ls
  qemu-ppc-static: /tmp/buildd/qemu-1.1.2+dfsg/linux-user/signal.c:4341: setup_frame: Assertion `({ unsigned long __guest = (unsigned long)(ka->_sa_handler) - guest_base; (__guest < (1ul << 32)) && (!reserved_va || (__guest < reserved_va)); })' failed.

  I have also built this from the git HEAD sources (hash
  6b80f7db8a7f84d21e46d01e30c8497733bb23a0) and I get the same result.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1052857/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-23 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-19 10:51 [Qemu-devel] [Bug 1052857] [NEW] qemu-user compiled static for ppc fails Erik de Castro Lopo
2013-01-01  6:56 ` [Qemu-devel] [Bug 1052857] " Samuel Seay
2013-01-02  0:10   ` Peter Maydell
2013-01-01 17:08 ` [Qemu-devel] [Bug 1052857] Re: qemu-user compiled static for ppc fails on 64bit hosts Samuel Seay
2013-01-02  5:08 ` Samuel Seay
2016-05-23 20:04 ` thh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).