Skip to contentSkip to conversation

Problem with running machine code specified in the program

Qemu-devel Hans Yang 3 participants 4 messages Aug 30, 2004 – Sep 3, 2004

lore
Share & tools
lore

Hans Yang

author
#0 lore raw

I got "qemu: uncaught target signal 11 (Segmentation fault) - exiting" when running program like that:

typedef int (*native_f)();

typedef struct {

    native_f func;

} ST;

int main()

{

    ST p;

    const int code[1] = {

        0xe1a0f00e  // mov pc, lr

    };

 

    p.func = (native_f)code;

p.func();

return 0;

}

My platform details:

CPU: Intel Pentium 4 2.40G

OS: Fedora Core release 2

Compiler: arm-linux-gcc 2.95.3

Emulator: qemu-arm 0.6.0

#1 lore raw
Quoted 2 lines · Hans Yang

I got "qemu: uncaught target signal 11 (Segmentation fault) - exiting" when running program like that:

Works for me with on i386 Debian Sid with qemu CVS+arm patches. Look in the list archives for my arm patch(es).

Paul

#2 lore raw

cause found for qemu-arm problems on fedora 2 (Re: [Qemu-devel] Problem with running machine code specified in the program)

In reply to Hans Yang
Quoted 2 lines · Hans Yang

I got "qemu: uncaught target signal 11 (Segmentation fault) - exiting" when running program like that:

I was running into this too, and just checked it out. You should do:

1. Run 'setarch i686 qemu-arm' instead of 'qemu-arm'.
2. Downgrade to the original 2.6.5 kernel that came with FC2.

It seems that qemu-arm broke somewhere between fedora's version of 2.6.6 and 2.6.8, their current kernel. I'm trying the intermediate releases right now.

cheers,
Lennert

#3 lore raw

Re: cause found for qemu-arm problems on fedora 2 (Re: [Qemu-devel] Problem with running machine code specified in the program)

Quoted 11 lines · Lennert Buytenhek
Quoted 2 lines

I got "qemu: uncaught target signal 11 (Segmentation fault) - exiting" when running program like that:

I was running into this too, and just checked it out. You should do:

1. Run 'setarch i686 qemu-arm' instead of 'qemu-arm'.
2. Downgrade to the original 2.6.5 kernel that came with FC2.

It seems that qemu-arm broke somewhere between fedora's version of 2.6.6 and 2.6.8, their current kernel. I'm trying the intermediate releases right now.

OK, here are my findings.

I tried qemu-arm from qemu 0.5.5 and from all daily qemu CVS snapshots between 20040504 and 20040901. Of those, there are actually only 16 different qemu-arm binaries (with a distinct md5 sum), so I only used those.

I tried the Fedora Core 2 kernels 2.6.5-1.358 (original), 2.6.6-1.427, 2.6.6-1.435, 2.6.6-1.435.2.1, 2.6.6-1.435.2.3, 2.6.7-1.494.2.2 and 2.6.8-1.521 (the latest.)

On all kernels, you get a sig11 if you run without 'setarch i686'.

If you run with 'setarch i686', kernel 2.6.6-1.435.2.3 still runs everything fine, but 2.6.7-1.494.2.2 breaks all qemu versions except for the 20040519 CVS snapshot. And on the kernel after that, 2.6.8-1.521, all qemu versions are broken. If I then try to set vm.legacy_vm_layout to 1, 20040519 starts working again, but all other snapshots before and after remain broken.

Puzzled.

--L