[hatari-devel] SIGSEGV error with MMU
Eero Tamminen
oak at helsinkinet.fi
Wed Feb 23 20:55:08 CET 2011
Hi,
On keskiviikko 23 helmikuu 2011, Laurent Sallafranque wrote:
> I've tested quickly the mmu code.
>
> I start with my usual 68030 CPU, no MMU.
>
> Then, I press "F12" and change the following parameters :
> CPU = 68040, activate MMU
>
> Then I reset Hatari.
>
> I get a SIGSEGV error when hatari reset (look at the gdb trace) :
>
> Exception 2 (0) at e02ce2 -> e02ce6!
> Building CPU, 46224 opcodes (4 1 1)
> CPU=68040, FPU=68040, MMU=1, JIT=0.
> MMU: enabled=0 page8k=0
> MMU: enabled=0 page8k=0
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000004f4e40 in get_iword () at
> /home/laurent/Atari/hatari/src/cpu/newcpu.h:326
> 326 {
> (gdb) bt
> #0 0x00000000004f4e40 in get_iword () at
> /home/laurent/Atari/hatari/src/cpu/newcpu.h:326
> #1 next_iword () at /home/laurent/Atari/hatari/src/cpu/newcpu.h:327
> #2 0x00000000006fe8d4 in op_11b0_31_ff (opcode=5040) at
> /home/laurent/Atari/hatari/build/src/cpu/cpuemu_31.c:7548
...
static inline uae_u16 do_get_mem_word(void *a)
{
return SDL_SwapBE16(*(uae_u16 *)a);
}
...
STATIC_INLINE uae_u32 get_iword (int o)
{
return do_get_mem_word((uae_u16 *)((regs).pc_p + (o)));
}
...
STATIC_INLINE uae_u32 next_iword (void)
{
uae_u32 r = get_iword (0);
m68k_incpc (2);
return r;
}
I.e. Hatari segfaulted when trying to byte-swap word at "regs.pc_p" address.
> If anybody's got an idea of where the problem can come from, I'd be
> happy to get some help.
What gdb shows for "print regs" and "print STRam" after the crash?
I.e. is regs.pc_p pointing even close to STRam array containing the emulated
RAM?
> I continue to search.
Maybe the ST RAM memory accessor functions (in cpu/memory.c) aren't properly
set up for MMU access?
- Eero
PS. I started reading cpu/memory.[ch] & newcpu.h, but got confused with
the large amount of functions, struct members[1] and functions that aren't
used anywhere. Is WinAUE code missing large pieces?
[1] Try e.g.:
grep -e baseaddr -e xlateaddr $(find -type f)
Then I looked into JIT stuff, and uurgh... That I definitely don't want to
debug. :-)
More information about the hatari-devel
mailing list