[hatari-devel] crash at address $F00000 with recent ide changes ?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi

while debugging something else, I noticed that after restoring a memory snapshot there was a crash in hatari when accessing $F00000 and IDE was not used.

Program received signal SIGSEGV, Segmentation fault.
0x00000000005b1f70 in ide_data_readw (addr=0, opaque=0x0) at /home/npomarede/src/hatari-int/src/ide.c:2446
2446            IDEState *s = ((IDEState *)opaque)->cur_drive;
(gdb) bt
#0 0x00000000005b1f70 in ide_data_readw (addr=0, opaque=0x0) at /home/npomarede/src/hatari-int/src/ide.c:2446 #1 Ide_Mem_wget (addr=15728640) at /home/npomarede/src/hatari-int/src/ide.c:141

This is the caller function :

uae_u32 REGPARAM3 Ide_Mem_wget(uaecptr addr)
{
        uint16_t retval;
        uaecptr addr_in = addr;

addr &= 0x00ffffff; /* Use a 24 bit address */

        if (addr >= 0xf00040 || !Ide_MmioIsAvailable())
        {
                /* invalid memory addressing --> bus error */
M68000_BusError(addr_in, BUS_ERROR_READ, BUS_ERROR_SIZE_WORD, BUS_ERROR_ACCESS_DATA);
                return -1;
        }

        if (addr == 0xf00000 || addr == 0xf00002)
        {
                retval = ide_data_readw(opaque_ide_if, 0);


after adding some traces/printfs in configuration.c, I see that when I restore a memory snapshot, ConfigureParams.Ide[i].bUseDevice with i=0 and 1 are restored as true, but I never configured IDE and if I print the values in IDE_Init at start of Hatari, [0].bUseDevice is false, so I don't see how it becomes true later.

This explains why Ide_MmioIsAvailable returns true, which calls ide_data_readw with opaque_id_if=null -> crash

Thomas, do you see where this comes from ? Maybe due to the changes you made to the configuration sections recently to handle arrays of devices ? In my case, my hatari.cfg is an "old" one before your recent changes.

Nicolas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/