From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwLgk-0004pJ-AV for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:31:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwLgf-0004nD-T8 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:31:25 -0400 Received: from [199.232.76.173] (port=45776 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwLgf-0004n3-2p for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:31:21 -0400 Received: from rv-out-0708.google.com ([209.85.198.247]:38506) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LwLge-00052b-AL for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:31:20 -0400 Received: by rv-out-0708.google.com with SMTP id c5so883759rvf.22 for ; Tue, 21 Apr 2009 12:31:18 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 21 Apr 2009 12:31:18 -0700 Message-ID: From: Jay Schulist Content-Type: multipart/alternative; boundary=000e0cd2e2d2e9df75046815b042 Subject: [Qemu-devel] qemu-ppc v0.10.2 linux: segfault on all ppc binaries List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --000e0cd2e2d2e9df75046815b042 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I'm using qemu-ppc v0.10.2 on Intel x86 Fedora 11 and I can't get any PPC binaries to work, every binary fails to execute (even hello world) and ends up with a segmentation fault (the crash is included below). I have noticed that every program never seems to get past doing an mmap or mmap2. I'm using a PPC cross-compiler and sys-root made from crosstools-ng's standard powerpc-unknown-linux-gnu configuration. This binary works fine on an actual PPC-linux system, but never using qemu-ppc. I've tried many different combinations of gcc/glibc for the cross-compiler and it hasn't seemed to make any difference. Any help would be greatly appreciated as I'm not sure what to try next to debug this issue. In case it helps, I've included the the crash, qemu version, hello.c program, /proc/cpu output, and gcc -v information. Thank you, Jay Schulist ------------------------- [jschulist@cross-comp2 ~]$ qemu-ppc -strace -L /opt/x-tools8/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu//sys-root ~/hello 17637 brk(0,1074284272,0,1074462048,1074458432,0) = 0x10012000 17637 mmap(0,4096,3,34,-1,0) = 0x42081000 17637 uname(0x4007f120) = 0 17637 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or directory) 17637 open("/etc/ld.so.cache",0,01) = 3 17637 fstat64(3,0x4007ebf0) = 0 17637 mmap(0,86927,1,2,3,0) = 0x42082000 17637 close(3) = 0 Invalid data memory access: 0xf2202008 NIP 4008aea8 LR 4008a9e8 CTR 00000000 XER 00000000 MSR 00006040 HID0 00000000 HF 00006000 idx 0 TB 00000000 00000000 GPR00 000000004209738f 000000004007ec78 0000000000000000 00000000a2382010 GPR04 000000004009c414 0000000000000000 0000000000000002 0000000000000003 GPR08 0000000042082000 00000000f2201ff4 000000004208200b 000000000001538f GPR12 0000000040090764 0000000000000000 00000000400aed10 000000004007ecd8 GPR16 000000004007eee0 000000004007ecdc 000000000000000a 000000004009c24c GPR20 0000000000000000 000000001000022c 0000000000000000 0000000042082000 GPR24 00000000ffffffff 0000000042081000 00000000a2382010 000000009fd1537f GPR28 000000004803ffff 000000002401ffff 00000000400af7c0 0000000042082000 CR 44002002 [ G G - - E - - E ] RES ffffffff FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR 00000000 Segmentation fault [jschulist@cross-comp2 ~]$ qemu-ppc -v qemu-ppc version 0.10.2, Copyright (c) 2003-2008 Fabrice Bellard usage: qemu-ppc [options] program [arguments...] Linux CPU emulator (compiled for ppc emulation) Standard options: -h print this help -g port wait gdb connection to port -L path set the elf interpreter prefix (default=/usr/gnemul/qemu-ppc) -s size set the stack size in bytes (default=524288) -cpu model select CPU (-cpu ? for list) -drop-ld-preload drop LD_PRELOAD for target process -E var=value sets/modifies targets environment variable(s) -U var unsets targets environment variable(s) Debug options: -d options activate log (logfile=/tmp/qemu.log) -p pagesize set the host page size to 'pagesize' -strace log system calls Environment variables: QEMU_STRACE Print system calls and arguments similar to the 'strace' program. Enable by setting to any value. You can use -E and -U options to set/unset environment variables for target process. It is possible to provide several variables by repeating the option. For example: -E var1=val2 -E var2=val2 -U LD_PRELOAD -U LD_DEBUG Note that if you provide several changes to single variable last change will stay in effect. [jschulist@cross-comp2 ~]$ cat hello.c #include int main(void) { printf("hello world\n"); return 0; } [jschulist@cross-comp2 ~]$ /opt/x-tools8/powerpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-gcc -Wall -o hello hello.c [jschulist@cross-comp2 ~]$ file hello hello: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.29, with unknown capability 0x41000000 = 0x11676e75, with unknown capability 0x10000 = 0x90401, not stripped [jschulist@cross-comp2 ~]$ /opt/x-tools8/powerpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-gcc -v Using built-in specs. Target: powerpc-unknown-linux-gnu Configured with: /opt/crosstool-ng/targets/src/gcc-4.3.2/configure --build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu --target=powerpc-unknown-linux-gnu --prefix=/root/x-tools8/powerpc-unknown-linux-gnu --with-sysroot=/root/x-tools8/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu//sys-root --enable-languages=c,c++ --disable-multilib --with-gmp=/root/x-tools8/powerpc-unknown-linux-gnu --with-mpfr=/root/x-tools8/powerpc-unknown-linux-gnu --with-pkgversion=crosstool-NG-svn_trunk@1459 --enable-__cxa_atexit --with-local-prefix=/root/x-tools8/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu//sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace Thread model: posix gcc version 4.3.2 (crosstool-NG-svn_trunk@1459) [jschulist@cross-comp2 ~]$ cat /proc/cpuinfoprocessor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz stepping : 11 cpu MHz : 2333.331 cache size : 4096 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_t sc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow vnmi flexpriority bogomips : 4654.94 clflush size : 64 power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz stepping : 11 cpu MHz : 2333.331 cache size : 4096 KBphysical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_t sc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow vnmi flexpriority bogomips : 4654.75 clflush size : 64 power management: --000e0cd2e2d2e9df75046815b042 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I'm using qemu-ppc v0.10.2 on Intel x86 Fedora 11 and I c= an't get any PPC binaries to work, every binary fails to execute (even = hello world) and ends up with a segmentation fault (the crash is included b= elow).

I have noticed that every program never seems to get past doing an mmap= or mmap2.

I'm using a PPC cross-compiler and sys-root made from= crosstools-ng's standard powerpc-unknown-linux-gnu configuration. This= binary works fine on an actual PPC-linux system, but never using qemu-ppc.= I've tried many different combinations of gcc/glibc for the cross-comp= iler and it hasn't seemed to make any difference.

Any help would be greatly appreciated as I'm not sure what to try n= ext to debug this issue. In case it helps, I've included the the crash,= qemu version, hello.c program, /proc/cpu output, and gcc -v information.
Thank you,

Jay Schulist

-------------------------

= [jschulist@cross-comp2 ~]$ qemu-ppc -strace -L /opt/x-tools8/powerpc-unknow= n-linux-gnu/powerpc-unknown-linux-gnu//sys-root ~/hello

17637 brk(0,= 1074284272,0,1074462048,1074458432,0) =3D 0x10012000

17637 mmap(0,4096,3,34,-1,0) =3D 0x42081000

17637 uname(0x4007f1= 20) =3D 0

17637 access("/etc/ld.so.preload",04) =3D -1 err= no=3D2 (No such file or directory)

17637 open("/etc/ld.so.cache= ",0,01) =3D 3

17637 fstat64(3,0x4007ebf0) =3D 0

17637 mmap(0,86927,1,2,3,0) = =3D 0x42082000

17637 close(3) =3D 0

Invalid data memory acces= s: 0xf2202008

NIP 4008aea8 LR 4008a9e8 CTR 00000000 XER 00000000
=
MSR 00006040 HID0 00000000 HF 00006000 idx 0

TB 00000000 00000000
GPR00 000000004209738f 000000004007ec78 0000000000000000 00000000a2382= 010

GPR04 000000004009c414 0000000000000000 0000000000000002 0000000= 000000003

GPR08 0000000042082000 00000000f2201ff4 000000004208200b 00000000000153= 8f

GPR12 0000000040090764 0000000000000000 00000000400aed10 00000000= 4007ecd8

GPR16 000000004007eee0 000000004007ecdc 000000000000000a 00= 0000004009c24c

GPR20 0000000000000000 000000001000022c 0000000000000000 00000000420820= 00

GPR24 00000000ffffffff 0000000042081000 00000000a2382010 00000000= 9fd1537f

GPR28 000000004803ffff 000000002401ffff 00000000400af7c0 00= 00000042082000

CR 44002002 [ G G - - E - - E ] RES ffffffff

FPR00 0000000000000= 000 0000000000000000 0000000000000000 0000000000000000

FPR04 0000000= 000000000 0000000000000000 0000000000000000 0000000000000000

FPR08 0= 000000000000000 0000000000000000 0000000000000000 0000000000000000

FPR12 0000000000000000 0000000000000000 0000000000000000 00000000000000= 00

FPR16 0000000000000000 0000000000000000 0000000000000000 00000000= 00000000

FPR20 0000000000000000 0000000000000000 0000000000000000 00= 00000000000000

FPR24 0000000000000000 0000000000000000 0000000000000000 00000000000000= 00

FPR28 0000000000000000 0000000000000000 0000000000000000 00000000= 00000000

FPSCR 00000000

Segmentation fault

[jschulist@= cross-comp2 ~]$ qemu-ppc -v

qemu-ppc version 0.10.2, Copyright (c) 2003-2008 Fabrice Bellard
usage: qemu-ppc [options] program [arguments...]

Linux CPU emulator= (compiled for ppc emulation)

Standard options:

-h print this= help

-g port wait gdb connection to port

-L path set the elf interpre= ter prefix (default=3D/usr/gnemul/qemu-ppc)

-s size set the stack si= ze in bytes (default=3D524288)

-cpu model select CPU (-cpu ? for lis= t)

-drop-ld-preload drop LD_PRELOAD for target process

-E var=3Dval= ue sets/modifies targets environment variable(s)

-U var unsets targe= ts environment variable(s)

Debug options:

-d options activate= log (logfile=3D/tmp/qemu.log)

-p pagesize set the host page size to 'pagesize'

-strace= log system calls

Environment variables:

QEMU_STRACE Print sy= stem calls and arguments similar to the

'strace' program. En= able by setting to any value.

You can use -E and -U options to set/unset environment variables
for target process. It is possible to provide several variables

by = repeating the option. For example:

-E var1=3Dval2 -E var2=3Dval2 -U = LD_PRELOAD -U LD_DEBUG

Note that if you provide several changes to single variable

last= change will stay in effect.

[jschulist@cross-comp2 ~]$ cat hello.c<= br>
#include <stdio.h>

int main(void) {

printf("= ;hello world\n");

return 0;

}

[jschulist@cross-comp2 ~]$ /opt/x-tools8/powe= rpc-unknown-linux-gnu/bin/powerpc-unknown-linux-gnu-gcc -Wall -o hello hell= o.c

[jschulist@cross-comp2 ~]$ file hello

hello: ELF 32-bit M= SB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked = (uses shared libs), for GNU/Linux 2.6.29, with unknown capability 0x4100000= 0 =3D 0x11676e75, with unknown capability 0x10000 =3D 0x90401, not stripped=

[jschulist@cross-comp2 ~]$ /opt/x-tools8/powerpc-unknown-linux-gnu/bin/= powerpc-unknown-linux-gnu-gcc -v

Using built-in specs.

Target= : powerpc-unknown-linux-gnu

Configured with: /opt/crosstool-ng/targe= ts/src/gcc-4.3.2/configure --build=3Di386-build_redhat-linux-gnu --host=3Di= 386-build_redhat-linux-gnu --target=3Dpowerpc-unknown-linux-gnu --prefix=3D= /root/x-tools8/powerpc-unknown-linux-gnu --with-sysroot=3D/root/x-tools8/po= werpc-unknown-linux-gnu/powerpc-unknown-linux-gnu//sys-root --enable-langua= ges=3Dc,c++ --disable-multilib --with-gmp=3D/root/x-tools8/powerpc-unknown-= linux-gnu --with-mpfr=3D/root/x-tools8/powerpc-unknown-linux-gnu --with-pkg= version=3Dcrosstool-NG-svn_trunk@1459 --enable-__cxa_atexit --with-local-pr= efix=3D/root/x-tools8/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu//= sys-root --disable-nls --enable-threads=3Dposix --enable-symvers=3Dgnu --en= able-c99 --enable-long-long --enable-target-optspace

Thread model: posix

gcc version 4.3.2 (crosstool-NG-svn_trunk@14= 59)

[jschulist@cross-comp2 ~]$ cat /proc/cpuinfoprocessor : 0
vendor_id : GenuineIntel

cpu family : 6

model : 15

model name : Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz

stepping : 1= 1

cpu MHz : 2333.331

cache size : 4096 KB

physical id = : 0

siblings : 2

core id : 0

cpu cores : 2

apicid : 0

initial apicid : 0

fdiv_bug : no

hlt_bug : = no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_ex= ception : yes

cpuid level : 10

wp : yes

flags : fpu vm= e de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts a= cpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_t

sc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx smx est tm2 ssse= 3 cx16 xtpr pdcm lahf_lm tpr_shadow vnmi flexpriority

bogomips : 465= 4.94

clflush size : 64

power management:

processor : 1=

vendor_id : GenuineIntel

cpu family : 6

model : 15
model name : Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz

stepping : = 11

cpu MHz : 2333.331

cache size : 4096 KBphysical id : 0

siblings : 2

core id : 1

cpu cores : 2

apicid : 1<= br>
initial apicid : 1

fdiv_bug : no

hlt_bug : no

f= 00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : y= es

cpuid level : 10

wp : yes

flags : fpu vme de pse tsc msr = pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse = sse2 ss ht tm pbe nx lm constant_t

sc arch_perfmon pebs bts pni dtes= 64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow v= nmi flexpriority

bogomips : 4654.75

clflush size : 64

power management: --000e0cd2e2d2e9df75046815b042--