qemu-system-arm can not handle more than 256M in versatile machine mode using the -m option

Bug #570588 reported by sam tygier on 2010-04-27
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
qemu-linaro (Ubuntu)
Low
Unassigned
rootstock (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: rootstock

i am trying to build an ubuntu lucid image for a beagleboard. the image boots, but i cant log in. when i inspected the image i found that there was not entry for my username in /etc/passwd.

i used the following script to run rootstock:
PACKAGES="ubuntu-minimal,linux-firmware,wireless-tools,usbutils"
PACKAGES+=",openssh-server,denyhosts,rsync"
PACKAGES+=",vim,wget,bash-completion,screen"
PACKAGES+=",mpd,alsa-utils,pulseaudio,pulseaudio-module-zeroconf"
PACKAGES+=",rtorrent"

sudo rootstock \
--fqdn beagleboard \
--login sam --password temppwd \
--imagesize 4G \
--seed $PACKAGES \
--dist lucid \
--serial ttyS2 \
--script fixup.sh \
--components "main universe multiverse" \
--kernel-image http://rcn-ee.net/deb/kernel/beagle/lucid/v2.6.32.11-l13/linux-image-2.6.32.11-l13_1.0lucid_armel.deb

i spotted the following error message in the rootstock output:
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
I: Virtual Machine done
I: Creating tarball from rootfs
I: Mounting temporary Image
/usr/bin/rootstock: line 195: 13642 Segmentation fault qemu-system-arm $QEMUOPTS -append "${APPEND}" > $QEMUFIFO 2>&1
I: ARM rootfs created as /data/beagleboard/ubuntu-lucid/build/armel-rootfs-201004270934.tgz
I: Extracting vmlinuz from *.deb
cp: cannot stat `/tmp/tmp.7KG74k1ImH/tmpmount/boot/initrd.img-*': No such file or directory

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: rootstock 0.1.99.3-0ubuntu1
Uname: Linux 2.6.34-020634rc5-generic x86_64
Architecture: amd64
Date: Tue Apr 27 10:01:18 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_GB.utf8
SourcePackage: rootstock

sam tygier (samtygier) wrote :
Oliver Grawert (ogra) wrote :

can you also attache "fixup.sh" ?

sam tygier (samtygier) wrote :

based on Robert Nelson's with a few extra lines

Oliver Grawert (ogra) wrote :

hmm, it seems to die in (or at least not proceed to) $KERNEL_IMG_CMD
possibly due to bashisms in setup_kernel_image() (i need to fix that)
that in turn seems to make the VM not exit properly...
can you try to change /bin/sh at the top of rootstock to /bin/bash and see if the segfault still shows up with the same commandline ?

sam tygier (samtygier) wrote :

i still get the segfault after changing rootstock to use /bin/bash

sam tygier (samtygier) wrote :

i tried putting a 'set -e' in the script that goes to $BUILDDIR/installer to see if that would give any clues.

i now get:
I: Downloading kernel image (deb) from external site
I: linux-image-2.6.32.11-l13_1.0lucid_armel.deb download complete
I: Setting up serial tty in image
I: Getting Virtual Machine kernel from the server
I: Switching to Virtual Machine for second stage processing
arm_sysctl_write: Bad register offset 0x0
arm_sysctl_write: Bad register offset 0x4
arm_sysctl_write: Bad register offset 0x24
arm_sysctl_write: Bad register offset 0x48
arm_sysctl_write: Bad register offset 0x58
arm_sysctl_write: Bad register offset 0x5c
arm_sysctl_write: Bad register offset 0x60
arm_sysctl_write: Bad register offset 0x78
...
vpb_sic_write: Bad register offset 0xff4
vpb_sic_write: Bad register offset 0xff8
vpb_sic_write: Bad register offset 0xffc
qemu: hardware error: pl181_write: Bad offset 10
CPU #0:
R00=fff03010 R01=00000fc0 R02=00000000 R03=00000000
R04=fff03000 R05=beffffed R06=c08490a0 R07=fff07ffc
R08=cf9e7de0 R09=cf9f6fb8 R10=cf9e7de0 R11=cf81fd8c
R12=00000000 R13=cf81fd74 R14=00000000 R15=c02286a0
PSR=20000013 --C- A svc32
I: Virtual Machine done
I: Creating tarball from rootfs
I: Mounting temporary Image
I: ARM rootfs created as /data/beagleboard/ubuntu-lucid/build/armel-rootfs-201004272013.tgz
I: Extracting vmlinuz from *.deb
cp: cannot stat `/tmp/tmp.6OijUUivi8/tmpmount/boot/initrd.img-*': No such file or directory

maybe this is intersting

sam tygier (samtygier) wrote :

apport picked up the crash this time
Bug #571432

sam tygier (samtygier) wrote :

i think i have found trigger. i had increased the memory option in QEMUOPTS to 512. if i set it back to 256 it completes successfully.

i think i crashes before i increases it, so maybe there is more to it that this.

sam tygier (samtygier) wrote :

so with the above command it will crash with 256 or 512.

but with a minimal build ( rootstock --fqdn beagleboard --login ubuntu --password temppwd --imagesize 2G --dist lucid --script fixup.sh --serial ttyS2 --kernel-image http://rcn-ee.net/deb/kernel/beagle/lucid/v2.6.32.7-l7.1/linux-image-2.6.32.7-l7.1_1.0lucid_armel.deb ) 256 works, and 512 crashes.

Mathias Gug (mathiaz) on 2010-05-18
Changed in qemu-kvm (Ubuntu):
importance: Undecided → Low
Arvind Singh (aaroh) wrote :

I have a similar issue,

I: Virtual Machine done
I: Creating tarball from rootfs
I: Mounting temporary Image
/usr/bin/rootstock: line 195: 29713 Segmentation fault qemu-system-arm $QEMUOPTS -append "${APPEND}" > $QEMUFIFO 2>&1
I: ARM rootfs created as /home/asingh/test/armel-rootfs-201006031142.tgz
I: Extracting vmlinuz from *.deb
cp: cannot stat `/tmp/tmp.UeWoUGFQpZ/tmpmount/boot/initrd.img-*': No such file or directory

Minimal build works ok.
My command:

sudo rootstock --fqdn beagleboard --login ubuntu --password beagle --imagesize 4G --swapsize 512 --components "main,universe,multiverse" --seed openssh-server,build-essential,apache2,postgresql-server-dev-8.4,postgresql-contrib,sqlite3,libsqlite3-dev --dist lucid --serial ttyS2 --kernel-image http://rcn-ee.net/deb/kernel/beagle/lucid/v2.6.32.11-l13/linux-image-2.6.32.11-l13_1.0lucid_armel.deb

Oliver Grawert (ogra) wrote :

please note that swapsize uses a swapfile while this bug is about changed options for the ram of the VM (not the swap)

Arvind Singh (aaroh) wrote :

My mistake I did change the RAM size, I can now consistently reproduce this.

Oliver Grawert (ogra) on 2010-06-04
summary: - /usr/bin/rootstock: line 195: 13642 Segmentation fault qemu-system-arm
- $QEMUOPTS -append "${APPEND}" > $QEMUFIFO 2>&1
+ qemu-system-arm can not handle more than 256M in versatile machine mode
+ using the -m option
Changed in rootstock (Ubuntu):
status: New → Invalid
Changed in qemu-kvm (Ubuntu):
status: New → Confirmed
Matteo Mattei (matteo-mattei) wrote :

Ubuntu Lucid

qemu 0.12.3+noroms-0ubuntu9.2
qemu-arm-static 0.12.3+noroms-0ubuntu9.2
qemu-common 0.12.3+noroms-0ubuntu9.2
qemu-kvm 0.12.3+noroms-0ubuntu9.2
qemu-kvm-extras 0.12.3+noroms-0ubuntu9.2
qemu-kvm-extras-static 0.12.3+noroms-0ubuntu9.2
qemu-launcher 1.7.4-1ubuntu2
qemubuilder 0.61
rootstock 0.1.99.3-0ubuntu1

I have the same error:

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for initramfs-tools ...
Processing triggers for python-support ...
/usr/bin/rootstock: line 282: 6890 Segmentation fault qemu-system-arm $QEMUOPTS -append "${APPEND}" > $QEMUFIFO 2>&1
I: Virtual Machine done
I: Creating tarball from rootfs
I: Mounting temporary Image
I: ARM rootfs created as /home/spot/test/armel-rootfs-201007121038.tgz
I: Cleaning up...
.....
I: A logfile was saved as /home/spot/test/rootstock-201007121038.log
I: done ...

This is my command line:

sudo rootstock -f NGP --seed setserial,openssh-server,ubuntu-minimal -i 1G --serial ttyS2 --doswap --swapsize 256 --restore-package-cache

Any idea how to solve/workaround this?

Dustin Kirkland  (kirkland) wrote :

Moving this bug over to qemu-linaro, since it now provides qemu-system-arm.

affects: qemu-kvm (Ubuntu) → qemu-linaro (Ubuntu)
Peter Maydell (pmaydell) wrote :

The physical memory map on versatile hardware does not allow more than 256MB of space for RAM. The bug here is just that qemu should exit with a helpful error message (or maybe clip the requested memory size to the maximum) rather than crashing.

Peter Maydell (pmaydell) wrote :

I wrote:
"The physical memory map on versatile hardware does not allow more than 256MB of space for RAM. The bug here is just that qemu should exit with a helpful error message"

...and I've just submitted the following two patches upstream which implement this:

http://patchwork.ozlabs.org/patch/87807/
http://patchwork.ozlabs.org/patch/87806/

so passing '-M versatilepb -m 512' to qemu-system-arm results in it failing cleanly with the message:
qemu: maximum permitted RAM size for 'versatilepb' is 256M

Cerin (chrisspen) wrote :

This bug essentially makes it impossible to emulate the Raspberry Pi. I can get the VM running, but as most software expects 1GB of memory, many operations fail when they run out of memory.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers