UncleVan
Posts: 16
Joined: Fri Dec 28, 2012 7:43 pm

qemu-system-arm: "Segmentation fault"

Tue Jan 01, 2013 2:04 pm

(apologize IF off-topic here; pls point me to the right forum then...)

I try to start with qemu the latest (as for now) 2012-12-16-wheezy-raspbian.img and get the same error over and over again at the end of the kernel boot:

Code: Select all

..... (lots of boot messages)
....
VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
devtmpfs: mounted
Freeing init memory: 144K
Segmentation fault
I tried almost every qemu-patched arm kernel I found around with google and the result is always he same.
Because the message appears just when user space gets started (/sbin/init etc) I suspect something about the EABI/AEABI.
I also tried different appends on the qemu command line, "init=/bin/bash" and the like - to the same...
The worst case would be a bug in qemu itself.

Anyone with similar expetience ? Any help is *highly* appreciated.

Here the scenario
=============================
Gentoo based Linux:

Code: Select all

sys-kernel/gentoo-sources-3.5.7
app-emulation/qemu-1.1.2-r2
Command:

Code: Select all

qemu-system-arm -cpu arm1176 -M versatilepb -nographic -kernel /media/VIRTUALS/kernel-qemu  -hda /media/VIRTUALS/2012-12-16-wheezy-raspbian.img  -append "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait"

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5879
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: qemu-system-arm: "Segmentation fault"

Tue Jan 01, 2013 3:40 pm

have you tried building qemu from git yourself (not using portage)?

UncleVan
Posts: 16
Joined: Fri Dec 28, 2012 7:43 pm

Re: qemu-system-arm: "Segmentation fault"

Tue Jan 01, 2013 6:59 pm

Thank you for the quick responce !

uuuehmm - why this ?
I could of course build it from source - what would be the benefit resp. what should I configure different then in portage ? Do you have some suspicion about qemu ? Or some patch ?
It is also interresting to know if someone else have the same failure ( - pls share ...)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5879
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: qemu-system-arm: "Segmentation fault"

Tue Jan 01, 2013 7:20 pm

Because I don't think the problem is with your kernel (wouldn't cause a seg fault) and I don't think it can be anything other than your qemu build. I don't know what could possibly be wrong, since gentoo should do essentially the same thing as building it yourself, I am grasping at straws.

I have written a guide, but it's pretty straight forward anyway:
http://xecdesign.com/compiling-qemu/

And I suspect that you're using this kernel already anyway, but just incase, you can also grab a kernel here:
http://xecdesign.com/qemu-emulating-ras ... -easy-way/

Anyway, enough shameless self promotion. If that doesn't work, I think you'll have to use a debugger or a trace of some sort to figure out where and why it's segfaulting.

UncleVan
Posts: 16
Joined: Fri Dec 28, 2012 7:43 pm

Re: qemu-system-arm: "Segmentation fault"

Wed Jan 02, 2013 2:36 pm

You right - been there seen that .... Nevertheless it is nice when someone like you is taking - yours - time to respond.
Ill give your advise a try - but this will take time, too. Meanwhile I still hope someone else share his experience ...
Thanks so far !

UncleVan
Posts: 16
Joined: Fri Dec 28, 2012 7:43 pm

Re: qemu-system-arm: "Segmentation fault"

Wed Jan 02, 2013 11:01 pm

Yesssss ShiftPlusOne ! You are (damn) right - It IS qemu-system-arm .
I got the recent stable version from http://git.qemu-project.org/qemu.git (stable-1.2) built it with

Code: Select all

./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --enable-tcg-interpreter --prefix=/opt
and then

Code: Select all

./arm-softmmu/qemu-system-arm -kernel kernel-qemu -append "console=ttyAMA0 root=/dev/sda2" -hda 2012-12-16-wheezy-raspbian.img -M versatilepb -cpu arm1176 -nographic
did the miracle .
May I ask you to post you ./configure command for qemu ? - If any different.
Thank you once more for the help.

Im getting slightly tired from posting bugs around...

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5879
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: qemu-system-arm: "Segmentation fault"

Thu Jan 03, 2013 7:16 am

Ah, that's good to hear.

Your configure string is fine, The important stuff is enabled by default anyway.

Return to “Bare metal, Assembly language”