arm on qemu and os.TestSeek

83 views
Skip to first unread message

Russ Cox

unread,
Feb 18, 2011, 1:06:51 PM2/18/11
to golang-dev, cap...@gmail.com
I am totally lost.

I installed the qemu-kvm-extras-static package on
my amd64 Ubuntu machine, which arranges with the
kernel to implement exec of an arm binary by invoking
it under qemu-arm-static.

I have been using this for months to run

GOARCH=arm DISABLE_NET_TESTS=1 ./all.bash

despite the fact that I don't have an arm processor
in my laptop. It has worked beautifully.
I believe it worked just a few days ago.

Today it doesn't work anymore: the os.TestSeek test
fails trying to do a 64-bit seek. It is as if only the low
32 bits of the seek are returned by qemu. Running the
qemu-arm-static command under strace, I can see
qemu do the seek with the correct (big) argument and
get the correct (big) response. That seems to imply
that the response is either not getting delivered to the
running arm binary correctly or that the running arm binary
is not interpreting it correctly.

I first noticed this in a client with many pending, related
changes, so I suspected my code. However, now I have
tried it in other, clean clients, even at revision points at which
I believe I ran all.bash this way successfully in the past, like:

changeset: 6972:d490173c433e
user: Russ Cox <r...@golang.org>
date: Wed Dec 15 14:57:49 2010 -0800
summary: 5l: fix arm build

Everything I have tried dies in the os.TestSeek test.

I have tried two different machines, one Lucid and
one Maverick. I have confirmed that the machines
are not running recently upgraded kernels, nor do they
have recently upgraded qemu-kvm-extras-static
packages installed.

Any ideas what might be going on? Has anyone
else run all.bash this way? Does it work today?
Do you get errors in TestSeek?

Thanks.
Russ

Martin Capitanio

unread,
Feb 18, 2011, 7:39:16 PM2/18/11
to golang-dev
On Feb 18, 7:06 pm, Russ Cox <r...@google.com> wrote:
> I am totally lost.
>
> I installed the qemu-kvm-extras-static package on
> my amd64 Ubuntu machine, which arranges with the
> kernel to implement exec of an arm binary by invoking
> it under qemu-arm-static.
>
> I have been using this for months to run
>
>     GOARCH=arm DISABLE_NET_TESTS=1 ./all.bash

Me too. Additionally I don't understand how could you ever pass the
rpc
or websocket test without an epoll support ( issue 1508 )

I tried ubuntu qemu-arm-static, qemu-arm with or without binfmt,
even fedora14 with newer qemu 0.13.0 and the results were
the same: rpc, websocket and os tests never passed.

Out of curiosity, can you try:
cd pkg/rpc/ && gotest

file 5.out
5.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically
linked, stripped

./5.out
Unsupported setsockopt level=41 optname=26
qemu: Unsupported syscall: 250
Start pollServer: epoll_create: function not implemented

Martin

Eoghan Sherry

unread,
Feb 18, 2011, 9:59:51 PM2/18/11
to Russ Cox, golang-dev, cap...@gmail.com
It's qemu mucking things up. The _llseek
syscall from the arm guest is implemented as
an lseek on the amd64 host and the result of the
lseek is stored in an int32 before it's stored in the
int64 supplied to _llseek.

Attached is a patch for the qemu-kvm package
on Lucid which fixes the problem and allows
os.TestSeek to pass.

Hope this helps.
Eoghan

x86-64-llseek.patch

Gustavo Niemeyer

unread,
Feb 19, 2011, 10:13:18 AM2/19/11
to Eoghan Sherry, Russ Cox, golang-dev, cap...@gmail.com

I've opened a bug to track this problem:

https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/721801

I'll try to get some packages with the fix applied for testing/use meanwhile.

--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/blog
http://niemeyer.net/twitter

Gustavo Niemeyer

unread,
Feb 19, 2011, 12:33:30 PM2/19/11
to Russ Cox, Eoghan Sherry, golang-dev
> I've opened a bug to track this problem:
>
> https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/721801
>
> I'll try to get some packages with the fix applied for testing/use meanwhile.

Packages with the suggested patch applied are available in my PPA:

sudo add-apt-repository ppa:niemeyer/ppa
sudo apt-get upgrade

Note that these packages will be upgraded if new official versions are released.

Please let me know if they fix the problem for you.

Eoghan Sherry

unread,
Feb 20, 2011, 2:58:58 PM2/20/11
to Gustavo Niemeyer, Russ Cox, golang-dev, cap...@gmail.com
On 19 February 2011 10:13, Gustavo Niemeyer <gus...@niemeyer.net> wrote:
> I've opened a bug to track this problem:
>
> https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/721801
>

Thanks for pushing the issue to launchpad.

Cheers,
Eoghan

Peter Maydell

unread,
Feb 22, 2011, 8:15:28 AM2/22/11
to golang-dev
On Feb 19, 12:39 am, Martin Capitanio <m...@capitanio.org> wrote:
> Me too. Additionally I don't understand how could you ever pass the
> rpc or websocket test without an epoll support ( issue 1508 )
>
> I tried ubuntu qemu-arm-static, qemu-arm with or without binfmt,
> even fedora14 with newer qemu 0.13.0 and the results were
> the same: rpc, websocket and os tests never passed.

Just FYI, we've just implemented the epoll syscalls in
upstream qemu:
http://git.qemu.org/qemu.git/commit/?id=0899965
https://bugs.launchpad.net/qemu-linaro/+bug/644961

So that's not in 0.14 but will be in 0.15, or you could
build from upstream source if you like living on the
bleeding edge.

-- PMM

Russ Cox

unread,
Feb 22, 2011, 11:56:30 AM2/22/11
to Peter Maydell, golang-dev
Thanks everyone. Maybe my memory is going and it never worked.
I'm happy to see the qemu fixes getting pushed upstream.

Russ

Gustavo Niemeyer

unread,
Feb 23, 2011, 1:43:02 PM2/23/11
to r...@golang.org, Peter Maydell, golang-dev
> Thanks everyone.  Maybe my memory is going and it never worked.
> I'm happy to see the qemu fixes getting pushed upstream.

This may also be of interest to those pushing the arm support:

---------- Forwarded message ----------
From: Steve Langasek <steve.l...@ubuntu.com>
Date: Thu, Jan 27, 2011 at 20:53
Subject: qemu in natty
To: ubuntu...@lists.ubuntu.com


Hi folks,

The qemu-kvm package in natty is in good shape for KVM users, but doesn't
work very well for anyone who wants to use it for emulation of non-x86
architectures.

A couple weeks ago I sat down with the Linaro toolchain engineers and the
Ubuntu server team to talk through how we can fix this without disrupting
the KVM support, given that most of the work for supporting other targets of
interest (e.g., ARM) is done on a very different upstream branch from the
qemu-kvm branch.  We think we've come up with a plan for how to do this:

 - A new source package, qemu-linaro, will be uploaded to natty that is
  based on the monthly Linaro releases of qemu.  These releases are derived
  from the maemo qemu branch, with Linaro-sourced ARM fixes added on top.
  This package is not going to work very well for x86 targets; will work
  very well for ARM targets; and should be no worse than qemu-kvm for other
  targets.

 - qemu-linaro will build a set of qemu-{system,user,user-static} packages,
  based off the existing qemu packaging in Debian; these packages will ship
  the corresponding qemu binaries for all targets other than x86 which will
  remain separated out in qemu-kvm.

 - Bug reports for ARM emulation will be fielded by the Linaro toolchain
  working group.  There is no committment from the Linaro TC WG to address
  bugs in other emulation targets, beyond forwarding them upstream.  (This
  is no worse than how things stand currently.)

 - qemu-kvm-extras and qemu-kvm-extras-static will become dummy transition
  packages provided by qemu-linaro and depending on the new packages.

If anyone has any comments or concerns with this plan, please shout!

Thanks,
--
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slan...@ubuntu.com                                     vor...@debian.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIVAwUBTUH3QVaNMPMhshM9AQhPZhAAkF1EXLsse3PLt1683ey27dhGiXJ5VDAE
QAh5hmbmz2/yjctduVqvCB7//QOg5FZJteqQ0YzbO+OnN0IN0xVi9pPVdRoEEfoj
wDLgkc5FC15f06VWSyGi/TAeleXlUwRf3xtBdK1yZhJJnAgmHq5rx30X0HtFk/dx
jFl7KqbClvRH405dwgzpqPR+vFeytEqP8f9InVyZm1ayBNo/JeIdP8w/xPE7j3I7
Ulv/p60FHRBS/ftDk9haaY880+M6NbVsKda5sOzm5JLhp+k33Mp3skyucY+17Bsh
08/t34foGqcmGYvrSQKju4bxOqSGtIhLVDGNvUJn0eitqwqbsTU1wG8GaRMCy+Ue
ezFxU3OMkrayljebvAi2Zthekl29dcNK3WzhDdCy1Rg+9rwDY6na0pZIYddADRVB
3+eUlgep3oA+3rI13ndS7xwQ5ngfzSPfDAFG/JJHeXawSx+9yYAaBEZS4P3kZuSX
PAJ+DrAD6lvz89udVUS4PnQdgVrnJsLeV+c6yCZqHGLEiPFXEt3HCtQO1bVgeBTe
kfgeCAZLfkBIx9fSkgIHF4CEpN4zt+KmX/E+Yo6t+y7UWOWQolqQCz79IPFWZeTG
Cc5WYjNQnnf8m7YJPf+NJBv0oFbsyTRrUTqUwl0vU8PMMujaFTo6Py45evShmfTA
KlFhBK6aKIk=
=AMNv
-----END PGP SIGNATURE-----

--
ubuntu-devel mailing list
ubuntu...@lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel

Reply all
Reply to author
Forward
0 new messages