From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGzLQ-0004Bv-VO for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:54:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGzLM-00048j-BS for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:54:44 -0400 Received: from [199.232.76.173] (port=60357 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGzLM-00048S-62 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:54:40 -0400 Received: from smtp-out.google.com ([216.239.33.17]:3605) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MGzLL-00076b-Il for qemu-devel@nongnu.org; Wed, 17 Jun 2009 13:54:39 -0400 Received: from zps75.corp.google.com (zps75.corp.google.com [172.25.146.75]) by smtp-out.google.com with ESMTP id n5HHsadK003303 for ; Wed, 17 Jun 2009 18:54:37 +0100 Received: from wf-out-1314.google.com (wfa28.prod.google.com [10.142.1.28]) by zps75.corp.google.com with ESMTP id n5HHsYPi021072 for ; Wed, 17 Jun 2009 10:54:34 -0700 Received: by wf-out-1314.google.com with SMTP id 28so221647wfa.21 for ; Wed, 17 Jun 2009 10:54:34 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 17 Jun 2009 20:54:33 +0300 Message-ID: From: Kai Backman Content-Type: multipart/alternative; boundary=000e0cd20d86e98d0d046c8efb33 Subject: [Qemu-devel] problems with mmap on qemu-arm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --000e0cd20d86e98d0d046c8efb33 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I'm running qemu-arm and see the following output from mmap with 'strace qemu-arm -strace' (for both host and traget strace output): mmap(NULL, 32800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad329b46000 4023 mmap(0,131072,7,34,-1,0) = 0xfffffff2 When my program later tries to read memory at 0xfffffffe it fails with a SIGSEGV: Program received signal SIGSEGV, Segmentation fault. 1: x/i $pc 0xce30: ldr r1, [r5] (gdb) i r r5 0xfffffffe -2 Why does qemu-arm return such high addresses on a 32 bit platform and why is the memory inaccessible? If this doesn't seem like an obvious bug in my code, where in the qemu code should I start looking for how mmap works? Kai -- Kai Backman, Software Engineer, kaib@google.com --000e0cd20d86e98d0d046c8efb33 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm running qemu-arm and see the following output from mmap with 's= trace qemu-arm -strace' (for both host and traget strace output):
mmap(NULL, 32800, PROT_R= EAD|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0x2ad329b46000=
4023 mmap(0,131072,7,3= 4,-1,0) =3D 0xfffffff2

When my program later tries to read memory at 0xfffffffe it fails with= a SIGSEGV:
Program received signal SIGSEGV, Segmentation fa= ult.
1: x/i $pc =A00xce30: =A0 =A0 ldr =A0 =A0 r1, [r= 5]
(gdb) i r
r5 =A0 =A0 =A0 =A0 =A0 =A0 0xfffffffe =A0 =A0 = =A0 -2

Why does qemu-arm return such = high addresses on a 32 bit platform and why is the memory inaccessible? If = this doesn't seem like an obvious bug in my code, where in the qemu cod= e should I start looking for how mmap works?

=A0Kai

--
Kai Backman, Software Engine= er, kaib@google.com
--000e0cd20d86e98d0d046c8efb33--