qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: "J. Mayer" <l_indien@magic.fr>, thayne@c2.net
Subject: Re: [Qemu-devel] Insta-segfault! i386-linux-user
Date: Wed, 19 Sep 2007 00:57:49 +0200	[thread overview]
Message-ID: <2A7DAB9C-352D-4069-B504-8FBCB30C8A8F@suse.de> (raw)
In-Reply-To: <1190155304.14938.286.camel@rapid>


On Sep 19, 2007, at 12:41 AM, J. Mayer wrote:

> On Wed, 2007-09-19 at 00:07 +0200, Alexander Graf wrote:
>> On Sep 18, 2007, at 11:49 PM, Thayne Harbaugh wrote:
>>
>>> On Tue, 2007-09-18 at 21:11 +0200, Alexander Graf wrote:
>>>> On Sep 18, 2007, at 8:25 PM, Thayne Harbaugh wrote:
>>>>
>>>>> On Tue, 2007-09-18 at 15:53 +0200, Ronald wrote:
>>>>>> Thayne Harbaugh schreef:
>>>
>>> <SNIP>
>>>
>>>>>>> ./i386-linux-user/qemu-i386 --help
>>>>>>> Segmentation fault
>>>>>>>
>>>>>>>> From GDB:
>>>>>>>
>>>>>>> Program received signal SIGSEGV, Segmentation fault.
>>>>>>> 0x0000000000000000 in ?? ()
>>>>>>> (gdb) bt
>>>>>>> #0  0x0000000000000000 in ?? ()
>>>>>>> #1  0x00000000600575ed in __libc_csu_init ()
>>>>>>> #2  0x00002b826c660ade in __libc_start_main () from /lib/ 
>>>>>>> libc.so.6
>>>>>>> #3  0x00000000600050e9 in _start ()
>>>
>>> <SNIP>
>>>
>>>>
>>>> We had this on the list some months ago.
>>>
>>> I'll dig for that.
>>>
>>>> As far as I recall this
>>>> correctly the problem is the linker script. Just take a look at the
>>>> suse source rpm where we replace that one, so it works with x86_64.
>>>
>>> Thanks for the guidance.
>>>
>>>> Be prepared for breakage though, as linux-user on 64-Bit hosts does
>>>> not work properly.
>>>
>>> What about it doesn't work properly?  Do you have some links for the
>>> list archives?
>>
>> Mostly syscalls that return 64-bit pointers. So for example mmap is
>> broken. You can find a patch for x86_64 for that in the rpm or on the
>> list as well, which does not fix the issue on ppc64 or ia64 though.
>
> As far of what I see in the code and I can see when executing programs
> in linux-user on x86_64, mmap may be the safer 64 bits call... There
> seem to be a hack for alpha, sparc, x86_64, ia64 and mips (don't know
> why ppc64 is not in the list...) that force the requested address  
> to be
> in the 32 bits address space (but does not seem to force the MAP_FIXED
> flag...).

On x86_64 there is a flags for mmap that forces it to only use 32  
bits. That one is way easier but does not exist on other architectures.

>
>> Additionally there is an IPC call that does an mmap in the end, where
>> you can not force it to return 32-bit values, so this can not be
>> easily fixed. The IA64-IA32 emulator actually does have an approach
>> for this, but I did not have the time to take a deeper look into  
>> that.
>
> Well, I noticed that there seem to be numerous problems in IPC, not
> especially related to 64 bits.
> As I reported yesterday, there seem to be some confusions between
> short/int and long types for all the targets I checked. There also  
> seem
> to be 64 bits issues, in addition...
> I can see no mmap in IPC calls, but I noticed there is a problem for
> 32/64 bits compatibility with the shmat call. I guess this can be  
> fixed
> exactly in the same way mmap was fixed, forcing the requested  
> address to
> a known area when the caller does not specify any...
>

This is what the IA64 emulator does and which is broken in qemu. Some  
months ago I sent some example programs to trigger this bug which  
actually only occured when I used threading. Just take a look at  
do_shmat in the ipc/shm.c in the linux kernel. The MAP_FIXED flag  
should work here, but the MAP_32BIT one is not available. I really  
don't remember which exact part broke, but I switched to using a 32- 
bit host for linux-user then and everything magically worked.

Cheers,

Alex

      reply	other threads:[~2007-09-18 22:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 12:32 [Qemu-devel] Insta-segfault! i386-linux-user Thayne Harbaugh
2007-09-18 13:53 ` Ronald
2007-09-18 18:25   ` Thayne Harbaugh
2007-09-18 19:11     ` Alexander Graf
2007-09-18 21:49       ` Thayne Harbaugh
2007-09-18 22:07         ` Alexander Graf
2007-09-18 22:41           ` J. Mayer
2007-09-18 22:57             ` Alexander Graf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2A7DAB9C-352D-4069-B504-8FBCB30C8A8F@suse.de \
    --to=agraf@suse.de \
    --cc=l_indien@magic.fr \
    --cc=qemu-devel@nongnu.org \
    --cc=thayne@c2.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).