[Qemu-discuss] qemu-i386 segfault on amd64 NetBSD

2016-12-22 Thread r0ller
Hi All,

As mentioned in the subject, I'm trying to get qemu-i386 (from qemu-2.7.0) 
user space emulation working on an amd64 NetBSD (7.0). Unfortunately, even 
giving a try to a 32bit binary printing "hello world" gives a segfault. 
Hopefully, it's me who's doing something wrong. I just compiled a 
simple hello world both with static and dynamic linking like:

clang -static -O2 -m32 -o hello32 hello.c

for static and for dynamic linking like

clang -O2 -m32 -o hello32 hello.c

Then I launch qemu as:

qemu-i386 -L /usr/lib/i386 -bsd NetBSD hello32

and I get a segfault. If I check the core dump file with gdb, then it says:

Program terminated with signal SIGSEGV, segmentation fault.
#0 0x
in strchr() from /usr/lib/libc.so.12 The same happens if no options are passed at all. Could any of you tell me what am I doing wrong? Thanks for your help in advance! Best regards, r0ller

Re: [Qemu-discuss] qemu-i386 segfault on amd64 NetBSD

2016-12-22 Thread Peter Maydell
On 22 December 2016 at 14:01, r0ller  wrote:
> As mentioned in the subject, I'm trying to get qemu-i386 (from qemu-2.7.0)
> user space emulation working on an amd64 NetBSD (7.0). Unfortunately, even
> giving a try to a 32bit binary printing "hello world" gives a segfault.
> Hopefully, it's me who's doing something wrong. I just compiled a simple
> hello world both with static and dynamic linking like:
>
> clang -static -O2 -m32 -o hello32 hello.c
>
> for static and for dynamic linking like
>
> clang -O2 -m32 -o hello32 hello.c
>
> Then I launch qemu as:
>
> qemu-i386 -L /usr/lib/i386 -bsd NetBSD hello32
>
> and I get a segfault.

The bsd-user QEMU code is unfortunately pretty much unmaintained:
nobody in the upstream QEMU community uses any of the BSDs, so
we're reliant on people who do use it to test, debug and send
us patches. (We don't even have any BSD machines in the "test
this at least compiles" set of systems...) So my first guess
as to what's going wrong here is "it's just broken". You might
check whether there are any patches in a "ports" system if
NetBSD has one, but otherwise I think you will need to debug
QEMU, I'm afraid.

thanks
-- PMM