From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjHzt-0002fq-Lk for qemu-devel@nongnu.org; Fri, 26 Sep 2008 14:24:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjHzs-0002fK-Aj for qemu-devel@nongnu.org; Fri, 26 Sep 2008 14:24:57 -0400 Received: from [199.232.76.173] (port=40961 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjHzr-0002fH-Vz for qemu-devel@nongnu.org; Fri, 26 Sep 2008 14:24:56 -0400 Received: from csl.cornell.edu ([128.84.224.10]:3729 helo=vlsi.csl.cornell.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KjHzr-0000Ls-19 for qemu-devel@nongnu.org; Fri, 26 Sep 2008 14:24:56 -0400 Received: from stanley.csl.cornell.edu (stanley.csl.cornell.edu [128.84.224.15]) by vlsi.csl.cornell.edu (8.13.4/8.13.4) with ESMTP id m8QIOh6L057005 for ; Fri, 26 Sep 2008 14:24:48 -0400 (EDT) Date: Fri, 26 Sep 2008 14:24:43 -0400 (EDT) From: Vince Weaver Message-ID: <20080926142222.U24737@stanley.csl.cornell.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: [Qemu-devel] linux-user mremap() Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Until the linux-user mremap() problem is fixed (the one where a 64-bit value can be returned even on a 32-bit target), might it make sense to apply a patch like this? This will at least let users know what the problem is, instead of just segfaulting. Vince Index: mmap.c =================================================================== --- mmap.c (revision 5321) +++ mmap.c (working copy) @@ -538,6 +538,13 @@ mmap_lock(); /* XXX: use 5 args syscall */ host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags); +#if TARGET_ABI_BITS == 32 + if (host_addr > 0xffffffff) { + printf("ERROR! mremap() returned 64-bit value on 32-bit target!\n\n"); + exit(-1); + } +#endif + if (host_addr == -1) { new_addr = -1; } else {