Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BCgWN-0005ui-DW for qemu-devel@nongnu.org; Sun, 11 Apr 2004 11:05:19 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BCgVr-0005fv-I5 for qemu-devel@nongnu.org; Sun, 11 Apr 2004 11:05:18 -0400 Received: from [62.210.190.9] (helo=brazzaville.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BCgVr-0005fl-44 for qemu-devel@nongnu.org; Sun, 11 Apr 2004 11:04:47 -0400 From: "J. Mayer" Content-Type: multipart/mixed; boundary="=-stlKXM9hgrQLrCiwro0F" Message-Id: <1081695882.10224.256.camel@rapid> Mime-Version: 1.0 Date: Sun, 11 Apr 2004 17:04:42 +0200 Subject: [Qemu-devel] Bug report 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 --=-stlKXM9hgrQLrCiwro0F Content-Type: text/plain Content-Transfer-Encoding: 7bit I just had a SIGSEGV, running qemu under gdb on my PC. Here's the case: we enter tb_link_phys with phys_pc == 0 Then, we crash in tb_alloc_page because the PageDesc returned by page_find is NULL. So, dereferencing this pointer, we get a segfault: p = page_find(page_addr >> TARGET_PAGE_BITS); tb->page_next[n] = p->first_tb; ^^^^^^ You'll find useful informations in gdb output, attached. -- J. Mayer Never organized --=-stlKXM9hgrQLrCiwro0F Content-Description: Qemu segfault gdb output Content-Disposition: inline; filename="qemu segfault" Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit (qemu) Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 27064)] tb_link_phys (tb=0x83ff094, phys_pc=0, phys_page2=4294967295) at /home/jocelyn/devel/ppc_emul/qemu-newCVS/qemu/exec.c:694 694 tb->page_next[n] = p->first_tb; (gdb) bt #0 tb_link_phys (tb=0x83ff094, phys_pc=0, phys_page2=4294967295) at /home/jocelyn/devel/ppc_emul/qemu-newCVS/qemu/exec.c:694 #1 0x0806a38c in cpu_ppc_exec (env1=0x8f007c0) at /home/jocelyn/devel/ppc_emul/qemu-newCVS/qemu/cpu-exec.c:346 #2 0x0804b839 in main_loop () at /home/jocelyn/devel/ppc_emul/qemu-newCVS/qemu/vl.c:1528 #3 0x0804c453 in main (argc=134526736, argv=0xbffff124) at /home/jocelyn/devel/ppc_emul/qemu-newCVS/qemu/vl.c:2170 (gdb) p tb = (TranslationBlock *) 0x83ff094 (gdb) p/x *tb = {pc = 0x7ffff660, cs_base = 0x0, flags = 0x0, size = 0x4, cflags = 0x0, tc_ptr = 0x8de24c0, hash_next = 0x0, phys_hash_next = 0x83919d8, page_next = {0x0, 0x0}, page_addr = {0x37962000, 0x0}, tb_next_offset = { 0xffff, 0xffff}, tb_jmp_offset = {0x0, 0x0, 0xffff, 0xffff}, jmp_next = { 0x0, 0x0}, jmp_first = 0x0} (gdb) p/x l1_map[0] = 0x8f18b10 (gdb) p/x *l1_map[0] = {phys_offset = 0x0, first_tb = 0x83ff050, code_write_count = 0x0, code_bitmap = 0x0} (gdb) info registers eax 0x0 0 ecx 0x83919d8 137959896 edx 0x37962 227682 ebx 0x0 0 esp 0xbfffdc50 0xbfffdc50 ebp 0x8f007c0 0x8f007c0 esi 0x83ff094 138408084 edi 0xffffffff -1 eip 0x8060886 0x8060886 eflags 0x10246 66118 cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x7 7 (gdb) disas Dump of assembler code for function tb_link_phys: 0x08060830 : push %ebp 0x08060831 : push %edi 0x08060832 : push %esi 0x08060833 : push %ebx 0x08060834 : sub bashxc,%esp 0x08060837 : xor %ebx,%ebx 0x08060839 : mov 0x24(%esp,1),%eax 0x0806083d : mov 0x20(%esp,1),%esi 0x08060841 : mov 0x28(%esp,1),%edi 0x08060845 : mov %eax,%edx 0x08060847 : and bashx7fff,%edx 0x0806084d : and bashxfffff000,%eax 0x08060852 : mov %eax,0x24(%esi) 0x08060855 : shl bashx2,%edx 0x08060858 : mov 0x8278780(%edx),%ecx 0x0806085e : mov %ecx,0x18(%esi) 0x08060861 : mov %esi,0x8278780(%edx) 0x08060867 : mov %eax,%edx 0x08060869 : shr bashx16,%eax 0x0806086c : mov 0x80a55a0(,%eax,4),%eax 0x08060873 : shr bashxc,%edx 0x08060876 : test %eax,%eax 0x08060878 : je 0x8060886 0x0806087a : and bashx3ff,%edx 0x08060880 : shl bashx4,%edx 0x08060883 : lea (%edx,%eax,1),%ebx 0x08060886 : mov 0x4(%ebx),%edx --=-stlKXM9hgrQLrCiwro0F--